Skip to content

Commit

Permalink
Merge branch 'next/irq-s3c24xx' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/kernel/git/kgene/linux-samsung into next/cleanup

From Kukjin Kim:
This is redoing the s3c24xx irqs in a generic way by using a declarative
approach.

* 'next/irq-s3c24xx' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung:
  ARM: S3C24XX: transform s3c2443 subirqs into new structure
  ARM: S3C24XX: modify s3c2443 irq init to initialize all irqs
  ARM: S3C24XX: move s3c2443 irq code to irq.c
  ARM: S3C24XX: transform s3c2416 irqs into new structure
  ARM: S3C24XX: modify s3c2416 irq init to initialize all irqs
  ARM: S3C24XX: move s3c2416 irq init to common irq code
  ARM: S3C24XX: Modify s3c_irq_wake to use the hwirq property
  ARM: S3C24XX: Move irq syscore-ops to irq-pm
  ARM: S3C24XX: transform irq handling into a declarative form

Signed-off-by: Olof Johansson <olof@lixom.net>
  • Loading branch information
Olof Johansson committed Feb 6, 2013
2 parents 7dcbeef + f44ddba commit 5060c88
Show file tree
Hide file tree
Showing 17 changed files with 687 additions and 1,132 deletions.
4 changes: 2 additions & 2 deletions arch/arm/mach-s3c24xx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ obj-$(CONFIG_S3C2412_DMA) += dma-s3c2412.o
obj-$(CONFIG_S3C2412_PM) += pm-s3c2412.o
obj-$(CONFIG_S3C2412_PM_SLEEP) += sleep-s3c2412.o

obj-$(CONFIG_CPU_S3C2416) += s3c2416.o irq-s3c2416.o clock-s3c2416.o
obj-$(CONFIG_CPU_S3C2416) += s3c2416.o clock-s3c2416.o
obj-$(CONFIG_S3C2416_PM) += pm-s3c2416.o

obj-$(CONFIG_CPU_S3C2440) += s3c2440.o irq-s3c2440.o clock-s3c2440.o
Expand All @@ -39,7 +39,7 @@ obj-$(CONFIG_S3C2440_DMA) += dma-s3c2440.o
obj-$(CONFIG_S3C2440_PLL_12000000) += pll-s3c2440-12000000.o
obj-$(CONFIG_S3C2440_PLL_16934400) += pll-s3c2440-16934400.o

obj-$(CONFIG_CPU_S3C2443) += s3c2443.o irq-s3c2443.o clock-s3c2443.o
obj-$(CONFIG_CPU_S3C2443) += s3c2443.o clock-s3c2443.o

# PM

Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-s3c24xx/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@
void s3c2410_restart(char mode, const char *cmd);
void s3c244x_restart(char mode, const char *cmd);

extern struct syscore_ops s3c24xx_irq_syscore_ops;

#endif /* __ARCH_ARM_MACH_S3C24XX_COMMON_H */
41 changes: 35 additions & 6 deletions arch/arm/mach-s3c24xx/irq-pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/syscore_ops.h>

#include <plat/cpu.h>
#include <plat/pm.h>
Expand All @@ -29,18 +30,18 @@
* set bit to 1 in allow bitfield to enable the wakeup settings on it
*/

unsigned long s3c_irqwake_intallow = 1L << (IRQ_RTC - IRQ_EINT0) | 0xfL;
unsigned long s3c_irqwake_intallow = 1L << 30 | 0xfL;
unsigned long s3c_irqwake_eintallow = 0x0000fff0L;

int s3c_irq_wake(struct irq_data *data, unsigned int state)
{
unsigned long irqbit = 1 << (data->irq - IRQ_EINT0);
unsigned long irqbit = 1 << data->hwirq;

if (!(s3c_irqwake_intallow & irqbit))
return -ENOENT;

printk(KERN_INFO "wake %s for irq %d\n",
state ? "enabled" : "disabled", data->irq);
pr_info("wake %s for hwirq %lu\n",
state ? "enabled" : "disabled", data->hwirq);

if (!state)
s3c_irqwake_intmask |= irqbit;
Expand All @@ -64,7 +65,7 @@ static unsigned long save_extint[3];
static unsigned long save_eintflt[4];
static unsigned long save_eintmask;

int s3c24xx_irq_suspend(void)
static int s3c24xx_irq_suspend(void)
{
unsigned int i;

Expand All @@ -80,7 +81,7 @@ int s3c24xx_irq_suspend(void)
return 0;
}

void s3c24xx_irq_resume(void)
static void s3c24xx_irq_resume(void)
{
unsigned int i;

Expand All @@ -93,3 +94,31 @@ void s3c24xx_irq_resume(void)
s3c_pm_do_restore(irq_save, ARRAY_SIZE(irq_save));
__raw_writel(save_eintmask, S3C24XX_EINTMASK);
}

struct syscore_ops s3c24xx_irq_syscore_ops = {
.suspend = s3c24xx_irq_suspend,
.resume = s3c24xx_irq_resume,
};

#ifdef CONFIG_CPU_S3C2416
static struct sleep_save s3c2416_irq_save[] = {
SAVE_ITEM(S3C2416_INTMSK2),
};

static int s3c2416_irq_suspend(void)
{
s3c_pm_do_save(s3c2416_irq_save, ARRAY_SIZE(s3c2416_irq_save));

return 0;
}

static void s3c2416_irq_resume(void)
{
s3c_pm_do_restore(s3c2416_irq_save, ARRAY_SIZE(s3c2416_irq_save));
}

struct syscore_ops s3c2416_irq_syscore_ops = {
.suspend = s3c2416_irq_suspend,
.resume = s3c2416_irq_resume,
};
#endif
Loading

0 comments on commit 5060c88

Please sign in to comment.