[PATCH 05/21] gpio: ab8500: Allow direction and pullups configuration

From: Lee Jones
Date: Fri Dec 14 2012 - 11:19:46 EST


From: Mian Yousaf Kaukab <mian.yousaf.kaukab@xxxxxxxxxxxxxx>

This patch extends the the platform data to include gpio direction and pullups
configurations. These configurations are applied during probe().

Signed-off-by: Lee Jones <lee.jones@xxxxxxxxxx>
Signed-off-by: Bibek Basu <bibek.basu@xxxxxxxxxxxxxx>
Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@xxxxxxxxxxxxxx>
Reviewed-by: Jonas ABERG <jonas.aberg@xxxxxxxxxxxxxx>
Tested-by: Jonas ABERG <jonas.aberg@xxxxxxxxxxxxxx>
---
drivers/gpio/gpio-ab8500.c | 12 ++++++++++++
include/linux/mfd/abx500/ab8500-gpio.h | 2 ++
2 files changed, 14 insertions(+)

diff --git a/drivers/gpio/gpio-ab8500.c b/drivers/gpio/gpio-ab8500.c
index 77fe1d7..dd95cb3 100644
--- a/drivers/gpio/gpio-ab8500.c
+++ b/drivers/gpio/gpio-ab8500.c
@@ -445,6 +445,18 @@ static int __devinit ab8500_gpio_probe(struct platform_device *pdev)
pdata->config_reg[i]);
if (ret < 0)
goto out_free;
+
+ ret = abx500_set_register_interruptible(ab8500_gpio->dev,
+ AB8500_MISC, i + AB8500_GPIO_DIR1_REG,
+ pdata->config_direction[i]);
+ if (ret < 0)
+ goto out_free;
+
+ ret = abx500_set_register_interruptible(ab8500_gpio->dev,
+ AB8500_MISC, i + AB8500_GPIO_PUD1_REG,
+ pdata->config_pullups[i]);
+ if (ret < 0)
+ goto out_free;
}
ret = abx500_set_register_interruptible(ab8500_gpio->dev, AB8500_MISC,
AB8500_GPIO_ALTFUN_REG,
diff --git a/include/linux/mfd/abx500/ab8500-gpio.h b/include/linux/mfd/abx500/ab8500-gpio.h
index 5caa615..94e85ca 100644
--- a/include/linux/mfd/abx500/ab8500-gpio.h
+++ b/include/linux/mfd/abx500/ab8500-gpio.h
@@ -18,6 +18,8 @@ struct ab8500_gpio_platform_data {
int gpio_base;
u32 irq_base;
u8 config_reg[8];
+ u8 config_direction[6];
+ u8 config_pullups[6];
};

enum ab8500_pin {
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/