[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1355501979-1157-6-git-send-email-lee.jones@linaro.org>
Date: Fri, 14 Dec 2012 16:19:23 +0000
From: Lee Jones <lee.jones@...aro.org>
To: linux-kernel@...r.kernel.org
Cc: linus.walleij@...aro.org,
Mian Yousaf Kaukab <mian.yousaf.kaukab@...ricsson.com>,
Lee Jones <lee.jones@...aro.org>,
Bibek Basu <bibek.basu@...ricsson.com>
Subject: [PATCH 05/21] gpio: ab8500: Allow direction and pullups configuration
From: Mian Yousaf Kaukab <mian.yousaf.kaukab@...ricsson.com>
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@...aro.org>
Signed-off-by: Bibek Basu <bibek.basu@...ricsson.com>
Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@...ricsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@...ricsson.com>
Tested-by: Jonas ABERG <jonas.aberg@...ricsson.com>
---
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists