All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/8] gpio: omap: cleanup: get rid of system GPIO <-> GPIO offset converseations
@ 2015-03-23 12:18 grygorii.strashko
  2015-03-23 12:18 ` [PATCH v2 1/8] gpio: omap: convert omap_gpio_is_input() to use gpio offset grygorii.strashko
                   ` (8 more replies)
  0 siblings, 9 replies; 18+ messages in thread
From: grygorii.strashko @ 2015-03-23 12:18 UTC (permalink / raw)
  To: Javier Martinez Canillas, Linus Walleij, Alexandre Courbot,
	ssantosh, Kevin Hilman, tony
  Cc: linux-omap, linux-gpio, linux-kernel, Grygorii Strashko

From: Grygorii Strashko <grygorii.strashko@linaro.org>

Now in TI OMAP GPIO driver there are a lot of places where
System GPIO number calculated and then converted to GPIO offset.
What is worse is that in many place such conversation performed twice
or even three times. But actually, we don't need to do that at all, because
- gpiolib always passes GPIO offset to GPIO controller
- OMAP GPIO driver converted to use IRQ domain, so
  struct irq_data->hwirq contains GPIO offset

Hence, it is safe to convert all GPIO OMAP functions to use GPIO
offset instead of system GPIO numbers. Also, this allows to remove
unneeded conversations routines
 #define GPIO_INDEX(bank, gpio)
 #define GPIO_BIT(bank, gpio)
 int omap_irq_to_gpio()

Tested on:
- dra7-evm.
- omap1 (osk5912), 770 and E3.

Last two patches have to be tested on OMAP1:
-  gpio: omap: get rid of omap_irq_to_gpio()
-  gpio: omap: get rid of GPIO_INDEX() macro

Based on top of Linux 4.0-rc4 plus patch
'[PATCH 1/2] gpio: omap: irq_shutdown: remove unnecessary call of gpiochip_unlock_as_irq'
http://www.spinics.net/lists/linux-omap/msg116482.html

Changes in v2:
- fixed build failure with Patch 5, no functional code
  changes.

Tested-by: Tony Lindgren <tony@atomide.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org> 
Acked-by: Javier Martinez Canillas <javier@dowhile0.org>

Grygorii Strashko (8):
  gpio: omap: convert omap_gpio_is_input() to use gpio offset
  gpio: omap: simplify omap_set_gpio_dataout_x()
  gpio: omap: convert debounce functions switch to use gpio offset
  gpio: omap: drop 'gpio' param from omap_gpio_init_irq()
  gpio: omap: convert gpio irq functions to use GPIO offset
  gpio: omap: get rid of GPIO_BIT() macro
  gpio: omap: get rid of omap_irq_to_gpio()
  gpio: omap: get rid of GPIO_INDEX() macro

 drivers/gpio/gpio-omap.c | 130 ++++++++++++++++++++---------------------------
 1 file changed, 55 insertions(+), 75 deletions(-)

-- 
1.9.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v2 1/8] gpio: omap: convert omap_gpio_is_input() to use gpio offset
  2015-03-23 12:18 [PATCH v2 0/8] gpio: omap: cleanup: get rid of system GPIO <-> GPIO offset converseations grygorii.strashko
@ 2015-03-23 12:18 ` grygorii.strashko
  2015-03-27 10:03   ` Linus Walleij
  2015-03-23 12:18 ` [PATCH v2 2/8] gpio: omap: simplify omap_set_gpio_dataout_x() grygorii.strashko
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: grygorii.strashko @ 2015-03-23 12:18 UTC (permalink / raw)
  To: Javier Martinez Canillas, Linus Walleij, Alexandre Courbot,
	ssantosh, Kevin Hilman, tony
  Cc: linux-omap, linux-gpio, linux-kernel, Grygorii Strashko

From: Grygorii Strashko <grygorii.strashko@linaro.org>

Convert omap_gpio_is_input() to use GPIO offset instead of mask and,
in such way, make code simpler and remove few lines of code.

Tested-by: Tony Lindgren <tony@atomide.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>
---
 drivers/gpio/gpio-omap.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 2b2fc4b..ce71239 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -472,11 +472,11 @@ static void omap_disable_gpio_module(struct gpio_bank *bank, unsigned offset)
 	}
 }
 
-static int omap_gpio_is_input(struct gpio_bank *bank, int mask)
+static int omap_gpio_is_input(struct gpio_bank *bank, unsigned offset)
 {
 	void __iomem *reg = bank->base + bank->regs->direction;
 
-	return readl_relaxed(reg) & mask;
+	return readl_relaxed(reg) & BIT(offset);
 }
 
 static void omap_gpio_init_irq(struct gpio_bank *bank, unsigned gpio,
@@ -519,7 +519,7 @@ static int omap_gpio_irq_type(struct irq_data *d, unsigned type)
 	offset = GPIO_INDEX(bank, gpio);
 	retval = omap_set_gpio_triggering(bank, offset, type);
 	omap_gpio_init_irq(bank, gpio, offset);
-	if (!omap_gpio_is_input(bank, BIT(offset))) {
+	if (!omap_gpio_is_input(bank, offset)) {
 		spin_unlock_irqrestore(&bank->lock, flags);
 		return -EINVAL;
 	}
@@ -976,12 +976,10 @@ static int omap_gpio_input(struct gpio_chip *chip, unsigned offset)
 static int omap_gpio_get(struct gpio_chip *chip, unsigned offset)
 {
 	struct gpio_bank *bank;
-	u32 mask;
 
 	bank = container_of(chip, struct gpio_bank, chip);
-	mask = (BIT(offset));
 
-	if (omap_gpio_is_input(bank, mask))
+	if (omap_gpio_is_input(bank, offset))
 		return omap_get_gpio_datain(bank, offset);
 	else
 		return omap_get_gpio_dataout(bank, offset);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v2 2/8] gpio: omap: simplify omap_set_gpio_dataout_x()
  2015-03-23 12:18 [PATCH v2 0/8] gpio: omap: cleanup: get rid of system GPIO <-> GPIO offset converseations grygorii.strashko
  2015-03-23 12:18 ` [PATCH v2 1/8] gpio: omap: convert omap_gpio_is_input() to use gpio offset grygorii.strashko
