r3649 - branches/src/target/kernel/2.6.24.x/patches
laforge at sita.openmoko.org
laforge at sita.openmoko.org
Fri Dec 14 12:17:28 CET 2007
Author: laforge
Date: 2007-12-14 12:17:24 +0100 (Fri, 14 Dec 2007)
New Revision: 3649
Removed:
branches/src/target/kernel/2.6.24.x/patches/qt2410-base.patch
Modified:
branches/src/target/kernel/2.6.24.x/patches/gta01-backlight.patch
branches/src/target/kernel/2.6.24.x/patches/gta01-core.patch
branches/src/target/kernel/2.6.24.x/patches/gta01-inputdevice.patch
branches/src/target/kernel/2.6.24.x/patches/gta01-jbt6k74.patch
branches/src/target/kernel/2.6.24.x/patches/gta01-no_nand_partitions.patch
branches/src/target/kernel/2.6.24.x/patches/gta01-pcf50606.patch
branches/src/target/kernel/2.6.24.x/patches/gta01-power_control.patch
branches/src/target/kernel/2.6.24.x/patches/gta01-vibrator.patch
branches/src/target/kernel/2.6.24.x/patches/gta02-core.patch
branches/src/target/kernel/2.6.24.x/patches/gta02-leds.patch
branches/src/target/kernel/2.6.24.x/patches/hxd8-core.patch
branches/src/target/kernel/2.6.24.x/patches/lis302dl.patch
branches/src/target/kernel/2.6.24.x/patches/pcf50633.patch
branches/src/target/kernel/2.6.24.x/patches/s3c2410-bbt.patch
branches/src/target/kernel/2.6.24.x/patches/s3c2410-pwm.patch
branches/src/target/kernel/2.6.24.x/patches/s3c2410-qt2410-buttons.patch
branches/src/target/kernel/2.6.24.x/patches/s3c2410_touchscreen.patch
branches/src/target/kernel/2.6.24.x/patches/series
Log:
* add proper patch descriptions
* add proper signed-off-by to patches that will be submitted
* fix various compiler warnings
* remove qt2410-base.patch since it is already in mainline
* reorder some patches
* add MODULE_DESCRIPTION to all modules
* remove private DEBUGP macros in favor of dev_dbg()
* use EXPORT_SYMBOL_GPL consistently throughout the code
* fix mmc/sd power-on for GTA01v3/v4/Bv2
* add new MACH_NEO1973 define for GTA01 and GTA02
* add snippet to MAINTAINERS file
* use consistent neo1973 naming for everything that is shared by gta01 and gta02
** KEYBOARD_GTA01 -> KEYBOARD_NEO1973
** gta01kbd.c -> neo1973kbd.c
** LEDS_GTA)1 -> LEDS_NEO1973_VIBRATOR
** leds-gta01.c -> leds-neo1973-vibrator.c
** gta01-pm-gsm -> neo1973-pm-gsm
** gta01-pm-bt -> neo1973-pm-bt
** gta01-pm-gps -> neo1973-pm-gps
** move all arm/common/gta01_pm_*.c to arm/plat-s3c24xx/neo1973_pm_*.c
** LEDS_GTA02 -> LEDES_NEO1973_GTA02
Modified: branches/src/target/kernel/2.6.24.x/patches/gta01-backlight.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/gta01-backlight.patch 2007-12-13 08:28:30 UTC (rev 3648)
+++ branches/src/target/kernel/2.6.24.x/patches/gta01-backlight.patch 2007-12-14 11:17:24 UTC (rev 3649)
@@ -1,10 +1,12 @@
-This is a backlight driver for FIC's Neo1973 Phone (codename GTA01)
+This is a backlight driver for the FIC/OpenMoko Neo1973 GTA01 GSM Phone
-Index: linux-2.6.23/drivers/video/backlight/Kconfig
+Signed-off-by: Harald Welte <laforge at openmoko.org>
+
+Index: linux-2.6/drivers/video/backlight/Kconfig
===================================================================
---- linux-2.6.23.orig/drivers/video/backlight/Kconfig
-+++ linux-2.6.23/drivers/video/backlight/Kconfig
-@@ -54,6 +54,14 @@
+--- linux-2.6.orig/drivers/video/backlight/Kconfig
++++ linux-2.6/drivers/video/backlight/Kconfig
+@@ -67,6 +67,14 @@
If you have a Sharp Zaurus SL-5500 (Collie) or SL-5600 (Poodle) say y to
enable the LCD/backlight driver.
@@ -13,29 +15,29 @@
+ depends on BACKLIGHT_CLASS_DEVICE && MACH_NEO1973_GTA01
+ default y
+ help
-+ If you have a FIC GTA01 say y to enable the backlight driver.
++ If you have a FIC Neo1973 GTA01, say y to enable the backlight driver.
+
+
config BACKLIGHT_HP680
tristate "HP Jornada 680 Backlight Driver"
depends on BACKLIGHT_CLASS_DEVICE && SH_HP6XX
-Index: linux-2.6.23/drivers/video/backlight/Makefile
+Index: linux-2.6/drivers/video/backlight/Makefile
===================================================================
---- linux-2.6.23.orig/drivers/video/backlight/Makefile
-+++ linux-2.6.23/drivers/video/backlight/Makefile
-@@ -3,6 +3,7 @@
- obj-$(CONFIG_LCD_CLASS_DEVICE) += lcd.o
+--- linux-2.6.orig/drivers/video/backlight/Makefile
++++ linux-2.6/drivers/video/backlight/Makefile
+@@ -5,6 +5,7 @@
+
obj-$(CONFIG_BACKLIGHT_CLASS_DEVICE) += backlight.o
obj-$(CONFIG_BACKLIGHT_CORGI) += corgi_bl.o
+obj-$(CONFIG_BACKLIGHT_GTA01) += gta01_bl.o
obj-$(CONFIG_BACKLIGHT_HP680) += hp680_bl.o
obj-$(CONFIG_BACKLIGHT_LOCOMO) += locomolcd.o
obj-$(CONFIG_BACKLIGHT_PROGEAR) += progear_bl.o
-Index: linux-2.6.23/drivers/video/backlight/gta01_bl.c
+Index: linux-2.6/drivers/video/backlight/gta01_bl.c
===================================================================
--- /dev/null
-+++ linux-2.6.23/drivers/video/backlight/gta01_bl.c
-@@ -0,0 +1,256 @@
++++ linux-2.6/drivers/video/backlight/gta01_bl.c
+@@ -0,0 +1,257 @@
+/*
+ * Backlight Driver for FIC GTA01 (Neo1973) GSM Phone
+ *
@@ -210,7 +212,7 @@
+ gta01bl_flags &= ~GTA01BL_BATTLOW;
+ gta01bl_send_intensity(gta01_backlight_device);
+}
-+EXPORT_SYMBOL(gta01bl_limit_intensity);
++EXPORT_SYMBOL_GPL(gta01bl_limit_intensity);
+
+
+static struct backlight_ops gta01bl_ops = {
@@ -290,5 +292,6 @@
+module_init(gta01bl_init);
+module_exit(gta01bl_exit);
+
++MODULE_DESCRIPTION("FIC GTA01 (Neo1973) Backlight Driver");
+MODULE_AUTHOR("Harald Welte <laforge at openmoko.org>");
-+MODULE_DESCRIPTION("FIC GTA01 (Neo1973) Backlight Driver");
++MODULE_LICENSE("GPL");
Modified: branches/src/target/kernel/2.6.24.x/patches/gta01-core.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/gta01-core.patch 2007-12-13 08:28:30 UTC (rev 3648)
+++ branches/src/target/kernel/2.6.24.x/patches/gta01-core.patch 2007-12-14 11:17:24 UTC (rev 3649)
@@ -1,17 +1,20 @@
-This patch adds support for the FIC GTA01 machine type to the ARM port of
-the linux kernel.
+This patch adds support for the FIC Neo1973 GTA01 machine type to the ARM port
+of the Linux kernel.
+Signed-off-by: Harald Welte <laforge at openmoko.org>
+
Index: linux-2.6/arch/arm/mach-s3c2410/Kconfig
===================================================================
--- linux-2.6.orig/arch/arm/mach-s3c2410/Kconfig
+++ linux-2.6/arch/arm/mach-s3c2410/Kconfig
-@@ -116,5 +116,12 @@
+@@ -116,5 +116,13 @@
help
Say Y here if you are using the Armzone QT2410
+config MACH_NEO1973_GTA01
+ bool "FIC Neo1973 GSM Phone (GTA01 Hardware)"
+ select CPU_S3C2410
++ select MACH_NEO1973
+ select SENSORS_PCF50606
+ help
+ Say Y here if you are using the FIC Neo1973 GSM Phone
@@ -31,11 +34,11 @@
===================================================================
--- /dev/null
+++ linux-2.6/arch/arm/mach-s3c2410/mach-gta01.c
-@@ -0,0 +1,783 @@
+@@ -0,0 +1,740 @@
+/*
+ * linux/arch/arm/mach-s3c2410/mach-gta01.c
+ *
-+ * S3C2410 Machine Support for the FIC GTA01 (Neo1973)
++ * S3C2410 Machine Support for the FIC Neo1973 GTA01
+ *
+ * Copyright (C) 2006-2007 by OpenMoko, Inc.
+ * Author: Harald Welte <laforge at openmoko.org>
@@ -399,47 +402,13 @@
+ &s3c_device_ts,
+};
+
-+static struct mtd_partition gta01_nand_part[] = {
-+ [0] = {
-+ .name = "U-Boot",
-+ .size = 0x30000,
-+ .offset = 0,
-+ },
-+ [1] = {
-+ .name = "U-Boot environment",
-+ .offset = 0x30000,
-+ .size = 0x4000,
-+ },
-+ [2] = {
-+ .name = "kernel",
-+ .offset = 0x34000,
-+ .size = SZ_2M,
-+ },
-+ [3] = {
-+ .name = "initrd",
-+ .offset = 0x234000,
-+ .size = SZ_4M,
-+ },
-+ [4] = {
-+ .name = "jffs2",
-+ .offset = 0x634000,
-+ .size = 0x39cc000,
-+ },
-+};
-+
+static struct s3c2410_nand_set gta01_nand_sets[] = {
+ [0] = {
-+ .name = "NAND",
++ .name = "neo1973-nand",
+ .nr_chips = 1,
-+ .nr_partitions = ARRAY_SIZE(gta01_nand_part),
-+ .partitions = gta01_nand_part,
+ },
+};
+
-+/* choose a set of timings which should suit most 512Mbit
-+ * chips and beyond.
-+ */
-+
+static struct s3c2410_platform_nand gta01_nand_info = {
+ .tacls = 20,
+ .twrph0 = 60,
@@ -479,16 +448,23 @@
+
+ switch (system_rev) {
+ case GTA01v3_SYSTEM_REV:
-+ /* FIXME */
++ switch (power_mode) {
++ case MMC_POWER_OFF:
++ pcf50606_onoff_set(pcf50606_global,
++ PCF50606_REGULATOR_D2REG, 0);
++ break;
++ case MMC_POWER_ON:
++ pcf50606_voltage_set(pcf50606_global,
++ PCF50606_REGULATOR_D2REG,
++ mmc_millivolts[vdd]);
++ pcf50606_onoff_set(pcf50606_global,
++ PCF50606_REGULATOR_D2REG, 1);
++ break;
++ }
+ break;
+ case GTA01v4_SYSTEM_REV:
-+ /* FIXME: set GTA01_GPIO_SDMMC_ON on GTA01v4 */
-+ //pcf50606_voltage_set(mmc_millivolts[vdd]);
-+ break;
+ case GTA01Bv2_SYSTEM_REV:
+ case GTA01Bv3_SYSTEM_REV:
-+ /* FIXME */
-+ break;
+ case GTA01Bv4_SYSTEM_REV:
+ switch (power_mode) {
+ case MMC_POWER_OFF:
@@ -505,8 +481,6 @@
+static struct s3c24xx_mci_pdata gta01_mmc_cfg = {
+ .gpio_detect = GTA01_GPIO_nSD_DETECT,
+ .set_power = >a01_mmc_set_power,
-+ .ocr_avail = MMC_VDD_32_33, /* GTA01Bv2/3/4 */
-+#if 0
+ .ocr_avail = MMC_VDD_145_150|MMC_VDD_150_155|MMC_VDD_155_160|
+ MMC_VDD_160_165| MMC_VDD_165_170|MMC_VDD_17_18|
+ MMC_VDD_18_19|MMC_VDD_19_20|MMC_VDD_20_21|
@@ -514,7 +488,6 @@
+ MMC_VDD_24_25|MMC_VDD_25_26|MMC_VDD_26_27|
+ MMC_VDD_27_28|MMC_VDD_28_29|MMC_VDD_29_30|
+ MMC_VDD_30_31|MMC_VDD_31_32|MMC_VDD_32_33,
-+#endif
+};
+
+static void gta01_udc_command(enum s3c2410_udc_cmd_e cmd)
@@ -528,9 +501,6 @@
+ case S3C2410_UDC_P_DISABLE:
+ s3c2410_gpio_setpin(GTA01_GPIO_USB_PULLUP, 0);
+ break;
-+ case S3C2410_UDC_P_RESET:
-+ /* FIXME! */
-+ break;
+ default:
+ break;
+ }
@@ -547,9 +517,9 @@
+
+static void __gta01_udc_vbus_draw(struct work_struct *work)
+{
-+ /* FIXME: this is a quick fix to work around boot-time
-+ * ordering problems if the s3c2410_udc is initialized
-+ * before the pcf50606 driver has defined pcf50606_global */
++ /* this is a fix to work around boot-time ordering problems if the
++ * s3c2410_udc is initialized before the pcf50606 driver has defined
++ * pcf50606_global */
+ if (!pcf50606_global)
+ return;
+
@@ -564,12 +534,10 @@
+ }
+}
+
-+static int gta01_udc_vbus_draw(unsigned int ma)
++static void gta01_udc_vbus_draw(unsigned int ma)
+{
+ gta01_udc_vbus_drawer.ma = ma;
+ schedule_work(>a01_udc_vbus_drawer.work);
-+
-+ return 0;
+}
+
+static struct s3c2410_udc_mach_info gta01_udc_cfg = {
@@ -596,14 +564,6 @@
+ },
+};
+
-+
-+#ifdef SPI_HARD
-+static struct s3c2410_spi_info spi_cfg = {
-+ .pin_cs = S3C2410_GPG3,
-+ .board_size = ARRAY_SIZE(gta01_spi_board_info),
-+ .board_info = gta01_spi_board_info,
-+};
-+#else
+static void spi_gpio_cs(struct s3c2410_spigpio_info *spi, int cs)
+{
+ switch (cs) {
@@ -653,7 +613,6 @@
+ .platform_data = &spi_gpio_cfg,
+ },
+};
-+#endif
+
+static struct gta01bl_machinfo backlight_machinfo = {
+ .default_intensity = 1,
@@ -685,7 +644,7 @@
+};
+
+struct platform_device gta01_led_dev = {
-+ .name = "gta01-led",
++ .name = "neo1973-vibrator",
+ .num_resources = ARRAY_SIZE(gta01_led_resources),
+ .resource = gta01_led_resources,
+};
@@ -706,13 +665,13 @@
+};
+
+struct platform_device gta01_button_dev = {
-+ .name ="gta01-button",
++ .name = "neo1973-button",
+ .num_resources = ARRAY_SIZE(gta01_button_resources),
+ .resource = gta01_button_resources,
+};
+
+static struct platform_device gta01_pm_gsm_dev = {
-+ .name ="gta01-pm-gsm",
++ .name = "neo1973-pm-gsm",
+};
+
+/* USB */
@@ -740,11 +699,15 @@
+
+static void __init gta01_machine_init(void)
+{
++ int rc;
++
+ if (system_rev == GTA01v4_SYSTEM_REV ||
+ system_rev == GTA01Bv2_SYSTEM_REV ||
+ system_rev == GTA01Bv3_SYSTEM_REV ||
-+ system_rev == GTA01Bv4_SYSTEM_REV)
++ system_rev == GTA01Bv4_SYSTEM_REV) {
+ gta01_udc_cfg.udc_command = gta01_udc_command;
++ gta01_mmc_cfg.ocr_avail = MMC_VDD_32_33;
++ }
+
+ s3c_device_usb.dev.platform_data = >a01_usb_info;
+ s3c_device_nand.dev.platform_data = >a01_nand_info;
@@ -760,14 +723,11 @@
+ s3c2410_gpio_cfgpin(S3C2410_GPC6, S3C2410_GPIO_OUTPUT);
+ s3c2410_gpio_setpin(S3C2410_GPC6, 1);
+
-+#ifdef SPI_HARD
-+#else
+ /* SPI chip select is gpio output */
+ s3c2410_gpio_cfgpin(S3C2410_GPG3, S3C2410_GPIO_OUTPUT);
+ s3c2410_gpio_setpin(S3C2410_GPG3, 1);
-+
+ platform_device_register(&s3c_device_spi_lcm);
-+#endif
++
+ platform_device_register(>a01_bl_dev);
+ platform_device_register(>a01_button_dev);
+ platform_device_register(>a01_pm_gsm_dev);
@@ -799,8 +759,10 @@
+ s3c2410_pm_init();
+
+ set_irq_type(GTA01_IRQ_MODEM, IRQT_RISING);
-+ request_irq(GTA01_IRQ_MODEM, gta01_modem_irq, IRQF_DISABLED, "modem",
-+ NULL);
++ rc = request_irq(GTA01_IRQ_MODEM, gta01_modem_irq, IRQF_DISABLED,
++ "modem", NULL);
++ if (!rc)
++ printk(KERN_ERR "GTA01: can't request GSM modem wakeup IRQ\n");
+ enable_irq_wake(GTA01_IRQ_MODEM);
+}
+
@@ -813,8 +775,6 @@
+ .init_machine = gta01_machine_init,
+ .timer = &s3c24xx_timer,
+MACHINE_END
-+
-+
Index: linux-2.6/include/asm-arm/arch-s3c2410/gta01.h
===================================================================
--- /dev/null
@@ -890,3 +850,36 @@
+#define GTA01Bv4_IRQ_PCF50606 IRQ_EINT9
+
+#endif /* _GTA01_H */
+Index: linux-2.6/MAINTAINERS
+===================================================================
+--- linux-2.6.orig/MAINTAINERS
++++ linux-2.6/MAINTAINERS
+@@ -1530,6 +1530,14 @@
+ M: akinobu.mita at gmail.com
+ S: Supported
+
++FIC/OPENMOKO NEO1973 GSM PHONE
++P: Harald Welte
++M: laforge at openmoko.org
++L: openmoko-kernel at lists.openmoko.org
++W: http://wiki.openmoko.org/wiki/Kernel
++W: http://wiki.openmoko.org/wiki/Neo1973
++S: Maintained
++
+ FRAMEBUFFER LAYER
+ P: Antonino Daplas
+ M: adaplas at gmail.com
+Index: linux-2.6/arch/arm/plat-s3c24xx/Kconfig
+===================================================================
+--- linux-2.6.orig/arch/arm/plat-s3c24xx/Kconfig
++++ linux-2.6/arch/arm/plat-s3c24xx/Kconfig
+@@ -46,4 +46,9 @@
+ help
+ Common machine code for SMDK2410 and SMDK2440
+
++config MACH_NEO1973
++ bool
++ help
++ Common machine code for Neo1973 hardware
++
+ endif
Modified: branches/src/target/kernel/2.6.24.x/patches/gta01-inputdevice.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/gta01-inputdevice.patch 2007-12-13 08:28:30 UTC (rev 3648)
+++ branches/src/target/kernel/2.6.24.x/patches/gta01-inputdevice.patch 2007-12-14 11:17:24 UTC (rev 3649)
@@ -1,5 +1,7 @@
This provides support for the GTA01 keyboard
+Signed-off-by: Harald Welte <laforge at openmoko.org>
+
Index: linux-2.6/drivers/input/keyboard/Kconfig
===================================================================
--- linux-2.6.orig/drivers/input/keyboard/Kconfig
@@ -8,12 +10,12 @@
To compile this driver as a module, choose M here: the
module will be called bf54x-keys.
-+config KEYBOARD_GTA01
-+ tristate "FIC Neo1973 (GTA01) buttons"
-+ depends on MACH_NEO1973_GTA01
++config KEYBOARD_NEO1973
++ tristate "FIC Neo1973 buttons"
++ depends on MACH_NEO1973
+ default y
+ help
-+ Say Y here to enable the buttons on the FIC Neo1973 (GTA01)
++ Say Y here to enable the buttons on the FIC Neo1973
+ GSM phone.
+
+ To compile this driver as a module, choose M here: the
@@ -29,19 +31,19 @@
obj-$(CONFIG_KEYBOARD_NEWTON) += newtonkbd.o
obj-$(CONFIG_KEYBOARD_STOWAWAY) += stowaway.o
obj-$(CONFIG_KEYBOARD_CORGI) += corgikbd.o
-+obj-$(CONFIG_KEYBOARD_GTA01) += gta01kbd.o
++obj-$(CONFIG_KEYBOARD_NEO1973) += neo1973kbd.o
obj-$(CONFIG_KEYBOARD_SPITZ) += spitzkbd.o
obj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o
obj-$(CONFIG_KEYBOARD_HIL_OLD) += hilkbd.o
-Index: linux-2.6/drivers/input/keyboard/gta01kbd.c
+Index: linux-2.6/drivers/input/keyboard/neo1973kbd.c
===================================================================
--- /dev/null
-+++ linux-2.6/drivers/input/keyboard/gta01kbd.c
-@@ -0,0 +1,249 @@
++++ linux-2.6/drivers/input/keyboard/neo1973kbd.c
+@@ -0,0 +1,252 @@
+/*
-+ * Keyboard driver for FIC GTA01 (Neo1973) GSM phone
++ * Keyboard driver for FIC Neo1973 GSM phone
+ *
-+ * (C) 2006 by OpenMoko, Inc.
++ * (C) 2006-2007 by OpenMoko, Inc.
+ * Author: Harald Welte <laforge at openmoko.org>
+ * All rights reserved.
+ *
@@ -63,90 +65,90 @@
+#include <asm/hardware.h>
+#include <asm/arch/gta01.h>
+
-+struct gta01kbd {
++struct neo1973kbd {
+ struct input_dev *input;
+ unsigned int suspended;
+ unsigned long suspend_jiffies;
+};
+
-+static irqreturn_t gta01kbd_aux_irq(int irq, void *dev_id)
++static irqreturn_t neo1973kbd_aux_irq(int irq, void *dev_id)
+{
-+ struct gta01kbd *gta01kbd_data = dev_id;
++ struct neo1973kbd *neo1973kbd_data = dev_id;
+
+ /* FIXME: use GPIO from platform_dev resources */
+ if (s3c2410_gpio_getpin(GTA01_GPIO_AUX_KEY))
-+ input_report_key(gta01kbd_data->input, KEY_PHONE, 0);
++ input_report_key(neo1973kbd_data->input, KEY_PHONE, 0);
+ else
-+ input_report_key(gta01kbd_data->input, KEY_PHONE, 1);
++ input_report_key(neo1973kbd_data->input, KEY_PHONE, 1);
+
-+ input_sync(gta01kbd_data->input);
++ input_sync(neo1973kbd_data->input);
+
+ return IRQ_HANDLED;
+}
+
-+static irqreturn_t gta01kbd_hold_irq(int irq, void *dev_id)
++static irqreturn_t neo1973kbd_hold_irq(int irq, void *dev_id)
+{
-+ struct gta01kbd *gta01kbd_data = dev_id;
++ struct neo1973kbd *neo1973kbd_data = dev_id;
+
+ /* FIXME: use GPIO from platform_dev resources */
+ if (s3c2410_gpio_getpin(GTA01_GPIO_HOLD_KEY))
-+ input_report_key(gta01kbd_data->input, KEY_PAUSE, 1);
++ input_report_key(neo1973kbd_data->input, KEY_PAUSE, 1);
+ else
-+ input_report_key(gta01kbd_data->input, KEY_PAUSE, 0);
++ input_report_key(neo1973kbd_data->input, KEY_PAUSE, 0);
+
-+ input_sync(gta01kbd_data->input);
++ input_sync(neo1973kbd_data->input);
+
+ return IRQ_HANDLED;
+}
+
-+static irqreturn_t gta01kbd_headphone_irq(int irq, void *dev_id)
++static irqreturn_t neo1973kbd_headphone_irq(int irq, void *dev_id)
+{
-+ struct gta01kbd *gta01kbd_data = dev_id;
++ struct neo1973kbd *neo1973kbd_data = dev_id;
+
+ /* FIXME: use GPIO from platform_dev resources */
+ if (s3c2410_gpio_getpin(GTA01_GPIO_JACK_INSERT))
-+ input_report_switch(gta01kbd_data->input, SW_HEADPHONE_INSERT, 1);
++ input_report_switch(neo1973kbd_data->input, SW_HEADPHONE_INSERT, 1);
+ else
-+ input_report_switch(gta01kbd_data->input, SW_HEADPHONE_INSERT, 0);
++ input_report_switch(neo1973kbd_data->input, SW_HEADPHONE_INSERT, 0);
+
-+ input_sync(gta01kbd_data->input);
++ input_sync(neo1973kbd_data->input);
+
+ return IRQ_HANDLED;
+}
+
+#ifdef CONFIG_PM
-+static int gta01kbd_suspend(struct platform_device *dev, pm_message_t state)
++static int neo1973kbd_suspend(struct platform_device *dev, pm_message_t state)
+{
-+ struct gta01kbd *gta01kbd = platform_get_drvdata(dev);
++ struct neo1973kbd *neo1973kbd = platform_get_drvdata(dev);
+
-+ gta01kbd->suspended = 1;
++ neo1973kbd->suspended = 1;
+
+ return 0;
+}
+
-+static int gta01kbd_resume(struct platform_device *dev)
++static int neo1973kbd_resume(struct platform_device *dev)
+{
-+ struct gta01kbd *gta01kbd = platform_get_drvdata(dev);
++ struct neo1973kbd *neo1973kbd = platform_get_drvdata(dev);
+
-+ gta01kbd->suspended = 0;
++ neo1973kbd->suspended = 0;
+
+ return 0;
+}
+#else
-+#define gta01kbd_suspend NULL
-+#define gta01kbd_resume NULL
++#define neo1973kbd_suspend NULL
++#define neo1973kbd_resume NULL
+#endif
+
-+static int gta01kbd_probe(struct platform_device *pdev)
++static int neo1973kbd_probe(struct platform_device *pdev)
+{
-+ struct gta01kbd *gta01kbd;
++ struct neo1973kbd *neo1973kbd;
+ struct input_dev *input_dev;
-+ int irq_aux, irq_hold, irq_jack;
++ int rc, irq_aux, irq_hold, irq_jack;
+
-+ gta01kbd = kzalloc(sizeof(struct gta01kbd), GFP_KERNEL);
++ neo1973kbd = kzalloc(sizeof(struct neo1973kbd), GFP_KERNEL);
+ input_dev = input_allocate_device();
-+ if (!gta01kbd || !input_dev) {
-+ kfree(gta01kbd);
++ if (!neo1973kbd || !input_dev) {
++ kfree(neo1973kbd);
+ input_free_device(input_dev);
+ return -ENOMEM;
+ }
@@ -166,12 +168,12 @@
+ if (irq_jack < 0)
+ return -EINVAL;
+
-+ platform_set_drvdata(pdev, gta01kbd);
++ platform_set_drvdata(pdev, neo1973kbd);
+
-+ gta01kbd->input = input_dev;
++ neo1973kbd->input = input_dev;
+
+#if 0
-+ spin_lock_init(>a01kbd->lock);
++ spin_lock_init(&neo1973kbd->lock);
+ /* Init Keyboard rescan timer */
+ init_timer(&corgikbd->timer);
+ corgikbd->timer.function = corgikbd_timer_callback;
@@ -186,40 +188,42 @@
+#endif
+
+ input_dev->name = "Neo1973 Buttons";
-+ input_dev->phys = "gta01kbd/input0";
++ input_dev->phys = "neo1973kbd/input0";
+ input_dev->id.bustype = BUS_HOST;
+ input_dev->id.vendor = 0x0001;
+ input_dev->id.product = 0x0001;
+ input_dev->id.version = 0x0100;
+ input_dev->cdev.dev = &pdev->dev;
-+ input_dev->private = gta01kbd;
++ input_dev->private = neo1973kbd;
+
+ input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_SW);
+ set_bit(SW_HEADPHONE_INSERT, input_dev->swbit);
+ set_bit(KEY_PHONE, input_dev->keybit);
+ set_bit(KEY_PAUSE, input_dev->keybit);
+
-+ input_register_device(gta01kbd->input);
++ rc = input_register_device(neo1973kbd->input);
++ if (rc)
++ goto out_register;
+
-+ if (request_irq(irq_aux, gta01kbd_aux_irq, IRQF_DISABLED |
++ if (request_irq(irq_aux, neo1973kbd_aux_irq, IRQF_DISABLED |
+ IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
-+ "Neo1973 AUX button", gta01kbd)) {
++ "Neo1973 AUX button", neo1973kbd)) {
+ dev_err(&pdev->dev, "Can't get IRQ %u\n", irq_aux);
+ goto out_aux;
+ }
+ enable_irq_wake(irq_aux);
+
-+ if (request_irq(irq_hold, gta01kbd_hold_irq, IRQF_DISABLED |
++ if (request_irq(irq_hold, neo1973kbd_hold_irq, IRQF_DISABLED |
+ IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
-+ "Neo1973 HOLD button", gta01kbd)) {
++ "Neo1973 HOLD button", neo1973kbd)) {
+ dev_err(&pdev->dev, "Can't get IRQ %u\n", irq_hold);
+ goto out_hold;
+ }
+ enable_irq_wake(irq_hold);
+
-+ if (request_irq(irq_jack, gta01kbd_headphone_irq, IRQF_DISABLED |
++ if (request_irq(irq_jack, neo1973kbd_headphone_irq, IRQF_DISABLED |
+ IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
-+ "Neo1973 Headphone Jack", gta01kbd)) {
++ "Neo1973 Headphone Jack", neo1973kbd)) {
+ dev_err(&pdev->dev, "Can't get IRQ %u\n", irq_jack);
+ goto out_jack;
+ }
@@ -230,60 +234,61 @@
+ return 0;
+
+out_jack:
-+ free_irq(irq_hold, gta01kbd);
++ free_irq(irq_hold, neo1973kbd);
+out_hold:
-+ free_irq(irq_aux, gta01kbd);
++ free_irq(irq_aux, neo1973kbd);
+out_aux:
-+ input_unregister_device(gta01kbd->input);
-+ input_free_device(gta01kbd->input);
++ input_unregister_device(neo1973kbd->input);
++out_register:
++ input_free_device(neo1973kbd->input);
+ platform_set_drvdata(pdev, NULL);
-+ kfree(gta01kbd);
++ kfree(neo1973kbd);
+
+ return -ENODEV;
+}
+
-+static int gta01kbd_remove(struct platform_device *pdev)
++static int neo1973kbd_remove(struct platform_device *pdev)
+{
-+ struct gta01kbd *gta01kbd = platform_get_drvdata(pdev);
++ struct neo1973kbd *neo1973kbd = platform_get_drvdata(pdev);
+
-+ free_irq(s3c2410_gpio_getirq(pdev->resource[2].start), gta01kbd);
-+ free_irq(s3c2410_gpio_getirq(pdev->resource[1].start), gta01kbd);
-+ free_irq(s3c2410_gpio_getirq(pdev->resource[0].start), gta01kbd);
++ free_irq(s3c2410_gpio_getirq(pdev->resource[2].start), neo1973kbd);
++ free_irq(s3c2410_gpio_getirq(pdev->resource[1].start), neo1973kbd);
++ free_irq(s3c2410_gpio_getirq(pdev->resource[0].start), neo1973kbd);
+#if 0
+ del_timer_sync(&corgikbd->htimer);
+ del_timer_sync(&corgikbd->timer);
+#endif
-+ input_unregister_device(gta01kbd->input);
-+ input_free_device(gta01kbd->input);
++ input_unregister_device(neo1973kbd->input);
++ input_free_device(neo1973kbd->input);
+ platform_set_drvdata(pdev, NULL);
-+ kfree(gta01kbd);
++ kfree(neo1973kbd);
+
+ return 0;
+}
+
-+static struct platform_driver gta01kbd_driver = {
-+ .probe = gta01kbd_probe,
-+ .remove = gta01kbd_remove,
-+ .suspend = gta01kbd_suspend,
-+ .resume = gta01kbd_resume,
++static struct platform_driver neo1973kbd_driver = {
++ .probe = neo1973kbd_probe,
++ .remove = neo1973kbd_remove,
++ .suspend = neo1973kbd_suspend,
++ .resume = neo1973kbd_resume,
+ .driver = {
-+ .name = "gta01-button",
++ .name = "neo1973-button",
+ },
+};
+
-+static int __devinit gta01kbd_init(void)
++static int __devinit neo1973kbd_init(void)
+{
-+ return platform_driver_register(>a01kbd_driver);
++ return platform_driver_register(&neo1973kbd_driver);
+}
+
-+static void __exit gta01kbd_exit(void)
++static void __exit neo1973kbd_exit(void)
+{
-+ platform_driver_unregister(>a01kbd_driver);
++ platform_driver_unregister(&neo1973kbd_driver);
+}
+
-+module_init(gta01kbd_init);
-+module_exit(gta01kbd_exit);
++module_init(neo1973kbd_init);
++module_exit(neo1973kbd_exit);
+
+MODULE_AUTHOR("Harald Welte <laforge at openmoko.org>");
-+MODULE_DESCRIPTION("FIC Neo1973 (GTA01) Buttons Driver");
++MODULE_DESCRIPTION("FIC Neo1973 buttons input driver");
+MODULE_LICENSE("GPL");
Modified: branches/src/target/kernel/2.6.24.x/patches/gta01-jbt6k74.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/gta01-jbt6k74.patch 2007-12-13 08:28:30 UTC (rev 3648)
+++ branches/src/target/kernel/2.6.24.x/patches/gta01-jbt6k74.patch 2007-12-14 11:17:24 UTC (rev 3649)
@@ -1,17 +1,21 @@
This driver adds support for LCM initialization of the JBT6K74 LCM
as found on the FIC GTA01 hardware
+Signed-off-by: Harald Welte <laforge at openmoko.org>
+
Index: linux-2.6/drivers/spi/Kconfig
===================================================================
--- linux-2.6.orig/drivers/spi/Kconfig
+++ linux-2.6/drivers/spi/Kconfig
-@@ -237,5 +237,9 @@
+@@ -237,5 +237,11 @@
# (slave support would go here)
+config SPI_SLAVE_JBT6K74
-+ tristate "tpo JP6K74 LCM ASIC"
-+ depends on SPI_MASTER && (MACH_NEO1973_GTA01 || MACH_QT2410)
++ tristate "tpo JP6K74 LCM ASIC control interface"
++ depends on SPI_MASTER && SYSFS
++ help
++ Driver for the tpo JP6K74-AS LCM SPI control interface.
+
endmenu # "SPI support"
@@ -29,7 +33,7 @@
===================================================================
--- /dev/null
+++ linux-2.6/drivers/spi/jbt6k74.c
-@@ -0,0 +1,648 @@
+@@ -0,0 +1,626 @@
+/* Linux kernel driver for the tpo JBT6K74-AS LCM ASIC
+ *
+ * Copyright (C) 2006-2007 by OpenMoko, Inc.
@@ -140,14 +144,6 @@
+ [JBT_STATE_QVGA_NORMAL] = "qvga-normal",
+};
+
-+#if 1
-+#define DEBUGP(x, args...) printk(KERN_ERR "%s: " x, __FUNCTION__, ## args);
-+#else
-+#define DEBUGP(x, args...) do { } while (0)
-+#endif
-+
-+
-+#define JBT_TX_BUF_SIZE
+struct jbt_info {
+ enum jbt_state state, last_state;
+ u_int16_t tx_buf[8];
@@ -205,7 +201,8 @@
+{
+ int rc;
+
-+ DEBUGP("entering\n");
++ dev_dbg(&jbt->spi_dev->dev, "entering %cVGA mode\n", qvga ? 'Q' : ' ');
++
+ rc = jbt_reg_write(jbt, JBT_REG_DISPLAY_MODE1, 0x01);
+ rc |= jbt_reg_write(jbt, JBT_REG_DISPLAY_MODE2, 0x00);
+ rc |= jbt_reg_write(jbt, JBT_REG_RGB_FORMAT, 0x60);
@@ -235,7 +232,6 @@
+ rc |= jbt_reg_write(jbt, JBT_REG_GAMMA1_BLUE_OFFSET, 0x00);
+
+ if (!qvga) {
-+ DEBUGP("entering VGA mode\n");
+ rc |= jbt_reg_write16(jbt, JBT_REG_HCLOCK_VGA, 0x1f0);
+ rc |= jbt_reg_write(jbt, JBT_REG_BLANK_CONTROL, 0x02);
+ rc |= jbt_reg_write16(jbt, JBT_REG_BLANK_TH_TV, 0x0804);
@@ -248,8 +244,6 @@
+ rc |= jbt_reg_write(jbt, JBT_REG_ASW_TIMING_2, 0x0e);
+ }
+ else {
-+ DEBUGP("entering QVGA mode\n");
-+
+ rc |= jbt_reg_write16(jbt, JBT_REG_HCLOCK_QVGA, 0x00ff);
+ rc |= jbt_reg_write(jbt, JBT_REG_BLANK_CONTROL_QVGA, 0x02);
+ rc |= jbt_reg_write16(jbt, JBT_REG_BLANK_TH_TV_QVGA, 0x0804);
@@ -269,8 +263,6 @@
+{
+ int rc;
+
-+ DEBUGP("entering\n");
-+
+ /* three times command zero */
+ rc = jbt_reg_write_nodata(jbt, 0x00);
+ mdelay(1);
@@ -288,7 +280,6 @@
+static int sleep_to_normal(struct jbt_info *jbt)
+{
+ int rc;
-+ DEBUGP("entering\n");
+
+ /* RGB I/F on, RAM wirte off, QVGA through, SIGCON enable */
+ rc = jbt_reg_write(jbt, JBT_REG_DISPLAY_MODE, 0x80);
@@ -313,7 +304,6 @@
+static int sleep_to_qvga_normal(struct jbt_info *jbt)
+{
+ int rc;
-+ DEBUGP("entering\n");
+
+ /* RGB I/F on, RAM wirte off, QVGA through, SIGCON enable */
+ rc = jbt_reg_write(jbt, JBT_REG_DISPLAY_MODE, 0x81);
@@ -338,7 +328,6 @@
+static int normal_to_sleep(struct jbt_info *jbt)
+{
+ int rc;
-+ DEBUGP("entering\n");
+
+ rc = jbt_reg_write_nodata(jbt, JBT_REG_DISPLAY_OFF);
+ rc |= jbt_reg_write16(jbt, JBT_REG_OUTPUT_CONTROL, 0x8002);
@@ -349,7 +338,6 @@
+
+static int sleep_to_standby(struct jbt_info *jbt)
+{
-+ DEBUGP("entering\n");
+ return jbt_reg_write(jbt, JBT_REG_POWER_ON_OFF, 0x00);
+}
+
@@ -358,7 +346,8 @@
+{
+ int rc = -EINVAL;
+
-+ DEBUGP("entering(old_state=%u, new_state=%u)\n", jbt->state, new_state);
++ dev_dbg(&jbt->spi_dev->dev, "entering (old_state=%u, "
++ "new_state=%u)\n", jbt->state, new_state);
+
+ switch (jbt->state) {
+ case JBT_STATE_DEEP_STANDBY:
@@ -457,17 +446,16 @@
+
+ return rc;
+}
-+EXPORT_SYMBOL(jbt6k74_enter_state);
++EXPORT_SYMBOL_GPL(jbt6k74_enter_state);
+
+int jbt6k74_display_onoff(struct jbt_info *jbt, int on)
+{
-+ DEBUGP("entering\n");
+ if (on)
+ return jbt_reg_write_nodata(jbt, JBT_REG_DISPLAY_ON);
+ else
+ return jbt_reg_write_nodata(jbt, JBT_REG_DISPLAY_OFF);
+}
-+EXPORT_SYMBOL(jbt6k74_display_onoff);
++EXPORT_SYMBOL_GPL(jbt6k74_display_onoff);
+
+static ssize_t state_read(struct device *dev, struct device_attribute *attr,
+ char *buf)
@@ -489,7 +477,6 @@
+ for (i = 0; i < ARRAY_SIZE(jbt_state_names); i++) {
+ if (!strncmp(buf, jbt_state_names[i],
+ strlen(jbt_state_names[i]))) {
-+ DEBUGP("Switch to state: %u\n", i);
+ jbt6k74_enter_state(jbt, i);
+ switch (i) {
+ case JBT_STATE_NORMAL:
@@ -564,7 +551,6 @@
+{
+ int rc;
+ struct jbt_info *jbt;
-+ DEBUGP("entering\n");
+
+ jbt = kzalloc(sizeof(*jbt), GFP_KERNEL);
+ if (!jbt)
@@ -582,7 +568,8 @@
+
+ rc = spi_setup(spi);
+ if (rc < 0) {
-+ printk(KERN_ERR "error during spi_setup of jbt6k74 driver\n");
++ dev_err(&spi->dev,
++ "error during spi_setup of jbt6k74 driver\n");
+ dev_set_drvdata(&spi->dev, NULL);
+ kfree(jbt);
+ return rc;
@@ -590,7 +577,7 @@
+
+ rc = jbt6k74_enter_state(jbt, JBT_STATE_NORMAL);
+ if (rc < 0)
-+ printk(KERN_WARNING "jbt6k74: cannot enter NORMAL state\n");
++ dev_warn(&spi->dev, "cannot enter NORMAL state\n");
+
+ jbt6k74_display_onoff(jbt, 1);
+
@@ -608,8 +595,6 @@
+{
+ struct jbt_info *jbt = dev_get_drvdata(&spi->dev);
+
-+ DEBUGP("entering\n");
-+
+ sysfs_remove_group(&spi->dev.kobj, &jbt_attr_group);
+ kfree(jbt);
+
@@ -620,7 +605,6 @@
+static int jbt_suspend(struct spi_device *spi, pm_message_t state)
+{
+ struct jbt_info *jbt = dev_get_drvdata(&spi->dev);
-+ DEBUGP("entering\n");
+
+ switch (state.event) {
+ case PM_EVENT_SUSPEND:
@@ -637,7 +621,6 @@
+static int jbt_resume(struct spi_device *spi)
+{
+ struct jbt_info *jbt = dev_get_drvdata(&spi->dev);
-+ DEBUGP("entering\n");
+
+ jbt6k74_enter_state(jbt, jbt->last_state);
+ jbt6k74_display_onoff(jbt, 1);
@@ -663,16 +646,15 @@
+
+static int __init jbt_init(void)
+{
-+ DEBUGP("entering\n");
+ return spi_register_driver(&jbt6k74_driver);
+}
+
+static void __exit jbt_exit(void)
+{
-+ DEBUGP("entering\n");
+ spi_unregister_driver(&jbt6k74_driver);
+}
+
++MODULE_DESCRIPTION("SPI driver for tpo JBT6K74-AS LCM control interface");
+MODULE_AUTHOR("Harald Welte <laforge at openmoko.org>");
+MODULE_LICENSE("GPL");
+
Modified: branches/src/target/kernel/2.6.24.x/patches/gta01-no_nand_partitions.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/gta01-no_nand_partitions.patch 2007-12-13 08:28:30 UTC (rev 3648)
+++ branches/src/target/kernel/2.6.24.x/patches/gta01-no_nand_partitions.patch 2007-12-14 11:17:24 UTC (rev 3649)
@@ -1,47 +1,14 @@
---- linux-2.6.22.1.orig/arch/arm/mach-s3c2410/mach-gta01.c
-+++ linux-2.6.22.1/arch/arm/mach-s3c2410/mach-gta01.c
-@@ -336,40 +336,10 @@
- &s3c_device_ts,
- };
-
--static struct mtd_partition gta01_nand_part[] = {
-- [0] = {
-- .name = "U-Boot",
-- .size = 0x30000,
-- .offset = 0,
-- },
-- [1] = {
-- .name = "U-Boot environment",
-- .offset = 0x30000,
-- .size = 0x4000,
-- },
-- [2] = {
-- .name = "kernel",
-- .offset = 0x34000,
-- .size = SZ_2M,
-- },
-- [3] = {
-- .name = "initrd",
-- .offset = 0x234000,
-- .size = SZ_4M,
-- },
-- [4] = {
-- .name = "jffs2",
-- .offset = 0x634000,
-- .size = 0x39cc000,
-- },
--};
--
- static struct s3c2410_nand_set gta01_nand_sets[] = {
- [0] = {
-- .name = "NAND",
-+ .name = "neo1973-nand",
- .nr_chips = 1,
-- .nr_partitions = ARRAY_SIZE(gta01_nand_part),
-- .partitions = gta01_nand_part,
- },
- };
-
+[PATCH] support mtd NAND commandline partitions for S3C2410
+
+This patch adds support for the mtd NAND core standard method of passing
+partition table information from the bootloader into the kernel by using
+the kernel commandline.
+
+The board specific code can still manually override and provide a fixed
+partition table, so this patch will behave backwards compatible.
+
+Signed-off-by: Harald Welte <laforge at openmoko.org>
+
--- linux-2.6.22.1.orig/drivers/mtd/nand/s3c2410.c
+++ linux-2.6.22.1/drivers/mtd/nand/s3c2410.c
@@ -547,17 +547,31 @@
Modified: branches/src/target/kernel/2.6.24.x/patches/gta01-pcf50606.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/gta01-pcf50606.patch 2007-12-13 08:28:30 UTC (rev 3648)
+++ branches/src/target/kernel/2.6.24.x/patches/gta01-pcf50606.patch 2007-12-14 11:17:24 UTC (rev 3649)
@@ -1,15 +1,19 @@
-This is the PCF50606 power management unit driver for FIC GTA01
+This is a NXP PCF50606 power management unit driver.
+The PCF50606 is used in the FIC/OpenMoko Neo1973 GTA01 GSM phone.
+
+Signed-off-by: Harald Welte <laforge at openmoko.org>
+
Index: linux-2.6/drivers/i2c/chips/pcf50606.c
===================================================================
--- /dev/null
+++ linux-2.6/drivers/i2c/chips/pcf50606.c
-@@ -0,0 +1,1929 @@
-+/* Philips PCF50606 Power Management Unit (PMU) driver
+@@ -0,0 +1,1935 @@
++/* Philips/NXP PCF50606 Power Management Unit (PMU) driver
+ *
-+ * (C) 2006 by OpenMoko, Inc.
-+ * Author: Harald Welte <laforge at openmoko.org> +
-+ * Matt Hsu <matt at openmoko.org>
++ * (C) 2006-2007 by OpenMoko, Inc.
++ * Authors: Harald Welte <laforge at openmoko.org>,
++ * Matt Hsu <matt at openmoko.org>
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
@@ -62,11 +66,12 @@
+
+#include "pcf50606.h"
+
-+#if 1
-+#define DEBUGP(x, args ...) printk("%s: " x, __FUNCTION__, ## args)
++/* we use dev_dbg() throughout the code, but sometimes don't want to
++ * write an entire line of debug related information. This DEBUGPC
++ * macro is a continuation for dev_dbg() */
++#ifdef DEBUG
+#define DEBUGPC(x, args ...) printk(x, ## args)
+#else
-+#define DEBUGP(x, args ...)
+#define DEBUGPC(x, args ...)
+#endif
+
@@ -126,8 +131,11 @@
+
+static struct i2c_driver pcf50606_driver;
+
++/* This is an ugly construct on how to access the (currently single/global)
++ * pcf50606 handle from other code in the kernel. I didn't really come up with
++ * a more decent method of dynamically resolving this */
+struct pcf50606_data *pcf50606_global;
-+EXPORT_SYMBOL(pcf50606_global);
++EXPORT_SYMBOL_GPL(pcf50606_global);
+
+static struct platform_device *pcf50606_pdev;
+
@@ -229,7 +237,7 @@
+ u_int8_t adcs2, adcs1;
+ u_int16_t ret;
+
-+ DEBUGP("entering (pcf=%p, channel=%u, data2=%p)\n",
++ dev_dbg(&pcf->client.dev, "entering (pcf=%p, channel=%u, data2=%p)\n",
+ pcf, channel, data2);
+
+ channel &= PCF50606_ADCC2_ADCMUX_MASK;
@@ -254,7 +262,8 @@
+
+ mutex_unlock(&pcf->lock);
+
-+ DEBUGP("returning %u %u\n", ret, data2 ? *data2 : 0);
++ dev_dbg(&pcf->client.dev, "returning %u %u\n", ret,
++ data2 ? *data2 : 0);
+
+ return ret;
+}
@@ -336,8 +345,6 @@
+
+static u_int8_t dx_voltage(unsigned int millivolts)
+{
-+ DEBUGP("(mvolts=%u)\n", millivolts);
-+
+ if (millivolts < 900)
+ return 0;
+ else if (millivolts > 3300)
@@ -385,7 +392,7 @@
+
+ return 0;
+}
-+EXPORT_SYMBOL(pcf50606_onoff_set);
++EXPORT_SYMBOL_GPL(pcf50606_onoff_set);
+
+int pcf50606_onoff_get(struct pcf50606_data *pcf,
+ enum pcf50606_regulator_id reg)
@@ -407,7 +414,7 @@
+ return 1;
+ }
+}
-+EXPORT_SYMBOL(pcf50606_onoff_get);
++EXPORT_SYMBOL_GPL(pcf50606_onoff_get);
+
+int pcf50606_voltage_set(struct pcf50606_data *pcf,
+ enum pcf50606_regulator_id reg,
@@ -417,7 +424,8 @@
+ u_int8_t regnr;
+ int rc;
+
-+ DEBUGP("pcf=%p, reg=%d, mvolts=%d\n", pcf, reg, millivolts);
++ dev_dbg(&pcf->client.dev, "pcf=%p, reg=%d, mvolts=%d\n", pcf, reg,
++ millivolts);
+
+ if (reg >= __NUM_PCF50606_REGULATORS)
+ return -EINVAL;
@@ -446,7 +454,6 @@
+ case PCF50606_REGULATOR_D3REG:
+ regnr = PCF50606_REG_D1REGC1 + (reg - PCF50606_REGULATOR_D1REG);
+ volt_bits = dx_voltage(millivolts);
-+ DEBUGP("dx_voltage(0x%x)=%u\n", millivolts, volt_bits);
+ rc = reg_set_bit_mask(pcf, regnr, 0x1f, volt_bits);
+ break;
+ case PCF50606_REGULATOR_LPREG:
@@ -467,7 +474,7 @@
+
+ return rc;
+}
-+EXPORT_SYMBOL(pcf50606_voltage_set);
++EXPORT_SYMBOL_GPL(pcf50606_voltage_set);
+
+unsigned int pcf50606_voltage_get(struct pcf50606_data *pcf,
+ enum pcf50606_regulator_id reg)
@@ -519,7 +526,7 @@
+
+ return rc;
+}
-+EXPORT_SYMBOL(pcf50606_voltage_get);
++EXPORT_SYMBOL_GPL(pcf50606_voltage_get);
+
+/* go into 'STANDBY' mode, i.e. power off the main CPU and peripherals */
+void pcf50606_go_standby(void)
@@ -527,7 +534,7 @@
+ reg_write(pcf50606_global, PCF50606_REG_OOCC1,
+ PCF50606_OOCC1_GOSTDBY);
+}
-+EXPORT_SYMBOL(pcf50606_go_standby);
++EXPORT_SYMBOL_GPL(pcf50606_go_standby);
+
+void pcf50606_gpo0_set(struct pcf50606_data *pcf, int on)
+{
@@ -540,7 +547,7 @@
+
+ reg_set_bit_mask(pcf, PCF50606_REG_GPOC1, 0x0f, val);
+}
-+EXPORT_SYMBOL(pcf50606_gpo0_set);
++EXPORT_SYMBOL_GPL(pcf50606_gpo0_set);
+
+int pcf50606_gpo0_get(struct pcf50606_data *pcf)
+{
@@ -551,7 +558,7 @@
+
+ return 0;
+}
-+EXPORT_SYMBOL(pcf50606_gpo0_get);
++EXPORT_SYMBOL_GPL(pcf50606_gpo0_get);
+
+static void pcf50606_work(struct work_struct *work)
+{
@@ -565,7 +572,8 @@
+ int2 = __reg_read(pcf, PCF50606_REG_INT2);
+ int3 = __reg_read(pcf, PCF50606_REG_INT3);
+
-+ DEBUGP("INT1=0x%02x INT2=0x%02x INT3=0x%02x:", int1, int2, int3);
++ dev_dbg(&pcf->client.dev, "INT1=0x%02x INT2=0x%02x INT3=0x%02x:",
++ int1, int2, int3);
+
+ if (int1 & PCF50606_INT1_ONKEYF) {
+ /* ONKEY falling edge (start of button press) */
@@ -613,8 +621,9 @@
+
+ if (pcf->onkey_seconds >= 0 &&
+ pcf->flags & PCF50606_F_PWR_PRESSED) {
-+ DEBUGP("ONKEY_SECONDS(%u, OOCC1=0x%02x) ",
-+ pcf->onkey_seconds, reg_read(pcf, PCF50606_REG_OOCC1));
++ DEBUGPC("ONKEY_SECONDS(%u, OOCC1=0x%02x) ",
++ pcf->onkey_seconds,
++ reg_read(pcf, PCF50606_REG_OOCC1));
+ pcf->onkey_seconds++;
+ if (pcf->onkey_seconds >=
+ pcf->pdata->onkey_seconds_required) {
@@ -641,8 +650,7 @@
+ if (pcf->pdata->cb)
+ pcf->pdata->cb(&pcf->client.dev,
+ PCF50606_FEAT_MBC, PMU_EVT_INSERT);
-+ /* FIXME: signal this to userspace */
-+ //kobject_uevent( ,KOBJ_ADD);
++ /* FIXME: how to signal this to userspace */
+ }
+ if (int2 & PCF50606_INT2_CHGRM) {
+ /* Charger removed */
@@ -653,28 +661,27 @@
+ if (pcf->pdata->cb)
+ pcf->pdata->cb(&pcf->client.dev,
+ PCF50606_FEAT_MBC, PMU_EVT_INSERT);
-+ /* FIXME: signal this to userspace */
-+ //kobject_uevent( ,KOBJ_REMOVE);
++ /* FIXME: how signal this to userspace */
+ }
+ if (int2 & PCF50606_INT2_CHGFOK) {
+ /* Battery ready for fast charging */
+ DEBUGPC("CHGFOK ");
+ pcf->flags |= PCF50606_F_CHG_FOK;
-+ /* FIXME: signal this to userspace */
++ /* FIXME: how to signal this to userspace */
+ }
+ if (int2 & PCF50606_INT2_CHGERR) {
+ /* Error in charge mode */
+ DEBUGPC("CHGERR ");
+ pcf->flags |= PCF50606_F_CHG_ERR;
+ pcf->flags &= ~(PCF50606_F_CHG_FOK|PCF50606_F_CHG_READY);
-+ /* FIXME: signal this to userspace */
++ /* FIXME: how to signal this to userspace */
+ }
+ if (int2 & PCF50606_INT2_CHGFRDY) {
+ /* Fast charge completed */
+ DEBUGPC("CHGFRDY ");
+ pcf->flags |= PCF50606_F_CHG_READY;
+ pcf->flags &= ~PCF50606_F_CHG_FOK;
-+ /* FIXME: signal this to userspace */
++ /* FIXME: how to signal this to userspace */
+ }
+ if (int2 & PCF50606_INT2_CHGPROT) {
+ /* Charging protection interrupt */
@@ -692,7 +699,7 @@
+ if (int2 & PCF50606_INT2_CHGWDEXP) {
+ /* Charger watchdog expires */
+ DEBUGPC("CHGWDEXP ");
-+ /* FIXME: signal this to userspace */
++ /* FIXME: how to signal this to userspace */
+ }
+
+ if (int3 & PCF50606_INT3_ADCRDY) {
@@ -701,14 +708,14 @@
+ }
+ if (int3 & PCF50606_INT3_ACDINS) {
+ /* Accessory insertion detected */
-+ DEBUGP("ACDINS ");
++ DEBUGPC("ACDINS ");
+ if (pcf->pdata->cb)
+ pcf->pdata->cb(&pcf->client.dev,
+ PCF50606_FEAT_ACD, PMU_EVT_INSERT);
+ }
+ if (int3 & PCF50606_INT3_ACDREM) {
+ /* Accessory removal detected */
-+ DEBUGP("ACDREM ");
++ DEBUGPC("ACDREM ");
+ if (pcf->pdata->cb)
+ pcf->pdata->cb(&pcf->client.dev,
+ PCF50606_FEAT_ACD, PMU_EVT_REMOVE);
@@ -755,7 +762,7 @@
+{
+ struct pcf50606_data *pcf = _pcf;
+
-+ DEBUGP("entering(irq=%u, pcf=%p): scheduling work\n",
++ dev_dbg(&pcf->client.dev, "entering(irq=%u, pcf=%p): scheduling work\n",
+ irq, _pcf);
+ pcf50606_schedule_work(pcf);
+
@@ -795,7 +802,7 @@
+
+ return adc_to_batt_millivolts(adc);
+}
-+EXPORT_SYMBOL(pcf50606_battvolt);
++EXPORT_SYMBOL_GPL(pcf50606_battvolt);
+
+static ssize_t show_battvolt(struct device *dev, struct device_attribute *attr,
+ char *buf)
@@ -862,8 +869,8 @@
+ if (reg_id < 0)
+ return -EIO;
+
-+ DEBUGP("attempting to set %s(%d) to %lu mvolts\n", attr->attr.name,
-+ reg_id, mvolts);
++ dev_dbg(dev, "attempting to set %s(%d) to %lu mvolts\n",
++ attr->attr.name, reg_id, mvolts);
+
+ if (mvolts == 0) {
+ pcf50606_onoff_set(pcf, reg_id, 0);
@@ -918,7 +925,7 @@
+ PCF50606_MBCC1_CHGMOD_IDLE);
+ }
+}
-+EXPORT_SYMBOL(pcf50606_charge_fast);
++EXPORT_SYMBOL_GPL(pcf50606_charge_fast);
+
+#define ONE 1000000
+static inline u_int16_t adc_to_rntc(struct pcf50606_data *pcf, u_int16_t adc)
@@ -1164,13 +1171,13 @@
+ pcf_tm.year = __reg_read(pcf, PCF50606_REG_RTCYR);
+ mutex_unlock(&pcf->lock);
+
-+ DEBUGP("PCF_TIME: %02x.%02x.%02x %02x:%02x:%02x\n",
++ dev_dbg(dev, "PCF_TIME: %02x.%02x.%02x %02x:%02x:%02x\n",
+ pcf_tm.day, pcf_tm.month, pcf_tm.year,
+ pcf_tm.hour, pcf_tm.min, pcf_tm.sec);
+
+ pcf2rtc_time(tm, &pcf_tm);
+
-+ DEBUGP("RTC_TIME: %u.%u.%u %u:%u:%u\n",
++ dev_dbg(dev, "RTC_TIME: %u.%u.%u %u:%u:%u\n",
+ tm->tm_mday, tm->tm_mon, tm->tm_year,
+ tm->tm_hour, tm->tm_min, tm->tm_sec);
+
@@ -1183,11 +1190,11 @@
+ struct pcf50606_data *pcf = i2c_get_clientdata(client);
+ struct pcf50606_time pcf_tm;
+
-+ DEBUGP("RTC_TIME: %u.%u.%u %u:%u:%u\n",
++ dev_dbg(dev, "RTC_TIME: %u.%u.%u %u:%u:%u\n",
+ tm->tm_mday, tm->tm_mon, tm->tm_year,
+ tm->tm_hour, tm->tm_min, tm->tm_sec);
+ rtc2pcf_time(&pcf_tm, tm);
-+ DEBUGP("PCF_TIME: %02x.%02x.%02x %02x:%02x:%02x\n",
++ dev_dbg(dev, "PCF_TIME: %02x.%02x.%02x %02x:%02x:%02x\n",
+ pcf_tm.day, pcf_tm.month, pcf_tm.year,
+ pcf_tm.hour, pcf_tm.min, pcf_tm.sec);
+
@@ -1419,7 +1426,7 @@
+
+ for (i = 0; i < ARRAY_SIZE(pwm_dc_table); i++) {
+ if (!strncmp(buf, pwm_dc_table[i], strlen(pwm_dc_table[i]))) {
-+ DEBUGP("setting pwm dc %s\n\r", pwm_dc_table[i]);
++ dev_dbg(dev, "setting pwm dc %s\n\r", pwm_dc_table[i]);
+ reg_set_bit_mask(pcf, PCF50606_REG_PWMC1, 0x1e,
+ (i << PCF50606_PWMC1_DC_SHIFT));
+ }
@@ -1456,7 +1463,8 @@
+
+ for (i = 0; i < ARRAY_SIZE(pwm_clk_table); i++) {
+ if (!strncmp(buf, pwm_clk_table[i], strlen(pwm_clk_table[i]))) {
-+ DEBUGP("setting pwm clk %s\n\r", pwm_clk_table[i]);
++ dev_dbg(dev, "setting pwm clk %s\n\r",
++ pwm_clk_table[i]);
+ reg_set_bit_mask(pcf, PCF50606_REG_PWMC1, 0xe0,
+ (i << PCF50606_PWMC1_CLK_SHIFT));
+ }
@@ -1502,11 +1510,11 @@
+/* We currently place those platform devices here to make sure the device
+ * suspend/resume order is correct */
+static struct platform_device gta01_pm_gps_dev = {
-+ .name ="gta01-pm-gps",
++ .name = "neo1973-pm-gps",
+};
+
+static struct platform_device gta01_pm_bt_dev = {
-+ .name ="gta01-pm-bt",
++ .name = "neo1973-pm-bt",
+};
+#endif
+
@@ -1562,7 +1570,6 @@
+ int err = 0;
+ int irq;
+
-+ DEBUGP("entering\n");
+ if (!pcf50606_pdev) {
+ printk(KERN_ERR "pcf50606: driver needs a platform_device!\n");
+ return -EIO;
@@ -1624,7 +1631,7 @@
+ goto exit_sysfs;
+
+ data->input_dev->name = "FIC Neo1973 PMU events";
-+ data->input_dev->phys = "FIXME";
++ data->input_dev->phys = "I2C";
+ data->input_dev->id.bustype = BUS_I2C;
+ data->input_dev->cdev.dev = &new_client->dev;
+
@@ -1633,7 +1640,9 @@
+ set_bit(KEY_POWER2, data->input_dev->keybit);
+ set_bit(KEY_BATTERY, data->input_dev->keybit);
+
-+ input_register_device(data->input_dev);
++ err = input_register_device(data->input_dev);
++ if (err)
++ goto exit_sysfs;
+
+ /* register power off handler with core power management */
+ pm_power_off = &pcf50606_go_standby;
@@ -1688,7 +1697,6 @@
+ &pcf50606bl_ops);
+ if (!data->backlight)
+ goto exit_misc;
-+ /* FIXME: are we sure we want default == off? */
+ data->backlight->props.max_brightness = 16;
+ data->backlight->props.power = FB_BLANK_UNBLANK;
+ data->backlight->props.brightness =
@@ -1721,9 +1729,7 @@
+ PCF50606_ACDC1_ACDAPE);
+
+ return 0;
-+exit_pwm:
-+ if (data->pdata->used_features & PCF50606_FEAT_PWM_BL)
-+ backlight_device_unregister(data->backlight);
++
+exit_misc:
+ if (data->pdata->used_features & PCF50606_FEAT_WDT)
+ misc_deregister(&pcf50606_wdt_miscdev);
@@ -1747,7 +1753,6 @@
+
+static int pcf50606_attach_adapter(struct i2c_adapter *adapter)
+{
-+ DEBUGP("entering, calling i2c_probe\n");
+ return i2c_probe(adapter, &addr_data, &pcf50606_detect);
+}
+
@@ -1755,8 +1760,6 @@
+{
+ struct pcf50606_data *pcf = i2c_get_clientdata(client);
+
-+ DEBUGP("entering\n");
-+
+ apm_get_power_status = NULL;
+ input_unregister_device(pcf->input_dev);
+
@@ -1781,9 +1784,15 @@
+}
+
+#ifdef CONFIG_PM
-+#define INT1M_RESUMERS (PCF50606_INT1_ALARM|PCF50606_INT1_ONKEYF|PCF50606_INT1_EXTONR)
-+#define INT2M_RESUMERS (PCF50606_INT2_CHGWD10S|PCF50606_INT2_CHGPROT|PCF50606_INT2_CHGERR)
-+#define INT3M_RESUMERS (PCF50606_INT3_LOWBAT|PCF50606_INT3_HIGHTMP|PCF50606_INT3_ACDINS)
++#define INT1M_RESUMERS (PCF50606_INT1_ALARM | \
++ PCF50606_INT1_ONKEYF | \
++ PCF50606_INT1_EXTONR)
++#define INT2M_RESUMERS (PCF50606_INT2_CHGWD10S | \
++ PCF50606_INT2_CHGPROT | \
++ PCF50606_INT2_CHGERR)
++#define INT3M_RESUMERS (PCF50606_INT3_LOWBAT | \
++ PCF50606_INT3_HIGHTMP | \
++ PCF50606_INT3_ACDINS)
+static int pcf50606_suspend(struct device *dev, pm_message_t state)
+{
+ struct i2c_client *client = to_i2c_client(dev);
@@ -1820,7 +1829,7 @@
+ if (i == PCF50606_REGULATOR_IOREG)
+ continue;
+
-+ DEBUGP("disabling pcf50606 regulator %u\n", i);
++ dev_dbg(dev, "disabling pcf50606 regulator %u\n", i);
+ /* we cannot use pcf50606_onoff_set() because we're
+ * already under the mutex */
+ tmp = __reg_read(pcf, regulator_registers[i]);
@@ -1929,6 +1938,7 @@
+ platform_driver_unregister(&pcf50606_plat_driver);
+}
+
++MODULE_DESCRIPTION("I2C chip driver for NXP PCF50606 power management unit");
+MODULE_AUTHOR("Harald Welte <laforge at openmoko.org>");
+MODULE_LICENSE("GPL");
+
@@ -2250,10 +2260,10 @@
will be called eeprom.
+config SENSORS_PCF50606
-+ tristate "Philips PCF50606"
++ tristate "Philips/NXP PCF50606"
+ depends on I2C
+ help
-+ If you say yes here you get support for Philips PCF50606
++ If you say yes here you get support for Philips/NXP PCF50606
+ PMU (Power Management Unit) chips.
+
+ This driver can also be built as a module. If so, the module
@@ -2291,7 +2301,7 @@
===================================================================
--- /dev/null
+++ linux-2.6/include/linux/pcf50606.h
-@@ -0,0 +1,104 @@
+@@ -0,0 +1,108 @@
+#ifndef _LINUX_PCF50606_H
+#define _LINUX_PCF50606_H
+
@@ -2309,6 +2319,10 @@
+};
+
+struct pcf50606_data;
++
++/* This is an ugly construct on how to access the (currently single/global)
++ * pcf50606 handle from other code in the kernel. I didn't really come up with
++ * a more decent method of dynamically resolving this */
+extern struct pcf50606_data *pcf50606_global;
+
+extern void
Modified: branches/src/target/kernel/2.6.24.x/patches/gta01-power_control.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/gta01-power_control.patch 2007-12-13 08:28:30 UTC (rev 3648)
+++ branches/src/target/kernel/2.6.24.x/patches/gta01-power_control.patch 2007-12-14 11:17:24 UTC (rev 3649)
@@ -1,16 +1,16 @@
-Index: linux-2.6/arch/arm/common/Makefile
+Index: linux-2.6/arch/arm/plat-s3c24xx/Makefile
===================================================================
---- linux-2.6.orig/arch/arm/common/Makefile
-+++ linux-2.6/arch/arm/common/Makefile
-@@ -18,3 +18,4 @@
- obj-$(CONFIG_ARCH_IXP2000) += uengine.o
- obj-$(CONFIG_ARCH_IXP23XX) += uengine.o
- obj-$(CONFIG_PCI_HOST_ITE8152) += it8152.o
-+obj-$(CONFIG_MACH_NEO1973_GTA01)+= gta01_pm_gsm.o gta01_pm_gps.o gta01_pm_bt.o
-Index: linux-2.6/arch/arm/common/gta01_pm_gps.c
+--- linux-2.6.orig/arch/arm/plat-s3c24xx/Makefile
++++ linux-2.6/arch/arm/plat-s3c24xx/Makefile
+@@ -28,3 +28,4 @@
+ obj-$(CONFIG_PM) += sleep.o
+ obj-$(CONFIG_S3C2410_DMA) += dma.o
+ obj-$(CONFIG_MACH_SMDK) += common-smdk.o
++obj-$(CONFIG_MACH_NEO1973) += neo1973_pm_gsm.o neo1973_pm_gps.o neo1973_pm_bt.o
+Index: linux-2.6/arch/arm/plat-s3c24xx/neo1973_pm_gps.c
===================================================================
--- /dev/null
-+++ linux-2.6/arch/arm/common/gta01_pm_gps.c
++++ linux-2.6/arch/arm/plat-s3c24xx/neo1973_pm_gps.c
@@ -0,0 +1,558 @@
+/*
+ * GPS Power Management code for the FIC Neo1973 GSM Phone
@@ -550,7 +550,7 @@
+ .suspend = gta01_pm_gps_suspend,
+ .resume = gta01_pm_gps_resume,
+ .driver = {
-+ .name = "gta01-pm-gps",
++ .name = "neo1973-pm-gps",
+ },
+};
+
@@ -569,11 +569,11 @@
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Harald Welte <laforge at openmoko.org>");
-+MODULE_DESCRIPTION("FIC GTA01 (Neo1973) GPS Power Management");
-Index: linux-2.6/arch/arm/common/gta01_pm_gsm.c
++MODULE_DESCRIPTION("FIC Neo1973 GPS Power Management");
+Index: linux-2.6/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
===================================================================
--- /dev/null
-+++ linux-2.6/arch/arm/common/gta01_pm_gsm.c
++++ linux-2.6/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
@@ -0,0 +1,217 @@
+/*
+ * GSM Management code for the FIC Neo1973 GSM Phone
@@ -772,7 +772,7 @@
+ .suspend = gta01_gsm_suspend,
+ .resume = gta01_gsm_resume,
+ .driver = {
-+ .name = "gta01-pm-gsm",
++ .name = "neo1973-pm-gsm",
+ },
+};
+
@@ -791,12 +791,12 @@
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Harald Welte <laforge at openmoko.org>");
-+MODULE_DESCRIPTION("FIC GTA01 (Neo1973) GSM Management");
-Index: linux-2.6/arch/arm/common/gta01_pm_bt.c
++MODULE_DESCRIPTION("FIC Neo1973 GSM Power Management");
+Index: linux-2.6/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
===================================================================
--- /dev/null
-+++ linux-2.6/arch/arm/common/gta01_pm_bt.c
-@@ -0,0 +1,154 @@
++++ linux-2.6/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
+@@ -0,0 +1,152 @@
+/*
+ * Bluetooth PM code for the FIC Neo1973 GSM Phone
+ *
@@ -820,7 +820,7 @@
+#include <asm/hardware.h>
+#include <asm/arch/gta01.h>
+
-+#define DRVMSG "FIC GTA01 (Neo1973) Bluetooth Power Management"
++#define DRVMSG "FIC Neo1973 Bluetooth Power Management"
+
+static ssize_t bt_read(struct device *dev, struct device_attribute *attr,
+ char *buf)
@@ -872,7 +872,7 @@
+#ifdef CONFIG_PM
+static int gta01_bt_suspend(struct platform_device *pdev, pm_message_t state)
+{
-+ dev_info(&pdev->dev, DRVMSG ": suspending\n");
++ dev_dbg(&pdev->dev, DRVMSG ": suspending\n");
+ /* FIXME: The PMU should save the PMU status, and the GPIO code should
+ * preserve the GPIO level, so there shouldn't be anything left to do
+ * for us, should there? */
@@ -882,7 +882,7 @@
+
+static int gta01_bt_resume(struct platform_device *pdev)
+{
-+ dev_info(&pdev->dev, DRVMSG ": resuming\n");
++ dev_dbg(&pdev->dev, DRVMSG ": resuming\n");
+
+ return 0;
+}
@@ -918,8 +918,6 @@
+
+static int gta01_bt_remove(struct platform_device *pdev)
+{
-+ dev_info(&pdev->dev, DRVMSG ": ending\n");
-+
+ sysfs_remove_group(&pdev->dev.kobj, >a01_bt_attr_group);
+
+ return 0;
@@ -931,7 +929,7 @@
+ .suspend = gta01_bt_suspend,
+ .resume = gta01_bt_resume,
+ .driver = {
-+ .name = "gta01-pm-bt",
++ .name = "neo1973-pm-bt",
+ },
+};
+
Modified: branches/src/target/kernel/2.6.24.x/patches/gta01-vibrator.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/gta01-vibrator.patch 2007-12-13 08:28:30 UTC (rev 3648)
+++ branches/src/target/kernel/2.6.24.x/patches/gta01-vibrator.patch 2007-12-14 11:17:24 UTC (rev 3649)
@@ -1,14 +1,54 @@
-This patch adds driver support for the FIC GTA01 vibrator device. The driver
-uses the existing LED class driver framework, since there's a lot of
-similarity between the LED and the vibrator function.
+This patch adds driver support for the vibator device of the FIC/OpenMoko
+Neo1973 GSM phone. The driver uses the existing LED class driver framework,
+since there's a lot of similarity between the LED and the vibrator function.
-Index: linux-2.6/drivers/leds/leds-gta01.c
+Signed-off-by: Harald Welte <laforge at openmoko.org>
+
+Index: linux-2.6/drivers/leds/Kconfig
===================================================================
+--- linux-2.6.orig/drivers/leds/Kconfig
++++ linux-2.6/drivers/leds/Kconfig
+@@ -57,7 +57,7 @@
+
+ config LEDS_S3C24XX
+ tristate "LED Support for Samsung S3C24XX GPIO LEDs"
+- depends on LEDS_CLASS && ARCH_S3C2410
++ depends on LEDS_CLASS && ARCH_S3C2410 && S3C2410_PWM
+ help
+ This option enables support for LEDs connected to GPIO lines
+ on Samsung S3C24XX series CPUs, such as the S3C2410 and S3C2440.
+@@ -114,6 +114,12 @@
+ help
+ This option enables support for the CM-X270 LEDs.
+
++config LEDS_NEO1973_VIBRATOR
++ tristate "Vibrator Support for the FIC Neo1973 GSM phone"
++ depends on LEDS_CLASS && MACH_NEO1973
++ help
++ This option enables support for the vibrator on the FIC Neo1973.
++
+ comment "LED Triggers"
+
+ config LEDS_TRIGGERS
+Index: linux-2.6/drivers/leds/Makefile
+===================================================================
+--- linux-2.6.orig/drivers/leds/Makefile
++++ linux-2.6/drivers/leds/Makefile
+@@ -19,6 +19,7 @@
+ obj-$(CONFIG_LEDS_COBALT_RAQ) += leds-cobalt-raq.o
+ obj-$(CONFIG_LEDS_GPIO) += leds-gpio.o
+ obj-$(CONFIG_LEDS_CM_X270) += leds-cm-x270.o
++obj-$(CONFIG_LEDS_NEO1973_VIBRATOR) += leds-neo1973-vibrator.o
+
+ # LED Triggers
+ obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o
+Index: linux-2.6/drivers/leds/leds-neo1973-vibrator.c
+===================================================================
--- /dev/null
-+++ linux-2.6/drivers/leds/leds-gta01.c
-@@ -0,0 +1,177 @@
++++ linux-2.6/drivers/leds/leds-neo1973-vibrator.c
+@@ -0,0 +1,178 @@
+/*
-+ * LED driver for the FIC GTA01 (Neo1973) GSM Phone Vibrator
++ * LED driver for the vibrator of the FIC Neo1973 GSM Phone
+ *
+ * (C) 2006-2007 by OpenMoko, Inc.
+ * Author: Harald Welte <laforge at openmoko.org>
@@ -70,7 +110,7 @@
+static struct gta01_vib_priv gta01_vib_led = {
+ .cdev = {
+ .name = "gta01:vibrator",
-+ .brightness_set = gta01vib_vib_set,
++ .brightness_set = gta01vib_vib_set,
+ },
+};
+
@@ -165,7 +205,7 @@
+ .resume = gta01vib_resume,
+#endif
+ .driver = {
-+ .name = "gta01-led",
++ .name = "neo1973-vibrator",
+ },
+};
+
@@ -183,42 +223,5 @@
+module_exit(gta01vib_exit);
+
+MODULE_AUTHOR("Harald Welte <laforge at openmoko.org>");
-+MODULE_DESCRIPTION("FIC GTA01 Vibrator driver");
-Index: linux-2.6/drivers/leds/Kconfig
-===================================================================
---- linux-2.6.orig/drivers/leds/Kconfig
-+++ linux-2.6/drivers/leds/Kconfig
-@@ -57,7 +57,7 @@
-
- config LEDS_S3C24XX
- tristate "LED Support for Samsung S3C24XX GPIO LEDs"
-- depends on LEDS_CLASS && ARCH_S3C2410
-+ depends on LEDS_CLASS && ARCH_S3C2410 && S3C2410_PWM
- help
- This option enables support for LEDs connected to GPIO lines
- on Samsung S3C24XX series CPUs, such as the S3C2410 and S3C2440.
-@@ -114,6 +114,12 @@
- help
- This option enables support for the CM-X270 LEDs.
-
-+config LEDS_GTA01
-+ tristate "Vibrator Support for the FIC Neo1973 (GTA01) Vibrator"
-+ depends on LEDS_CLASS && MACH_NEO1973_GTA01
-+ help
-+ This option enables support for the Vibrator on the FIC Neo1973.
-+
- comment "LED Triggers"
-
- config LEDS_TRIGGERS
-Index: linux-2.6/drivers/leds/Makefile
-===================================================================
---- linux-2.6.orig/drivers/leds/Makefile
-+++ linux-2.6/drivers/leds/Makefile
-@@ -19,6 +19,7 @@
- obj-$(CONFIG_LEDS_COBALT_RAQ) += leds-cobalt-raq.o
- obj-$(CONFIG_LEDS_GPIO) += leds-gpio.o
- obj-$(CONFIG_LEDS_CM_X270) += leds-cm-x270.o
-+obj-$(CONFIG_LEDS_GTA01) += leds-gta01.o
-
- # LED Triggers
- obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o
++MODULE_DESCRIPTION("FIC Neo1973 vibrator driver");
++MODULE_LICENSE("GPL");
Modified: branches/src/target/kernel/2.6.24.x/patches/gta02-core.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/gta02-core.patch 2007-12-13 08:28:30 UTC (rev 3648)
+++ branches/src/target/kernel/2.6.24.x/patches/gta02-core.patch 2007-12-14 11:17:24 UTC (rev 3649)
@@ -2,7 +2,7 @@
===================================================================
--- /dev/null
+++ linux-2.6/arch/arm/mach-s3c2440/mach-gta02.c
-@@ -0,0 +1,663 @@
+@@ -0,0 +1,667 @@
+/*
+ * linux/arch/arm/mach-s3c2440/mach-gta02.c
+ *
@@ -393,7 +393,7 @@
+static void __gta02_udc_vbus_draw(struct work_struct *work)
+{
+ if (!pcf50633_global) {
-+ printk(KERN_ERR, "pcf50633 not initialized yet, can't change "
++ printk(KERN_ERR "pcf50633 not initialized yet, can't change "
+ "vbus_draw\n");
+ return;
+ }
@@ -497,13 +497,13 @@
+};
+
+static struct platform_device gta01_button_dev = {
-+ .name = "gta01-button",
++ .name = "neo1973-button",
+ .num_resources = ARRAY_SIZE(gta01_button_resources),
+ .resource = gta01_button_resources,
+};
+
+static struct platform_device gta01_pm_gsm_dev = {
-+ .name = "gta01-pm-gsm",
++ .name = "neo1973-pm-gsm",
+};
+
+/* USB */
@@ -600,6 +600,8 @@
+
+static void __init gta02_machine_init(void)
+{
++ int rc;
++
+ s3c_device_usb.dev.platform_data = >a02_usb_info;
+ s3c_device_nand.dev.platform_data = >a02_nand_info;
+ s3c_device_sdi.dev.platform_data = >a02_mmc_cfg;
@@ -652,8 +654,10 @@
+
+ /* Make sure the modem can wake us up */
+ set_irq_type(GTA02_IRQ_MODEM, IRQT_RISING);
-+ request_irq(GTA02_IRQ_MODEM, gta02_modem_irq, IRQF_DISABLED, "modem",
-+ NULL);
++ rc = request_irq(GTA02_IRQ_MODEM, gta02_modem_irq, IRQF_DISABLED,
++ "modem", NULL);
++ if (rc < 0)
++ printk(KERN_ERR "GTA02: can't request GSM modem wakeup IRQ\n");
+ enable_irq_wake(GTA02_IRQ_MODEM);
+}
+
@@ -802,11 +806,11 @@
obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o
obj-$(CONFIG_MACH_HXD8) += mach-hxd8.o
+obj-$(CONFIG_MACH_NEO1973_GTA02) += mach-gta02.o
-Index: linux-2.6/arch/arm/common/gta01_pm_bt.c
+Index: linux-2.6/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
===================================================================
---- linux-2.6.orig/arch/arm/common/gta01_pm_bt.c
-+++ linux-2.6/arch/arm/common/gta01_pm_bt.c
-@@ -19,22 +19,40 @@
+--- linux-2.6.orig/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
++++ linux-2.6/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
+@@ -19,7 +19,9 @@
#include <linux/pcf50606.h>
#include <asm/hardware.h>
@@ -814,10 +818,9 @@
#include <asm/arch/gta01.h>
+#include <asm/arch/gta02.h>
--#define DRVMSG "FIC GTA01 (Neo1973) Bluetooth Power Management"
-+#define DRVMSG "FIC Neo1973 Bluetooth Power Management"
+ #define DRVMSG "FIC Neo1973 Bluetooth Power Management"
- static ssize_t bt_read(struct device *dev, struct device_attribute *attr,
+@@ -27,14 +29,30 @@
char *buf)
{
if (!strcmp(attr->attr.name, "power_on")) {
@@ -924,10 +927,10 @@
/* we pull reset to low to make sure that the chip doesn't
* drain power through the reset line */
s3c2410_gpio_setpin(GTA01_GPIO_BT_EN, 0);
-Index: linux-2.6/arch/arm/common/gta01_pm_gsm.c
+Index: linux-2.6/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
===================================================================
---- linux-2.6.orig/arch/arm/common/gta01_pm_gsm.c
-+++ linux-2.6/arch/arm/common/gta01_pm_gsm.c
+--- linux-2.6.orig/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
++++ linux-2.6/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
@@ -19,8 +19,14 @@
#include <linux/errno.h>
@@ -1030,16 +1033,10 @@
return sysfs_create_group(&pdev->dev.kobj, >a01_gsm_attr_group);
}
-@@ -214,4 +250,4 @@
-
- MODULE_LICENSE("GPL");
- MODULE_AUTHOR("Harald Welte <laforge at openmoko.org>");
--MODULE_DESCRIPTION("FIC GTA01 (Neo1973) GSM Management");
-+MODULE_DESCRIPTION("FIC Neo1973 GSM Power Management");
-Index: linux-2.6/drivers/leds/leds-gta01.c
+Index: linux-2.6/drivers/leds/leds-neo1973-vibrator.c
===================================================================
---- linux-2.6.orig/drivers/leds/leds-gta01.c
-+++ linux-2.6/drivers/leds/leds-gta01.c
+--- linux-2.6.orig/drivers/leds/leds-neo1973-vibrator.c
++++ linux-2.6/drivers/leds/leds-neo1973-vibrator.c
@@ -110,7 +110,7 @@
struct resource *r;
int rc;
Modified: branches/src/target/kernel/2.6.24.x/patches/gta02-leds.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/gta02-leds.patch 2007-12-13 08:28:30 UTC (rev 3648)
+++ branches/src/target/kernel/2.6.24.x/patches/gta02-leds.patch 2007-12-14 11:17:24 UTC (rev 3649)
@@ -4,9 +4,9 @@
+++ linux-2.6/drivers/leds/Kconfig
@@ -120,6 +120,12 @@
help
- This option enables support for the Vibrator on the FIC Neo1973.
+ This option enables support for the vibrator on the FIC Neo1973.
-+config LEDS_GTA02
++config LEDS_NEO1973_GTA02
+ tristate "LED Support for the FIC Neo1973 (GTA02)"
+ depends on LEDS_CLASS && MACH_NEO1973_GTA02
+ help
@@ -22,18 +22,18 @@
@@ -20,6 +20,7 @@
obj-$(CONFIG_LEDS_GPIO) += leds-gpio.o
obj-$(CONFIG_LEDS_CM_X270) += leds-cm-x270.o
- obj-$(CONFIG_LEDS_GTA01) += leds-gta01.o
-+obj-$(CONFIG_LEDS_GTA02) += leds-gta02.o
+ obj-$(CONFIG_LEDS_NEO1973_VIBRATOR) += leds-neo1973-vibrator.o
++obj-$(CONFIG_LEDS_NEO1973_GTA02) += leds-neo1973-gta02.o
# LED Triggers
obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o
-Index: linux-2.6/drivers/leds/leds-gta02.c
+Index: linux-2.6/drivers/leds/leds-neo1973-gta02.c
===================================================================
--- /dev/null
-+++ linux-2.6/drivers/leds/leds-gta02.c
++++ linux-2.6/drivers/leds/leds-neo1973-gta02.c
@@ -0,0 +1,216 @@
+/*
-+ * LED driver for the FIC GTA02 (Neo1973) GSM Phone
++ * LED driver for the FIC Neo1973 GTA02 GSM phone
+ *
+ * (C) 2006-2007 by OpenMoko, Inc.
+ * Author: Harald Welte <laforge at openmoko.org>
@@ -246,5 +246,5 @@
+module_exit(gta02led_exit);
+
+MODULE_AUTHOR("Harald Welte <laforge at openmoko.org>");
-+MODULE_DESCRIPTION("FIC GTA02 LED driver");
++MODULE_DESCRIPTION("FIC Neo1973 GTA02 LED driver");
+MODULE_LICENSE("GPL");
Modified: branches/src/target/kernel/2.6.24.x/patches/hxd8-core.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/hxd8-core.patch 2007-12-13 08:28:30 UTC (rev 3648)
+++ branches/src/target/kernel/2.6.24.x/patches/hxd8-core.patch 2007-12-14 11:17:24 UTC (rev 3649)
@@ -29,7 +29,7 @@
===================================================================
--- /dev/null
+++ linux-2.6/arch/arm/mach-s3c2440/mach-hxd8.c
-@@ -0,0 +1,380 @@
+@@ -0,0 +1,378 @@
+/* linux/arch/arm/mach-s3c2440/mach-hxd8.c
+ *
+ * S3C2440 Machine Support for the FIC HXD8
@@ -310,7 +310,7 @@
+};
+
+static struct platform_device hxd8_pm_gsm_dev = {
-+ .name = "gta01-pm-gsm",
++ .name = "neo1973-pm-gsm",
+};
+
+static void gta01_udc_command(enum s3c2410_udc_cmd_e cmd)
@@ -334,7 +334,7 @@
+
+/* USB Charger */
+
-+static int hxd8_udc_vbus_draw(unsigned int ma)
++static void hxd8_udc_vbus_draw(unsigned int ma)
+{
+ if (ma >= 500) {
+ /* enable fast charge */
@@ -345,8 +345,6 @@
+ printk(KERN_DEBUG "udc: disabling fast charge\n");
+ s3c2410_gpio_setpin(HXD8_GPIO_USB_CUR_SEL, 0);
+ }
-+
-+ return 0;
+}
+
+static struct s3c2410_udc_mach_info hxd8_udc_cfg = {
Modified: branches/src/target/kernel/2.6.24.x/patches/lis302dl.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/lis302dl.patch 2007-12-13 08:28:30 UTC (rev 3648)
+++ branches/src/target/kernel/2.6.24.x/patches/lis302dl.patch 2007-12-14 11:17:24 UTC (rev 3649)
@@ -2,11 +2,11 @@
Signed-off-by: Harald Welte <laforge at openmoko.org>
-Index: linux-2.6.22.5-moko/arch/arm/mach-s3c2440/mach-gta02.c
+Index: linux-2.6/arch/arm/mach-s3c2440/mach-gta02.c
===================================================================
---- linux-2.6.22.5-moko.orig/arch/arm/mach-s3c2440/mach-gta02.c
-+++ linux-2.6.22.5-moko/arch/arm/mach-s3c2440/mach-gta02.c
-@@ -44,6 +44,7 @@
+--- linux-2.6.orig/arch/arm/mach-s3c2440/mach-gta02.c
++++ linux-2.6/arch/arm/mach-s3c2440/mach-gta02.c
+@@ -45,6 +45,7 @@
#include <linux/mtd/partitions.h>
#include <linux/pcf50633.h>
@@ -14,7 +14,7 @@
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
-@@ -403,7 +404,7 @@
+@@ -413,7 +414,7 @@
.oversampling_shift = 5,
};
@@ -23,8 +23,8 @@
static struct spi_board_info gta02_spi_board_info[] __initdata = {
{
-@@ -431,6 +432,48 @@
- .board_info = gta02_spi_board_info,
+@@ -454,6 +455,48 @@
+ .resource = gta01_led_resources,
};
+/* SPI: Accelerometers attached to SPI of s3c244x */
@@ -66,24 +66,24 @@
+static struct s3c2410_spi_info gta02_spi_acc_cfg = {
+ .set_cs = gta02_spi_acc_set_cs,
+ .board_size = ARRAY_SIZE(gta02_spi_acc_bdinfo),
-+ .board_info = >a02_spi_acc_bdinfo,
++ .board_info = gta02_spi_acc_bdinfo,
+};
+
static struct resource gta02_led_resources[] = {
- [0] = {
- .start = GTA02_GPIO_VIBRATOR_ON,
-@@ -560,6 +603,7 @@
+ {
+ .name = "gta02-power:orange",
+@@ -600,6 +643,7 @@
s3c_device_usb.dev.platform_data = >a02_usb_info;
s3c_device_nand.dev.platform_data = >a02_nand_info;
s3c_device_sdi.dev.platform_data = >a02_mmc_cfg;
+ s3c_device_spi1.dev.platform_data = >a02_spi_acc_cfg;
- INIT_WORK(>a02_udc_vbus_drawer.work, __gta02_udc_vbus_draw);
- s3c24xx_udc_set_platdata(>a02_udc_cfg);
-Index: linux-2.6.22.5-moko/drivers/spi/lis302dl.c
+ /* Only GTA02v1 has a SD_DETECT GPIO. Since the slot is not
+ * hot-pluggable, this is not required anyway */
+Index: linux-2.6/drivers/spi/lis302dl.c
===================================================================
--- /dev/null
-+++ linux-2.6.22.5-moko/drivers/spi/lis302dl.c
++++ linux-2.6/drivers/spi/lis302dl.c
@@ -0,0 +1,633 @@
+/* Linux kernel driver for the ST LIS302D 3-axis accelerometer
+ *
@@ -718,13 +718,13 @@
+
+module_init(lis302dl_init);
+module_exit(lis302dl_exit);
-Index: linux-2.6.22.5-moko/drivers/spi/Kconfig
+Index: linux-2.6/drivers/spi/Kconfig
===================================================================
---- linux-2.6.22.5-moko.orig/drivers/spi/Kconfig
-+++ linux-2.6.22.5-moko/drivers/spi/Kconfig
-@@ -197,5 +197,9 @@
- tristate "tpo JP6K74 LCM ASIC"
- depends on SPI_MASTER && (MACH_NEO1973_GTA01 || MACH_QT2410)
+--- linux-2.6.orig/drivers/spi/Kconfig
++++ linux-2.6/drivers/spi/Kconfig
+@@ -243,5 +243,9 @@
+ help
+ Driver for the tpo JP6K74-AS LCM SPI control interface.
+config SPI_SLAVE_LIS302DL
+ tristate "STmicro LIS302DL 3-axis accelerometer"
@@ -732,20 +732,20 @@
+
endmenu # "SPI support"
-Index: linux-2.6.22.5-moko/drivers/spi/Makefile
+Index: linux-2.6/drivers/spi/Makefile
===================================================================
---- linux-2.6.22.5-moko.orig/drivers/spi/Makefile
-+++ linux-2.6.22.5-moko/drivers/spi/Makefile
-@@ -35,4 +35,5 @@
+--- linux-2.6.orig/drivers/spi/Makefile
++++ linux-2.6/drivers/spi/Makefile
+@@ -40,4 +40,5 @@
# SPI slave drivers (protocol for that link)
obj-$(CONFIG_SPI_SLAVE_JBT6K74) += jbt6k74.o
+obj-$(CONFIG_SPI_SLAVE_LIS302DL) += lis302dl.o
# ... add above this line ...
-Index: linux-2.6.22.5-moko/include/linux/lis302dl.h
+Index: linux-2.6/include/linux/lis302dl.h
===================================================================
--- /dev/null
-+++ linux-2.6.22.5-moko/include/linux/lis302dl.h
++++ linux-2.6/include/linux/lis302dl.h
@@ -0,0 +1,11 @@
+#ifndef _LINUX_LIS302DL_H
+#define _LINUX_LIS302DL_H
Modified: branches/src/target/kernel/2.6.24.x/patches/pcf50633.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/pcf50633.patch 2007-12-13 08:28:30 UTC (rev 3648)
+++ branches/src/target/kernel/2.6.24.x/patches/pcf50633.patch 2007-12-14 11:17:24 UTC (rev 3649)
@@ -1334,11 +1334,11 @@
+/* We currently place those platform devices here to make sure the device
+ * suspend/resume order is correct */
+static struct platform_device gta01_pm_gps_dev = {
-+ .name ="gta01-pm-gps",
++ .name = "neo1973-pm-gps",
+};
+
+static struct platform_device gta01_pm_bt_dev = {
-+ .name ="gta01-pm-bt",
++ .name = "neo1973-pm-bt",
+};
+#endif
+
@@ -1469,7 +1469,9 @@
+ set_bit(KEY_POWER2, data->input_dev->keybit);
+ set_bit(KEY_BATTERY, data->input_dev->keybit);
+
-+ input_register_device(data->input_dev);
++ err = input_register_device(data->input_dev);
++ if (err)
++ goto exit_sysfs;
+
+ /* configure interrupt mask */
+ reg_write(data, PCF50633_REG_INT1M, PCF50633_INT1_SECOND);
@@ -1526,9 +1528,6 @@
+#endif
+
+ return 0;
-+exit_pwm:
-+ if (data->pdata->used_features & PCF50633_FEAT_PWM_BL)
-+ backlight_device_unregister(data->backlight);
+exit_rtc:
+ if (data->pdata->used_features & PCF50633_FEAT_RTC)
+ rtc_device_unregister(pcf50633_global->rtc);
@@ -1766,6 +1765,7 @@
+ platform_driver_unregister(&pcf50633_plat_driver);
+}
+
++MODULE_DESCRIPTION("I2C chip driver for NXP PCF50633 power management unit");
+MODULE_AUTHOR("Harald Welte <laforge at openmoko.org>");
+MODULE_LICENSE("GPL");
+
Deleted: branches/src/target/kernel/2.6.24.x/patches/qt2410-base.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/qt2410-base.patch 2007-12-13 08:28:30 UTC (rev 3648)
+++ branches/src/target/kernel/2.6.24.x/patches/qt2410-base.patch 2007-12-14 11:17:24 UTC (rev 3649)
@@ -1,361 +0,0 @@
-Index: linux-2.6.20.1/arch/arm/mach-s3c2410/mach-qt2410.c.old
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.20.1/arch/arm/mach-s3c2410/mach-qt2410.c.old 2007-02-21 16:28:56.000000000 +0100
-@@ -0,0 +1,356 @@
-+/*
-+ *
-+ * linux/arch/arm/mach-s3c2410/mach-qt2410.c
-+ *
-+ * Copyright (C) 2006 by OpenMoko, Inc.
-+ * Author: Harald Welte <laforge at openmoko.org>
-+ * 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 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/kernel.h>
-+#include <linux/types.h>
-+#include <linux/interrupt.h>
-+#include <linux/list.h>
-+#include <linux/timer.h>
-+#include <linux/init.h>
-+#include <linux/platform_device.h>
-+#include <linux/serial_core.h>
-+#include <linux/spi/spi.h>
-+#include <linux/spi/spi_bitbang.h>
-+
-+#include <linux/mtd/mtd.h>
-+#include <linux/mtd/nand.h>
-+#include <linux/mtd/nand_ecc.h>
-+#include <linux/mtd/partitions.h>
-+
-+#include <asm/mach/arch.h>
-+#include <asm/mach/map.h>
-+#include <asm/mach/irq.h>
-+
-+#include <asm/hardware.h>
-+#include <asm/io.h>
-+#include <asm/irq.h>
-+#include <asm/mach-types.h>
-+
-+#include <asm/arch/regs-gpio.h>
-+#include <asm/arch/regs-serial.h>
-+#include <asm/arch/fb.h>
-+#include <asm/arch/nand.h>
-+#include <asm/arch/udc.h>
-+#include <asm/arch/ts.h>
-+#include <asm/arch/spi.h>
-+#include <asm/arch/spi-gpio.h>
-+
-+#include "devs.h"
-+#include "cpu.h"
-+
-+#include "pm.h"
-+
-+static struct map_desc qt2410_iodesc[] __initdata = {
-+ { 0xe0000000, __phys_to_pfn(S3C2410_CS3+0x01000000), SZ_1M, MT_DEVICE }
-+};
-+
-+#define UCON S3C2410_UCON_DEFAULT
-+#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
-+#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
-+
-+static struct s3c2410_uartcfg smdk2410_uartcfgs[] = {
-+ [0] = {
-+ .hwport = 0,
-+ .flags = 0,
-+ .ucon = UCON,
-+ .ulcon = ULCON,
-+ .ufcon = UFCON,
-+ },
-+ [1] = {
-+ .hwport = 1,
-+ .flags = 0,
-+ .ucon = UCON,
-+ .ulcon = ULCON,
-+ .ufcon = UFCON,
-+ },
-+ [2] = {
-+ .hwport = 2,
-+ .flags = 0,
-+ .ucon = UCON,
-+ .ulcon = ULCON,
-+ .ufcon = UFCON,
-+ }
-+};
-+
-+/* LCD driver info */
-+
-+static struct s3c2410fb_mach_info qt2410_lcd_cfg __initdata = {
-+ .type = S3C2410_LCDCON1_TFT,
-+ .regs = {
-+
-+ .lcdcon1 = S3C2410_LCDCON1_TFT16BPP |
-+ S3C2410_LCDCON1_TFT |
-+ S3C2410_LCDCON1_CLKVAL(0x04),
-+
-+ .lcdcon2 = S3C2410_LCDCON2_VBPD(1) |
-+ S3C2410_LCDCON2_LINEVAL(319) |
-+ S3C2410_LCDCON2_VFPD(6) |
-+ S3C2410_LCDCON2_VSPW(3),
-+
-+ .lcdcon3 = S3C2410_LCDCON3_HBPD(12) |
-+ S3C2410_LCDCON3_HOZVAL(239) |
-+ S3C2410_LCDCON3_HFPD(7),
-+
-+ .lcdcon4 = S3C2410_LCDCON4_MVAL(0) |
-+ S3C2410_LCDCON4_HSPW(3),
-+
-+ .lcdcon5 = S3C2410_LCDCON5_FRM565 |
-+ S3C2410_LCDCON5_INVVLINE |
-+ S3C2410_LCDCON5_INVVFRAME |
-+ S3C2410_LCDCON5_PWREN |
-+ S3C2410_LCDCON5_HWSWP,
-+ },
-+
-+#if 0
-+ /* currently setup by downloader */
-+ .gpccon = 0xaa940659,
-+ .gpccon_mask = 0xffffffff,
-+ .gpcup = 0x0000ffff,
-+ .gpcup_mask = 0xffffffff,
-+ .gpdcon = 0xaa84aaa0,
-+ .gpdcon_mask = 0xffffffff,
-+ .gpdup = 0x0000faff,
-+ .gpdup_mask = 0xffffffff,
-+#endif
-+
-+ .lpcsel = ((0xCE6) & ~7) | 1<<4,
-+
-+ .width = 240,
-+ .height = 320,
-+
-+ .xres = {
-+ .min = 240,
-+ .max = 240,
-+ .defval = 240,
-+ },
-+
-+ .yres = {
-+ .min = 320,
-+ .max = 320,
-+ .defval = 320,
-+ },
-+
-+ .bpp = {
-+ .min = 16,
-+ .max = 16,
-+ .defval = 16,
-+ },
-+};
-+
-+static struct resource cs89x0_resources[] = {
-+ [0] = {
-+ .start = 0x19000000,
-+ .end = 0x19000000 + 16,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = IRQ_EINT9,
-+ .end = IRQ_EINT9,
-+ .flags = IORESOURCE_IRQ,
-+ },
-+};
-+
-+static struct platform_device cs89x0_device = {
-+ .name = "cirrus-cs89x0",
-+ .num_resources = ARRAY_SIZE(cs89x0_resources),
-+ .resource = cs89x0_resources,
-+};
-+
-+static struct platform_device *qt2410_devices[] __initdata = {
-+ &s3c_device_usb,
-+ &s3c_device_lcd,
-+ &s3c_device_wdt,
-+ &s3c_device_i2c,
-+ &s3c_device_iis,
-+ &s3c_device_sdi,
-+ &s3c_device_usbgadget,
-+ &s3c_device_nand,
-+ &s3c_device_ts,
-+ &cs89x0_device,
-+};
-+
-+static struct s3c24xx_board qt2410_board __initdata = {
-+ .devices = qt2410_devices,
-+ .devices_count = ARRAY_SIZE(qt2410_devices)
-+};
-+
-+static struct s3c2410_nand_set qt2410_nand_sets[] = {
-+ [0] = {
-+ .name = "qt2410-nand",
-+ .nr_chips = 1,
-+ },
-+};
-+
-+/* choose a set of timings which should suit most 512Mbit
-+ * chips and beyond.
-+ */
-+
-+static struct s3c2410_platform_nand qt2410_nand_info = {
-+ .tacls = 20,
-+ .twrph0 = 60,
-+ .twrph1 = 20,
-+ .nr_sets = ARRAY_SIZE(qt2410_nand_sets),
-+ .sets = qt2410_nand_sets,
-+};
-+
-+/* SPI */
-+static struct spi_board_info qt2410_spi_board_info[] __initdata = {
-+ {
-+ .modalias = "jbt6k74",
-+ /* platform_data */
-+ /* controller_data */
-+ /* irq */
-+ .max_speed_hz = 10 * 1000 * 1000,
-+ .bus_num = 1,
-+ /* chip_select */
-+ },
-+};
-+
-+static void spi_gpio_cs(struct s3c2410_spigpio_info *spi, int cs)
-+{
-+ switch (cs) {
-+ case BITBANG_CS_ACTIVE:
-+ s3c2410_gpio_setpin(S3C2410_GPB5, 0);
-+ break;
-+ case BITBANG_CS_INACTIVE:
-+ s3c2410_gpio_setpin(S3C2410_GPB5, 1);
-+ break;
-+ }
-+}
-+
-+static struct s3c2410_spigpio_info spi_gpio_cfg = {
-+ .pin_clk = S3C2410_GPG7,
-+ .pin_mosi = S3C2410_GPG6,
-+ .pin_miso = S3C2410_GPG5,
-+ .board_size = ARRAY_SIZE(qt2410_spi_board_info),
-+ .board_info = qt2410_spi_board_info,
-+ .chip_select = &spi_gpio_cs,
-+};
-+
-+static struct resource s3c_spi_lcm_resource[] = {
-+ [0] = {
-+ .start = S3C2410_GPB5,
-+ .end = S3C2410_GPB5,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = S3C2410_GPG5,
-+ .end = S3C2410_GPG5,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [2] = {
-+ .start = S3C2410_GPG6,
-+ .end = S3C2410_GPG6,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [3] = {
-+ .start = S3C2410_GPG7,
-+ .end = S3C2410_GPG7,
-+ .flags = IORESOURCE_MEM,
-+ },
-+};
-+
-+static struct platform_device s3c_device_spi_lcm = {
-+ .name = "s3c24xx-spi-gpio",
-+ .id = 1,
-+ .num_resources = ARRAY_SIZE(s3c_spi_lcm_resource),
-+ .resource = s3c_spi_lcm_resource,
-+ .dev = {
-+ .platform_data = &spi_gpio_cfg,
-+ },
-+};
-+
-+static void qt2410_udc_pullup(enum s3c2410_udc_cmd_e cmd)
-+{
-+ printk(KERN_DEBUG "udc: pullup(%d)\n", cmd);
-+
-+ switch (cmd) {
-+ case S3C2410_UDC_P_ENABLE:
-+ break;
-+ case S3C2410_UDC_P_DISABLE:
-+ break;
-+ case S3C2410_UDC_P_RESET:
-+ break;
-+ default:
-+ break;
-+ }
-+}
-+
-+static struct s3c2410_udc_mach_info qt2410_udc_cfg = {
-+ .udc_command = qt2410_udc_pullup,
-+};
-+
-+static struct s3c2410_ts_mach_info qt2410_ts_cfg = {
-+ .delay = 10000,
-+ .presc = 49,
-+ .oversampling_shift = 2,
-+};
-+
-+static void __init qt2410_map_io(void)
-+{
-+ s3c24xx_init_io(qt2410_iodesc, ARRAY_SIZE(qt2410_iodesc));
-+ s3c24xx_init_clocks(12*1000*1000);
-+ s3c24xx_init_uarts(smdk2410_uartcfgs, ARRAY_SIZE(smdk2410_uartcfgs));
-+ s3c24xx_set_board(&qt2410_board);
-+}
-+
-+static void __init qt2410_machine_init(void)
-+{
-+ /* Configure the LEDs (even if we have no LED support)*/
-+
-+ s3c2410_gpio_cfgpin(S3C2410_GPF4, S3C2410_GPF4_OUTP);
-+ s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP);
-+ s3c2410_gpio_cfgpin(S3C2410_GPF6, S3C2410_GPF6_OUTP);
-+ s3c2410_gpio_cfgpin(S3C2410_GPF7, S3C2410_GPF7_OUTP);
-+
-+ s3c2410_gpio_setpin(S3C2410_GPF4, 1);
-+ s3c2410_gpio_setpin(S3C2410_GPF5, 1);
-+ s3c2410_gpio_setpin(S3C2410_GPF6, 1);
-+ s3c2410_gpio_setpin(S3C2410_GPF7, 1);
-+
-+ s3c_device_nand.dev.platform_data = &qt2410_nand_info;
-+ s3c24xx_fb_set_platdata(&qt2410_lcd_cfg);
-+ s3c24xx_udc_set_platdata(&qt2410_udc_cfg);
-+ set_s3c2410ts_info(&qt2410_ts_cfg);
-+
-+ s3c2410_gpio_cfgpin(S3C2410_GPB5, S3C2410_GPIO_OUTPUT);
-+ spi_register_board_info(qt2410_spi_board_info,
-+ ARRAY_SIZE(qt2410_spi_board_info));
-+ platform_device_register(&s3c_device_spi_lcm);
-+
-+ s3c2410_pm_init();
-+}
-+
-+MACHINE_START(QT2410, "QT2410")
-+ .phys_io = S3C2410_PA_UART,
-+ .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
-+ .boot_params = S3C2410_SDRAM_PA + 0x100,
-+ .map_io = qt2410_map_io,
-+ .init_irq = s3c24xx_init_irq,
-+ .init_machine = qt2410_machine_init,
-+ .timer = &s3c24xx_timer,
-+MACHINE_END
-+
-+
Modified: branches/src/target/kernel/2.6.24.x/patches/s3c2410-bbt.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/s3c2410-bbt.patch 2007-12-13 08:28:30 UTC (rev 3648)
+++ branches/src/target/kernel/2.6.24.x/patches/s3c2410-bbt.patch 2007-12-14 11:17:24 UTC (rev 3649)
@@ -1,3 +1,10 @@
+[PATCH] Add Kconfig option to enable NAND bad-block-table support for s3c2410
+
+This patch adds a new CONFIG_MTD_NAND_S3C2410_BBT which, if enabled,
+asks the mtd NAND core to use a bad-block table.
+
+Signed-off-by: Harald Welte <laforge at openmoko.org>
+
Index: linux-2.6.17.14-fic4.test/drivers/mtd/nand/s3c2410.c
===================================================================
--- linux-2.6.17.14-fic4.test.orig/drivers/mtd/nand/s3c2410.c 2007-02-02 13:02:10.000000000 +0100
Modified: branches/src/target/kernel/2.6.24.x/patches/s3c2410-pwm.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/s3c2410-pwm.patch 2007-12-13 08:28:30 UTC (rev 3648)
+++ branches/src/target/kernel/2.6.24.x/patches/s3c2410-pwm.patch 2007-12-14 11:17:24 UTC (rev 3649)
@@ -1,3 +1,8 @@
+This patch adds a PWM api abstraction for the S3C2410 SoC
+
+Signed-off-by: Javi Roman <javiroman at kernel-labs.org>
+Signed-off-by: Harald Welte <laforge at openmoko.org>
+
Index: linux-2.6.23/arch/arm/mach-s3c2410/Kconfig
===================================================================
--- linux-2.6.23.orig/arch/arm/mach-s3c2410/Kconfig
Modified: branches/src/target/kernel/2.6.24.x/patches/s3c2410-qt2410-buttons.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/s3c2410-qt2410-buttons.patch 2007-12-13 08:28:30 UTC (rev 3648)
+++ branches/src/target/kernel/2.6.24.x/patches/s3c2410-qt2410-buttons.patch 2007-12-14 11:17:24 UTC (rev 3649)
@@ -49,7 +49,7 @@
@@ -15,6 +15,7 @@
obj-$(CONFIG_KEYBOARD_STOWAWAY) += stowaway.o
obj-$(CONFIG_KEYBOARD_CORGI) += corgikbd.o
- obj-$(CONFIG_KEYBOARD_GTA01) += gta01kbd.o
+ obj-$(CONFIG_KEYBOARD_NEO1973) += neo1973kbd.o
+obj-$(CONFIG_KEYBOARD_QT2410) += qt2410kbd.o
obj-$(CONFIG_KEYBOARD_SPITZ) += spitzkbd.o
obj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o
Modified: branches/src/target/kernel/2.6.24.x/patches/s3c2410_touchscreen.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/s3c2410_touchscreen.patch 2007-12-13 08:28:30 UTC (rev 3648)
+++ branches/src/target/kernel/2.6.24.x/patches/s3c2410_touchscreen.patch 2007-12-14 11:17:24 UTC (rev 3649)
@@ -128,7 +128,7 @@
===================================================================
--- /dev/null
+++ linux-2.6/drivers/input/touchscreen/s3c2410_ts.c
-@@ -0,0 +1,428 @@
+@@ -0,0 +1,437 @@
+/*
+ * 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
@@ -340,6 +340,7 @@
+
+static int __init s3c2410ts_probe(struct platform_device *pdev)
+{
++ int rc;
+ struct s3c2410_ts_mach_info *info;
+ struct input_dev *input_dev;
+
@@ -366,7 +367,7 @@
+ printk(DEBUG_LVL "got and enabled clock\n");
+#endif
+
-+ base_addr=ioremap(S3C2410_PA_ADC,0x20);
++ base_addr = ioremap(S3C2410_PA_ADC,0x20);
+ if (base_addr == NULL) {
+ printk(KERN_ERR "Failed to remap register block\n");
+ return -ENOMEM;
@@ -426,6 +427,7 @@
+ if (request_irq(IRQ_TC, stylus_updown, IRQF_SAMPLE_RANDOM,
+ "s3c2410_action", ts.dev)) {
+ printk(KERN_ERR "s3c2410_ts.c: Could not allocate ts IRQ_TC !\n");
++ free_irq(IRQ_ADC);
+ iounmap(base_addr);
+ return -EIO;
+ }
@@ -433,7 +435,14 @@
+ printk(KERN_INFO "%s successfully loaded\n", s3c2410ts_name);
+
+ /* All went ok, so register to the input system */
-+ input_register_device(ts.dev);
++ rc = input_register_device(ts.dev);
++ if (rc) {
++ free_irq(IRQ_TC);
++ free_irq(IRQ_ADC);
++ clk_disable(adc_clock);
++ ionumap(base_addr);
++ return -EIO;
++ }
+
+ return 0;
+}
Modified: branches/src/target/kernel/2.6.24.x/patches/series
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/series 2007-12-13 08:28:30 UTC (rev 3648)
+++ branches/src/target/kernel/2.6.24.x/patches/series 2007-12-14 11:17:24 UTC (rev 3649)
@@ -20,9 +20,9 @@
s3cmci-unfinished-write-fix.patch
s3c_mci_platform.patch
s3c2410-pwm.patch
-qt2410-base.patch
qt2410-cs8900.patch
qt2410-s3c_mci-pdata.patch
+gta01-no_nand_partitions.patch
gta01-pcf50606.patch
gta01-core.patch
gta01-jbt6k74.patch
@@ -30,7 +30,6 @@
gta01-vibrator.patch
gta01-inputdevice.patch
gta01-power_control.patch
-gta01-no_nand_partitions.patch
input-nots-mousedev.patch
ts0710.patch
s3c2410-qt2410-buttons.patch
More information about the commitlog
mailing list