From: Tarun Kanti DebBarma <hidden> Date: 2012-02-23 12:12:10
The cleanup is mostly getting rid of redundant fields in struct gpio_bank{}
as we already have them as part of bank->context now. Also, remove un-used
variable from gpio_irq_handler.
The fix include correction of _set_gpio_irqenable() implementation and fix
type mismatch of gpio trigger parameter.
It is baselined on top of Kevin's following series:
gpio/omap: cleanup and runtime PM conversion for v3.4
git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm.git for_3.4/gpio/runtime-pm-cleanup
I have applied Benoit's GPIO patches in following series on top of Kevin's
before applying my changes.
gpio/omap: Cleanup and adaptation to Device Tree
git://git.kernel.org/pub/scm/linux/kernel/git/bcousson/linux-omap-dt.git for_3.4/dt_gpio
Series is available here for reference:
git://gitorious.org/~tarunkanti/omap-sw-develoment/tarunkantis-linux-omap-dev for_3.4/gpio_further_cleanup_fixes
Power Test: Off-mode and Retention on OMAP3430 (Suspend and Idle paths).
Functional Test: OMAP2430, OMAP3430SDP, ZOOM3, OMAP4430, OMAP4-BLAZE
Tarun Kanti DebBarma (6):
gpio/omap: remove saved_fallingdetect, saved_risingdetect fields
gpio/omap: remove saved_wakeup field from struct gpio_bank
gpio/omap: remove suspend_wakeup field from struct gpio_bank
gpio/omap: get rid of retrigger variable in gpio_irq_handler
gpio/omap: fix trigger type to unsigned
gpio/omap: fix _set_gpio_irqenable implementation
drivers/gpio/gpio-omap.c | 56 +++++++++++++++++++--------------------------
1 files changed, 24 insertions(+), 32 deletions(-)
From: Tarun Kanti DebBarma <hidden> Date: 2012-02-23 12:10:43
This local variable is just assigned zero and then OR'ed
with isr. It does not appear to serve any purpose and so
removing it.
Signed-off-by: Tarun Kanti DebBarma <redacted>
---
drivers/gpio/gpio-omap.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
From: Tarun Kanti DebBarma <hidden> Date: 2012-02-23 12:10:45
This function should be capable of both enabling and disabling interrupts
based upon the *enable* parameter. Right now the function only enables
the interrupt and *enable* is not used at all. So add the interrupt
disable capability also using the parameter.
Signed-off-by: Tarun Kanti DebBarma <redacted>
---
drivers/gpio/gpio-omap.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
From: Tarun Kanti DebBarma <hidden> Date: 2012-02-23 12:10:56
Since we already have bank->context.wake_en to keep track
of gpios which are wakeup enabled, there is no need to have
this field any more.
Signed-off-by: Tarun Kanti DebBarma <redacted>
---
drivers/gpio/gpio-omap.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
@@ -497,9 +496,9 @@ static int _set_gpio_wakeup(struct gpio_bank *bank, int gpio, int enable)spin_lock_irqsave(&bank->lock,flags);if(enable)-bank->suspend_wakeup|=gpio_bit;+bank->context.wake_en|=gpio_bit;else-bank->suspend_wakeup&=~gpio_bit;+bank->context.wake_en&=~gpio_bit;spin_unlock_irqrestore(&bank->lock,flags);
@@ -772,7 +771,7 @@ static int omap_mpuio_suspend_noirq(struct device *dev)spin_lock_irqsave(&bank->lock,flags);bank->context.wake_en=__raw_readl(mask_reg);-__raw_writel(0xffff&~bank->suspend_wakeup,mask_reg);+__raw_writel(0xffff&~bank->context.wake_en,mask_reg);spin_unlock_irqrestore(&bank->lock,flags);return0;
@@ -1137,12 +1136,12 @@ static int omap_gpio_suspend(struct device *dev)if(!bank->mod_usage||!bank->loses_context)return0;-if(!bank->regs->wkup_en||!bank->suspend_wakeup)+if(!bank->regs->wkup_en||!bank->context.wake_en)return0;spin_lock_irqsave(&bank->lock,flags);_gpio_rmw(base,bank->regs->wkup_en,0xffffffff,0);-_gpio_rmw(base,bank->regs->wkup_en,bank->suspend_wakeup,1);+_gpio_rmw(base,bank->regs->wkup_en,bank->context.wake_en,1);spin_unlock_irqrestore(&bank->lock,flags);return0;
From: Tarun Kanti DebBarma <hidden> Date: 2012-02-23 12:11:14
Since we already have context.fallingdetect and context.risingdetect
there is no more need to have these additional fields. Also, getting
rid of extra reads associated with them.
Signed-off-by: Tarun Kanti DebBarma <redacted>
---
drivers/gpio/gpio-omap.c | 19 ++++++++-----------
1 files changed, 8 insertions(+), 11 deletions(-)
From: Tarun Kanti DebBarma <hidden> Date: 2012-02-23 12:11:15
There is no more need to have saved_wakeup. Instead we can use
context.wake_en which holds the current wakeup enable register
context. This also means that the read from wakeup enable register
is not needed.
Signed-off-by: Tarun Kanti DebBarma <redacted>
---
drivers/gpio/gpio-omap.c | 13 ++++---------
1 files changed, 4 insertions(+), 9 deletions(-)
From: Tarun Kanti DebBarma <hidden> Date: 2012-02-23 12:11:16
The GPIO trigger parameter is of type unsigned.
enum {
IRQ_TYPE_NONE = 0x00000000,
IRQ_TYPE_EDGE_RISING = 0x00000001,
IRQ_TYPE_EDGE_FALLING = 0x00000002,
IRQ_TYPE_EDGE_BOTH = (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING),
IRQ_TYPE_LEVEL_HIGH = 0x00000004,
IRQ_TYPE_LEVEL_LOW = 0x00000008,
IRQ_TYPE_LEVEL_MASK = (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH),
IRQ_TYPE_SENSE_MASK = 0x0000000f,
IRQ_TYPE_PROBE = 0x00000010,
...
};
Even though gpio_irq_type(struct irq_data *d, unsigned type) has the right type
of parameter, the subsequent called functions set_gpio_triggering() and
set_gpio_trigger() wrongly makes it signed integer. Fix this.
Signed-off-by: Tarun Kanti DebBarma <redacted>
---
drivers/gpio/gpio-omap.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
On Thu, Feb 23, 2012 at 5:40 PM, Tarun Kanti DebBarma
[off-list ref] wrote:
The cleanup is mostly getting rid of redundant fields in struct gpio_bank{}
as we already have them as part of bank->context now. Also, remove un-used
variable from gpio_irq_handler.
The fix include correction of _set_gpio_irqenable() implementation and fix
type mismatch of gpio trigger parameter.
It is baselined on top of Kevin's following series:
gpio/omap: cleanup and runtime PM conversion for v3.4
git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm.git for_3.4/gpio/runtime-pm-cleanup
I have applied Benoit's GPIO patches in following series on top of Kevin's
before applying my changes.
gpio/omap: Cleanup and adaptation to Device Tree
git://git.kernel.org/pub/scm/linux/kernel/git/bcousson/linux-omap-dt.git for_3.4/dt_gpio
Series is available here for reference:
git://gitorious.org/~tarunkanti/omap-sw-develoment/tarunkantis-linux-omap-dev for_3.4/gpio_further_cleanup_fixes
Power Test: Off-mode and Retention on OMAP3430 (Suspend and Idle paths).
Functional Test: OMAP2430, OMAP3430SDP, ZOOM3, OMAP4430, OMAP4-BLAZE
Tarun Kanti DebBarma (6):
?gpio/omap: remove saved_fallingdetect, saved_risingdetect fields
?gpio/omap: remove saved_wakeup field from struct gpio_bank
?gpio/omap: remove suspend_wakeup field from struct gpio_bank
?gpio/omap: get rid of retrigger variable in gpio_irq_handler
?gpio/omap: fix trigger type to unsigned
?gpio/omap: fix _set_gpio_irqenable implementation
?drivers/gpio/gpio-omap.c | ? 56 +++++++++++++++++++--------------------------
?1 files changed, 24 insertions(+), 32 deletions(-)
Nice clean-up series. I have gone through this series one more time
Thanks for updating change-logs. I noticed you dropped the edge triggered
irq wakeup fix....I see on the list now.... Kevin has fixed that already.
Series looks good to me. You can add:
Reviewed-by: Santosh Shilimkar <redacted>
Regards
Santosh
From: Felipe Balbi <hidden> Date: 2012-02-23 12:28:21
On Thu, Feb 23, 2012 at 05:40:26PM +0530, Tarun Kanti DebBarma wrote:
Since we already have context.fallingdetect and context.risingdetect
there is no more need to have these additional fields. Also, getting
rid of extra reads associated with them.
Signed-off-by: Tarun Kanti DebBarma <redacted>
From: Felipe Balbi <hidden> Date: 2012-02-23 12:28:52
On Thu, Feb 23, 2012 at 05:40:27PM +0530, Tarun Kanti DebBarma wrote:
There is no more need to have saved_wakeup. Instead we can use
context.wake_en which holds the current wakeup enable register
context. This also means that the read from wakeup enable register
is not needed.
Signed-off-by: Tarun Kanti DebBarma <redacted>
From: Felipe Balbi <hidden> Date: 2012-02-23 12:29:49
On Thu, Feb 23, 2012 at 05:40:28PM +0530, Tarun Kanti DebBarma wrote:
Since we already have bank->context.wake_en to keep track
of gpios which are wakeup enabled, there is no need to have
this field any more.
Signed-off-by: Tarun Kanti DebBarma <redacted>
From: Felipe Balbi <hidden> Date: 2012-02-23 12:30:26
On Thu, Feb 23, 2012 at 05:40:29PM +0530, Tarun Kanti DebBarma wrote:
This local variable is just assigned zero and then OR'ed
with isr. It does not appear to serve any purpose and so
removing it.
Signed-off-by: Tarun Kanti DebBarma <redacted>
From: Felipe Balbi <hidden> Date: 2012-02-23 12:31:00
On Thu, Feb 23, 2012 at 05:40:30PM +0530, Tarun Kanti DebBarma wrote:
The GPIO trigger parameter is of type unsigned.
enum {
IRQ_TYPE_NONE = 0x00000000,
IRQ_TYPE_EDGE_RISING = 0x00000001,
IRQ_TYPE_EDGE_FALLING = 0x00000002,
IRQ_TYPE_EDGE_BOTH = (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING),
IRQ_TYPE_LEVEL_HIGH = 0x00000004,
IRQ_TYPE_LEVEL_LOW = 0x00000008,
IRQ_TYPE_LEVEL_MASK = (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH),
IRQ_TYPE_SENSE_MASK = 0x0000000f,
IRQ_TYPE_PROBE = 0x00000010,
...
};
Even though gpio_irq_type(struct irq_data *d, unsigned type) has the right type
of parameter, the subsequent called functions set_gpio_triggering() and
set_gpio_trigger() wrongly makes it signed integer. Fix this.
Signed-off-by: Tarun Kanti DebBarma <redacted>
From: Felipe Balbi <hidden> Date: 2012-02-23 12:31:39
On Thu, Feb 23, 2012 at 05:40:31PM +0530, Tarun Kanti DebBarma wrote:
This function should be capable of both enabling and disabling interrupts
based upon the *enable* parameter. Right now the function only enables
the interrupt and *enable* is not used at all. So add the interrupt
disable capability also using the parameter.
Signed-off-by: Tarun Kanti DebBarma <redacted>
This one should probably be ported to stable releases, adding
stable at vger to the cc list
Acked-by: Felipe Balbi <redacted>
--
1.7.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
On Thursday 23 February 2012 05:40 PM, Tarun Kanti DebBarma wrote:
quoted hunk
The GPIO trigger parameter is of type unsigned.
enum {
IRQ_TYPE_NONE = 0x00000000,
IRQ_TYPE_EDGE_RISING = 0x00000001,
IRQ_TYPE_EDGE_FALLING = 0x00000002,
IRQ_TYPE_EDGE_BOTH = (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING),
IRQ_TYPE_LEVEL_HIGH = 0x00000004,
IRQ_TYPE_LEVEL_LOW = 0x00000008,
IRQ_TYPE_LEVEL_MASK = (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH),
IRQ_TYPE_SENSE_MASK = 0x0000000f,
IRQ_TYPE_PROBE = 0x00000010,
...
};
Even though gpio_irq_type(struct irq_data *d, unsigned type) has the right type
of parameter, the subsequent called functions set_gpio_triggering() and
set_gpio_trigger() wrongly makes it signed integer. Fix this.
Signed-off-by: Tarun Kanti DebBarma <redacted>
---
drivers/gpio/gpio-omap.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
From: Russell King - ARM Linux <hidden> Date: 2012-02-23 12:46:39
On Thu, Feb 23, 2012 at 06:09:16PM +0530, Shubhrajyoti wrote:
On Thursday 23 February 2012 05:40 PM, Tarun Kanti DebBarma wrote:
quoted
-static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger)
+static int _set_gpio_triggering(struct gpio_bank *bank, int gpio,
+ unsigned trigger)
From: Grant Likely <hidden> Date: 2012-03-12 17:34:32
On Thu, 23 Feb 2012 17:56:33 +0530, "Shilimkar, Santosh" [off-list ref] wrote:
On Thu, Feb 23, 2012 at 5:40 PM, Tarun Kanti DebBarma
[off-list ref] wrote:
quoted
The cleanup is mostly getting rid of redundant fields in struct gpio_bank{}
as we already have them as part of bank->context now. Also, remove un-used
variable from gpio_irq_handler.
The fix include correction of _set_gpio_irqenable() implementation and fix
type mismatch of gpio trigger parameter.
It is baselined on top of Kevin's following series:
gpio/omap: cleanup and runtime PM conversion for v3.4
git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm.git for_3.4/gpio/runtime-pm-cleanup
I have applied Benoit's GPIO patches in following series on top of Kevin's
before applying my changes.
gpio/omap: Cleanup and adaptation to Device Tree
git://git.kernel.org/pub/scm/linux/kernel/git/bcousson/linux-omap-dt.git for_3.4/dt_gpio
Series is available here for reference:
git://gitorious.org/~tarunkanti/omap-sw-develoment/tarunkantis-linux-omap-dev for_3.4/gpio_further_cleanup_fixes
Power Test: Off-mode and Retention on OMAP3430 (Suspend and Idle paths).
Functional Test: OMAP2430, OMAP3430SDP, ZOOM3, OMAP4430, OMAP4-BLAZE
Tarun Kanti DebBarma (6):
??gpio/omap: remove saved_fallingdetect, saved_risingdetect fields
??gpio/omap: remove saved_wakeup field from struct gpio_bank
??gpio/omap: remove suspend_wakeup field from struct gpio_bank
??gpio/omap: get rid of retrigger variable in gpio_irq_handler
??gpio/omap: fix trigger type to unsigned
??gpio/omap: fix _set_gpio_irqenable implementation
??drivers/gpio/gpio-omap.c | ?? 56 +++++++++++++++++++--------------------------
??1 files changed, 24 insertions(+), 32 deletions(-)
Nice clean-up series. I have gone through this series one more time
Thanks for updating change-logs. I noticed you dropped the edge triggered
irq wakeup fix....I see on the list now.... Kevin has fixed that already.
Series looks good to me. You can add:
Reviewed-by: Santosh Shilimkar <redacted>
What's the status of this series? Should I be expecting a v2? Or am I supposed
to pick up this one? (a pull req would make things easier for me)
g.