Re: OMAP3: PM: Add the wakeup source driver, v4

2009-05-14 Thread Kim Kyuwon

Kevin Hilman writes:

Kim Kyuwon chamm...@gmail.com writes:


Hi Kevin,

Could you please review this fourth version of OMAP wakeup source driver?



Yes.  I'm working through my backlog of PM branch submissions this
week.

I've been focusing on getting some of the PM branch reworked and
rebased so I can start submitting upstream.  


I apologize for the delays, but the upstream work is currently higher
priority than adding large new features to the PM branch.


I agree.
Thank you for your works about OMAP tree and OMAP PM brach!
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: OMAP3: PM: Add the wakeup source driver, v4

2009-05-13 Thread Kim Kyuwon
Hi Kevin,

Could you please review this fourth version of OMAP wakeup source driver?

Regards,
Kyuwon.

On Tue, May 5, 2009 at 6:13 PM, Kim Kyuwon q1@samsung.com wrote:
 Sometimes, it is necessary to find out what does wake up my board from 
 suspend?. Notifying wake-up source feature may be used to blame unexpected 
 wake-up events which increase power consumption. And user mode applications 
 can act smartly according to the wake-up event from Suspend-to-RAM state to 
 minimize power consumption. Note that this driver can't inform wake-up events 
 from idle state. This driver uses sysfs interface to give information to user 
 mode applications like:

 cat /sys/power/omap_resume_irq
 cat /sys/power/omap_resume_event

 This driver also provides the I/O pad wake-up source configuration. Specific 
 GPIO settings in the board file are:

 /* I/O pad wakeup source configuration */
 static struct iopad_wake boardname_iopad_wake[] = {
{
.mux_index  = AE7_34XX_GPIO24,
.alias  = KEY_PWRON,
},
{
.mux_index  = ETK_D9_GPIO23,
.alias  = USB_DETECT,
},
 };

 static struct omap_wake_platform_data boardname_wake_data = {
.iopad_wakes= boardname_iopad_wake,
.iopad_wake_num = ARRAY_SIZE(boardname_iopad_wake),
 };

 static struct platform_device boardname_wakeup = {
.name   = omap-wake,
.id = -1,
.dev= {
.platform_data  = boardname_wake_data,
},
 };

 The patch adds Kconfig options OMAP34xx wakeup source support under System 
 type-TI OMAP implementations menu.

 Signed-off-by: Kim Kyuwon q1@samsung.com
 ---
  arch/arm/mach-omap2/Makefile  |1 +
  arch/arm/mach-omap2/irq.c |   21 ++-
  arch/arm/mach-omap2/omapdev-common.h  |3 +
  arch/arm/mach-omap2/omapdev3xxx.h |   63 +
  arch/arm/mach-omap2/pm34xx.c  |   13 +
  arch/arm/mach-omap2/prcm-common.h |4 +
  arch/arm/mach-omap2/prm-regbits-34xx.h|5 +
  arch/arm/mach-omap2/wake34xx.c|  409 
 +
  arch/arm/plat-omap/Kconfig|9 +
  arch/arm/plat-omap/include/mach/irqs.h|4 +
  arch/arm/plat-omap/include/mach/mux.h |3 +
  arch/arm/plat-omap/include/mach/omapdev.h |3 +
  arch/arm/plat-omap/include/mach/wake.h|   52 
  arch/arm/plat-omap/mux.c  |   25 ++-
  14 files changed, 605 insertions(+), 10 deletions(-)
  create mode 100644 arch/arm/mach-omap2/wake34xx.c
  create mode 100644 arch/arm/plat-omap/include/mach/wake.h

 diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
 index c58bab4..cfc5a13 100644
 --- a/arch/arm/mach-omap2/Makefile
 +++ b/arch/arm/mach-omap2/Makefile
 @@ -25,6 +25,7 @@ obj-$(CONFIG_ARCH_OMAP2)  += pm24xx.o
  obj-$(CONFIG_ARCH_OMAP24XX)+= sleep24xx.o
  obj-$(CONFIG_ARCH_OMAP3)   += pm34xx.o sleep34xx.o cpuidle34xx.o
  obj-$(CONFIG_PM_DEBUG) += pm-debug.o
 +obj-$(CONFIG_OMAP3_WAKE)   += wake34xx.o
  endif

  # SmartReflex driver
 diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
 index 700fc3d..18ac725 100644
 --- a/arch/arm/mach-omap2/irq.c
 +++ b/arch/arm/mach-omap2/irq.c
 @@ -33,9 +33,6 @@
  #define INTC_MIR_SET0  0x008c
  #define INTC_PENDING_IRQ0  0x0098

 -/* Number of IRQ state bits in each MIR register */
 -#define IRQ_BITS_PER_REG   32
 -
  /*
  * OMAP2 has a number of different interrupt controllers, each interrupt
  * controller is identified as its own bank. Register definitions are
 @@ -193,6 +190,24 @@ int omap_irq_pending(void)
return 0;
  }

 +void omap_get_pending_irqs(u32 *pending_irqs, unsigned len)
 +{
 +   int i, j = 0;
 +
 +   for (i = 0; i  ARRAY_SIZE(irq_banks); i++) {
 +   struct omap_irq_bank *bank = irq_banks + i;
 +   int irq;
 +
 +   for (irq = 0; irq  bank-nr_irqs  j  len;
 +   irq += IRQ_BITS_PER_REG) {
 +   int offset = irq  (~(IRQ_BITS_PER_REG - 1));
 +
 +   pending_irqs[j++] = intc_bank_read_reg(bank,
 +   (INTC_PENDING_IRQ0 + offset));
 +   }
 +   }
 +}
 +
  void __init omap_init_irq(void)
  {
unsigned long nr_of_irqs = 0;
 diff --git a/arch/arm/mach-omap2/omapdev-common.h 
 b/arch/arm/mach-omap2/omapdev-common.h
 index a2d4855..57b9b0b 100644
 --- a/arch/arm/mach-omap2/omapdev-common.h
 +++ b/arch/arm/mach-omap2/omapdev-common.h
 @@ -228,10 +228,13 @@ static struct omapdev *omapdevs[] = {
hsmmc2_3xxx_omapdev,
mcspi3_3xxx_omapdev,
gptimer1_3xxx_omapdev,
 +   gptimer12_3xxx_omapdev,
prm_3xxx_omapdev,
cm_3xxx_omapdev,