aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/plat-s3c24xx
diff options
context:
space:
mode:
authorAndy Green <andy@openmoko.com>2008-11-19 17:09:43 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-11-19 17:09:43 +0000
commit7e6fd937a8024327afa2e211280e73305f08844e (patch)
treed18acaca1e5c01b7762a061786b4d6e05435aa11 /arch/arm/plat-s3c24xx
parent433ad9e322020b611165198cf951ffb31160bb8e (diff)
add-gta01-resume-sysfs.patch
Adds the somewhat simpler resume source support for GTA01 since PMU is not a wake source Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'arch/arm/plat-s3c24xx')
-rw-r--r--arch/arm/plat-s3c24xx/neo1973_pm_resume_reason.c53
1 files changed, 33 insertions, 20 deletions
diff --git a/arch/arm/plat-s3c24xx/neo1973_pm_resume_reason.c b/arch/arm/plat-s3c24xx/neo1973_pm_resume_reason.c
index cca42dc7047..145556b5f50 100644
--- a/arch/arm/plat-s3c24xx/neo1973_pm_resume_reason.c
+++ b/arch/arm/plat-s3c24xx/neo1973_pm_resume_reason.c
@@ -23,10 +23,28 @@
#ifdef CONFIG_MACH_NEO1973_GTA02
#include <asm/arch/gta02.h>
#include <linux/pcf50633.h>
-
+#endif
static unsigned int *gstatus4_mapped;
-static char *resume_reasons[] = {
+static char *resume_reasons[][17] = { { /* GTA01 */
+ "EINT00_NULL",
+ "EINT01_GSM",
+ "EINT02_NULL",
+ "EINT03_NULL",
+ "EINT04_JACK",
+ "EINT05_SDCARD",
+ "EINT06_AUXKEY",
+ "EINT07_HOLDKEY",
+ "EINT08_NULL",
+ "EINT09_NULL",
+ "EINT10_NULL",
+ "EINT11_NULL",
+ "EINT12_NULL",
+ "EINT13_NULL",
+ "EINT14_NULL",
+ "EINT15_NULL",
+ NULL
+}, { /* GTA02 */
"EINT00_ACCEL1",
"EINT01_GSM",
"EINT02_BLUETOOTH",
@@ -44,7 +62,7 @@ static char *resume_reasons[] = {
"EINT14_NULL",
"EINT15_NULL",
NULL
-};
+} };
static ssize_t resume_reason_read(struct device *dev,
struct device_attribute *attr,
@@ -52,15 +70,18 @@ static ssize_t resume_reason_read(struct device *dev,
{
int bit = 0;
char *end = buf;
+ int gta = !!machine_is_neo1973_gta02();
- for (bit = 0; resume_reasons[bit]; bit++) {
+ for (bit = 0; resume_reasons[gta][bit]; bit++) {
if ((*gstatus4_mapped) & (1 << bit))
- end += sprintf(end, "* %s\n", resume_reasons[bit]);
+ end += sprintf(end, "* %s\n", resume_reasons[gta][bit]);
else
- end += sprintf(end, " %s\n", resume_reasons[bit]);
+ end += sprintf(end, " %s\n", resume_reasons[gta][bit]);
- if (bit == 9) /* PMU */
+#ifdef CONFIG_MACH_NEO1973_GTA02
+ if ((gta) && (bit == 9)) /* PMU */
end += pcf50633_report_resumers(pcf50633_global, end);
+#endif
}
return end - buf;
@@ -83,21 +104,14 @@ static int __init neo1973_resume_reason_probe(struct platform_device *pdev)
{
dev_info(&pdev->dev, "starting\n");
- switch (machine_arch_type) {
-#ifdef CONFIG_MACH_NEO1973_GTA01
- case MACH_TYPE_NEO1973_GTA01:
+ gstatus4_mapped = ioremap(0x560000BC /* GSTATUS4 */, 0x4);
+ if (!gstatus4_mapped) {
+ dev_err(&pdev->dev, "failed to ioremap() memory region\n");
return -EINVAL;
-#endif /* CONFIG_MACH_NEO1973_GTA01 */
- default:
- gstatus4_mapped = ioremap(0x560000BC, 0x4);
- if (!gstatus4_mapped) {
- dev_err(&pdev->dev, "failed to ioremap() memory region\n");
- return -EINVAL;
- }
- break;
}
- return sysfs_create_group(&pdev->dev.kobj, &neo1973_resume_reason_attr_group);
+ return sysfs_create_group(&pdev->dev.kobj,
+ &neo1973_resume_reason_attr_group);
}
static int neo1973_resume_reason_remove(struct platform_device *pdev)
@@ -131,4 +145,3 @@ module_exit(neo1973_resume_reason_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Andy Green <andy@openmoko.com>");
MODULE_DESCRIPTION("Neo1973 resume_reason");
-#endif