@ 2015-03-23 12:18 ` grygorii.strashko
  2015-03-27 10:04   ` Linus Walleij
  2015-03-23 12:18 ` [PATCH v2 3/8] gpio: omap: convert debounce functions switch to use gpio offset grygorii.strashko
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: grygorii.strashko @ 2015-03-23 12:18 UTC (permalink / raw)
  To: Javier Martinez Canillas, Linus Walleij, Alexandre Courbot,
	ssantosh, Kevin Hilman, tony
  Cc: linux-omap, linux-gpio, linux-kernel, Grygorii Strashko

From: Grygorii Strashko <grygorii.strashko@linaro.org>

Both functions omap_set_gpio_dataout_reg() and
omap_set_gpio_dataout_mask() accept GPIO offset
as 'gpio' input parameter, so rename it to 'offset' and
drop usage of GPIO_BIT() macro.

Tested-by: Tony Lindgren <tony@atomide.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>
---
 drivers/gpio/gpio-omap.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index ce71239..7aeee7b 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -75,7 +75,7 @@ struct gpio_bank {
 	int power_mode;
 	bool workaround_enabled;
 
-	void (*set_dataout)(struct gpio_bank *bank, int gpio, int enable);
+	void (*set_dataout)(struct gpio_bank *bank, unsigned gpio, int enable);
 	int (*get_context_loss_count)(struct device *dev);
 
 	struct omap_gpio_reg_offs *regs;
@@ -119,11 +119,11 @@ static void omap_set_gpio_direction(struct gpio_bank *bank, int gpio,
 
 
 /* set data out value using dedicate set/clear register */
-static void omap_set_gpio_dataout_reg(struct gpio_bank *bank, int gpio,
+static void omap_set_gpio_dataout_reg(struct gpio_bank *bank, unsigned offset,
 				      int enable)
 {
 	void __iomem *reg = bank->base;
-	u32 l = GPIO_BIT(bank, gpio);
+	u32 l = BIT(offset);
 
 	if (enable) {
 		reg += bank->regs->set_dataout;
@@ -137,11 +137,11 @@ static void omap_set_gpio_dataout_reg(struct gpio_bank *bank, int gpio,
 }
 
 /* set data out value using mask register */
-static void omap_set_gpio_dataout_mask(struct gpio_bank *bank, int gpio,
+static void omap_set_gpio_dataout_mask(struct gpio_bank *bank, unsigned offset,
 				       int enable)
 {
 	void __iomem *reg = bank->base + bank->regs->dataout;
-	u32 gpio_bit = GPIO_BIT(bank, gpio);
+	u32 gpio_bit = BIT(offset);
 	u32 l;
 
 	l = readl_relaxed(reg);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v2 3/8] gpio: omap: convert debounce functions switch to use gpio offset
  2015-03-23 12:18 [PATCH v2 0/8] gpio: omap: cleanup: get rid of system GPIO <-> GPIO offset converseations grygorii.strashko
  2015-03-23 12:18 ` [PATCH v2 1/8] gpio: omap: convert omap_gpio_is_input() to use gpio offset grygorii.strashko
  2015-03-23 12:18 ` [PATCH v2 2/8] gpio: omap: simplify omap_set_gpio_dataout_x() grygorii.strashko
@ 2015-03-23 12:18 ` grygorii.strashko
  2015-03-27 10:05   ` Linus Walleij
  2015-03-23 12:18 ` [PATCH v2 4/8] gpio: omap: drop 'gpio' param from omap_gpio_init_irq() grygorii.strashko
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: grygorii.strashko @ 2015-03-23 12:18 UTC (permalink / raw)
  To: Javier Martinez Canillas, Linus Walleij, Alexandre Courbot,
	ssantosh, Kevin Hilman, tony
  Cc: linux-omap, linux-gpio, linux-kernel, Grygorii Strashko

From: Grygorii Strashko <grygorii.strashko@linaro.org>

Convert debounce functions to use GPIO offset instead of system
GPIO numbers. This allows to drop unneeded conversations between
system GPIO <-> GPIO offset which are done in many places and
many times.
It is safe to do now because:
- gpiolib always passes GPIO offset to GPIO controller
- OMAP GPIO driver converted to use IRQ domain

This is preparation step before removing:
 #define GPIO_INDEX(bank, gpio)
 #define GPIO_BIT(bank, gpio)
 int omap_irq_to_gpio()

Tested-by: Tony Lindgren <tony@atomide.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>
---
 drivers/gpio/gpio-omap.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 7aeee7b..2df693b 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -208,13 +208,13 @@ static inline void omap_gpio_dbck_disable(struct gpio_bank *bank)
 /**
  * omap2_set_gpio_debounce - low level gpio debounce time
  * @bank: the gpio bank we're acting upon
- * @gpio: the gpio number on this @gpio
+ * @offset: the gpio number on this @bank
  * @debounce: debounce time to use
  *
  * OMAP's debounce time is in 31us steps so we need
  * to convert and round up to the closest unit.
  */
