From 88a9cbf5b061a1deeae7e3fc9e2e4694500cefc3 Mon Sep 17 00:00:00 2001 From: Martin Jansa Date: Wed, 20 Oct 2010 11:30:03 +0200 Subject: linux-openmoko-2.6.34: add patch from qtmoko for resume_reason Signed-off-by: Martin Jansa --- ...sume-reason-sysfs-node-ported-from-2.6.29.patch | 215 +++++++++++++++++++++ .../linux/linux-openmoko-2.6.34/om-gta02/defconfig | 21 +- recipes/linux/linux-openmoko-2.6.34_git.bb | 3 +- 3 files changed, 237 insertions(+), 2 deletions(-) create mode 100644 recipes/linux/linux-openmoko-2.6.34/0022-Openmoko-resume-reason-sysfs-node-ported-from-2.6.29.patch (limited to 'recipes/linux') diff --git a/recipes/linux/linux-openmoko-2.6.34/0022-Openmoko-resume-reason-sysfs-node-ported-from-2.6.29.patch b/recipes/linux/linux-openmoko-2.6.34/0022-Openmoko-resume-reason-sysfs-node-ported-from-2.6.29.patch new file mode 100644 index 0000000000..7903bc4b6b --- /dev/null +++ b/recipes/linux/linux-openmoko-2.6.34/0022-Openmoko-resume-reason-sysfs-node-ported-from-2.6.29.patch @@ -0,0 +1,215 @@ +From c52969e6e305d83edb489f46a6985008a0b3f1cb Mon Sep 17 00:00:00 2001 +From: Timo Juhani Lindfors +Date: Mon, 18 Oct 2010 21:17:42 +0200 +Subject: [PATCH] Openmoko resume reason sysfs node ported from 2.6.29 + +Signed-off-by: Martin Jansa +--- + arch/arm/mach-s3c2440/mach-gta02.c | 5 + + drivers/misc/Kconfig | 7 ++ + drivers/misc/Makefile | 1 + + drivers/misc/neo1973_pm_resume_reason.c | 142 +++++++++++++++++++++++++++++++ + 4 files changed, 155 insertions(+), 0 deletions(-) + create mode 100644 drivers/misc/neo1973_pm_resume_reason.c + +diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c +index 6b57c42..702b80a 100644 +--- a/arch/arm/mach-s3c2440/mach-gta02.c ++++ b/arch/arm/mach-s3c2440/mach-gta02.c +@@ -152,6 +152,10 @@ static long gta02_panic_blink(long count) + return delay; + } + ++struct platform_device gta02_resume_reason_device = { ++ .name = "neo1973-resume", ++ .num_resources = 0, ++}; + + static struct map_desc gta02_iodesc[] __initdata = { + { +@@ -1289,6 +1293,7 @@ static struct platform_device *gta02_devices[] __initdata = { + static struct platform_device *gta02_devices_pmu_children[] = { + >a02_hdq_device, + >a02_platform_bat, ++ >a02_resume_reason_device, + }; + + /* +diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig +index 0d0d625..1baeedd 100644 +--- a/drivers/misc/Kconfig ++++ b/drivers/misc/Kconfig +@@ -327,6 +327,13 @@ config VMWARE_BALLOON + To compile this driver as a module, choose M here: the + module will be called vmware_balloon. + ++config OPENMOKO_RESUME_REASON ++ tristate "Openmoko resume reason driver" ++ depends on SYSFS ++ help ++ This driver adds a sysfs entry for accessing the resume reason ++ of the openmoko board. ++ + source "drivers/misc/c2port/Kconfig" + source "drivers/misc/eeprom/Kconfig" + source "drivers/misc/cb710/Kconfig" +diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile +index 7b6f7ee..57b6984 100644 +--- a/drivers/misc/Makefile ++++ b/drivers/misc/Makefile +@@ -30,3 +30,4 @@ obj-$(CONFIG_IWMC3200TOP) += iwmc3200top/ + obj-y += eeprom/ + obj-y += cb710/ + obj-$(CONFIG_VMWARE_BALLOON) += vmware_balloon.o ++obj-$(CONFIG_OPENMOKO_RESUME_REASON) += neo1973_pm_resume_reason.o +diff --git a/drivers/misc/neo1973_pm_resume_reason.c b/drivers/misc/neo1973_pm_resume_reason.c +new file mode 100644 +index 0000000..5bcc818 +--- /dev/null ++++ b/drivers/misc/neo1973_pm_resume_reason.c +@@ -0,0 +1,142 @@ ++/* ++ * Resume reason sysfs for the FIC Neo1973 GSM Phone ++ * ++ * (C) 2008 by Openmoko Inc. ++ * Author: Andy Green ++ * All rights reserved. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License resume_reason 2 as ++ * published by the Free Software Foundation ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#ifdef CONFIG_MACH_NEO1973_GTA02 ++#include ++#include ++#endif ++ ++static unsigned int *gstatus4_mapped; ++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", ++ "EINT03_DEBUGBRD", ++ "EINT04_JACK", ++ "EINT05_WLAN", ++ "EINT06_AUXKEY", ++ "EINT07_HOLDKEY", ++ "EINT08_ACCEL2", ++ "EINT09_PMU", ++ "EINT10_NULL", ++ "EINT11_NULL", ++ "EINT12_GLAMO", ++ "EINT13_NULL", ++ "EINT14_NULL", ++ "EINT15_NULL", ++ NULL ++} }; ++ ++static ssize_t resume_reason_read(struct device *dev, ++ struct device_attribute *attr, ++ char *buf) ++{ ++ int bit = 0; ++ char *end = buf; ++ int gta = !!machine_is_neo1973_gta02(); ++ ++ for (bit = 0; resume_reasons[gta][bit]; bit++) { ++ if ((*gstatus4_mapped) & (1 << bit)) ++ end += sprintf(end, "* %s\n", resume_reasons[gta][bit]); ++ else ++ end += sprintf(end, " %s\n", resume_reasons[gta][bit]); ++ } ++ ++ return end - buf; ++} ++ ++ ++static DEVICE_ATTR(resume_reason, 0644, resume_reason_read, NULL); ++ ++static struct attribute *neo1973_resume_reason_sysfs_entries[] = { ++ &dev_attr_resume_reason.attr, ++ NULL ++}; ++ ++static struct attribute_group neo1973_resume_reason_attr_group = { ++ .name = NULL, ++ .attrs = neo1973_resume_reason_sysfs_entries, ++}; ++ ++static int __init neo1973_resume_reason_probe(struct platform_device *pdev) ++{ ++ dev_info(&pdev->dev, "starting\n"); ++ ++ gstatus4_mapped = ioremap(0x560000BC /* GSTATUS4 */, 0x4); ++ if (!gstatus4_mapped) { ++ dev_err(&pdev->dev, "failed to ioremap() memory region\n"); ++ return -EINVAL; ++ } ++ ++ return sysfs_create_group(&pdev->dev.kobj, ++ &neo1973_resume_reason_attr_group); ++} ++ ++static int neo1973_resume_reason_remove(struct platform_device *pdev) ++{ ++ sysfs_remove_group(&pdev->dev.kobj, &neo1973_resume_reason_attr_group); ++ iounmap(gstatus4_mapped); ++ return 0; ++} ++ ++static struct platform_driver neo1973_resume_reason_driver = { ++ .probe = neo1973_resume_reason_probe, ++ .remove = neo1973_resume_reason_remove, ++ .driver = { ++ .name = "neo1973-resume", ++ }, ++}; ++ ++static int __devinit neo1973_resume_reason_init(void) ++{ ++ return platform_driver_register(&neo1973_resume_reason_driver); ++} ++ ++static void neo1973_resume_reason_exit(void) ++{ ++ platform_driver_unregister(&neo1973_resume_reason_driver); ++} ++ ++module_init(neo1973_resume_reason_init); ++module_exit(neo1973_resume_reason_exit); ++ ++MODULE_LICENSE("GPL"); ++MODULE_AUTHOR("Andy Green "); ++MODULE_DESCRIPTION("Neo1973 resume_reason"); +-- +1.7.3.1 + diff --git a/recipes/linux/linux-openmoko-2.6.34/om-gta02/defconfig b/recipes/linux/linux-openmoko-2.6.34/om-gta02/defconfig index 029146ad63..d2e98801f1 100644 --- a/recipes/linux/linux-openmoko-2.6.34/om-gta02/defconfig +++ b/recipes/linux/linux-openmoko-2.6.34/om-gta02/defconfig @@ -923,7 +923,26 @@ CONFIG_BLK_DEV_RAM_SIZE=4096 # CONFIG_CDROM_PKTCDVD is not set # CONFIG_ATA_OVER_ETH is not set # CONFIG_MG_DISK is not set -# CONFIG_MISC_DEVICES is not set +CONFIG_MISC_DEVICES=y +# CONFIG_AD525X_DPOT is not set +# CONFIG_ICS932S401 is not set +# CONFIG_ENCLOSURE_SERVICES is not set +# CONFIG_ISL29003 is not set +# CONFIG_SENSORS_TSL2550 is not set +# CONFIG_DS1682 is not set +# CONFIG_TI_DAC7512 is not set +CONFIG_OPENMOKO_RESUME_REASON=y +# CONFIG_C2PORT is not set + +# +# EEPROM support +# +# CONFIG_EEPROM_AT24 is not set +# CONFIG_EEPROM_AT25 is not set +# CONFIG_EEPROM_LEGACY is not set +# CONFIG_EEPROM_MAX6875 is not set +# CONFIG_EEPROM_93CX6 is not set +# CONFIG_IWMC3200TOP is not set CONFIG_HAVE_IDE=y # CONFIG_IDE is not set diff --git a/recipes/linux/linux-openmoko-2.6.34_git.bb b/recipes/linux/linux-openmoko-2.6.34_git.bb index 9d22d9a11f..023ad814d8 100644 --- a/recipes/linux/linux-openmoko-2.6.34_git.bb +++ b/recipes/linux/linux-openmoko-2.6.34_git.bb @@ -4,7 +4,7 @@ require linux-openmoko.inc KERNEL_RELEASE="2.6.34.7" SRCREV = "e4182f3551f1b8e8f8bd07a2d68e49a0ec4cd04a" -OEV = "oe6" +OEV = "oe7" PV = "${KERNEL_RELEASE}-${OEV}+gitr${SRCPV}" SRC_URI = "\ @@ -35,6 +35,7 @@ SRC_URI = "\ file://0019-Enable-powering-off-after-8s-POWER-press.patch \ file://0020-GTA02-bt-remember-state-of-bluetooth-in-variable.patch \ file://0021-tslib-relies-on-ts-pressures-events-so-this-hack-is-.patch \ + file://0022-Openmoko-resume-reason-sysfs-node-ported-from-2.6.29.patch \ # fix PR2349 file://0010-mach-gta02-fix-PR2349-do-not-manage-down.patch \ file://defconfig \ -- cgit 1.2.3-korg