1 From 2a48642ac0347c70f105997392f50b1ce8df45a3 Mon Sep 17 00:00:00 2001
2 From: Andy Green <andy@openmoko.com>
3 Date: Wed, 2 Jul 2008 22:36:10 +0100
4 Subject: [PATCH] add-gta01-resume-sysfs.patch
6 Adds the somewhat simpler resume source support for GTA01
7 since PMU is not a wake source
9 Signed-off-by: Andy Green <andy@openmoko.com>
11 arch/arm/plat-s3c24xx/neo1973_pm_resume_reason.c | 53 +++++++++++++--------
12 1 files changed, 33 insertions(+), 20 deletions(-)
14 diff --git a/arch/arm/plat-s3c24xx/neo1973_pm_resume_reason.c b/arch/arm/plat-s3c24xx/neo1973_pm_resume_reason.c
15 index cca42dc..145556b 100644
16 --- a/arch/arm/plat-s3c24xx/neo1973_pm_resume_reason.c
17 +++ b/arch/arm/plat-s3c24xx/neo1973_pm_resume_reason.c
19 #ifdef CONFIG_MACH_NEO1973_GTA02
20 #include <asm/arch/gta02.h>
21 #include <linux/pcf50633.h>
25 static unsigned int *gstatus4_mapped;
26 -static char *resume_reasons[] = {
27 +static char *resume_reasons[][17] = { { /* GTA01 */
49 @@ -44,7 +62,7 @@ static char *resume_reasons[] = {
56 static ssize_t resume_reason_read(struct device *dev,
57 struct device_attribute *attr,
58 @@ -52,15 +70,18 @@ static ssize_t resume_reason_read(struct device *dev,
62 + int gta = !!machine_is_neo1973_gta02();
64 - for (bit = 0; resume_reasons[bit]; bit++) {
65 + for (bit = 0; resume_reasons[gta][bit]; bit++) {
66 if ((*gstatus4_mapped) & (1 << bit))
67 - end += sprintf(end, "* %s\n", resume_reasons[bit]);
68 + end += sprintf(end, "* %s\n", resume_reasons[gta][bit]);
70 - end += sprintf(end, " %s\n", resume_reasons[bit]);
71 + end += sprintf(end, " %s\n", resume_reasons[gta][bit]);
73 - if (bit == 9) /* PMU */
74 +#ifdef CONFIG_MACH_NEO1973_GTA02
75 + if ((gta) && (bit == 9)) /* PMU */
76 end += pcf50633_report_resumers(pcf50633_global, end);
81 @@ -83,21 +104,14 @@ static int __init neo1973_resume_reason_probe(struct platform_device *pdev)
83 dev_info(&pdev->dev, "starting\n");
85 - switch (machine_arch_type) {
86 -#ifdef CONFIG_MACH_NEO1973_GTA01
87 - case MACH_TYPE_NEO1973_GTA01:
88 + gstatus4_mapped = ioremap(0x560000BC /* GSTATUS4 */, 0x4);
89 + if (!gstatus4_mapped) {
90 + dev_err(&pdev->dev, "failed to ioremap() memory region\n");
92 -#endif /* CONFIG_MACH_NEO1973_GTA01 */
94 - gstatus4_mapped = ioremap(0x560000BC, 0x4);
95 - if (!gstatus4_mapped) {
96 - dev_err(&pdev->dev, "failed to ioremap() memory region\n");
102 - return sysfs_create_group(&pdev->dev.kobj, &neo1973_resume_reason_attr_group);
103 + return sysfs_create_group(&pdev->dev.kobj,
104 + &neo1973_resume_reason_attr_group);
107 static int neo1973_resume_reason_remove(struct platform_device *pdev)
108 @@ -131,4 +145,3 @@ module_exit(neo1973_resume_reason_exit);
109 MODULE_LICENSE("GPL");
110 MODULE_AUTHOR("Andy Green <andy@openmoko.com>");
111 MODULE_DESCRIPTION("Neo1973 resume_reason");