-static void omap2_set_gpio_debounce(struct gpio_bank *bank, unsigned gpio,
+static void omap2_set_gpio_debounce(struct gpio_bank *bank, unsigned offset,
 				    unsigned debounce)
 {
 	void __iomem		*reg;
@@ -231,7 +231,7 @@ static void omap2_set_gpio_debounce(struct gpio_bank *bank, unsigned gpio,
 	else
 		debounce = (debounce / 0x1f) - 1;
 
-	l = GPIO_BIT(bank, gpio);
+	l = BIT(offset);
 
 	clk_prepare_enable(bank->dbck);
 	reg = bank->base + bank->regs->debounce;
@@ -266,16 +266,16 @@ static void omap2_set_gpio_debounce(struct gpio_bank *bank, unsigned gpio,
 /**
  * omap_clear_gpio_debounce - clear debounce settings for a gpio
  * @bank: the gpio bank we're acting upon
- * @gpio: the gpio number on this @gpio
+ * @offset: the gpio number on this @bank
  *
  * If a gpio is using debounce, then clear the debounce enable bit and if
  * this is the only gpio in this bank using debounce, then clear the debounce
  * time too. The debounce clock will also be disabled when calling this function
  * if this is the only gpio in the bank using debounce.
  */
-static void omap_clear_gpio_debounce(struct gpio_bank *bank, unsigned gpio)
+static void omap_clear_gpio_debounce(struct gpio_bank *bank, unsigned offset)
 {
-	u32 gpio_bit = GPIO_BIT(bank, gpio);
+	u32 gpio_bit = BIT(offset);
 
 	if (!bank->dbck_flag)
 		return;
@@ -659,7 +659,7 @@ static void omap_reset_gpio(struct gpio_bank *bank, int gpio)
 	omap_set_gpio_irqenable(bank, gpio, 0);
 	omap_clear_gpio_irqstatus(bank, gpio);
 	omap_set_gpio_triggering(bank, GPIO_INDEX(bank, gpio), IRQ_TYPE_NONE);
-	omap_clear_gpio_debounce(bank, gpio);
+	omap_clear_gpio_debounce(bank, GPIO_INDEX(bank, gpio));
 }
 
 /* Use disable_irq_wake() and enable_irq_wake() functions from drivers */
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v2 4/8] gpio: omap: drop 'gpio' param from omap_gpio_init_irq()
  2015-03-23 12:18 [PATCH v2 0/8] gpio: omap: cleanup: get rid of system GPIO <-> GPIO offset converseations grygorii.strashko
                   ` (2 preceding siblings ...)
  2015-03-23 12:18 ` [PATCH v2 3/8] gpio: omap: convert debounce functions switch to use gpio offset grygorii.strashko
@ 2015-03-23 12:18 ` grygorii.strashko
  2015-03-27 10:05   ` Linus Walleij
  2015-03-23 12:18 ` [PATCH v2 5/8] gpio: omap: convert gpio irq functions to use GPIO offset grygorii.strashko
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: grygorii.strashko @ 2015-03-23 12:18 UTC (permalink / raw)
  To: Javier Martinez Canillas, Linus Walleij, Alexandre Courbot,
	ssantosh, Kevin Hilman, tony
  Cc: linux-omap, linux-gpio, linux-kernel, Grygorii Strashko

From: Grygorii Strashko <grygorii.strashko@linaro.org>

The 'gpio' parameter isn't needed any more as it
duplicates 'offset' parameter, so drop it.

Tested-by: Tony Lindgren <tony@atomide.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>
---
 drivers/gpio/gpio-omap.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 2df693b..ff5d54d 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -479,14 +479,13 @@ static int omap_gpio_is_input(struct gpio_bank *bank, unsigned offset)
 	return readl_relaxed(reg) & BIT(offset);
 }
 
-static void omap_gpio_init_irq(struct gpio_bank *bank, unsigned gpio,
-			       unsigned offset)
+static void omap_gpio_init_irq(struct gpio_bank *bank, unsigned offset)
 {
 	if (!LINE_USED(bank->mod_usage, offset)) {
 		omap_enable_gpio_module(bank, offset);
 		omap_set_gpio_direction(bank, offset, 1);
 	}
-	bank->irq_usage |= BIT(GPIO_INDEX(bank, gpio));
+	bank->irq_usage |= BIT(offset);
 }
 
 static int omap_gpio_irq_type(struct irq_data *d, unsigned type)
@@ -518,7 +517,7 @@ static int omap_gpio_irq_type(struct irq_data *d, unsigned type)
 	spin_lock_irqsave(&bank->lock, flags);
 	offset = GPIO_INDEX(bank, gpio);
 	retval = omap_set_gpio_triggering(bank, offset, type);
-	omap_gpio_init_irq(bank, gpio, offset);
+	omap_gpio_init_irq(bank, offset);
 	if (!omap_gpio_is_input(bank, offset)) {
 		spin_unlock_irqrestore(&bank->lock, flags);
 		return -EINVAL;
@@ -803,15 +802,14 @@ exit:
 static unsigned int omap_gpio_irq_startup(struct irq_data *d)
 {
 	struct gpio_bank *bank = omap_irq_data_get_bank(d);
-	unsigned int gpio = omap_irq_to_gpio(bank, d->hwirq);
 	unsigned long flags;
-	unsigned offset = GPIO_INDEX(bank, gpio);
+	unsigned offset = d->hwirq;
 
 	if (!BANK_USED(bank))
 		pm_runtime_get_sync(bank->dev);
 
 	spin_lock_irqsave(&bank->lock, flags);
-	omap_gpio_init_irq(bank, gpio, offset);
+	omap_gpio_init_irq(bank, offset);
 	spin_unlock_irqrestore(&bank->lock, flags);
 	omap_gpio_unmask_irq(d);
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v2 5/8] gpio: omap: convert gpio irq functions to use GPIO offset
  2015-03-23 12:18 [PATCH v2 0/8] gpio: omap: cleanup: get rid of system GPIO <-> GPIO offset converseations grygorii.strashko
                   ` (3 preceding siblings ...)
  2015-03-23 12:18 ` [PATCH v2 4/8] gpio: omap: drop 'gpio' param from omap_gpio_init_irq() grygorii.strashko
@ 2015-03-23 12:18 ` grygorii.strashko
  2015-03-27 10:06   ` Linus Walleij
  2015-03-23 12:18 ` [PATCH v2 6/8] gpio: omap: get rid of GPIO_BIT() macro grygorii.strashko
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: grygorii.strashko @ 2015-03-23 12:18 UTC (permalink / raw)
  To: Javier Martinez Canillas, Linus Walleij, Alexandre Courbot,
	ssantosh, Kevin Hilman, tony
  Cc: linux-omap, linux-gpio, linux-kernel, Grygorii Strashko

From: Grygorii Strashko <grygorii.strashko@linaro.org>

Convert GPIO IRQ functions to use GPIO offset instead of system
GPIO numbers. This allows to drop unneeded conversations between
system GPIO <-> GPIO offset which are done in many places and
many times.
It is safe to do now because:
- gpiolib always passes GPIO offset to GPIO controller
- OMAP GPIO driver converted to use IRQ domain, so
  struct irq_data->hwirq contains GPIO offset

This is preparation step before removing:
 #define GPIO_INDEX(bank, gpio)
 #define GPIO_BIT(bank, gpio)
 int omap_irq_to_gpio()

Tested-by: Tony Lindgren <tony@atomide.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>
---
 drivers/gpio/gpio-omap.c | 67 ++++++++++++++++++++++++------------------------
 1 file changed, 34 insertions(+), 33 deletions(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index ff5d54d..628a132 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -549,9 +549,10 @@ static void omap_clear_gpio_irqbank(struct gpio_bank *bank, int gpio_mask)
 	readl_relaxed(reg);
 }
 
-static inline void omap_clear_gpio_irqstatus(struct gpio_bank *bank, int gpio)
+static inline void omap_clear_gpio_irqstatus(struct gpio_bank *bank,
+					     unsigned offset)
 {
-	omap_clear_gpio_irqbank(bank, GPIO_BIT(bank, gpio));
+	omap_clear_gpio_irqbank(bank, BIT(offset));
 }
 
 static u32 omap_get_gpio_irqbank_mask(struct gpio_bank *bank)
@@ -612,13 +613,13 @@ static void omap_disable_gpio_irqbank(struct gpio_bank *bank, int gpio_mask)
 	writel_relaxed(l, reg);
 }
 
-static inline void omap_set_gpio_irqenable(struct gpio_bank *bank, int gpio,
-					   int enable)
+static inline void omap_set_gpio_irqenable(struct gpio_bank *bank,
+					   unsigned offset, int enable)
 {
 	if (enable)
-		omap_enable_gpio_irqbank(bank, GPIO_BIT(bank, gpio));
+		omap_enable_gpio_irqbank(bank, BIT(offset));
 	else
-		omap_disable_gpio_irqbank(bank, GPIO_BIT(bank, gpio));
+		omap_disable_gpio_irqbank(bank, BIT(offset));
 }
 
 /*
@@ -629,14 +630,16 @@ static inline void omap_set_gpio_irqenable(struct gpio_bank *bank, int gpio,
  * enabled. When system is suspended, only selected GPIO interrupts need
  * to have wake-up enabled.
  */
-static int omap_set_gpio_wakeup(struct gpio_bank *bank, int gpio, int enable)
+static int omap_set_gpio_wakeup(struct gpio_bank *bank, unsigned offset,
+				int enable)
 {
-	u32 gpio_bit = GPIO_BIT(bank, gpio);
+	u32 gpio_bit = BIT(offset);
 	unsigned long flags;
 
 	if (bank->non_wakeup_gpios & gpio_bit) {
 		dev_err(bank->dev,
-			"Unable to modify wakeup on non-wakeup GPIO%d\n", gpio);
+			"Unable to modify wakeup on non-wakeup GPIO%d\n",
+			offset);
 		return -EINVAL;
 	}
 
@@ -652,22 +655,22 @@ static int omap_set_gpio_wakeup(struct gpio_bank *bank, int gpio, int enable)
 	return 0;
 }
 
-static void omap_reset_gpio(struct gpio_bank *bank, int gpio)
+static void omap_reset_gpio(struct gpio_bank *bank, unsigned offset)
 {
-	omap_set_gpio_direction(bank, GPIO_INDEX(bank, gpio), 1);
-	omap_set_gpio_irqenable(bank, gpio, 0);
-	omap_clear_gpio_irqstatus(bank, gpio);
-	omap_set_gpio_triggering(bank, GPIO_INDEX(bank, gpio), IRQ_TYPE_NONE);
-	omap_clear_gpio_debounce(bank, GPIO_INDEX(bank, gpio));
+	omap_set_gpio_direction(bank, offset, 1);
+	omap_set_gpio_irqenable(bank, offset, 0);
+	omap_clear_gpio_irqstatus(bank, offset);
+	omap_set_gpio_triggering(bank, offset, IRQ_TYPE_NONE);
+	omap_clear_gpio_debounce(bank, offset);
 }
 
 /* Use disable_irq_wake() and enable_irq_wake() functions from drivers */
 static int omap_gpio_wake_enable(struct irq_data *d, unsigned int enable)
 {
 	struct gpio_bank *bank = omap_irq_data_get_bank(d);
-	unsigned int gpio = omap_irq_to_gpio(bank, d->hwirq);
+	unsigned offset = d->hwirq;
 
-	return omap_set_gpio_wakeup(bank, gpio, enable);
+	return omap_set_gpio_wakeup(bank, offset, enable);
 }
 
 static int omap_gpio_request(struct gpio_chip *chip, unsigned offset)
@@ -705,7 +708,7 @@ static void omap_gpio_free(struct gpio_chip *chip, unsigned offset)
 	spin_lock_irqsave(&bank->lock, flags);
 	bank->mod_usage &= ~(BIT(offset));
 	omap_disable_gpio_module(bank, offset);
-	omap_reset_gpio(bank, bank->chip.base + offset);
+	omap_reset_gpio(bank, offset);
 	spin_unlock_irqrestore(&bank->lock, flags);
 
 	/*
@@ -819,14 +822,13 @@ static unsigned int omap_gpio_irq_startup(struct irq_data *d)
 static void omap_gpio_irq_shutdown(struct irq_data *d)
 {
 	struct gpio_bank *bank = omap_irq_data_get_bank(d);
-	unsigned int gpio = omap_irq_to_gpio(bank, d->hwirq);
 	unsigned long flags;
-	unsigned offset = GPIO_INDEX(bank, gpio);
+	unsigned offset = d->hwirq;
 
 	spin_lock_irqsave(&bank->lock, flags);
 	bank->irq_usage &= ~(BIT(offset));
 	omap_disable_gpio_module(bank, offset);
-	omap_reset_gpio(bank, gpio);
+	omap_reset_gpio(bank, offset);
 	spin_unlock_irqrestore(&bank->lock, flags);
 
 	/*
@@ -840,43 +842,42 @@ static void omap_gpio_irq_shutdown(struct irq_data *d)
 static void omap_gpio_ack_irq(struct irq_data *d)
 {
 	struct gpio_bank *bank = omap_irq_data_get_bank(d);
-	unsigned int gpio = omap_irq_to_gpio(bank, d->hwirq);
+	unsigned offset = d->hwirq;
 
-	omap_clear_gpio_irqstatus(bank, gpio);
+	omap_clear_gpio_irqstatus(bank, offset);
 }
 
 static void omap_gpio_mask_irq(struct irq_data *d)
 {
 	struct gpio_bank *bank = omap_irq_data_get_bank(d);
-	unsigned int gpio = omap_irq_to_gpio(bank, d->hwirq);
+	unsigned offset = d->hwirq;
 	unsigned long flags;
 
 	spin_lock_irqsave(&bank->lock, flags);
-	omap_set_gpio_irqenable(bank, gpio, 0);
-	omap_set_gpio_triggering(bank, GPIO_INDEX(bank, gpio), IRQ_TYPE_NONE);
+	omap_set_gpio_irqenable(bank, offset, 0);
+	omap_set_gpio_triggering(bank, offset, IRQ_TYPE_NONE);
 	spin_unlock_irqrestore(&bank->lock, flags);
 }
 
 static void omap_gpio_unmask_irq(struct irq_data *d)
 {
 	struct gpio_bank *bank = omap_irq_data_get_bank(d);
-	unsigned int gpio = omap_irq_to_gpio(bank, d->hwirq);
-	unsigned int irq_mask = GPIO_BIT(bank, gpio);
+	unsigned offset = d->hwirq;
 	u32 trigger = irqd_get_trigger_type(d);
 	unsigned long flags;
 
 	spin_lock_irqsave(&bank->lock, flags);
 	if (trigger)
-		omap_set_gpio_triggering(bank, GPIO_INDEX(bank, gpio), trigger);
+		omap_set_gpio_triggering(bank, offset, trigger);
 
 	/* For level-triggered GPIOs, the clearing must be done after
 	 * the HW source is cleared, thus after the handler has run */
-	if (bank->level_mask & irq_mask) {
-		omap_set_gpio_irqenable(bank, gpio, 0);
-		omap_clear_gpio_irqstatus(bank, gpio);
+	if (bank->level_mask & BIT(offset)) {
+		omap_set_gpio_irqenable(bank, offset, 0);
+		omap_clear_gpio_irqstatus(bank, offset);
 	}
 
-	omap_set_gpio_irqenable(bank, gpio, 1);
+	omap_set_gpio_irqenable(bank, offset, 1);
 	spin_unlock_irqrestore(&bank->lock, flags);
 }
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v2 6/8] gpio: omap: get rid of GPIO_BIT() macro
  2015-03-23 12:18 [PATCH v2 0/8] gpio: omap: cleanup: get rid of system GPIO <-> GPIO offset converseations grygorii.strashko
                   ` (4 preceding siblings ...)
  2015-03-23 12:18 ` [PATCH v2 5/8] gpio: omap: convert gpio irq functions to use GPIO offset grygorii.strashko
