aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-ich.c
diff options
context:
space:
mode:
authorVincent Donnefort <vdonnefort@gmail.com>2013-06-17 08:03:49 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-06-19 15:14:00 -0400
commit7f6569f54695c18e13be2c538834fdd0fad1d3a6 (patch)
tree3b17706c4bc6c43a9a1d9cb51b688dfbc217682a /drivers/gpio/gpio-ich.c
parent62ffac141e82334ed0065c118b0544e23f3f5243 (diff)
gpio: ich: add GPO_BLINK support
This patch makes sure blink hardware is disabled for selected GPIO. Blink hardware is controled by GPO_BLINK register and is available for GPIOs from 0 to 31. Signed-off-by: Vincent Donnefort <vdonnefort@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-ich.c')
-rw-r--r--drivers/gpio/gpio-ich.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-ich.c b/drivers/gpio/gpio-ich.c
index e16d932fd444..2729e3d2d5bb 100644
--- a/drivers/gpio/gpio-ich.c
+++ b/drivers/gpio/gpio-ich.c
@@ -41,12 +41,14 @@ enum GPIO_REG {
41 GPIO_USE_SEL = 0, 41 GPIO_USE_SEL = 0,
42 GPIO_IO_SEL, 42 GPIO_IO_SEL,
43 GPIO_LVL, 43 GPIO_LVL,
44 GPO_BLINK
44}; 45};
45 46
46static const u8 ichx_regs[3][3] = { 47static const u8 ichx_regs[4][3] = {
47 {0x00, 0x30, 0x40}, /* USE_SEL[1-3] offsets */ 48 {0x00, 0x30, 0x40}, /* USE_SEL[1-3] offsets */
48 {0x04, 0x34, 0x44}, /* IO_SEL[1-3] offsets */ 49 {0x04, 0x34, 0x44}, /* IO_SEL[1-3] offsets */
49 {0x0c, 0x38, 0x48}, /* LVL[1-3] offsets */ 50 {0x0c, 0x38, 0x48}, /* LVL[1-3] offsets */
51 {0x18, 0x18, 0x18}, /* BLINK offset */
50}; 52};
51 53
52static const u8 ichx_reglen[3] = { 54static const u8 ichx_reglen[3] = {
@@ -148,6 +150,10 @@ static int ichx_gpio_direction_input(struct gpio_chip *gpio, unsigned nr)
148static int ichx_gpio_direction_output(struct gpio_chip *gpio, unsigned nr, 150static int ichx_gpio_direction_output(struct gpio_chip *gpio, unsigned nr,
149 int val) 151 int val)
150{ 152{
153 /* Disable blink hardware which is available for GPIOs from 0 to 31. */
154 if (nr < 32)
155 ichx_write_bit(GPO_BLINK, nr, 0, 0);
156
151 /* Set GPIO output value. */ 157 /* Set GPIO output value. */
152 ichx_write_bit(GPIO_LVL, nr, val, 0); 158 ichx_write_bit(GPIO_LVL, nr, val, 0);
153 159