* [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life
@ 2012-12-14 16:19 Lee Jones
2012-12-14 16:19 ` [PATCH 01/21] gpio: ab8500: Activate and port AB8500 GPIO driver to new framework Lee Jones
` (22 more replies)
0 siblings, 23 replies; 28+ messages in thread
From: Lee Jones @ 2012-12-14 16:19 UTC (permalink / raw)
To: linux-kernel; +Cc: linus.walleij
The ab8500 GPIO driver is currently 'BROKEN', due to a lack of
updates and recent frame-work adoption. This patch-set aims to
bring the driver back to life so we may make use of it again.
This first stage is to bring it into line with ST-Ericsson's
internal track, which has been keeping up-to-date. After these
patches have been accepted I will then overhaul the driver to
use the most recent APIs and frame-works, such as pinctrl and
Device Tree.
Please give these patches an easy ride. I know they're not
perfect, but they do provide a great base on with I can form
the overhaul. Thanks for your understanding.
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH 01/21] gpio: ab8500: Activate and port AB8500 GPIO driver to new framework
2012-12-14 16:19 [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Lee Jones
@ 2012-12-14 16:19 ` Lee Jones
2012-12-14 16:19 ` [PATCH 02/21] gpio: ab8500: Make pins configurable Lee Jones
` (21 subsequent siblings)
22 siblings, 0 replies; 28+ messages in thread
From: Lee Jones @ 2012-12-14 16:19 UTC (permalink / raw)
To: linux-kernel; +Cc: linus.walleij, Philippe Langlais, Lee Jones
From: Philippe Langlais <philippe.langlais@linaro.org>
The AB8500 GPIO driver is currently marked as broken, as it's still
using the old framework. This patch brings it back up to scratch and
enables it so we can make good use of it once more.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Philippe Langlais <philippe.langlais@linaro.org>
---
drivers/gpio/Kconfig | 2 +-
drivers/gpio/gpio-ab8500.c | 60 +++++++++++++++++++++++---------------------
2 files changed, 32 insertions(+), 30 deletions(-)
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 47150f5..6bf9575 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -624,7 +624,7 @@ config GPIO_JANZ_TTL
config GPIO_AB8500
bool "ST-Ericsson AB8500 Mixed Signal Circuit gpio functions"
- depends on AB8500_CORE && BROKEN
+ depends on AB8500_CORE
help
Select this to enable the AB8500 IC GPIO driver
diff --git a/drivers/gpio/gpio-ab8500.c b/drivers/gpio/gpio-ab8500.c
index 050c05d..db40acb 100644
--- a/drivers/gpio/gpio-ab8500.c
+++ b/drivers/gpio/gpio-ab8500.c
@@ -207,7 +207,7 @@ static struct gpio_chip ab8500gpio_chip = {
static unsigned int irq_to_rising(unsigned int irq)
{
- struct ab8500_gpio *ab8500_gpio = get_irq_chip_data(irq);
+ struct ab8500_gpio *ab8500_gpio = irq_get_chip_data(irq);
int offset = irq - ab8500_gpio->irq_base;
int new_irq = offset + AB8500_INT_GPIO6R
+ ab8500_gpio->parent->irq_base;
@@ -216,7 +216,7 @@ static unsigned int irq_to_rising(unsigned int irq)
static unsigned int irq_to_falling(unsigned int irq)
{
- struct ab8500_gpio *ab8500_gpio = get_irq_chip_data(irq);
+ struct ab8500_gpio *ab8500_gpio = irq_get_chip_data(irq);
int offset = irq - ab8500_gpio->irq_base;
int new_irq = offset + AB8500_INT_GPIO6F
+ ab8500_gpio->parent->irq_base;
@@ -261,15 +261,16 @@ static irqreturn_t handle_falling(int irq, void *dev)
return IRQ_HANDLED;
}
-static void ab8500_gpio_irq_lock(unsigned int irq)
+static void ab8500_gpio_irq_lock(struct irq_data *data)
{
- struct ab8500_gpio *ab8500_gpio = get_irq_chip_data(irq);
+ struct ab8500_gpio *ab8500_gpio = irq_data_get_irq_chip_data(data);
mutex_lock(&ab8500_gpio->lock);
}
-static void ab8500_gpio_irq_sync_unlock(unsigned int irq)
+static void ab8500_gpio_irq_sync_unlock(struct irq_data *data)
{
- struct ab8500_gpio *ab8500_gpio = get_irq_chip_data(irq);
+ struct ab8500_gpio *ab8500_gpio = irq_data_get_irq_chip_data(data);
+ unsigned int irq = data->irq;
int offset = irq - ab8500_gpio->irq_base;
bool rising = ab8500_gpio->rising & BIT(offset);
bool falling = ab8500_gpio->falling & BIT(offset);
@@ -316,21 +317,22 @@ static void ab8500_gpio_irq_sync_unlock(unsigned int irq)
}
-static void ab8500_gpio_irq_mask(unsigned int irq)
+static void ab8500_gpio_irq_mask(struct irq_data *data)
{
- struct ab8500_gpio *ab8500_gpio = get_irq_chip_data(irq);
+ struct ab8500_gpio *ab8500_gpio = irq_data_get_irq_chip_data(data);
ab8500_gpio->irq_action = MASK;
}
-static void ab8500_gpio_irq_unmask(unsigned int irq)
+static void ab8500_gpio_irq_unmask(struct irq_data *data)
{
- struct ab8500_gpio *ab8500_gpio = get_irq_chip_data(irq);
+ struct ab8500_gpio *ab8500_gpio = irq_data_get_irq_chip_data(data);
ab8500_gpio->irq_action = UNMASK;
}
-static int ab8500_gpio_irq_set_type(unsigned int irq, unsigned int type)
+static int ab8500_gpio_irq_set_type(struct irq_data *data, unsigned int type)
{
- struct ab8500_gpio *ab8500_gpio = get_irq_chip_data(irq);
+ struct ab8500_gpio *ab8500_gpio = irq_data_get_irq_chip_data(data);
+ unsigned int irq = data->irq;
int offset = irq - ab8500_gpio->irq_base;
if (type == IRQ_TYPE_EDGE_BOTH) {
@@ -344,28 +346,28 @@ static int ab8500_gpio_irq_set_type(unsigned int irq, unsigned int type)
return 0;
}
-unsigned int ab8500_gpio_irq_startup(unsigned int irq)
+unsigned int ab8500_gpio_irq_startup(struct irq_data *data)
{
- struct ab8500_gpio *ab8500_gpio = get_irq_chip_data(irq);
+ struct ab8500_gpio *ab8500_gpio = irq_data_get_irq_chip_data(data);
ab8500_gpio->irq_action = STARTUP;
return 0;
}
-void ab8500_gpio_irq_shutdown(unsigned int irq)
+void ab8500_gpio_irq_shutdown(struct irq_data *data)
{
- struct ab8500_gpio *ab8500_gpio = get_irq_chip_data(irq);
+ struct ab8500_gpio *ab8500_gpio = irq_data_get_irq_chip_data(data);
ab8500_gpio->irq_action = SHUTDOWN;
}
static struct irq_chip ab8500_gpio_irq_chip = {
.name = "ab8500-gpio",
- .startup = ab8500_gpio_irq_startup,
- .shutdown = ab8500_gpio_irq_shutdown,
- .bus_lock = ab8500_gpio_irq_lock,
- .bus_sync_unlock = ab8500_gpio_irq_sync_unlock,
- .mask = ab8500_gpio_irq_mask,
- .unmask = ab8500_gpio_irq_unmask,
- .set_type = ab8500_gpio_irq_set_type,
+ .irq_startup = ab8500_gpio_irq_startup,
+ .irq_shutdown = ab8500_gpio_irq_shutdown,
+ .irq_bus_lock = ab8500_gpio_irq_lock,
+ .irq_bus_sync_unlock = ab8500_gpio_irq_sync_unlock,
+ .irq_mask = ab8500_gpio_irq_mask,
+ .irq_unmask = ab8500_gpio_irq_unmask,
+ .irq_set_type = ab8500_gpio_irq_set_type,
};
static int ab8500_gpio_irq_init(struct ab8500_gpio *ab8500_gpio)
@@ -374,14 +376,14 @@ static int ab8500_gpio_irq_init(struct ab8500_gpio *ab8500_gpio)
int irq;
for (irq = base; irq < base + AB8500_NUM_VIR_GPIO_IRQ ; irq++) {
- set_irq_chip_data(irq, ab8500_gpio);
- set_irq_chip_and_handler(irq, &ab8500_gpio_irq_chip,
+ irq_set_chip_data(irq, ab8500_gpio);
+ irq_set_chip_and_handler(irq, &ab8500_gpio_irq_chip,
handle_simple_irq);
- set_irq_nested_thread(irq, 1);
+ irq_set_nested_thread(irq, 1);
#ifdef CONFIG_ARM
set_irq_flags(irq, IRQF_VALID);
#else
- set_irq_noprobe(irq);
+ irq_set_noprobe(irq);
#endif
}
@@ -397,8 +399,8 @@ static void ab8500_gpio_irq_remove(struct ab8500_gpio *ab8500_gpio)
#ifdef CONFIG_ARM
set_irq_flags(irq, 0);
#endif
- set_irq_chip_and_handler(irq, NULL, NULL);
- set_irq_chip_data(irq, NULL);
+ irq_set_chip_and_handler(irq, NULL, NULL);
+ irq_set_chip_data(irq, NULL);
}
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 02/21] gpio: ab8500: Make pins configurable
2012-12-14 16:19 [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Lee Jones
2012-12-14 16:19 ` [PATCH 01/21] gpio: ab8500: Activate and port AB8500 GPIO driver to new framework Lee Jones
@ 2012-12-14 16:19 ` Lee Jones
2012-12-14 16:19 ` [PATCH 03/21] gpio: ab8500: Fix alternate function register address Lee Jones
` (20 subsequent siblings)
22 siblings, 0 replies; 28+ messages in thread
From: Lee Jones @ 2012-12-14 16:19 UTC (permalink / raw)
To: linux-kernel; +Cc: linus.walleij, Mian Yousaf Kaukab, Lee Jones, Bengt Jonsson
From: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Make it possible to set the pin configuration either as gpio or specific
functionality through the driver interface.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Tested-by: Jonas ABERG <jonas.aberg@stericsson.com>
---
drivers/gpio/gpio-ab8500.c | 63 ++++++++++++++++++++++++++++++++
include/linux/mfd/abx500/ab8500-gpio.h | 51 ++++++++++++++++++++++++++
2 files changed, 114 insertions(+)
diff --git a/drivers/gpio/gpio-ab8500.c b/drivers/gpio/gpio-ab8500.c
index db40acb..c3c7c5a 100644
--- a/drivers/gpio/gpio-ab8500.c
+++ b/drivers/gpio/gpio-ab8500.c
@@ -495,6 +495,69 @@ static int __devexit ab8500_gpio_remove(struct platform_device *pdev)
return 0;
}
+/*
+ * ab8500_gpio_config_select()
+ *
+ * Configure functionality of pin, either specific use or GPIO.
+ * @dev: device pointer
+ * @gpio: gpio number
+ * @gpio_select: true if the pin should be used as GPIO
+ */
+int ab8500_gpio_config_select(struct device *dev,
+ enum ab8500_pin gpio, bool gpio_select)
+{
+ u8 offset = gpio - AB8500_PIN_GPIO1;
+ u8 reg = AB8500_GPIO_SEL1_REG + (offset / 8);
+ u8 pos = offset % 8;
+ u8 val = gpio_select ? 1 : 0;
+ int ret;
+
+ ret = abx500_mask_and_set_register_interruptible(dev,
+ AB8500_MISC, reg, 1 << pos, val << pos);
+ if (ret < 0)
+ dev_err(dev, "%s write failed\n", __func__);
+
+ dev_vdbg(dev, "%s (bank, addr, mask, value): 0x%x, 0x%x, 0x%x, 0x%x\n",
+ __func__, AB8500_MISC, reg, 1 << pos, val << pos);
+
+ return ret;
+}
+
+/*
+ * ab8500_gpio_config_get_select()
+ *
+ * Read currently configured functionality, either specific use or GPIO.
+ * @dev: device pointer
+ * @gpio: gpio number
+ * @gpio_select: pointer to pin selection status
+ */
+int ab8500_gpio_config_get_select(struct device *dev,
+ enum ab8500_pin gpio, bool *gpio_select)
+{
+ u8 offset = gpio - AB8500_PIN_GPIO1;
+ u8 reg = AB8500_GPIO_SEL1_REG + (offset / 8);
+ u8 pos = offset % 8;
+ u8 val;
+ int ret;
+
+ ret = abx500_get_register_interruptible(dev,
+ AB8500_MISC, reg, &val);
+ if (ret < 0) {
+ dev_err(dev, "%s read failed\n", __func__);
+ return ret;
+ }
+
+ if (val & (1 << pos))
+ *gpio_select = true;
+ else
+ *gpio_select = false;
+
+ dev_vdbg(dev, "%s (bank, addr, mask, value): 0x%x, 0x%x, 0x%x, 0x%x\n",
+ __func__, AB8500_MISC, reg, 1 << pos, val);
+
+ return 0;
+}
+
static struct platform_driver ab8500_gpio_driver = {
.driver = {
.name = "ab8500-gpio",
diff --git a/include/linux/mfd/abx500/ab8500-gpio.h b/include/linux/mfd/abx500/ab8500-gpio.h
index 2387c20..5caa615 100644
--- a/include/linux/mfd/abx500/ab8500-gpio.h
+++ b/include/linux/mfd/abx500/ab8500-gpio.h
@@ -20,4 +20,55 @@ struct ab8500_gpio_platform_data {
u8 config_reg[8];
};
+enum ab8500_pin {
+ AB8500_PIN_GPIO1 = 0,
+ AB8500_PIN_GPIO2,
+ AB8500_PIN_GPIO3,
+ AB8500_PIN_GPIO4,
+ AB8500_PIN_GPIO5,
+ AB8500_PIN_GPIO6,
+ AB8500_PIN_GPIO7,
+ AB8500_PIN_GPIO8,
+ AB8500_PIN_GPIO9,
+ AB8500_PIN_GPIO10,
+ AB8500_PIN_GPIO11,
+ AB8500_PIN_GPIO12,
+ AB8500_PIN_GPIO13,
+ AB8500_PIN_GPIO14,
+ AB8500_PIN_GPIO15,
+ AB8500_PIN_GPIO16,
+ AB8500_PIN_GPIO17,
+ AB8500_PIN_GPIO18,
+ AB8500_PIN_GPIO19,
+ AB8500_PIN_GPIO20,
+ AB8500_PIN_GPIO21,
+ AB8500_PIN_GPIO22,
+ AB8500_PIN_GPIO23,
+ AB8500_PIN_GPIO24,
+ AB8500_PIN_GPIO25,
+ AB8500_PIN_GPIO26,
+ AB8500_PIN_GPIO27,
+ AB8500_PIN_GPIO28,
+ AB8500_PIN_GPIO29,
+ AB8500_PIN_GPIO30,
+ AB8500_PIN_GPIO31,
+ AB8500_PIN_GPIO32,
+ AB8500_PIN_GPIO33,
+ AB8500_PIN_GPIO34,
+ AB8500_PIN_GPIO35,
+ AB8500_PIN_GPIO36,
+ AB8500_PIN_GPIO37,
+ AB8500_PIN_GPIO38,
+ AB8500_PIN_GPIO39,
+ AB8500_PIN_GPIO40,
+ AB8500_PIN_GPIO41,
+ AB8500_PIN_GPIO42,
+};
+
+int ab8500_gpio_config_select(struct device *dev,
+ enum ab8500_pin gpio, bool gpio_select);
+
+int ab8500_gpio_config_get_select(struct device *dev,
+ enum ab8500_pin gpio, bool *gpio_select);
+
#endif /* _AB8500_GPIO_H */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 03/21] gpio: ab8500: Fix alternate function register address
2012-12-14 16:19 [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Lee Jones
2012-12-14 16:19 ` [PATCH 01/21] gpio: ab8500: Activate and port AB8500 GPIO driver to new framework Lee Jones
2012-12-14 16:19 ` [PATCH 02/21] gpio: ab8500: Make pins configurable Lee Jones
@ 2012-12-14 16:19 ` Lee Jones
2012-12-14 16:19 ` [PATCH 04/21] gpio: ab8500: Read register corrected in get_value api Lee Jones
` (19 subsequent siblings)
22 siblings, 0 replies; 28+ messages in thread
From: Lee Jones @ 2012-12-14 16:19 UTC (permalink / raw)
To: linux-kernel; +Cc: linus.walleij, Bibek Basu, Lee Jones, Mian Yousaf Kaukab
From: Bibek Basu <bibek.basu@stericsson.com>
Alternate function register address is actually 0x50 and thus
changed accordingly.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Bibek Basu <bibek.basu@stericsson.com>
Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Tested-by: Jonas ABERG <jonas.aberg@stericsson.com>
---
drivers/gpio/gpio-ab8500.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-ab8500.c b/drivers/gpio/gpio-ab8500.c
index c3c7c5a..b7d4416 100644
--- a/drivers/gpio/gpio-ab8500.c
+++ b/drivers/gpio/gpio-ab8500.c
@@ -60,7 +60,7 @@
#define AB8500_GPIO_IN4_REG 0x43
#define AB8500_GPIO_IN5_REG 0x44
#define AB8500_GPIO_IN6_REG 0x45
-#define AB8500_GPIO_ALTFUN_REG 0x45
+#define AB8500_GPIO_ALTFUN_REG 0x50
#define ALTFUN_REG_INDEX 6
#define AB8500_NUM_GPIO 42
#define AB8500_NUM_VIR_GPIO_IRQ 16
--
1.7.9.5
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 04/21] gpio: ab8500: Read register corrected in get_value api
2012-12-14 16:19 [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Lee Jones
` (2 preceding siblings ...)
2012-12-14 16:19 ` [PATCH 03/21] gpio: ab8500: Fix alternate function register address Lee Jones
@ 2012-12-14 16:19 ` Lee Jones
2012-12-14 16:19 ` [PATCH 05/21] gpio: ab8500: Allow direction and pullups configuration Lee Jones
` (18 subsequent siblings)
22 siblings, 0 replies; 28+ messages in thread
From: Lee Jones @ 2012-12-14 16:19 UTC (permalink / raw)
To: linux-kernel; +Cc: linus.walleij, Bibek Basu, Lee Jones, Mian Yousaf Kaukab
From: Bibek Basu <bibek.basu@stericsson.com>
Read register is corrected from "AB8500_GPIO_OUT1_REG" to
"AB8500_GPIO_IN1_REG" in get_value api
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Bibek Basu <bibek.basu@stericsson.com>
Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Tested-by: Jonas ABERG <jonas.aberg@stericsson.com>
---
drivers/gpio/gpio-ab8500.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-ab8500.c b/drivers/gpio/gpio-ab8500.c
index b7d4416..77fe1d7 100644
--- a/drivers/gpio/gpio-ab8500.c
+++ b/drivers/gpio/gpio-ab8500.c
@@ -115,7 +115,7 @@ static int ab8500_gpio_get(struct gpio_chip *chip, unsigned offset)
{
struct ab8500_gpio *ab8500_gpio = to_ab8500_gpio(chip);
u8 mask = 1 << (offset % 8);
- u8 reg = AB8500_GPIO_OUT1_REG + (offset / 8);
+ u8 reg = AB8500_GPIO_IN1_REG + (offset / 8);
int ret;
u8 data;
ret = abx500_get_register_interruptible(ab8500_gpio->dev, AB8500_MISC,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 05/21] gpio: ab8500: Allow direction and pullups configuration
2012-12-14 16:19 [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Lee Jones
` (3 preceding siblings ...)
2012-12-14 16:19 ` [PATCH 04/21] gpio: ab8500: Read register corrected in get_value api Lee Jones
@ 2012-12-14 16:19 ` Lee Jones
2012-12-14 16:19 ` [PATCH 06/21] gpio: ab8500: Add api to enable pulldown Lee Jones
` (17 subsequent siblings)
22 siblings, 0 replies; 28+ messages in thread
From: Lee Jones @ 2012-12-14 16:19 UTC (permalink / raw)
To: linux-kernel; +Cc: linus.walleij, Mian Yousaf Kaukab, Lee Jones, Bibek Basu
From: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.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@linaro.org>
Signed-off-by: Bibek Basu <bibek.basu@stericsson.com>
Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Tested-by: Jonas ABERG <jonas.aberg@stericsson.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
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 06/21] gpio: ab8500: Add api to enable pulldown
2012-12-14 16:19 [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Lee Jones
` (4 preceding siblings ...)
2012-12-14 16:19 ` [PATCH 05/21] gpio: ab8500: Allow direction and pullups configuration Lee Jones
@ 2012-12-14 16:19 ` Lee Jones
2012-12-14 16:19 ` [PATCH 07/21] gpio: ab8500: Write argument value instead of hardwired 1 Lee Jones
` (16 subsequent siblings)
22 siblings, 0 replies; 28+ messages in thread
From: Lee Jones @ 2012-12-14 16:19 UTC (permalink / raw)
To: linux-kernel; +Cc: linus.walleij, Mian Yousaf Kaukab, Lee Jones, Bibek Basu
From: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Bibek Basu <bibek.basu@stericsson.com>
Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Tested-by: Jonas ABERG <jonas.aberg@stericsson.com>
---
drivers/gpio/gpio-ab8500.c | 17 +++++++++++++++++
include/linux/mfd/abx500/ab8500-gpio.h | 3 +++
2 files changed, 20 insertions(+)
diff --git a/drivers/gpio/gpio-ab8500.c b/drivers/gpio/gpio-ab8500.c
index dd95cb3..b71bb72 100644
--- a/drivers/gpio/gpio-ab8500.c
+++ b/drivers/gpio/gpio-ab8500.c
@@ -507,6 +507,23 @@ static int __devexit ab8500_gpio_remove(struct platform_device *pdev)
return 0;
}
+int ab8500_config_pulldown(struct device *dev,
+ enum ab8500_pin gpio, bool enable)
+{
+ u8 offset = gpio - AB8500_PIN_GPIO1;
+ u8 pos = offset % 8;
+ u8 val = enable ? 0 : 1;
+ u8 reg = AB8500_GPIO_PUD1_REG + (offset / 8);
+ int ret;
+
+ ret = abx500_mask_and_set_register_interruptible(dev,
+ AB8500_MISC, reg, 1 << pos, val << pos);
+ if (ret < 0)
+ dev_err(dev, "%s write failed\n", __func__);
+ return ret;
+}
+EXPORT_SYMBOL(ab8500_config_pulldown);
+
/*
* ab8500_gpio_config_select()
*
diff --git a/include/linux/mfd/abx500/ab8500-gpio.h b/include/linux/mfd/abx500/ab8500-gpio.h
index 94e85ca..48325db 100644
--- a/include/linux/mfd/abx500/ab8500-gpio.h
+++ b/include/linux/mfd/abx500/ab8500-gpio.h
@@ -67,6 +67,9 @@ enum ab8500_pin {
AB8500_PIN_GPIO42,
};
+int ab8500_config_pulldown(struct device *dev,
+ enum ab8500_pin gpio, bool enable);
+
int ab8500_gpio_config_select(struct device *dev,
enum ab8500_pin gpio, bool gpio_select);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 07/21] gpio: ab8500: Write argument value instead of hardwired 1
2012-12-14 16:19 [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Lee Jones
` (5 preceding siblings ...)
2012-12-14 16:19 ` [PATCH 06/21] gpio: ab8500: Add api to enable pulldown Lee Jones
@ 2012-12-14 16:19 ` Lee Jones
2012-12-14 16:19 ` [PATCH 08/21] gpio: ab8500: Fix gpio offset bounds for irq mapping Lee Jones
` (15 subsequent siblings)
22 siblings, 0 replies; 28+ messages in thread
From: Lee Jones @ 2012-12-14 16:19 UTC (permalink / raw)
To: linux-kernel; +Cc: linus.walleij, Marcel Tunnissen, Lee Jones
From: Marcel Tunnissen <Marcel.Tuennissen@stericsson.com>
This fixes a bug in gpio_set_value(xxx, 0) for ab8500 GPIOs.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Marcel Tunnissen <Marcel.Tuennissen@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Tested-by: Jonas ABERG <jonas.aberg@stericsson.com>
---
drivers/gpio/gpio-ab8500.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-ab8500.c b/drivers/gpio/gpio-ab8500.c
index b71bb72..d3bbcce 100644
--- a/drivers/gpio/gpio-ab8500.c
+++ b/drivers/gpio/gpio-ab8500.c
@@ -132,7 +132,7 @@ static void ab8500_gpio_set(struct gpio_chip *chip, unsigned offset, int val)
struct ab8500_gpio *ab8500_gpio = to_ab8500_gpio(chip);
int ret;
/* Write the data */
- ret = ab8500_gpio_set_bits(chip, AB8500_GPIO_OUT1_REG, offset, 1);
+ ret = ab8500_gpio_set_bits(chip, AB8500_GPIO_OUT1_REG, offset, val);
if (ret < 0)
dev_err(ab8500_gpio->dev, "%s write failed\n", __func__);
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 08/21] gpio: ab8500: Fix gpio offset bounds for irq mapping
2012-12-14 16:19 [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Lee Jones
` (6 preceding siblings ...)
2012-12-14 16:19 ` [PATCH 07/21] gpio: ab8500: Write argument value instead of hardwired 1 Lee Jones
@ 2012-12-14 16:19 ` Lee Jones
2012-12-14 16:19 ` [PATCH 09/21] gpio: ab8500: Fix bad include name after renaming Lee Jones
` (14 subsequent siblings)
22 siblings, 0 replies; 28+ messages in thread
From: Lee Jones @ 2012-12-14 16:19 UTC (permalink / raw)
To: linux-kernel; +Cc: linus.walleij, Mian Yousaf Kaukab, Lee Jones
From: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
AB8500 gpio numbers start from 1 and not 0 so the offset
0 represents gpio 1. Fixing cluster bounds accordingly for
irq mappings.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Tested-by: Jonas ABERG <jonas.aberg@stericsson.com>
---
drivers/gpio/gpio-ab8500.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpio/gpio-ab8500.c b/drivers/gpio/gpio-ab8500.c
index d3bbcce..a0253ad 100644
--- a/drivers/gpio/gpio-ab8500.c
+++ b/drivers/gpio/gpio-ab8500.c
@@ -174,9 +174,9 @@ static int ab8500_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
int start;
int end;
} clusters[] = {
- {.start = 6, .end = 13},
- {.start = 24, .end = 25},
- {.start = 36, .end = 41},
+ {.start = 5, .end = 12}, /* GPIO numbers start from 1 */
+ {.start = 23, .end = 24},
+ {.start = 35, .end = 40},
};
struct ab8500_gpio *ab8500_gpio = to_ab8500_gpio(chip);
int base = ab8500_gpio->irq_base;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 09/21] gpio: ab8500: Fix bad include name after renaming
2012-12-14 16:19 [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Lee Jones
` (7 preceding siblings ...)
2012-12-14 16:19 ` [PATCH 08/21] gpio: ab8500: Fix gpio offset bounds for irq mapping Lee Jones
@ 2012-12-14 16:19 ` Lee Jones
2012-12-14 16:19 ` [PATCH 10/21] gpio: ab8500: Add support for the AB9540 Lee Jones
` (13 subsequent siblings)
22 siblings, 0 replies; 28+ messages in thread
From: Lee Jones @ 2012-12-14 16:19 UTC (permalink / raw)
To: linux-kernel; +Cc: linus.walleij, Philippe Langlais, Lee Jones
From: Philippe Langlais <philippe.langlais@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Philippe Langlais <philippe.langlais@linaro.org>
---
drivers/gpio/gpio-ab8500.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-ab8500.c b/drivers/gpio/gpio-ab8500.c
index a0253ad..273f7ca 100644
--- a/drivers/gpio/gpio-ab8500.c
+++ b/drivers/gpio/gpio-ab8500.c
@@ -18,9 +18,9 @@
#include <linux/gpio.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
-#include <linux/mfd/ab8500.h>
#include <linux/mfd/abx500.h>
-#include <linux/mfd/ab8500/gpio.h>
+#include <linux/mfd/abx500/ab8500-gpio.h>
+
/*
* GPIO registers offset
--
1.7.9.5
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 10/21] gpio: ab8500: Add support for the AB9540
2012-12-14 16:19 [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Lee Jones
` (8 preceding siblings ...)
2012-12-14 16:19 ` [PATCH 09/21] gpio: ab8500: Fix bad include name after renaming Lee Jones
@ 2012-12-14 16:19 ` Lee Jones
2012-12-14 16:19 ` [PATCH 11/21] gpio: ab8500: Add support for AB8505 Chip Lee Jones
` (12 subsequent siblings)
22 siblings, 0 replies; 28+ messages in thread
From: Lee Jones @ 2012-12-14 16:19 UTC (permalink / raw)
To: linux-kernel
Cc: linus.walleij, Michel JAOUEN, Lee Jones, Maxime Coquelin,
Alex MACRO
From: Michel JAOUEN <michel.jaouen@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Maxime Coquelin <maxime.coquelin@st-ericsson.com>
Signed-off-by: Alex MACRO <alex.macro@stericsson.com>
Signed-off-by: Michel JAOUEN <michel.jaouen@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Reviewed-by: Bengt JONSSON <bengt.g.jonsson@stericsson.com>
Reviewed-by: Bibek BASU <bibek.basu@stericsson.com>
---
drivers/gpio/gpio-ab8500.c | 92 +++++++++++++++++++++++++++++++++-----------
1 file changed, 70 insertions(+), 22 deletions(-)
diff --git a/drivers/gpio/gpio-ab8500.c b/drivers/gpio/gpio-ab8500.c
index 273f7ca..b78cf2f 100644
--- a/drivers/gpio/gpio-ab8500.c
+++ b/drivers/gpio/gpio-ab8500.c
@@ -23,6 +23,13 @@
/*
+ * The AB9540 GPIO support is an extended version of the
+ * AB8500 GPIO support. The AB9540 supports an additional
+ * (7th) register so that more GPIO may be configured and
+ * used.
+ */
+
+/*
* GPIO registers offset
* Bank: 0x10
*/
@@ -32,6 +39,7 @@
#define AB8500_GPIO_SEL4_REG 0x03
#define AB8500_GPIO_SEL5_REG 0x04
#define AB8500_GPIO_SEL6_REG 0x05
+#define AB9540_GPIO_SEL7_REG 0x06
#define AB8500_GPIO_DIR1_REG 0x10
#define AB8500_GPIO_DIR2_REG 0x11
@@ -39,6 +47,7 @@
#define AB8500_GPIO_DIR4_REG 0x13
#define AB8500_GPIO_DIR5_REG 0x14
#define AB8500_GPIO_DIR6_REG 0x15
+#define AB9540_GPIO_DIR7_REG 0x16
#define AB8500_GPIO_OUT1_REG 0x20
#define AB8500_GPIO_OUT2_REG 0x21
@@ -46,6 +55,7 @@
#define AB8500_GPIO_OUT4_REG 0x23
#define AB8500_GPIO_OUT5_REG 0x24
#define AB8500_GPIO_OUT6_REG 0x25
+#define AB9540_GPIO_OUT7_REG 0x26
#define AB8500_GPIO_PUD1_REG 0x30
#define AB8500_GPIO_PUD2_REG 0x31
@@ -53,6 +63,7 @@
#define AB8500_GPIO_PUD4_REG 0x33
#define AB8500_GPIO_PUD5_REG 0x34
#define AB8500_GPIO_PUD6_REG 0x35
+#define AB9540_GPIO_PUD7_REG 0x36
#define AB8500_GPIO_IN1_REG 0x40
#define AB8500_GPIO_IN2_REG 0x41
@@ -60,9 +71,12 @@
#define AB8500_GPIO_IN4_REG 0x43
#define AB8500_GPIO_IN5_REG 0x44
#define AB8500_GPIO_IN6_REG 0x45
+#define AB9540_GPIO_IN7_REG 0x46
#define AB8500_GPIO_ALTFUN_REG 0x50
-#define ALTFUN_REG_INDEX 6
+#define AB8500_ALTFUN_REG_INDEX 6
+#define AB9540_ALTFUN_REG_INDEX 7
#define AB8500_NUM_GPIO 42
+#define AB9540_NUM_GPIO 54
#define AB8500_NUM_VIR_GPIO_IRQ 16
enum ab8500_gpio_action {
@@ -73,6 +87,11 @@ enum ab8500_gpio_action {
UNMASK
};
+struct ab8500_gpio_irq_cluster {
+ int start;
+ int end;
+};
+
struct ab8500_gpio {
struct gpio_chip chip;
struct ab8500 *parent;
@@ -82,7 +101,32 @@ struct ab8500_gpio {
enum ab8500_gpio_action irq_action;
u16 rising;
u16 falling;
+ struct ab8500_gpio_irq_cluster *irq_cluster;
+ int irq_cluster_size;
+};
+
+/*
+ * Only some GPIOs are interrupt capable, and they are
+ * organized in discontiguous clusters:
+ *
+ * GPIO6 to GPIO13
+ * GPIO24 and GPIO25
+ * GPIO36 to GPIO41
+ * GPIO50 to GPIO54 (AB9540 only)
+ */
+static struct ab8500_gpio_irq_cluster ab8500_irq_clusters[] = {
+ {.start = 5, .end = 12}, /* GPIO numbers start from 1 */
+ {.start = 23, .end = 24},
+ {.start = 35, .end = 40},
+};
+
+static struct ab8500_gpio_irq_cluster ab9540_irq_clusters[] = {
+ {.start = 5, .end = 12}, /* GPIO numbers start from 1 */
+ {.start = 23, .end = 24},
+ {.start = 35, .end = 40},
+ {.start = 49, .end = 53},
};
+
/**
* to_ab8500_gpio() - get the pointer to ab8500_gpio
* @chip: Member of the structure ab8500_gpio
@@ -162,28 +206,13 @@ static int ab8500_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
static int ab8500_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
{
- /*
- * Only some GPIOs are interrupt capable, and they are
- * organized in discontiguous clusters:
- *
- * GPIO6 to GPIO13
- * GPIO24 and GPIO25
- * GPIO36 to GPIO41
- */
- static struct ab8500_gpio_irq_cluster {
- int start;
- int end;
- } clusters[] = {
- {.start = 5, .end = 12}, /* GPIO numbers start from 1 */
- {.start = 23, .end = 24},
- {.start = 35, .end = 40},
- };
struct ab8500_gpio *ab8500_gpio = to_ab8500_gpio(chip);
int base = ab8500_gpio->irq_base;
int i;
- for (i = 0; i < ARRAY_SIZE(clusters); i++) {
- struct ab8500_gpio_irq_cluster *cluster = &clusters[i];
+ for (i = 0; i < ab8500_gpio->irq_cluster_size; i++) {
+ struct ab8500_gpio_irq_cluster *cluster =
+ &ab8500_gpio->irq_cluster[i];
if (offset >= cluster->start && offset <= cluster->end)
return base + offset - cluster->start;
@@ -412,6 +441,8 @@ static int __devinit ab8500_gpio_probe(struct platform_device *pdev)
struct ab8500_gpio *ab8500_gpio;
int ret;
int i;
+ int last_gpio_sel_reg;
+ int altfun_reg_index;
pdata = ab8500_pdata->gpio;
if (!pdata) {
@@ -427,10 +458,27 @@ static int __devinit ab8500_gpio_probe(struct platform_device *pdev)
ab8500_gpio->dev = &pdev->dev;
ab8500_gpio->parent = dev_get_drvdata(pdev->dev.parent);
ab8500_gpio->chip = ab8500gpio_chip;
- ab8500_gpio->chip.ngpio = AB8500_NUM_GPIO;
ab8500_gpio->chip.dev = &pdev->dev;
ab8500_gpio->chip.base = pdata->gpio_base;
ab8500_gpio->irq_base = pdata->irq_base;
+
+ /* Configure GPIO Settings for specific AB devices */
+ if (cpu_is_u9540()) {
+ ab8500_gpio->chip.ngpio = AB9540_NUM_GPIO;
+ ab8500_gpio->irq_cluster = ab9540_irq_clusters;
+ ab8500_gpio->irq_cluster_size =
+ ARRAY_SIZE(ab9540_irq_clusters);
+ last_gpio_sel_reg = AB9540_GPIO_SEL7_REG;
+ altfun_reg_index = AB9540_ALTFUN_REG_INDEX;
+ } else {
+ ab8500_gpio->chip.ngpio = AB8500_NUM_GPIO;
+ ab8500_gpio->irq_cluster = ab8500_irq_clusters;
+ ab8500_gpio->irq_cluster_size =
+ ARRAY_SIZE(ab8500_irq_clusters);
+ last_gpio_sel_reg = AB8500_GPIO_SEL6_REG;
+ altfun_reg_index = AB8500_ALTFUN_REG_INDEX;
+ }
+
/* initialize the lock */
mutex_init(&ab8500_gpio->lock);
/*
@@ -439,7 +487,7 @@ static int __devinit ab8500_gpio_probe(struct platform_device *pdev)
* These values are for selecting the PINs as
* GPIO or alternate function
*/
- for (i = AB8500_GPIO_SEL1_REG; i <= AB8500_GPIO_SEL6_REG; i++) {
+ for (i = AB8500_GPIO_SEL1_REG; i <= last_gpio_sel_reg; i++) {
ret = abx500_set_register_interruptible(ab8500_gpio->dev,
AB8500_MISC, i,
pdata->config_reg[i]);
@@ -460,7 +508,7 @@ static int __devinit ab8500_gpio_probe(struct platform_device *pdev)
}
ret = abx500_set_register_interruptible(ab8500_gpio->dev, AB8500_MISC,
AB8500_GPIO_ALTFUN_REG,
- pdata->config_reg[ALTFUN_REG_INDEX]);
+ pdata->config_reg[altfun_reg_index]);
if (ret < 0)
goto out_free;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 11/21] gpio: ab8500: Add support for AB8505 Chip
2012-12-14 16:19 [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Lee Jones
` (9 preceding siblings ...)
2012-12-14 16:19 ` [PATCH 10/21] gpio: ab8500: Add support for the AB9540 Lee Jones
@ 2012-12-14 16:19 ` Lee Jones
2012-12-14 16:19 ` [PATCH 12/21] gpio: ab8500: Allow gpios to wake the system from suspend Lee Jones
` (11 subsequent siblings)
22 siblings, 0 replies; 28+ messages in thread
From: Lee Jones @ 2012-12-14 16:19 UTC (permalink / raw)
To: linux-kernel; +Cc: linus.walleij, Naga Radhesh, Lee Jones
From: Naga Radhesh <naga.radheshy@stericsson.com>
Number of gpio pins has been changed for AB8505, so
change gpio configurations according to AB8505.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Naga Radhesh <naga.radheshy@stericsson.com>
Reviewed-by: Bibek BASU <bibek.basu@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
---
drivers/gpio/gpio-ab8500.c | 41 +++++++++++++++++++++++++++++++++++------
1 file changed, 35 insertions(+), 6 deletions(-)
diff --git a/drivers/gpio/gpio-ab8500.c b/drivers/gpio/gpio-ab8500.c
index b78cf2f..8616368 100644
--- a/drivers/gpio/gpio-ab8500.c
+++ b/drivers/gpio/gpio-ab8500.c
@@ -77,6 +77,7 @@
#define AB9540_ALTFUN_REG_INDEX 7
#define AB8500_NUM_GPIO 42
#define AB9540_NUM_GPIO 54
+#define AB8505_NUM_GPIO 53
#define AB8500_NUM_VIR_GPIO_IRQ 16
enum ab8500_gpio_action {
@@ -127,6 +128,24 @@ static struct ab8500_gpio_irq_cluster ab9540_irq_clusters[] = {
{.start = 49, .end = 53},
};
+/*
+ * For AB8505 Only some GPIOs are interrupt capable, and they are
+ * organized in discontiguous clusters:
+ *
+ * GPIO10 to GPIO11
+ * GPIO13
+ * GPIO40 and GPIO41
+ * GPIO50
+ * GPIO52 to GPIO53
+ */
+static struct ab8500_gpio_irq_cluster ab8505_irq_clusters[] = {
+ {.start = 9, .end = 10}, /* GPIO numbers start from 1 */
+ {.start = 12, .end = 12},
+ {.start = 39, .end = 40},
+ {.start = 49, .end = 49},
+ {.start = 51, .end = 52},
+};
+
/**
* to_ab8500_gpio() - get the pointer to ab8500_gpio
* @chip: Member of the structure ab8500_gpio
@@ -435,6 +454,7 @@ static void ab8500_gpio_irq_remove(struct ab8500_gpio *ab8500_gpio)
static int __devinit ab8500_gpio_probe(struct platform_device *pdev)
{
+ struct ab8500 *parent = dev_get_drvdata(pdev->dev.parent);
struct ab8500_platform_data *ab8500_pdata =
dev_get_platdata(pdev->dev.parent);
struct ab8500_gpio_platform_data *pdata;
@@ -471,12 +491,21 @@ static int __devinit ab8500_gpio_probe(struct platform_device *pdev)
last_gpio_sel_reg = AB9540_GPIO_SEL7_REG;
altfun_reg_index = AB9540_ALTFUN_REG_INDEX;
} else {
- ab8500_gpio->chip.ngpio = AB8500_NUM_GPIO;
- ab8500_gpio->irq_cluster = ab8500_irq_clusters;
- ab8500_gpio->irq_cluster_size =
- ARRAY_SIZE(ab8500_irq_clusters);
- last_gpio_sel_reg = AB8500_GPIO_SEL6_REG;
- altfun_reg_index = AB8500_ALTFUN_REG_INDEX;
+ if (is_ab8505(parent)) {
+ ab8500_gpio->chip.ngpio = AB8505_NUM_GPIO;
+ ab8500_gpio->irq_cluster = ab8505_irq_clusters;
+ ab8500_gpio->irq_cluster_size =
+ ARRAY_SIZE(ab8505_irq_clusters);
+ last_gpio_sel_reg = AB9540_GPIO_SEL7_REG;
+ altfun_reg_index = AB9540_ALTFUN_REG_INDEX;
+ } else {
+ ab8500_gpio->chip.ngpio = AB8500_NUM_GPIO;
+ ab8500_gpio->irq_cluster = ab8500_irq_clusters;
+ ab8500_gpio->irq_cluster_size =
+ ARRAY_SIZE(ab8500_irq_clusters);
+ last_gpio_sel_reg = AB8500_GPIO_SEL6_REG;
+ altfun_reg_index = AB8500_ALTFUN_REG_INDEX;
+ }
}
/* initialize the lock */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 12/21] gpio: ab8500: Allow gpios to wake the system from suspend
2012-12-14 16:19 [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Lee Jones
` (10 preceding siblings ...)
2012-12-14 16:19 ` [PATCH 11/21] gpio: ab8500: Add support for AB8505 Chip Lee Jones
@ 2012-12-14 16:19 ` Lee Jones
2012-12-14 16:19 ` [PATCH 13/21] gpio: ab8500: Use most recent run-time platform checker Lee Jones
` (10 subsequent siblings)
22 siblings, 0 replies; 28+ messages in thread
From: Lee Jones @ 2012-12-14 16:19 UTC (permalink / raw)
To: linux-kernel; +Cc: linus.walleij, Paer-Olof Haakansson, Lee Jones
From: Paer-Olof Haakansson <par-olof.hakansson@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Paer-Olof Haakansson <par-olof.hakansson@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
---
drivers/gpio/gpio-ab8500.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-ab8500.c b/drivers/gpio/gpio-ab8500.c
index 8616368..ef75984 100644
--- a/drivers/gpio/gpio-ab8500.c
+++ b/drivers/gpio/gpio-ab8500.c
@@ -329,12 +329,12 @@ static void ab8500_gpio_irq_sync_unlock(struct irq_data *data)
if (rising)
ret = request_threaded_irq(irq_to_rising(irq),
NULL, handle_rising,
- IRQF_TRIGGER_RISING,
+ IRQF_TRIGGER_RISING | IRQF_NO_SUSPEND,
"ab8500-gpio-r", ab8500_gpio);
if (falling)
ret = request_threaded_irq(irq_to_falling(irq),
NULL, handle_falling,
- IRQF_TRIGGER_FALLING,
+ IRQF_TRIGGER_FALLING | IRQF_NO_SUSPEND,
"ab8500-gpio-f", ab8500_gpio);
break;
case SHUTDOWN:
--
1.7.9.5
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 13/21] gpio: ab8500: Use most recent run-time platform checker
2012-12-14 16:19 [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Lee Jones
` (11 preceding siblings ...)
2012-12-14 16:19 ` [PATCH 12/21] gpio: ab8500: Allow gpios to wake the system from suspend Lee Jones
@ 2012-12-14 16:19 ` Lee Jones
2012-12-14 16:19 ` [PATCH 14/21] gpio: ab8500: Remove ENUMs from linux/mfd/abx500/ab8500-gpio.h Lee Jones
` (9 subsequent siblings)
22 siblings, 0 replies; 28+ messages in thread
From: Lee Jones @ 2012-12-14 16:19 UTC (permalink / raw)
To: linux-kernel; +Cc: linus.walleij, Michel JAOUEN, Lee Jones
From: Michel JAOUEN <michel.jaouen@stericsson.com>
Use is_ab9540() instead of cpu_is_u9540() when checking platform.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Michel JAOUEN <michel.jaouen@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
---
drivers/gpio/gpio-ab8500.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-ab8500.c b/drivers/gpio/gpio-ab8500.c
index ef75984..200c605 100644
--- a/drivers/gpio/gpio-ab8500.c
+++ b/drivers/gpio/gpio-ab8500.c
@@ -483,7 +483,7 @@ static int __devinit ab8500_gpio_probe(struct platform_device *pdev)
ab8500_gpio->irq_base = pdata->irq_base;
/* Configure GPIO Settings for specific AB devices */
- if (cpu_is_u9540()) {
+ if (is_ab9540(parent)) {
ab8500_gpio->chip.ngpio = AB9540_NUM_GPIO;
ab8500_gpio->irq_cluster = ab9540_irq_clusters;
ab8500_gpio->irq_cluster_size =
--
1.7.9.5
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 14/21] gpio: ab8500: Remove ENUMs from linux/mfd/abx500/ab8500-gpio.h
2012-12-14 16:19 [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Lee Jones
` (12 preceding siblings ...)
2012-12-14 16:19 ` [PATCH 13/21] gpio: ab8500: Use most recent run-time platform checker Lee Jones
@ 2012-12-14 16:19 ` Lee Jones
2012-12-14 16:19 ` [PATCH 15/21] gpio: ab8500: Add support for the ab8540 Lee Jones
` (8 subsequent siblings)
22 siblings, 0 replies; 28+ messages in thread
From: Lee Jones @ 2012-12-14 16:19 UTC (permalink / raw)
To: linux-kernel; +Cc: linus.walleij, Lee Jones
These are no longer used and will be replaced by a simple macro.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/gpio/gpio-ab8500.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpio/gpio-ab8500.c b/drivers/gpio/gpio-ab8500.c
index 200c605..ab6ceac 100644
--- a/drivers/gpio/gpio-ab8500.c
+++ b/drivers/gpio/gpio-ab8500.c
@@ -585,9 +585,9 @@ static int __devexit ab8500_gpio_remove(struct platform_device *pdev)
}
int ab8500_config_pulldown(struct device *dev,
- enum ab8500_pin gpio, bool enable)
+ int gpio, bool enable)
{
- u8 offset = gpio - AB8500_PIN_GPIO1;
+ u8 offset = gpio - AB8500_PIN_GPIO(1);
u8 pos = offset % 8;
u8 val = enable ? 0 : 1;
u8 reg = AB8500_GPIO_PUD1_REG + (offset / 8);
@@ -610,9 +610,9 @@ EXPORT_SYMBOL(ab8500_config_pulldown);
* @gpio_select: true if the pin should be used as GPIO
*/
int ab8500_gpio_config_select(struct device *dev,
- enum ab8500_pin gpio, bool gpio_select)
+ int gpio, bool gpio_select)
{
- u8 offset = gpio - AB8500_PIN_GPIO1;
+ u8 offset = gpio - AB8500_PIN_GPIO(1);
u8 reg = AB8500_GPIO_SEL1_REG + (offset / 8);
u8 pos = offset % 8;
u8 val = gpio_select ? 1 : 0;
@@ -638,9 +638,9 @@ int ab8500_gpio_config_select(struct device *dev,
* @gpio_select: pointer to pin selection status
*/
int ab8500_gpio_config_get_select(struct device *dev,
- enum ab8500_pin gpio, bool *gpio_select)
+ int gpio, bool *gpio_select)
{
- u8 offset = gpio - AB8500_PIN_GPIO1;
+ u8 offset = gpio - AB8500_PIN_GPIO(1);
u8 reg = AB8500_GPIO_SEL1_REG + (offset / 8);
u8 pos = offset % 8;
u8 val;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 15/21] gpio: ab8500: Add support for the ab8540
2012-12-14 16:19 [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Lee Jones
` (13 preceding siblings ...)
2012-12-14 16:19 ` [PATCH 14/21] gpio: ab8500: Remove ENUMs from linux/mfd/abx500/ab8500-gpio.h Lee Jones
@ 2012-12-14 16:19 ` Lee Jones
2012-12-14 16:19 ` [PATCH 16/21] gpio: ab8500: Add internal pull up on GPIO of ab8540 Lee Jones
` (7 subsequent siblings)
22 siblings, 0 replies; 28+ messages in thread
From: Lee Jones @ 2012-12-14 16:19 UTC (permalink / raw)
To: linux-kernel; +Cc: linus.walleij, Alexandre Torgue, Lee Jones
From: Alexandre Torgue <alexandre.torgue@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alexandre Torgue <alexandre.torgue@stericsson.com>
Reviewed-by: Maxime COQUELIN <maxime.coquelin@stericsson.com>
Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com>
Reviewed-by: Mattias WALLIN <mattias.wallin@stericsson.com>
---
drivers/gpio/gpio-ab8500.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-ab8500.c b/drivers/gpio/gpio-ab8500.c
index ab6ceac..757ae34 100644
--- a/drivers/gpio/gpio-ab8500.c
+++ b/drivers/gpio/gpio-ab8500.c
@@ -78,6 +78,7 @@
#define AB8500_NUM_GPIO 42
#define AB9540_NUM_GPIO 54
#define AB8505_NUM_GPIO 53
+#define AB8540_NUM_GPIO 56
#define AB8500_NUM_VIR_GPIO_IRQ 16
enum ab8500_gpio_action {
@@ -146,6 +147,15 @@ static struct ab8500_gpio_irq_cluster ab8505_irq_clusters[] = {
{.start = 51, .end = 52},
};
+/*
+ * For AB8540 Only some GPIOs are interrupt capable:
+ * GPIO51 to GPIO54
+ */
+static struct ab8500_gpio_irq_cluster ab8540_irq_clusters[] = {
+ {.start = 50, .end = 53}, /* GPIO numbers start from 1 */
+};
+
+
/**
* to_ab8500_gpio() - get the pointer to ab8500_gpio
* @chip: Member of the structure ab8500_gpio
@@ -483,7 +493,14 @@ static int __devinit ab8500_gpio_probe(struct platform_device *pdev)
ab8500_gpio->irq_base = pdata->irq_base;
/* Configure GPIO Settings for specific AB devices */
- if (is_ab9540(parent)) {
+ if (is_ab8540(parent)) {
+ ab8500_gpio->chip.ngpio = AB8540_NUM_GPIO;
+ ab8500_gpio->irq_cluster = ab8540_irq_clusters;
+ ab8500_gpio->irq_cluster_size =
+ ARRAY_SIZE(ab8540_irq_clusters);
+ last_gpio_sel_reg = AB9540_GPIO_SEL7_REG;
+ altfun_reg_index = AB9540_ALTFUN_REG_INDEX;
+ } else if (is_ab9540(parent)) {
ab8500_gpio->chip.ngpio = AB9540_NUM_GPIO;
ab8500_gpio->irq_cluster = ab9540_irq_clusters;
ab8500_gpio->irq_cluster_size =
--
1.7.9.5
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 16/21] gpio: ab8500: Add internal pull up on GPIO of ab8540
2012-12-14 16:19 [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Lee Jones
` (14 preceding siblings ...)
2012-12-14 16:19 ` [PATCH 15/21] gpio: ab8500: Add support for the ab8540 Lee Jones
@ 2012-12-14 16:19 ` Lee Jones
2012-12-14 16:19 ` [PATCH 17/21] gpio: ab8500: Add the action range for the internal pull up function on GPIO Lee Jones
` (6 subsequent siblings)
22 siblings, 0 replies; 28+ messages in thread
From: Lee Jones @ 2012-12-14 16:19 UTC (permalink / raw)
To: linux-kernel; +Cc: linus.walleij, Alexandre Torgue, Lee Jones, Yang QU
From: Alexandre Torgue <alexandre.torgue@stericsson.com>
Add 4 GPIOs named GPIOx_VBAT which have both internal pull up
and pull down capability on ab8540. We can also select different
voltage domains for GPIOx_VBAT.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Yang QU <yang.qu@stericsson.com>
Reviewed-by: Alexandre TORGUE <alexandre.torgue@stericsson.com>
Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
Tested-by: Alexandre TORGUE <alexandre.torgue@stericsson.com>
Tested-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
---
drivers/gpio/gpio-ab8500.c | 64 ++++++++++++++++++++++++++++
include/linux/mfd/abx500/ab8500-gpio.h | 71 +++++++++++---------------------
2 files changed, 87 insertions(+), 48 deletions(-)
diff --git a/drivers/gpio/gpio-ab8500.c b/drivers/gpio/gpio-ab8500.c
index 757ae34..ff8df1f 100644
--- a/drivers/gpio/gpio-ab8500.c
+++ b/drivers/gpio/gpio-ab8500.c
@@ -72,6 +72,8 @@
#define AB8500_GPIO_IN5_REG 0x44
#define AB8500_GPIO_IN6_REG 0x45
#define AB9540_GPIO_IN7_REG 0x46
+#define AB8540_GPIO_VINSEL_REG 0x47
+#define AB8540_GPIO_PULL_UPDOWN_REG 0x48
#define AB8500_GPIO_ALTFUN_REG 0x50
#define AB8500_ALTFUN_REG_INDEX 6
#define AB9540_ALTFUN_REG_INDEX 7
@@ -80,6 +82,8 @@
#define AB8505_NUM_GPIO 53
#define AB8540_NUM_GPIO 56
#define AB8500_NUM_VIR_GPIO_IRQ 16
+#define AB8540_GPIO_PULL_UPDOWN_MASK 0x03
+#define AB8540_GPIO_VINSEL_MASK 0x03
enum ab8500_gpio_action {
NONE,
@@ -552,6 +556,20 @@ static int __devinit ab8500_gpio_probe(struct platform_device *pdev)
if (ret < 0)
goto out_free;
}
+
+ if (is_ab8540(parent)) {
+ ret = abx500_set_register_interruptible(ab8500_gpio->dev,
+ AB8500_MISC, AB8540_GPIO_VINSEL_REG,
+ pdata->config_vinsel);
+ if (ret < 0)
+ goto out_free;
+ ret = abx500_set_register_interruptible(ab8500_gpio->dev,
+ AB8500_MISC, AB8540_GPIO_PULL_UPDOWN_REG,
+ pdata->config_pullupdown);
+ if (ret < 0)
+ goto out_free;
+ }
+
ret = abx500_set_register_interruptible(ab8500_gpio->dev, AB8500_MISC,
AB8500_GPIO_ALTFUN_REG,
pdata->config_reg[altfun_reg_index]);
@@ -619,6 +637,52 @@ int ab8500_config_pulldown(struct device *dev,
EXPORT_SYMBOL(ab8500_config_pulldown);
/*
+ * ab8540_config_pull_updown() only available for following GPIOs:
+ * GPIO51(GPIO1_VBAT)
+ * GPIO52(GPIO2_VBAT)
+ * GPIO53(GPIO3_VBAT)
+ * GPIO54(GPIO4_VBAT)
+ */
+int ab8540_config_pull_updown(struct device *dev,
+ int gpio, enum ab8540_gpio_pull_updown reg)
+{
+ u8 offset = gpio - AB8500_PIN_GPIO(51);
+ u8 pos = 2 * offset;
+ int ret;
+
+ ret = abx500_mask_and_set_register_interruptible(dev,
+ AB8500_MISC, AB8540_GPIO_PULL_UPDOWN_REG,
+ AB8540_GPIO_PULL_UPDOWN_MASK << pos, reg << pos);
+ if (ret < 0)
+ dev_err(dev, "%s failed (%d)\n", __func__, ret);
+ return ret;
+}
+EXPORT_SYMBOL(ab8540_config_pull_updown);
+
+/*
+ * ab8540_gpio_config_vinsel() only available for following GPIOs:
+ * GPIO51(GPIO1_VBAT)
+ * GPIO52(GPIO2_VBAT)
+ * GPIO53(GPIO3_VBAT)
+ * GPIO54(GPIO4_VBAT)
+ */
+int ab8540_gpio_config_vinsel(struct device *dev,
+ int gpio, enum ab8540_gpio_vinsel reg)
+{
+ u8 offset = gpio - AB8500_PIN_GPIO(51);
+ u8 pos = 2 * offset;
+ int ret;
+
+ ret = abx500_mask_and_set_register_interruptible(dev,
+ AB8500_MISC, AB8540_GPIO_VINSEL_REG,
+ AB8540_GPIO_VINSEL_MASK << pos, reg << pos);
+ if (ret < 0)
+ dev_err(dev, "%s failed (%d)\n", __func__, ret);
+ return ret;
+}
+EXPORT_SYMBOL(ab8540_gpio_config_vinsel);
+
+/*
* ab8500_gpio_config_select()
*
* Configure functionality of pin, either specific use or GPIO.
diff --git a/include/linux/mfd/abx500/ab8500-gpio.h b/include/linux/mfd/abx500/ab8500-gpio.h
index 48325db..20df07d 100644
--- a/include/linux/mfd/abx500/ab8500-gpio.h
+++ b/include/linux/mfd/abx500/ab8500-gpio.h
@@ -18,62 +18,37 @@ struct ab8500_gpio_platform_data {
int gpio_base;
u32 irq_base;
u8 config_reg[8];
- u8 config_direction[6];
- u8 config_pullups[6];
+ u8 config_direction[7];
+ u8 config_pullups[7];
+ u8 config_vinsel;
+ u8 config_pullupdown;
};
-enum ab8500_pin {
- AB8500_PIN_GPIO1 = 0,
- AB8500_PIN_GPIO2,
- AB8500_PIN_GPIO3,
- AB8500_PIN_GPIO4,
- AB8500_PIN_GPIO5,
- AB8500_PIN_GPIO6,
- AB8500_PIN_GPIO7,
- AB8500_PIN_GPIO8,
- AB8500_PIN_GPIO9,
- AB8500_PIN_GPIO10,
- AB8500_PIN_GPIO11,
- AB8500_PIN_GPIO12,
- AB8500_PIN_GPIO13,
- AB8500_PIN_GPIO14,
- AB8500_PIN_GPIO15,
- AB8500_PIN_GPIO16,
- AB8500_PIN_GPIO17,
- AB8500_PIN_GPIO18,
- AB8500_PIN_GPIO19,
- AB8500_PIN_GPIO20,
- AB8500_PIN_GPIO21,
- AB8500_PIN_GPIO22,
- AB8500_PIN_GPIO23,
- AB8500_PIN_GPIO24,
- AB8500_PIN_GPIO25,
- AB8500_PIN_GPIO26,
- AB8500_PIN_GPIO27,
- AB8500_PIN_GPIO28,
- AB8500_PIN_GPIO29,
- AB8500_PIN_GPIO30,
- AB8500_PIN_GPIO31,
- AB8500_PIN_GPIO32,
- AB8500_PIN_GPIO33,
- AB8500_PIN_GPIO34,
- AB8500_PIN_GPIO35,
- AB8500_PIN_GPIO36,
- AB8500_PIN_GPIO37,
- AB8500_PIN_GPIO38,
- AB8500_PIN_GPIO39,
- AB8500_PIN_GPIO40,
- AB8500_PIN_GPIO41,
- AB8500_PIN_GPIO42,
+enum ab8540_gpio_pull_updown {
+ AB8540_GPIO_PULL_DOWN = 0x0,
+ AB8540_GPIO_PULL_NONE = 0x1,
+ AB8540_GPIO_PULL_UP = 0x3,
+};
+
+enum ab8540_gpio_vinsel {
+ AB8540_GPIO_VINSEL_VBAT = 0x0,
+ AB8540_GPIO_VINSEL_VIN_1V8 = 0x1,
+ AB8540_GPIO_VINSEL_VDD_BIF = 0x2,
};
int ab8500_config_pulldown(struct device *dev,
- enum ab8500_pin gpio, bool enable);
+ int gpio, bool enable);
+
+int ab8540_config_pull_updown(struct device *dev,
+ int gpio, enum ab8540_gpio_pull_updown reg);
+
+int ab8540_gpio_config_vinsel(struct device *dev,
+ int gpio, enum ab8540_gpio_vinsel reg);
int ab8500_gpio_config_select(struct device *dev,
- enum ab8500_pin gpio, bool gpio_select);
+ int gpio, bool gpio_select);
int ab8500_gpio_config_get_select(struct device *dev,
- enum ab8500_pin gpio, bool *gpio_select);
+ int gpio, bool *gpio_select);
#endif /* _AB8500_GPIO_H */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 17/21] gpio: ab8500: Add the action range for the internal pull up function on GPIO
2012-12-14 16:19 [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Lee Jones
` (15 preceding siblings ...)
2012-12-14 16:19 ` [PATCH 16/21] gpio: ab8500: Add internal pull up on GPIO of ab8540 Lee Jones
@ 2012-12-14 16:19 ` Lee Jones
2012-12-14 16:19 ` [PATCH 18/21] gpio: ab8500: Fix parameter uninitialized warning for ab8540 Lee Jones
` (5 subsequent siblings)
22 siblings, 0 replies; 28+ messages in thread
From: Lee Jones @ 2012-12-14 16:19 UTC (permalink / raw)
To: linux-kernel; +Cc: linus.walleij, Yang QU, Lee Jones
From: Yang QU <yang.qu@stericsson.com>
Only 4 GPIOs named GPIOx_VBAT have both internal pull up and pull
down capability on ab8540. Limit the action range for this function.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Yang QU <yang.qu@stericsson.com>
Reviewed-by: Per FORLIN <per.forlin@stericsson.com>
---
drivers/gpio/gpio-ab8500.c | 54 +++++++++++++++++---------------
include/linux/mfd/abx500/ab8500-gpio.h | 6 ++--
2 files changed, 32 insertions(+), 28 deletions(-)
diff --git a/drivers/gpio/gpio-ab8500.c b/drivers/gpio/gpio-ab8500.c
index ff8df1f..b4f631a 100644
--- a/drivers/gpio/gpio-ab8500.c
+++ b/drivers/gpio/gpio-ab8500.c
@@ -23,10 +23,12 @@
/*
- * The AB9540 GPIO support is an extended version of the
- * AB8500 GPIO support. The AB9540 supports an additional
- * (7th) register so that more GPIO may be configured and
- * used.
+ * The AB9540 and AB8540 GPIO support are extended versions
+ * of the AB8500 GPIO support.
+ * The AB9540 supports an additional (7th) register so that
+ * more GPIO may be configured and used.
+ * The AB8540 supports 4 new gpios (GPIOx_VBAT) that have
+ * internal pull-up and pull-down capabilities.
*/
/*
@@ -636,46 +638,46 @@ int ab8500_config_pulldown(struct device *dev,
}
EXPORT_SYMBOL(ab8500_config_pulldown);
-/*
- * ab8540_config_pull_updown() only available for following GPIOs:
- * GPIO51(GPIO1_VBAT)
- * GPIO52(GPIO2_VBAT)
- * GPIO53(GPIO3_VBAT)
- * GPIO54(GPIO4_VBAT)
- */
int ab8540_config_pull_updown(struct device *dev,
- int gpio, enum ab8540_gpio_pull_updown reg)
+ int gpio, enum ab8540_gpio_pull_updown val)
{
- u8 offset = gpio - AB8500_PIN_GPIO(51);
- u8 pos = 2 * offset;
+ u8 pos;
int ret;
+ if ((gpio < AB8500_PIN_GPIO(51)) || (gpio > AB8500_PIN_GPIO(54))) {
+ ret = -EINVAL;
+ goto out;
+ }
+
+ pos = (gpio - AB8500_PIN_GPIO(51)) << 1;
+
ret = abx500_mask_and_set_register_interruptible(dev,
AB8500_MISC, AB8540_GPIO_PULL_UPDOWN_REG,
- AB8540_GPIO_PULL_UPDOWN_MASK << pos, reg << pos);
+ AB8540_GPIO_PULL_UPDOWN_MASK << pos, val << pos);
+
+out:
if (ret < 0)
dev_err(dev, "%s failed (%d)\n", __func__, ret);
return ret;
}
EXPORT_SYMBOL(ab8540_config_pull_updown);
-/*
- * ab8540_gpio_config_vinsel() only available for following GPIOs:
- * GPIO51(GPIO1_VBAT)
- * GPIO52(GPIO2_VBAT)
- * GPIO53(GPIO3_VBAT)
- * GPIO54(GPIO4_VBAT)
- */
int ab8540_gpio_config_vinsel(struct device *dev,
- int gpio, enum ab8540_gpio_vinsel reg)
+ int gpio, enum ab8540_gpio_vinsel val)
{
- u8 offset = gpio - AB8500_PIN_GPIO(51);
- u8 pos = 2 * offset;
+ u8 pos;
int ret;
+ if ((gpio < AB8500_PIN_GPIO(51)) || (gpio > AB8500_PIN_GPIO(54))) {
+ ret = -EINVAL;
+ goto out;
+ }
+
ret = abx500_mask_and_set_register_interruptible(dev,
AB8500_MISC, AB8540_GPIO_VINSEL_REG,
- AB8540_GPIO_VINSEL_MASK << pos, reg << pos);
+ AB8540_GPIO_VINSEL_MASK << pos, val << pos);
+
+out:
if (ret < 0)
dev_err(dev, "%s failed (%d)\n", __func__, ret);
return ret;
diff --git a/include/linux/mfd/abx500/ab8500-gpio.h b/include/linux/mfd/abx500/ab8500-gpio.h
index 20df07d..86ccb33 100644
--- a/include/linux/mfd/abx500/ab8500-gpio.h
+++ b/include/linux/mfd/abx500/ab8500-gpio.h
@@ -39,11 +39,13 @@ enum ab8540_gpio_vinsel {
int ab8500_config_pulldown(struct device *dev,
int gpio, bool enable);
+/* Selects pull up/pull down for GPIOx_VBAT, x=1 to 4 */
int ab8540_config_pull_updown(struct device *dev,
- int gpio, enum ab8540_gpio_pull_updown reg);
+ int gpio, enum ab8540_gpio_pull_updown val);
+/* Selects voltage for GPIOx_VBAT, x=1 to 4 */
int ab8540_gpio_config_vinsel(struct device *dev,
- int gpio, enum ab8540_gpio_vinsel reg);
+ int gpio, enum ab8540_gpio_vinsel val);
int ab8500_gpio_config_select(struct device *dev,
int gpio, bool gpio_select);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 18/21] gpio: ab8500: Fix parameter uninitialized warning for ab8540
2012-12-14 16:19 [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Lee Jones
` (16 preceding siblings ...)
2012-12-14 16:19 ` [PATCH 17/21] gpio: ab8500: Add the action range for the internal pull up function on GPIO Lee Jones
@ 2012-12-14 16:19 ` Lee Jones
2012-12-14 16:19 ` [PATCH 19/21] gpio: ab8500: Update gpio ab8540 interrupt mapping Lee Jones
` (4 subsequent siblings)
22 siblings, 0 replies; 28+ messages in thread
From: Lee Jones @ 2012-12-14 16:19 UTC (permalink / raw)
To: linux-kernel; +Cc: linus.walleij, Yang QU, Lee Jones
From: Yang QU <yang.qu@stericsson.com>
Missing initial value in ab8540 gpio configuration function. So
initialize it and fix this warning.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Yang QU <yang.qu@stericsson.com>
Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com>
---
drivers/gpio/gpio-ab8500.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpio/gpio-ab8500.c b/drivers/gpio/gpio-ab8500.c
index b4f631a..833d4c2 100644
--- a/drivers/gpio/gpio-ab8500.c
+++ b/drivers/gpio/gpio-ab8500.c
@@ -673,6 +673,8 @@ int ab8540_gpio_config_vinsel(struct device *dev,
goto out;
}
+ pos = (gpio - AB8500_PIN_GPIO(51)) << 1;
+
ret = abx500_mask_and_set_register_interruptible(dev,
AB8500_MISC, AB8540_GPIO_VINSEL_REG,
AB8540_GPIO_VINSEL_MASK << pos, val << pos);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 19/21] gpio: ab8500: Update gpio ab8540 interrupt mapping
2012-12-14 16:19 [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Lee Jones
` (17 preceding siblings ...)
2012-12-14 16:19 ` [PATCH 18/21] gpio: ab8500: Fix parameter uninitialized warning for ab8540 Lee Jones
@ 2012-12-14 16:19 ` Lee Jones
2012-12-14 16:19 ` [PATCH 20/21] gpio: ab8500: Fix ab8540 setting direction output error Lee Jones
` (3 subsequent siblings)
22 siblings, 0 replies; 28+ messages in thread
From: Lee Jones @ 2012-12-14 16:19 UTC (permalink / raw)
To: linux-kernel; +Cc: linus.walleij, Yang QU, Lee Jones
From: Yang QU <yang.qu@stericsson.com>
Add some GPIOs used as interrupt on ab8540 and modify the setting
strategy of the interrupt line.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Yang QU <yang.qu@stericsson.com>
Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com>
Reviewed-by: Xiao Mei ZHANG <xiaomei.zhang@stericsson.com>
Tested-by: Yang QU <yang.qu@stericsson.com>
---
drivers/gpio/gpio-ab8500.c | 50 +++++++++++++++++++++++++++++++++-----------
1 file changed, 38 insertions(+), 12 deletions(-)
diff --git a/drivers/gpio/gpio-ab8500.c b/drivers/gpio/gpio-ab8500.c
index 833d4c2..edc3037 100644
--- a/drivers/gpio/gpio-ab8500.c
+++ b/drivers/gpio/gpio-ab8500.c
@@ -98,6 +98,7 @@ enum ab8500_gpio_action {
struct ab8500_gpio_irq_cluster {
int start;
int end;
+ int offset;
};
struct ab8500_gpio {
@@ -155,10 +156,12 @@ static struct ab8500_gpio_irq_cluster ab8505_irq_clusters[] = {
/*
* For AB8540 Only some GPIOs are interrupt capable:
+ * GPIO43 to GPIO44
* GPIO51 to GPIO54
*/
static struct ab8500_gpio_irq_cluster ab8540_irq_clusters[] = {
- {.start = 50, .end = 53}, /* GPIO numbers start from 1 */
+ {.start = 42, .end = 43, .offset = 2}, /* GPIO numbers start from 1 */
+ {.start = 50, .end = 53},
};
@@ -253,7 +256,7 @@ static int ab8500_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
return base + offset - cluster->start;
/* Advance by the number of gpios in this cluster */
- base += cluster->end - cluster->start + 1;
+ base += cluster->end + cluster->offset - cluster->start + 1;
}
return -EINVAL;
@@ -273,7 +276,12 @@ static unsigned int irq_to_rising(unsigned int irq)
{
struct ab8500_gpio *ab8500_gpio = irq_get_chip_data(irq);
int offset = irq - ab8500_gpio->irq_base;
- int new_irq = offset + AB8500_INT_GPIO6R
+ int new_irq;
+ if (is_ab8540(ab8500_gpio->parent)) {
+ new_irq = offset * 2 + AB8540_INT_GPIO43R
+ + ab8500_gpio->parent->irq_base;
+ } else
+ new_irq = offset + AB8500_INT_GPIO6R
+ ab8500_gpio->parent->irq_base;
return new_irq;
}
@@ -282,8 +290,13 @@ static unsigned int irq_to_falling(unsigned int irq)
{
struct ab8500_gpio *ab8500_gpio = irq_get_chip_data(irq);
int offset = irq - ab8500_gpio->irq_base;
- int new_irq = offset + AB8500_INT_GPIO6F
- + ab8500_gpio->parent->irq_base;
+ int new_irq;
+ if (is_ab8540(ab8500_gpio->parent)) {
+ new_irq = offset * 2 + AB8540_INT_GPIO43F
+ + ab8500_gpio->parent->irq_base;
+ } else
+ new_irq = offset + AB8500_INT_GPIO6F
+ + ab8500_gpio->parent->irq_base;
return new_irq;
}
@@ -291,20 +304,33 @@ static unsigned int irq_to_falling(unsigned int irq)
static unsigned int rising_to_irq(unsigned int irq, void *dev)
{
struct ab8500_gpio *ab8500_gpio = dev;
- int offset = irq - AB8500_INT_GPIO6R
- - ab8500_gpio->parent->irq_base ;
- int new_irq = offset + ab8500_gpio->irq_base;
+ int offset, new_irq;
+ if (is_ab8540(ab8500_gpio->parent)) {
+ offset = irq - AB8540_INT_GPIO43R
+ - ab8500_gpio->parent->irq_base;
+ new_irq = (offset >> 1) + ab8500_gpio->irq_base;
+ } else {
+ offset = irq - AB8500_INT_GPIO6R
+ - ab8500_gpio->parent->irq_base;
+ new_irq = offset + ab8500_gpio->irq_base;
+ }
return new_irq;
}
static unsigned int falling_to_irq(unsigned int irq, void *dev)
{
struct ab8500_gpio *ab8500_gpio = dev;
- int offset = irq - AB8500_INT_GPIO6F
- - ab8500_gpio->parent->irq_base ;
- int new_irq = offset + ab8500_gpio->irq_base;
+ int offset, new_irq;
+ if (is_ab8540(ab8500_gpio->parent)) {
+ offset = irq - AB8540_INT_GPIO43F
+ - ab8500_gpio->parent->irq_base;
+ new_irq = (offset >> 1) + ab8500_gpio->irq_base;
+ } else {
+ offset = irq - AB8500_INT_GPIO6F
+ - ab8500_gpio->parent->irq_base;
+ new_irq = offset + ab8500_gpio->irq_base;
+ }
return new_irq;
-
}
/*
--
1.7.9.5
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 20/21] gpio: ab8500: Fix ab8540 setting direction output error
2012-12-14 16:19 [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Lee Jones
` (18 preceding siblings ...)
2012-12-14 16:19 ` [PATCH 19/21] gpio: ab8500: Update gpio ab8540 interrupt mapping Lee Jones
@ 2012-12-14 16:19 ` Lee Jones
2012-12-14 16:19 ` [PATCH 21/21] gpio: ab8500: Add explicit dependencies Lee Jones
` (2 subsequent siblings)
22 siblings, 0 replies; 28+ messages in thread
From: Lee Jones @ 2012-12-14 16:19 UTC (permalink / raw)
To: linux-kernel; +Cc: linus.walleij, Yang QU, Lee Jones
From: Yang QU <yang.qu@stericsson.com>
Set GpioPullUpDownSel register for direction output function as GPIO51
to GPIO54 not share the same register with other GPIOs on AB8540.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Yang QU <yang.qu@stericsson.com>
Reviewed-by: Patrick DELAUNAY <patrick.delaunay@stericsson.com>
Reviewed-by: Xiao Mei ZHANG <xiaomei.zhang@stericsson.com>
Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
Reviewed-by: Maxime COQUELIN <maxime.coquelin@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Reviewed-by: Mattias WALLIN <mattias.wallin@stericsson.com>
---
drivers/gpio/gpio-ab8500.c | 33 +++++++++++++++++++++++++--------
1 file changed, 25 insertions(+), 8 deletions(-)
diff --git a/drivers/gpio/gpio-ab8500.c b/drivers/gpio/gpio-ab8500.c
index edc3037..ed5832e 100644
--- a/drivers/gpio/gpio-ab8500.c
+++ b/drivers/gpio/gpio-ab8500.c
@@ -86,6 +86,8 @@
#define AB8500_NUM_VIR_GPIO_IRQ 16
#define AB8540_GPIO_PULL_UPDOWN_MASK 0x03
#define AB8540_GPIO_VINSEL_MASK 0x03
+#define AB8540_GPIOX_VBAT_START 51
+#define AB8540_GPIOX_VBAT_END 54
enum ab8500_gpio_action {
NONE,
@@ -222,6 +224,7 @@ static void ab8500_gpio_set(struct gpio_chip *chip, unsigned offset, int val)
static int ab8500_gpio_direction_output(struct gpio_chip *chip, unsigned offset,
int val)
{
+ struct ab8500_gpio *ab8500_gpio = to_ab8500_gpio(chip);
int ret;
/* set direction as output */
ret = ab8500_gpio_set_bits(chip, AB8500_GPIO_DIR1_REG, offset, 1);
@@ -231,6 +234,18 @@ static int ab8500_gpio_direction_output(struct gpio_chip *chip, unsigned offset,
ret = ab8500_gpio_set_bits(chip, AB8500_GPIO_PUD1_REG, offset, 1);
if (ret < 0)
return ret;
+ /*
+ * Disable both pull down and pull up for GPIO51 to GPIO54 (GPIO1_VBAT
+ * to GPIO4_VBAT).
+ */
+ if (is_ab8540(ab8500_gpio->parent)) {
+ if (offset >= (AB8540_GPIOX_VBAT_START - 1)
+ && offset <= (AB8540_GPIOX_VBAT_END - 1))
+ ret = ab8540_config_pull_updown(ab8500_gpio->dev,
+ AB8500_PIN_GPIO(offset + 1), AB8540_GPIO_PULL_NONE);
+ if (ret < 0)
+ return ret;
+ }
/* set the output as 1 or 0 */
return ab8500_gpio_set_bits(chip, AB8500_GPIO_OUT1_REG, offset, val);
@@ -278,10 +293,10 @@ static unsigned int irq_to_rising(unsigned int irq)
int offset = irq - ab8500_gpio->irq_base;
int new_irq;
if (is_ab8540(ab8500_gpio->parent)) {
- new_irq = offset * 2 + AB8540_INT_GPIO43R
+ new_irq = offset * 2 + AB8540_INT_GPIO43R
+ ab8500_gpio->parent->irq_base;
} else
- new_irq = offset + AB8500_INT_GPIO6R
+ new_irq = offset + AB8500_INT_GPIO6R
+ ab8500_gpio->parent->irq_base;
return new_irq;
}
@@ -292,10 +307,10 @@ static unsigned int irq_to_falling(unsigned int irq)
int offset = irq - ab8500_gpio->irq_base;
int new_irq;
if (is_ab8540(ab8500_gpio->parent)) {
- new_irq = offset * 2 + AB8540_INT_GPIO43F
+ new_irq = offset * 2 + AB8540_INT_GPIO43F
+ ab8500_gpio->parent->irq_base;
} else
- new_irq = offset + AB8500_INT_GPIO6F
+ new_irq = offset + AB8500_INT_GPIO6F
+ ab8500_gpio->parent->irq_base;
return new_irq;
@@ -670,12 +685,13 @@ int ab8540_config_pull_updown(struct device *dev,
u8 pos;
int ret;
- if ((gpio < AB8500_PIN_GPIO(51)) || (gpio > AB8500_PIN_GPIO(54))) {
+ if ((gpio < AB8500_PIN_GPIO(AB8540_GPIOX_VBAT_START))
+ || (gpio > AB8500_PIN_GPIO(AB8540_GPIOX_VBAT_END))) {
ret = -EINVAL;
goto out;
}
- pos = (gpio - AB8500_PIN_GPIO(51)) << 1;
+ pos = (gpio - AB8500_PIN_GPIO(AB8540_GPIOX_VBAT_START)) << 1;
ret = abx500_mask_and_set_register_interruptible(dev,
AB8500_MISC, AB8540_GPIO_PULL_UPDOWN_REG,
@@ -694,12 +710,13 @@ int ab8540_gpio_config_vinsel(struct device *dev,
u8 pos;
int ret;
- if ((gpio < AB8500_PIN_GPIO(51)) || (gpio > AB8500_PIN_GPIO(54))) {
+ if ((gpio < AB8500_PIN_GPIO(AB8540_GPIOX_VBAT_START))
+ || (gpio > AB8500_PIN_GPIO(AB8540_GPIOX_VBAT_END))) {
ret = -EINVAL;
goto out;
}
- pos = (gpio - AB8500_PIN_GPIO(51)) << 1;
+ pos = (gpio - AB8500_PIN_GPIO(AB8540_GPIOX_VBAT_START)) << 1;
ret = abx500_mask_and_set_register_interruptible(dev,
AB8500_MISC, AB8540_GPIO_VINSEL_REG,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 21/21] gpio: ab8500: Add explicit dependencies
2012-12-14 16:19 [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Lee Jones
` (19 preceding siblings ...)
2012-12-14 16:19 ` [PATCH 20/21] gpio: ab8500: Fix ab8540 setting direction output error Lee Jones
@ 2012-12-14 16:19 ` Lee Jones
2012-12-19 14:18 ` [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Linus Walleij
2012-12-19 22:26 ` Grant Likely
22 siblings, 0 replies; 28+ messages in thread
From: Lee Jones @ 2012-12-14 16:19 UTC (permalink / raw)
To: linux-kernel; +Cc: linus.walleij, Linus Walleij, Lee Jones
From: Linus Walleij <linus.walleij@stericsson.com>
This driver is using symbols from <linux/mfd/abx500/ab8500.h> so
include this file explicitly.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
---
drivers/gpio/gpio-ab8500.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpio/gpio-ab8500.c b/drivers/gpio/gpio-ab8500.c
index ed5832e..d201de9 100644
--- a/drivers/gpio/gpio-ab8500.c
+++ b/drivers/gpio/gpio-ab8500.c
@@ -19,6 +19,7 @@
#include <linux/irq.h>
#include <linux/interrupt.h>
#include <linux/mfd/abx500.h>
+#include <linux/mfd/abx500/ab8500.h>
#include <linux/mfd/abx500/ab8500-gpio.h>
--
1.7.9.5
^ permalink raw reply related [flat|nested] 28+ messages in thread
* Re: [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life
2012-12-14 16:19 [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Lee Jones
` (20 preceding siblings ...)
2012-12-14 16:19 ` [PATCH 21/21] gpio: ab8500: Add explicit dependencies Lee Jones
@ 2012-12-19 14:18 ` Linus Walleij
2012-12-19 22:49 ` Grant Likely
2013-01-04 14:17 ` Linus Walleij
2012-12-19 22:26 ` Grant Likely
22 siblings, 2 replies; 28+ messages in thread
From: Linus Walleij @ 2012-12-19 14:18 UTC (permalink / raw)
To: Lee Jones, Grant Likely, Patrice CHOTARD; +Cc: linux-kernel
On Fri, Dec 14, 2012 at 5:19 PM, Lee Jones <lee.jones@linaro.org> wrote:
> The ab8500 GPIO driver is currently 'BROKEN', due to a lack of
> updates and recent frame-work adoption. This patch-set aims to
> bring the driver back to life so we may make use of it again.
>
> This first stage is to bring it into line with ST-Ericsson's
> internal track, which has been keeping up-to-date. After these
> patches have been accepted I will then overhaul the driver to
> use the most recent APIs and frame-works, such as pinctrl and
> Device Tree.
>
> Please give these patches an easy ride. I know they're not
> perfect, but they do provide a great base on with I can form
> the overhaul. Thanks for your understanding.
OK I've applied these 21 patches on a branch in the pinctrl
tree to be used as a merge base.
The only valid reason to have it in the pinctrl tree is obviously
that it should be converted into a pinctrl driver in the next
cycle, aiming at includion into kernel v3.9.
I know my colleague Patrice is already working on this, and
thus I can plan for it :-) It is also an interesting subject since
the ux500 will be the first platform with two pin controllers
and the first with an off-SoC pin controller.
But any cleanups are welcome now, and I know you're already
up to more patching...
Let us make sure we chisel out a real nice pinctrl/pinctrl-abx500.c
driver by the end of this kernel cycle so things are under
(pin)control again.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life
2012-12-14 16:19 [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Lee Jones
` (21 preceding siblings ...)
2012-12-19 14:18 ` [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Linus Walleij
@ 2012-12-19 22:26 ` Grant Likely
22 siblings, 0 replies; 28+ messages in thread
From: Grant Likely @ 2012-12-19 22:26 UTC (permalink / raw)
To: Lee Jones, linux-kernel; +Cc: linus.walleij
On Fri, 14 Dec 2012 16:19:18 +0000, Lee Jones <lee.jones@linaro.org> wrote:
> The ab8500 GPIO driver is currently 'BROKEN', due to a lack of
> updates and recent frame-work adoption. This patch-set aims to
> bring the driver back to life so we may make use of it again.
>
> This first stage is to bring it into line with ST-Ericsson's
> internal track, which has been keeping up-to-date. After these
> patches have been accepted I will then overhaul the driver to
> use the most recent APIs and frame-works, such as pinctrl and
> Device Tree.
>
> Please give these patches an easy ride. I know they're not
> perfect, but they do provide a great base on with I can form
> the overhaul. Thanks for your understanding.
Since it's already broken, I'll probably pick up the majority of these
as long as they make the world better. I'll reply to each in turn.
g.
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life
2012-12-19 14:18 ` [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Linus Walleij
@ 2012-12-19 22:49 ` Grant Likely
2012-12-20 7:51 ` Lee Jones
2013-01-04 14:17 ` Linus Walleij
1 sibling, 1 reply; 28+ messages in thread
From: Grant Likely @ 2012-12-19 22:49 UTC (permalink / raw)
To: Linus Walleij, Lee Jones, Patrice CHOTARD; +Cc: linux-kernel
On Wed, 19 Dec 2012 15:18:00 +0100, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Fri, Dec 14, 2012 at 5:19 PM, Lee Jones <lee.jones@linaro.org> wrote:
>
> > The ab8500 GPIO driver is currently 'BROKEN', due to a lack of
> > updates and recent frame-work adoption. This patch-set aims to
> > bring the driver back to life so we may make use of it again.
> >
> > This first stage is to bring it into line with ST-Ericsson's
> > internal track, which has been keeping up-to-date. After these
> > patches have been accepted I will then overhaul the driver to
> > use the most recent APIs and frame-works, such as pinctrl and
> > Device Tree.
> >
> > Please give these patches an easy ride. I know they're not
> > perfect, but they do provide a great base on with I can form
> > the overhaul. Thanks for your understanding.
>
> OK I've applied these 21 patches on a branch in the pinctrl
> tree to be used as a merge base.
>
> The only valid reason to have it in the pinctrl tree is obviously
> that it should be converted into a pinctrl driver in the next
> cycle, aiming at includion into kernel v3.9.
>
> I know my colleague Patrice is already working on this, and
> thus I can plan for it :-) It is also an interesting subject since
> the ux500 will be the first platform with two pin controllers
> and the first with an off-SoC pin controller.
Okay, fine by me. I've looked through all the patches and I think they
should be merged.
g.
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life
2012-12-19 22:49 ` Grant Likely
@ 2012-12-20 7:51 ` Lee Jones
0 siblings, 0 replies; 28+ messages in thread
From: Lee Jones @ 2012-12-20 7:51 UTC (permalink / raw)
To: Grant Likely; +Cc: Linus Walleij, Patrice CHOTARD, linux-kernel
On Wed, 19 Dec 2012, Grant Likely wrote:
> On Wed, 19 Dec 2012 15:18:00 +0100, Linus Walleij <linus.walleij@linaro.org> wrote:
> > On Fri, Dec 14, 2012 at 5:19 PM, Lee Jones <lee.jones@linaro.org> wrote:
> >
> > > The ab8500 GPIO driver is currently 'BROKEN', due to a lack of
> > > updates and recent frame-work adoption. This patch-set aims to
> > > bring the driver back to life so we may make use of it again.
> > >
> > > This first stage is to bring it into line with ST-Ericsson's
> > > internal track, which has been keeping up-to-date. After these
> > > patches have been accepted I will then overhaul the driver to
> > > use the most recent APIs and frame-works, such as pinctrl and
> > > Device Tree.
> > >
> > > Please give these patches an easy ride. I know they're not
> > > perfect, but they do provide a great base on with I can form
> > > the overhaul. Thanks for your understanding.
> >
> > OK I've applied these 21 patches on a branch in the pinctrl
> > tree to be used as a merge base.
> >
> > The only valid reason to have it in the pinctrl tree is obviously
> > that it should be converted into a pinctrl driver in the next
> > cycle, aiming at includion into kernel v3.9.
> >
> > I know my colleague Patrice is already working on this, and
> > thus I can plan for it :-) It is also an interesting subject since
> > the ux500 will be the first platform with two pin controllers
> > and the first with an off-SoC pin controller.
>
> Okay, fine by me. I've looked through all the patches and I think they
> should be merged.
Thanks for your understanding Grant.
--
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life
2012-12-19 14:18 ` [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Linus Walleij
2012-12-19 22:49 ` Grant Likely
@ 2013-01-04 14:17 ` Linus Walleij
2013-01-04 14:46 ` Lee Jones
1 sibling, 1 reply; 28+ messages in thread
From: Linus Walleij @ 2013-01-04 14:17 UTC (permalink / raw)
To: Lee Jones, Grant Likely, Patrice CHOTARD; +Cc: linux-kernel
On Wed, Dec 19, 2012 at 3:18 PM, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Fri, Dec 14, 2012 at 5:19 PM, Lee Jones <lee.jones@linaro.org> wrote:
>
>> The ab8500 GPIO driver is currently 'BROKEN', due to a lack of
>> updates and recent frame-work adoption. This patch-set aims to
>> bring the driver back to life so we may make use of it again.
>>
>> This first stage is to bring it into line with ST-Ericsson's
>> internal track, which has been keeping up-to-date. After these
>> patches have been accepted I will then overhaul the driver to
>> use the most recent APIs and frame-works, such as pinctrl and
>> Device Tree.
>>
>> Please give these patches an easy ride. I know they're not
>> perfect, but they do provide a great base on with I can form
>> the overhaul. Thanks for your understanding.
>
> OK I've applied these 21 patches on a branch in the pinctrl
> tree to be used as a merge base.
No I'll have to scrap this topic branch, as it does not compile.
Analysing the problem I see that part of the reason why it does
not compile is that it is adding stuff referencing the global
numberspace, like biasing.
Which is pinctrl business. So the proper feedback is that it
should be rewritten to use pinctrl.
Which is in the works.
So the plan is to mail out an all-in-one pinctrl replacement
patch instead, deleting the old AB8500 GPIO driver and
replacing it fully with a pinctrl driver.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life
2013-01-04 14:17 ` Linus Walleij
@ 2013-01-04 14:46 ` Lee Jones
0 siblings, 0 replies; 28+ messages in thread
From: Lee Jones @ 2013-01-04 14:46 UTC (permalink / raw)
To: Linus Walleij; +Cc: Grant Likely, Patrice CHOTARD, linux-kernel
On Fri, 04 Jan 2013, Linus Walleij wrote:
> On Wed, Dec 19, 2012 at 3:18 PM, Linus Walleij <linus.walleij@linaro.org> wrote:
> > On Fri, Dec 14, 2012 at 5:19 PM, Lee Jones <lee.jones@linaro.org> wrote:
> >
> >> The ab8500 GPIO driver is currently 'BROKEN', due to a lack of
> >> updates and recent frame-work adoption. This patch-set aims to
> >> bring the driver back to life so we may make use of it again.
> >>
> >> This first stage is to bring it into line with ST-Ericsson's
> >> internal track, which has been keeping up-to-date. After these
> >> patches have been accepted I will then overhaul the driver to
> >> use the most recent APIs and frame-works, such as pinctrl and
> >> Device Tree.
> >>
> >> Please give these patches an easy ride. I know they're not
> >> perfect, but they do provide a great base on with I can form
> >> the overhaul. Thanks for your understanding.
> >
> > OK I've applied these 21 patches on a branch in the pinctrl
> > tree to be used as a merge base.
>
> No I'll have to scrap this topic branch, as it does not compile.
>
> Analysing the problem I see that part of the reason why it does
> not compile is that it is adding stuff referencing the global
> numberspace, like biasing.
>
> Which is pinctrl business. So the proper feedback is that it
> should be rewritten to use pinctrl.
>
> Which is in the works.
>
> So the plan is to mail out an all-in-one pinctrl replacement
> patch instead, deleting the old AB8500 GPIO driver and
> replacing it fully with a pinctrl driver.
Makes sense, although that's going to be a hell of a patch-set.
--
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 28+ messages in thread
end of thread, other threads:[~2013-01-04 14:47 UTC | newest]
Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-14 16:19 [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Lee Jones
2012-12-14 16:19 ` [PATCH 01/21] gpio: ab8500: Activate and port AB8500 GPIO driver to new framework Lee Jones
2012-12-14 16:19 ` [PATCH 02/21] gpio: ab8500: Make pins configurable Lee Jones
2012-12-14 16:19 ` [PATCH 03/21] gpio: ab8500: Fix alternate function register address Lee Jones
2012-12-14 16:19 ` [PATCH 04/21] gpio: ab8500: Read register corrected in get_value api Lee Jones
2012-12-14 16:19 ` [PATCH 05/21] gpio: ab8500: Allow direction and pullups configuration Lee Jones
2012-12-14 16:19 ` [PATCH 06/21] gpio: ab8500: Add api to enable pulldown Lee Jones
2012-12-14 16:19 ` [PATCH 07/21] gpio: ab8500: Write argument value instead of hardwired 1 Lee Jones
2012-12-14 16:19 ` [PATCH 08/21] gpio: ab8500: Fix gpio offset bounds for irq mapping Lee Jones
2012-12-14 16:19 ` [PATCH 09/21] gpio: ab8500: Fix bad include name after renaming Lee Jones
2012-12-14 16:19 ` [PATCH 10/21] gpio: ab8500: Add support for the AB9540 Lee Jones
2012-12-14 16:19 ` [PATCH 11/21] gpio: ab8500: Add support for AB8505 Chip Lee Jones
2012-12-14 16:19 ` [PATCH 12/21] gpio: ab8500: Allow gpios to wake the system from suspend Lee Jones
2012-12-14 16:19 ` [PATCH 13/21] gpio: ab8500: Use most recent run-time platform checker Lee Jones
2012-12-14 16:19 ` [PATCH 14/21] gpio: ab8500: Remove ENUMs from linux/mfd/abx500/ab8500-gpio.h Lee Jones
2012-12-14 16:19 ` [PATCH 15/21] gpio: ab8500: Add support for the ab8540 Lee Jones
2012-12-14 16:19 ` [PATCH 16/21] gpio: ab8500: Add internal pull up on GPIO of ab8540 Lee Jones
2012-12-14 16:19 ` [PATCH 17/21] gpio: ab8500: Add the action range for the internal pull up function on GPIO Lee Jones
2012-12-14 16:19 ` [PATCH 18/21] gpio: ab8500: Fix parameter uninitialized warning for ab8540 Lee Jones
2012-12-14 16:19 ` [PATCH 19/21] gpio: ab8500: Update gpio ab8540 interrupt mapping Lee Jones
2012-12-14 16:19 ` [PATCH 20/21] gpio: ab8500: Fix ab8540 setting direction output error Lee Jones
2012-12-14 16:19 ` [PATCH 21/21] gpio: ab8500: Add explicit dependencies Lee Jones
2012-12-19 14:18 ` [PATCH 00/21] gpio: ab8500: Bring AB8500 back to life Linus Walleij
2012-12-19 22:49 ` Grant Likely
2012-12-20 7:51 ` Lee Jones
2013-01-04 14:17 ` Linus Walleij
2013-01-04 14:46 ` Lee Jones
2012-12-19 22:26 ` Grant Likely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).