@ 2015-03-23 12:18 ` grygorii.strashko
  2015-03-27 10:07   ` Linus Walleij
  2015-03-23 12:18 ` [PATCH v2 7/8] gpio: omap: get rid of omap_irq_to_gpio() grygorii.strashko
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: grygorii.strashko @ 2015-03-23 12:18 UTC (permalink / raw)
  To: Javier Martinez Canillas, Linus Walleij, Alexandre Courbot,
	ssantosh, Kevin Hilman, tony
  Cc: linux-omap, linux-gpio, linux-kernel, Grygorii Strashko

From: Grygorii Strashko <grygorii.strashko@linaro.org>

Now OMAP GPIO driver prepared for GPIO_BIT() macro removing.
Do it ;)

Tested-by: Tony Lindgren <tony@atomide.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>
---
 drivers/gpio/gpio-omap.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 628a132..dd7934a 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -82,7 +82,6 @@ struct gpio_bank {
 };
 
 #define GPIO_INDEX(bank, gpio) (gpio % bank->width)
-#define GPIO_BIT(bank, gpio) (BIT(GPIO_INDEX(bank, gpio)))
 #define GPIO_MOD_CTRL_BIT	BIT(0)
 
 #define BANK_USED(bank) (bank->mod_usage || bank->irq_usage)
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v2 7/8] gpio: omap: get rid of omap_irq_to_gpio()
  2015-03-23 12:18 [PATCH v2 0/8] gpio: omap: cleanup: get rid of system GPIO <-> GPIO offset converseations grygorii.strashko
                   ` (5 preceding siblings ...)
  2015-03-23 12:18 ` [PATCH v2 6/8] gpio: omap: get rid of GPIO_BIT() macro grygorii.strashko
@ 2015-03-23 12:18 ` grygorii.strashko
  2015-03-27 10:08   ` Linus Walleij
  2015-03-23 12:18 ` [PATCH v2 8/8] gpio: omap: get rid of GPIO_INDEX() macro grygorii.strashko
  2015-03-27 10:27 ` [PATCH v2 0/8] gpio: omap: cleanup: get rid of system GPIO <-> GPIO offset converseations Grygorii.Strashko@linaro.org
  8 siblings, 1 reply; 18+ messages in thread
From: grygorii.strashko @ 2015-03-23 12:18 UTC (permalink / raw)
  To: Javier Martinez Canillas, Linus Walleij, Alexandre Courbot,
	ssantosh, Kevin Hilman, tony
  Cc: linux-omap, linux-gpio, linux-kernel, Grygorii Strashko

From: Grygorii Strashko <grygorii.strashko@linaro.org>

Now OMAP GPIO driver prepared for omap_irq_to_gpio() removing.
Do it ;)

Tested-by: Tony Lindgren <tony@atomide.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>
---
 drivers/gpio/gpio-omap.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index dd7934a..615e950 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -89,11 +89,6 @@ struct gpio_bank {
 
 static void omap_gpio_unmask_irq(struct irq_data *d);
 
-static int omap_irq_to_gpio(struct gpio_bank *bank, unsigned int gpio_irq)
-{
-	return bank->chip.base + gpio_irq;
-}
-
 static inline struct gpio_bank *omap_irq_data_get_bank(struct irq_data *d)
 {
 	struct gpio_chip *chip = irq_data_get_irq_chip_data(d);
@@ -490,22 +485,21 @@ static void omap_gpio_init_irq(struct gpio_bank *bank, unsigned offset)
 static int omap_gpio_irq_type(struct irq_data *d, unsigned type)
 {
 	struct gpio_bank *bank = omap_irq_data_get_bank(d);
-	unsigned gpio = 0;
 	int retval;
 	unsigned long flags;
-	unsigned offset;
+	unsigned offset = d->hwirq;
 
 	if (!BANK_USED(bank))
 		pm_runtime_get_sync(bank->dev);
 
 #ifdef CONFIG_ARCH_OMAP1
-	if (d->irq > IH_MPUIO_BASE)
+	if (d->irq > IH_MPUIO_BASE) {
+		unsigned gpio = 0;
 		gpio = OMAP_MPUIO(d->irq - IH_MPUIO_BASE);
+		offset = GPIO_INDEX(bank, gpio);
+	}
 #endif
 
-	if (!gpio)
-		gpio = omap_irq_to_gpio(bank, d->hwirq);
-
 	if (type & ~IRQ_TYPE_SENSE_MASK)
 		return -EINVAL;
 
@@ -514,7 +508,6 @@ static int omap_gpio_irq_type(struct irq_data *d, unsigned type)
 		return -EINVAL;
 
 	spin_lock_irqsave(&bank->lock, flags);
-	offset = GPIO_INDEX(bank, gpio);
 	retval = omap_set_gpio_triggering(bank, offset, type);
 	omap_gpio_init_irq(bank, offset);
 	if (!omap_gpio_is_input(bank, offset)) {
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v2 8/8] gpio: omap: get rid of GPIO_INDEX() macro
  2015-03-23 12:18 [PATCH v2 0/8] gpio: omap: cleanup: get rid of system GPIO <-> GPIO offset converseations grygorii.strashko
                   ` (6 preceding siblings ...)
  2015-03-23 12:18 ` [PATCH v2 7/8] gpio: omap: get rid of omap_irq_to_gpio() grygorii.strashko
@ 2015-03-23 12:18 ` grygorii.strashko
  2015-03-27 10:09   ` Linus Walleij
  2015-03-27 10:27 ` [PATCH v2 0/8] gpio: omap: cleanup: get rid of system GPIO <-> GPIO offset converseations Grygorii.Strashko@linaro.org
  8 siblings, 1 reply; 18+ messages in thread
