Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 36569
b: refs/heads/master
c: 1e582fc
h: refs/heads/master
i:
  36567: 8f667a0
v: v3
  • Loading branch information
Ben Dooks authored and Russell King committed Sep 25, 2006
1 parent f41e669 commit f154417
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3fc3a25ba47735296984ddbb2e6ba504017ec3e1
refs/heads/master: 1e582fc73781da47eddd90c75bf97f191e4f450f
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-s3c2410/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ obj-$(CONFIG_CPU_S3C2400) += s3c2400-gpio.o

obj-$(CONFIG_CPU_S3C2410) += s3c2410.o
obj-$(CONFIG_CPU_S3C2410) += s3c2410-gpio.o
obj-$(CONFIG_CPU_S3C2410) += s3c2410-irq.o
obj-$(CONFIG_CPU_S3C2410_DMA) += s3c2410-dma.o

# Power Management support
Expand Down
53 changes: 53 additions & 0 deletions trunk/arch/arm/mach-s3c2410/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,59 @@ s3c_irq_demux_extint(unsigned int irq,
}
}

#ifdef CONFIG_PM

static struct sleep_save irq_save[] = {
SAVE_ITEM(S3C2410_INTMSK),
SAVE_ITEM(S3C2410_INTSUBMSK),
};

/* the extint values move between the s3c2410/s3c2440 and the s3c2412
* so we use an array to hold them, and to calculate the address of
* the register at run-time
*/

static unsigned long save_extint[3];
static unsigned long save_eintflt[4];
static unsigned long save_eintmask;

int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state)
{
unsigned int i;

for (i = 0; i < ARRAY_SIZE(save_extint); i++)
save_extint[i] = __raw_readl(S3C24XX_EXTINT0 + (i*4));

for (i = 0; i < ARRAY_SIZE(save_eintflt); i++)
save_eintflt[i] = __raw_readl(S3C24XX_EINFLT0 + (i*4));

s3c2410_pm_do_save(irq_save, ARRAY_SIZE(irq_save));
save_eintmask = __raw_readl(S3C24XX_EINTMASK);

return 0;
}

int s3c24xx_irq_resume(struct sys_device *dev)
{
unsigned int i;

for (i = 0; i < ARRAY_SIZE(save_extint); i++)
__raw_writel(save_extint[i], S3C24XX_EXTINT0 + (i*4));

for (i = 0; i < ARRAY_SIZE(save_eintflt); i++)
__raw_writel(save_eintflt[i], S3C24XX_EINFLT0 + (i*4));

s3c2410_pm_do_restore(irq_save, ARRAY_SIZE(irq_save));
__raw_writel(save_eintmask, S3C24XX_EINTMASK);

return 0;
}

#else
#define s3c24xx_irq_suspend NULL
#define s3c24xx_irq_resume NULL
#endif

/* s3c24xx_init_irq
*
* Initialise S3C2410 IRQ system
Expand Down
22 changes: 2 additions & 20 deletions trunk/arch/arm/mach-s3c2410/pm.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* linux/arch/arm/mach-s3c2410/pm.c
*
* Copyright (c) 2004 Simtec Electronics
* Copyright (c) 2004,2006 Simtec Electronics
* Ben Dooks <ben@simtec.co.uk>
*
* S3C2410 Power Manager (Suspend-To-RAM) support
* S3C24XX Power Manager (Suspend-To-RAM) support
*
* See Documentation/arm/Samsung-S3C24XX/Suspend.txt for more information
*
Expand All @@ -24,9 +24,6 @@
* Parts based on arch/arm/mach-pxa/pm.c
*
* Thanks to Dimitry Andric for debugging
*
* Modifications:
* 10-Mar-2005 LCVR Changed S3C2410_VA_UART to S3C24XX_VA_UART
*/

#include <linux/init.h>
Expand Down Expand Up @@ -92,19 +89,6 @@ static struct sleep_save core_save[] = {
SAVE_ITEM(S3C2410_REFRESH),
};

/* this lot should be really saved by the IRQ code */
static struct sleep_save irq_save[] = {
SAVE_ITEM(S3C2410_EXTINT0),
SAVE_ITEM(S3C2410_EXTINT1),
SAVE_ITEM(S3C2410_EXTINT2),
SAVE_ITEM(S3C2410_EINFLT0),
SAVE_ITEM(S3C2410_EINFLT1),
SAVE_ITEM(S3C2410_EINFLT2),
SAVE_ITEM(S3C2410_EINFLT3),
SAVE_ITEM(S3C2410_EINTMASK),
SAVE_ITEM(S3C2410_INTMSK)
};

