]> git.baikalelectronics.ru Git - kernel.git/commit
gpio/mxc: add missing initialization of basic_mmio_gpio shadow variables
authorLothar Waßmann <LW@KARO-electronics.de>
Thu, 7 Jul 2011 12:50:16 +0000 (14:50 +0200)
committerGrant Likely <grant.likely@secretlab.ca>
Thu, 7 Jul 2011 18:42:50 +0000 (12:42 -0600)
commit29dbd1ec398598731fe47032d0782fe59734361a
tree272d56ac4e895e9c14b6154a54e8a9014657c6eb
parent368d7b375d04621f443634f95bebaf56a4d9c37d
gpio/mxc: add missing initialization of basic_mmio_gpio shadow variables

The bgpio_init() function does not initialise the shadow register for
the GPIO direction register. Thus, when configuring the first GPIO with
gpio_set_direction() all other GPIOs of the same bank will be
configured as inputs. Since the bgpio layer cannot know whether the
register is readable, the initialisation should be done by the caller
of bgpio_init().

Also, the 'data' shadow variable that is used inside basic_mmio_gpio
to cache the current value of the GPIO_DR register is initialised from
the GPIO_PSR register within bgpio_init(). Thus when setting the
output value of a certain GPIO, the other GPIO outputs of the same
bank will be set or cleared depending on the pin state of the GPIO
inputs during bgpio_init().

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
drivers/gpio/gpio-mxc.c