From: grygorii.strashko @ 2015-03-23 12:18 UTC (permalink / raw)
  To: Javier Martinez Canillas, Linus Walleij, Alexandre Courbot,
	ssantosh, Kevin Hilman, tony
  Cc: linux-omap, linux-gpio, linux-kernel, Grygorii Strashko

From: Grygorii Strashko <grygorii.strashko@linaro.org>

Now OMAP GPIO driver prepared for GPIO_INDEX() macro removing.
Do It ;)

Tested-by: Tony Lindgren <tony@atomide.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>
---
 drivers/gpio/gpio-omap.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 615e950..cd1d5bf 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -81,7 +81,6 @@ struct gpio_bank {
 	struct omap_gpio_reg_offs *regs;
 };
 
-#define GPIO_INDEX(bank, gpio) (gpio % bank->width)
 #define GPIO_MOD_CTRL_BIT	BIT(0)
 
 #define BANK_USED(bank) (bank->mod_usage || bank->irq_usage)
@@ -492,14 +491,6 @@ static int omap_gpio_irq_type(struct irq_data *d, unsigned type)
 	if (!BANK_USED(bank))
 		pm_runtime_get_sync(bank->dev);
 
-#ifdef CONFIG_ARCH_OMAP1
-	if (d->irq > IH_MPUIO_BASE) {
-		unsigned gpio = 0;
-		gpio = OMAP_MPUIO(d->irq - IH_MPUIO_BASE);
-		offset = GPIO_INDEX(bank, gpio);
-	}
-#endif
-
 	if (type & ~IRQ_TYPE_SENSE_MASK)
 		return -EINVAL;
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 1/8] gpio: omap: convert omap_gpio_is_input() to use gpio offset
  2015-03-23 12:18 ` [PATCH v2 1/8] gpio: omap: convert omap_gpio_is_input() to use gpio offset grygorii.strashko
@ 2015-03-27 10:03   ` Linus Walleij
  0 siblings, 0 replies; 18+ messages in thread