static struct sleep_save gpio_save[] = {
SAVE_ITEM(S3C2410_GPACON),
SAVE_ITEM(S3C2410_GPADAT),
Expand Down Expand Up @@ -564,7 +548,6 @@ static int s3c2410_pm_enter(suspend_state_t state)
/* save all necessary core registers not covered by the drivers */

s3c2410_pm_do_save(gpio_save, ARRAY_SIZE(gpio_save));
s3c2410_pm_do_save(irq_save, ARRAY_SIZE(irq_save));
s3c2410_pm_do_save(core_save, ARRAY_SIZE(core_save));
s3c2410_pm_do_save(uart_save, ARRAY_SIZE(uart_save));

Expand Down Expand Up @@ -608,7 +591,6 @@ static int s3c2410_pm_enter(suspend_state_t state)

s3c2410_pm_do_restore_core(core_save, ARRAY_SIZE(core_save));
s3c2410_pm_do_restore(gpio_save, ARRAY_SIZE(gpio_save));
s3c2410_pm_do_restore(irq_save, ARRAY_SIZE(irq_save));
s3c2410_pm_do_restore(uart_save, ARRAY_SIZE(uart_save));

s3c2410_pm_debug_init();
Expand Down
8 changes: 8 additions & 0 deletions trunk/arch/arm/mach-s3c2410/pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,11 @@ struct sleep_save {

extern void s3c2410_pm_do_save(struct sleep_save *ptr, int count);
extern void s3c2410_pm_do_restore(struct sleep_save *ptr, int count);

#ifdef CONFIG_PM
extern int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state);
extern int s3c24xx_irq_resume(struct sys_device *dev);
#else
#define s3c24xx_irq_suspend NULL
#define s3c24xx_irq_resume NULL
#endif
48 changes: 48 additions & 0 deletions trunk/arch/arm/mach-s3c2410/s3c2410-irq.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/* linux/arch/arm/mach-s3c2410/s3c2410-irq.c
*
* Copyright (c) 2006 Simtec Electronics
* Ben Dooks <ben@simtec.co.uk>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/

#include <linux/init.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/ioport.h>
#include <linux/ptrace.h>
#include <linux/sysdev.h>

#include "cpu.h"
#include "pm.h"

static int s3c2410_irq_add(struct sys_device *sysdev)
{
return 0;
}

static struct sysdev_driver s3c2410_irq_driver = {
.add = s3c2410_irq_add,
.suspend = s3c24xx_irq_suspend,
.resume = s3c24xx_irq_resume,
};

static int s3c2410_irq_init(void)
{
return sysdev_driver_register(&s3c2410_sysclass, &s3c2410_irq_driver);
}

arch_initcall(s3c2410_irq_init);
3 changes: 3 additions & 0 deletions trunk/arch/arm/mach-s3c2410/s3c2412-irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

#include "cpu.h"
#include "irq.h"
#include "pm.h"

/* the s3c2412 changes the behaviour of IRQ_EINT0 through IRQ_EINT3 by
* having them turn up in both the INT* and the EINT* registers. Whilst
Expand Down Expand Up @@ -120,6 +121,8 @@ static int s3c2412_irq_add(struct sys_device *sysdev)

static struct sysdev_driver s3c2412_irq_driver = {
.add = s3c2412_irq_add,
.suspend = s3c24xx_irq_suspend,
.resume = s3c24xx_irq_resume,
};

static int s3c2412_irq_init(void)
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-s3c2410/s3c2440-irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static int s3c2440_irq_add(struct sys_device *sysdev)
}

static struct sysdev_driver s3c2440_irq_driver = {
.add = s3c2440_irq_add,
.add = s3c2440_irq_add,
};

static int s3c2440_irq_init(void)
Expand Down
9 changes: 7 additions & 2 deletions trunk/arch/arm/mach-s3c2410/s3c244x-irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ static int s3c244x_irq_add(struct sys_device *sysdev)
}

static struct sysdev_driver s3c2440_irq_driver = {
.add = s3c244x_irq_add,
.add = s3c244x_irq_add,
.suspend = s3c24xx_irq_suspend,
.resume = s3c24xx_irq_resume,
};

static int s3c2440_irq_init(void)
Expand All @@ -131,9 +133,12 @@ static int s3c2440_irq_init(void)
arch_initcall(s3c2440_irq_init);

static struct sysdev_driver s3c2442_irq_driver = {
.add = s3c244x_irq_add,
.add = s3c244x_irq_add,
.suspend = s3c24xx_irq_suspend,
.resume = s3c24xx_irq_resume,
};


static int s3c2442_irq_init(void)
{
return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_irq_driver);
Expand Down

0 comments on commit f154417

Please sign in to comment.