From: Linus Walleij @ 2015-03-27 10:03 UTC (permalink / raw)
  To: Grygorii Strashko
  Cc: Javier Martinez Canillas, Alexandre Courbot, Santosh Shilimkar,
	Kevin Hilman, Tony Lindgren, Linux-OMAP, linux-gpio,
	linux-kernel

On Mon, Mar 23, 2015 at 1:18 PM,  <grygorii.strashko@linaro.org> wrote:

> From: Grygorii Strashko <grygorii.strashko@linaro.org>
>
> Convert omap_gpio_is_input() to use GPIO offset instead of mask and,
> in such way, make code simpler and remove few lines of code.
>
> Tested-by: Tony Lindgren <tony@atomide.com>
> Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
> Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
> Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 2/8] gpio: omap: simplify omap_set_gpio_dataout_x()
  2015-03-23 12:18 ` [PATCH v2 2/8] gpio: omap: simplify omap_set_gpio_dataout_x() grygorii.strashko
@ 2015-03-27 10:04   ` Linus Walleij
  0 siblings, 0 replies; 18+ messages in thread
From: Linus Walleij @ 2015-03-27 10:04 UTC (permalink / raw)
  To: Grygorii Strashko
  Cc: Javier Martinez Canillas, Alexandre Courbot, Santosh Shilimkar,
	Kevin Hilman, Tony Lindgren, Linux-OMAP, linux-gpio,
	linux-kernel

On Mon, Mar 23, 2015 at 1:18 PM,  <grygorii.strashko@linaro.org> wrote:

> From: Grygorii Strashko <grygorii.strashko@linaro.org>
>
> Both functions omap_set_gpio_dataout_reg() and
> omap_set_gpio_dataout_mask() accept GPIO offset
> as 'gpio' input parameter, so rename it to 'offset' and
> drop usage of GPIO_BIT() macro.
>
> Tested-by: Tony Lindgren <tony@atomide.com>
> Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
> Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
> Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 3/8] gpio: omap: convert debounce functions switch to use gpio offset
  2015-03-23 12:18 ` [PATCH v2 3/8] gpio: omap: convert debounce functions switch to use gpio offset grygorii.strashko
@ 2015-03-27 10:05   ` Linus Walleij
  0 siblings, 0 replies; 18+ messages in thread
From: Linus Walleij @ 2015-03-27 10:05 UTC (permalink / raw)
  To: Grygorii Strashko
  Cc: Javier Martinez Canillas, Alexandre Courbot, Santosh Shilimkar,
	Kevin Hilman, Tony Lindgren, Linux-OMAP, linux-gpio,
	linux-kernel

On Mon, Mar 23, 2015 at 1:18 PM,  <grygorii.strashko@linaro.org> wrote:

> From: Grygorii Strashko <grygorii.strashko@linaro.org>
>
> Convert debounce functions to use GPIO offset instead of system
> GPIO numbers. This allows to drop unneeded conversations between
> system GPIO <-> GPIO offset which are done in many places and
> many times.
> It is safe to do now because:
> - gpiolib always passes GPIO offset to GPIO controller
> - OMAP GPIO driver converted to use IRQ domain
>
> This is preparation step before removing:
>  #define GPIO_INDEX(bank, gpio)
>  #define GPIO_BIT(bank, gpio)
>  int omap_irq_to_gpio()
>
> Tested-by: Tony Lindgren <tony@atomide.com>
> Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
> Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
> Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 4/8] gpio: omap: drop 'gpio' param from omap_gpio_init_irq()
  2015-03-23 12:18 ` [PATCH v2 4/8] gpio: omap: drop 'gpio' param from omap_gpio_init_irq() grygorii.strashko
@ 2015-03-27 10:05   ` Linus Walleij
  0 siblings, 0 replies; 18+ messages in thread
From: Linus Walleij @ 2015-03-27 10:05 UTC (permalink / raw)
  To: Grygorii Strashko
  Cc: Javier Martinez Canillas, Alexandre Courbot, Santosh Shilimkar,
	Kevin Hilman, Tony Lindgren, Linux-OMAP, linux-gpio,
	linux-kernel

On Mon, Mar 23, 2015 at 1:18 PM,  <grygorii.strashko@linaro.org> wrote:

> From: Grygorii Strashko <grygorii.strashko@linaro.org>
>
> The 'gpio' parameter isn't needed any more as it
> duplicates 'offset' parameter, so drop it.
>
> Tested-by: Tony Lindgren <tony@atomide.com>
> Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
> Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
> Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 5/8] gpio: omap: convert gpio irq functions to use GPIO offset
  2015-03-23 12:18 ` [PATCH v2 5/8] gpio: omap: convert gpio irq functions to use GPIO offset grygorii.strashko
@ 2015-03-27 10:06   ` Linus Walleij
  0 siblings, 0 replies; 18+ messages in thread
From: Linus Walleij @ 2015-03-27 10:06 UTC (permalink / raw)
  To: Grygorii Strashko
  Cc: Javier Martinez Canillas, Alexandre Courbot, Santosh Shilimkar,
	Kevin Hilman, Tony Lindgren, Linux-OMAP, linux-gpio,
	linux-kernel

On Mon, Mar 23, 2015 at 1:18 PM,  <grygorii.strashko@linaro.org> wrote:

> From: Grygorii Strashko <grygorii.strashko@linaro.org>
>
> Convert GPIO IRQ functions to use GPIO offset instead of system
> GPIO numbers. This allows to drop unneeded conversations between
> system GPIO <-> GPIO offset which are done in many places and
> many times.
> It is safe to do now because:
> - gpiolib always passes GPIO offset to GPIO controller
> - OMAP GPIO driver converted to use IRQ domain, so
>   struct irq_data->hwirq contains GPIO offset
>
> This is preparation step before removing:
>  #define GPIO_INDEX(bank, gpio)
>  #define GPIO_BIT(bank, gpio)
>  int omap_irq_to_gpio()
>
> Tested-by: Tony Lindgren <tony@atomide.com>
> Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
> Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
> Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 6/8] gpio: omap: get rid of GPIO_BIT() macro
  2015-03-23 12:18 ` [PATCH v2 6/8] gpio: omap: get rid of GPIO_BIT() macro grygorii.strashko
@ 2015-03-27 10:07   ` Linus Walleij
  0 siblings, 0 replies; 18+ messages in thread
From: Linus Walleij @ 2015-03-27 10:07 UTC (permalink / raw)
  To: Grygorii Strashko
  Cc: Javier Martinez Canillas, Alexandre Courbot, Santosh Shilimkar,
	Kevin Hilman, Tony Lindgren, Linux-OMAP, linux-gpio,
	linux-kernel

On Mon, Mar 23, 2015 at 1:18 PM,  <grygorii.strashko@linaro.org> wrote:

> From: Grygorii Strashko <grygorii.strashko@linaro.org>
>
> Now OMAP GPIO driver prepared for GPIO_BIT() macro removing.
> Do it ;)
>
> Tested-by: Tony Lindgren <tony@atomide.com>
> Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
> Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
> Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 7/8] gpio: omap: get rid of omap_irq_to_gpio()
  2015-03-23 12:18 ` [PATCH v2 7/8] gpio: omap: get rid of omap_irq_to_gpio() grygorii.strashko
@ 2015-03-27 10:08   ` Linus Walleij
  0 siblings, 0 replies; 18+ messages in thread
From: Linus Walleij @ 2015-03-27 10:08 UTC (permalink / raw)
  To: Grygorii Strashko
  Cc: Javier Martinez Canillas, Alexandre Courbot, Santosh Shilimkar,
	Kevin Hilman, Tony Lindgren, Linux-OMAP, linux-gpio,
	linux-kernel

On Mon, Mar 23, 2015 at 1:18 PM,  <grygorii.strashko@linaro.org> wrote:

> From: Grygorii Strashko <grygorii.strashko@linaro.org>
>
> Now OMAP GPIO driver prepared for omap_irq_to_gpio() removing.
> Do it ;)
>
> Tested-by: Tony Lindgren <tony@atomide.com>
> Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
> Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
> Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 8/8] gpio: omap: get rid of GPIO_INDEX() macro
  2015-03-23 12:18 ` [PATCH v2 8/8] gpio: omap: get rid of GPIO_INDEX() macro grygorii.strashko
@ 2015-03-27 10:09   ` Linus Walleij
  0 siblings, 0 replies; 18+ messages in thread
From: Linus Walleij @ 2015-03-27 10:09 UTC (permalink / raw)
  To: Grygorii Strashko
  Cc: Javier Martinez Canillas, Alexandre Courbot, Santosh Shilimkar,
	Kevin Hilman, Tony Lindgren, Linux-OMAP, linux-gpio,
	linux-kernel

On Mon, Mar 23, 2015 at 1:18 PM,  <grygorii.strashko@linaro.org> wrote:

> From: Grygorii Strashko <grygorii.strashko@linaro.org>
>
> Now OMAP GPIO driver prepared for GPIO_INDEX() macro removing.
> Do It ;)
>
> Tested-by: Tony Lindgren <tony@atomide.com>
> Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
> Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
> Signed-off-by: Grygorii Strashko <grygorii.strashko@linaro.org>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2 0/8] gpio: omap: cleanup: get rid of system GPIO <-> GPIO offset converseations
  2015-03-23 12:18 [PATCH v2 0/8] gpio: omap: cleanup: get rid of system GPIO <-> GPIO offset converseations grygorii.strashko
                   ` (7 preceding siblings ...)
  2015-03-23 12:18 ` [PATCH v2 8/8] gpio: omap: get rid of GPIO_INDEX() macro grygorii.strashko
@ 2015-03-27 10:27 ` Grygorii.Strashko@linaro.org
  8 siblings, 0 replies; 18+ messages in thread
From: Grygorii.Strashko@linaro.org @ 2015-03-27 10:27 UTC (permalink / raw)
  To: grygorii.strashko, Javier Martinez Canillas, Linus Walleij,
	Alexandre Courbot, ssantosh, Kevin Hilman, tony
  Cc: linux-omap, linux-gpio, linux-kernel

On 03/23/2015 02:18 PM, grygorii.strashko@linaro.org wrote:
> From: Grygorii Strashko <grygorii.strashko@linaro.org>
>
> Now in TI OMAP GPIO driver there are a lot of places where
> System GPIO number calculated and then converted to GPIO offset.
> What is worse is that in many place such conversation performed twice
> or even three times. But actually, we don't need to do that at all, because
> - gpiolib always passes GPIO offset to GPIO controller
> - OMAP GPIO driver converted to use IRQ domain, so
>    struct irq_data->hwirq contains GPIO offset
>
> Hence, it is safe to convert all GPIO OMAP functions to use GPIO
> offset instead of system GPIO numbers. Also, this allows to remove
> unneeded conversations routines
>   #define GPIO_INDEX(bank, gpio)
>   #define GPIO_BIT(bank, gpio)
>   int omap_irq_to_gpio()
>
> Tested on:
> - dra7-evm.
> - omap1 (osk5912), 770 and E3.
>
> Last two patches have to be tested on OMAP1:
> -  gpio: omap: get rid of omap_irq_to_gpio()
> -  gpio: omap: get rid of GPIO_INDEX() macro
>
> Based on top of Linux 4.0-rc4 plus patch
> '[PATCH 1/2] gpio: omap: irq_shutdown: remove unnecessary call of gpiochip_unlock_as_irq'
> http://www.spinics.net/lists/linux-omap/msg116482.html
>
> Changes in v2:
> - fixed build failure with Patch 5, no functional code
>    changes.
>
> Tested-by: Tony Lindgren <tony@atomide.com>
> Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
> Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
>

Thanks Linus.

regards,
-grygorii



-- 
regards,
-grygorii

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2015-03-27 10:27 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-23 12:18 [PATCH v2 0/8] gpio: omap: cleanup: get rid of system GPIO <-> GPIO offset converseations grygorii.strashko
2015-03-23 12:18 ` [PATCH v2 1/8] gpio: omap: convert omap_gpio_is_input() to use gpio offset grygorii.strashko
2015-03-27 10:03   ` Linus Walleij
2015-03-23 12:18 ` [PATCH v2 2/8] gpio: omap: simplify omap_set_gpio_dataout_x() grygorii.strashko
2015-03-27 10:04   ` Linus Walleij
2015-03-23 12:18 ` [PATCH v2 3/8] gpio: omap: convert debounce functions switch to use gpio offset grygorii.strashko
2015-03-27 10:05   ` Linus Walleij
2015-03-23 12:18 ` [PATCH v2 4/8] gpio: omap: drop 'gpio' param from omap_gpio_init_irq() grygorii.strashko
2015-03-27 10:05   ` Linus Walleij
2015-03-23 12:18 ` [PATCH v2 5/8] gpio: omap: convert gpio irq functions to use GPIO offset grygorii.strashko
2015-03-27 10:06   ` Linus Walleij
2015-03-23 12:18 ` [PATCH v2 6/8] gpio: omap: get rid of GPIO_BIT() macro grygorii.strashko
2015-03-27 10:07   ` Linus Walleij
2015-03-23 12:18 ` [PATCH v2 7/8] gpio: omap: get rid of omap_irq_to_gpio() grygorii.strashko
2015-03-27 10:08   ` Linus Walleij
2015-03-23 12:18 ` [PATCH v2 8/8] gpio: omap: get rid of GPIO_INDEX() macro grygorii.strashko
2015-03-27 10:09   ` Linus Walleij
2015-03-27 10:27 ` [PATCH v2 0/8] gpio: omap: cleanup: get rid of system GPIO <-> GPIO offset converseations Grygorii.Strashko@linaro.org

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.