From 36293686234f12e5f5fc166a6b38a1efec36da2d Mon Sep 17 00:00:00 2001 From: Mirko Vogt Date: Sun, 5 Jul 2009 11:37:52 +0000 Subject: purge out config and patches for 2.6.29 as 2.6.30.1 is now default and stable SVN-Revision: 16685 --- .../patches-2.6.29/001-merge-openmoko.patch | 96378 ------------------- 1 file changed, 96378 deletions(-) delete mode 100644 target/linux/s3c24xx/patches-2.6.29/001-merge-openmoko.patch (limited to 'target/linux/s3c24xx/patches-2.6.29/001-merge-openmoko.patch') diff --git a/target/linux/s3c24xx/patches-2.6.29/001-merge-openmoko.patch b/target/linux/s3c24xx/patches-2.6.29/001-merge-openmoko.patch deleted file mode 100644 index 713d1ffdfe..0000000000 --- a/target/linux/s3c24xx/patches-2.6.29/001-merge-openmoko.patch +++ /dev/null @@ -1,96378 +0,0 @@ -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/include/asm/fiq.h linux-2.6.29-rc3.owrt.om/arch/arm/include/asm/fiq.h ---- linux-2.6.29-rc3.owrt/arch/arm/include/asm/fiq.h 2009-05-10 22:05:03.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/include/asm/fiq.h 2009-05-10 22:27:59.000000000 +0200 -@@ -29,8 +29,9 @@ - extern int claim_fiq(struct fiq_handler *f); - extern void release_fiq(struct fiq_handler *f); - extern void set_fiq_handler(void *start, unsigned int length); --extern void set_fiq_regs(struct pt_regs *regs); --extern void get_fiq_regs(struct pt_regs *regs); -+extern void set_fiq_c_handler(void (*handler)(void)); -+extern void __attribute__((naked)) set_fiq_regs(struct pt_regs *regs); -+extern void __attribute__((naked)) get_fiq_regs(struct pt_regs *regs); - extern void enable_fiq(int fiq); - extern void disable_fiq(int fiq); - -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/include/asm/hardware/tzic-sp890.h linux-2.6.29-rc3.owrt.om/arch/arm/include/asm/hardware/tzic-sp890.h ---- linux-2.6.29-rc3.owrt/arch/arm/include/asm/hardware/tzic-sp890.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/include/asm/hardware/tzic-sp890.h 2009-05-10 22:27:59.000000000 +0200 -@@ -0,0 +1,22 @@ -+#ifndef __SP890_TZIC_H__ -+#define __SP890_TZIC_H__ -+ -+#define SP890_TZIC_UNLOCK_MAGIC (0x0ACCE550) -+ -+#define SP890_TZIC_FIQSTATUS 0 -+#define SP890_TZIC_RAWINTR 4 -+#define SP890_TZIC_INTSELECT 8 -+#define SP890_TZIC_FIQENABLE 0xc -+#define SP890_TZIC_FIQENCLEAR 0x10 -+#define SP890_TZIC_FIQBYPASS 0x14 -+#define SP890_TZIC_PROTECTION 0x18 -+#define SP890_TZIC_LOCK 0x1c -+#define SP890_TZIC_LOCKSTATUS 0x20 -+#define SP890_TZIC_ITCR 0x300 -+#define SP890_TZIC_ITIP1 0x304 -+#define SP890_TZIC_ITIP2 0x308 -+#define SP890_TZIC_ITOP1 0x30c -+#define SP890_TZIC_ITOP2 0x310 -+#define SP890_TZIC_PERIPHIDO 0xfe0 -+ -+#endif -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/include/asm/irqflags.h linux-2.6.29-rc3.owrt.om/arch/arm/include/asm/irqflags.h ---- linux-2.6.29-rc3.owrt/arch/arm/include/asm/irqflags.h 2009-05-10 22:05:03.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/include/asm/irqflags.h 2009-05-10 22:27:59.000000000 +0200 -@@ -5,6 +5,16 @@ - - #include - -+#ifdef CONFIG_FIND_IRQ_BLOCKERS -+void iblock_start(void); -+void iblock_end(void); -+void iblock_end_maybe(unsigned long flags); -+#else -+#define iblock_start() -+#define iblock_end() -+#define iblock_end_maybe(x) -+#endif -+ - /* - * CPU interrupt mask handling. - */ -@@ -31,6 +41,7 @@ - #define raw_local_irq_save(x) \ - ({ \ - unsigned long temp; \ -+ iblock_start(); \ - (void) (&temp == &x); \ - __asm__ __volatile__( \ - "mrs %0, cpsr @ local_irq_save\n" \ -@@ -47,6 +58,7 @@ - #define raw_local_irq_enable() \ - ({ \ - unsigned long temp; \ -+ iblock_end(); \ - __asm__ __volatile__( \ - "mrs %0, cpsr @ local_irq_enable\n" \ - " bic %0, %0, #128\n" \ -@@ -62,6 +74,7 @@ - #define raw_local_irq_disable() \ - ({ \ - unsigned long temp; \ -+ iblock_start(); \ - __asm__ __volatile__( \ - "mrs %0, cpsr @ local_irq_disable\n" \ - " orr %0, %0, #128\n" \ -@@ -117,11 +130,12 @@ - * restore saved IRQ & FIQ state - */ - #define raw_local_irq_restore(x) \ -+ ({ iblock_end_maybe(x); \ - __asm__ __volatile__( \ - "msr cpsr_c, %0 @ local_irq_restore\n" \ - : \ - : "r" (x) \ -- : "memory", "cc") -+ : "memory", "cc"); }) - - #define raw_irqs_disabled_flags(flags) \ - ({ \ -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/include/asm/kexec.h linux-2.6.29-rc3.owrt.om/arch/arm/include/asm/kexec.h ---- linux-2.6.29-rc3.owrt/arch/arm/include/asm/kexec.h 2009-05-10 22:05:03.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/include/asm/kexec.h 2009-05-10 22:27:59.000000000 +0200 -@@ -1,8 +1,6 @@ - #ifndef _ARM_KEXEC_H - #define _ARM_KEXEC_H - --#ifdef CONFIG_KEXEC -- - /* Maximum physical address we can use pages from */ - #define KEXEC_SOURCE_MEMORY_LIMIT (-1UL) - /* Maximum address we can reach in physical address mode */ -@@ -14,6 +12,10 @@ - - #define KEXEC_ARCH KEXEC_ARCH_ARM - -+#define KEXEC_BOOT_PARAMS_SIZE 1536 -+ -+#ifdef CONFIG_KEXEC -+ - #define KEXEC_ARM_ATAGS_OFFSET 0x1000 - #define KEXEC_ARM_ZIMAGE_OFFSET 0x8000 - -@@ -29,3 +31,4 @@ - #endif /* CONFIG_KEXEC */ - - #endif /* _ARM_KEXEC_H */ -+ -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/Kconfig linux-2.6.29-rc3.owrt.om/arch/arm/Kconfig ---- linux-2.6.29-rc3.owrt/arch/arm/Kconfig 2009-05-10 22:05:03.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/Kconfig 2009-05-10 22:27:59.000000000 +0200 -@@ -1086,7 +1086,8 @@ - - menu "CPU Power Management" - --if (ARCH_SA1100 || ARCH_INTEGRATOR || ARCH_OMAP || ARCH_IMX || ARCH_PXA) -+if (ARCH_SA1100 || ARCH_INTEGRATOR || ARCH_OMAP || ARCH_IMX || ARCH_PXA || \ -+ ARCH_S3C64XX) - - source "drivers/cpufreq/Kconfig" - -@@ -1126,6 +1127,10 @@ - default y - select CPU_FREQ_DEFAULT_GOV_USERSPACE - -+config CPU_FREQ_S3C64XX -+ bool "CPUfreq support for S3C64xx CPUs" -+ depends on CPU_FREQ && CPU_S3C6410 -+ - endif - - source "drivers/cpuidle/Kconfig" -@@ -1305,6 +1310,8 @@ - - source "drivers/uwb/Kconfig" - -+source "drivers/ar6000/Kconfig" -+ - source "drivers/mmc/Kconfig" - - source "drivers/memstick/Kconfig" -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/kernel/fiq.c linux-2.6.29-rc3.owrt.om/arch/arm/kernel/fiq.c ---- linux-2.6.29-rc3.owrt/arch/arm/kernel/fiq.c 2009-05-10 22:08:41.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/kernel/fiq.c 2009-05-10 22:27:59.000000000 +0200 -@@ -8,6 +8,8 @@ - * - * FIQ support re-written by Russell King to be more generic - * -+ * FIQ handler in C supoprt written by Andy Green -+ * - * We now properly support a method by which the FIQ handlers can - * be stacked onto the vector. We still do not support sharing - * the FIQ vector itself. -@@ -124,6 +126,83 @@ - : "r" (®s->ARM_r8), "I" (PSR_I_BIT | PSR_F_BIT | FIQ_MODE)); - } - -+/* -------- FIQ handler in C --------- -+ * -+ * Major Caveats for using this -+ * --------------------------- -+ * * -+ * * 1) it CANNOT touch any vmalloc()'d memory, only memory -+ * that was kmalloc()'d. Static allocations in the monolithic kernel -+ * are kmalloc()'d so they are okay. You can touch memory-mapped IO, but -+ * the pointer for it has to have been stored in kmalloc'd memory. The -+ * reason for this is simple: every now and then Linux turns off interrupts -+ * and reorders the paging tables. If a FIQ happens during this time, the -+ * virtual memory space can be partly or entirely disordered or missing. -+ * -+ * 2) Because vmalloc() is used when a module is inserted, THIS FIQ -+ * ISR HAS TO BE IN THE MONOLITHIC KERNEL, not a module. But the way -+ * it is set up, you can all to enable and disable it from your module -+ * and intercommunicate with it through struct fiq_ipc -+ * fiq_ipc which you can define in -+ * asm/archfiq_ipc_type.h. The reason is the same as above, a -+ * FIQ could happen while even the ISR is not present in virtual memory -+ * space due to pagetables being changed at the time. -+ * -+ * 3) You can't call any Linux API code except simple macros -+ * - understand that FIQ can come in at any time, no matter what -+ * state of undress the kernel may privately be in, thinking it -+ * locked the door by turning off interrupts... FIQ is an -+ * unstoppable monster force (which is its value) -+ * - they are not vmalloc()'d memory safe -+ * - they might do crazy stuff like sleep: FIQ pisses fire and -+ * is not interested in 'sleep' that the weak seem to need -+ * - calling APIs from FIQ can re-enter un-renterable things -+ * - summary: you cannot interoperate with linux APIs directly in the FIQ ISR -+ * -+ * If you follow these rules, it is fantastic, an extremely powerful, solid, -+ * genuine hard realtime feature. -+ */ -+ -+static void (*current_fiq_c_isr)(void); -+#define FIQ_C_ISR_STACK_SIZE 256 -+ -+static void __attribute__((naked)) __jump_to_isr(void) -+{ -+ asm __volatile__ ("mov pc, r8"); -+} -+ -+ -+static void __attribute__((naked)) __actual_isr(void) -+{ -+ asm __volatile__ ( -+ "stmdb sp!, {r0-r12, lr};" -+ "mov fp, sp;" -+ ); -+ -+ current_fiq_c_isr(); -+ -+ asm __volatile__ ( -+ "ldmia sp!, {r0-r12, lr};" -+ "subs pc, lr, #4;" -+ ); -+} -+ -+void set_fiq_c_handler(void (*isr)(void)) -+{ -+ struct pt_regs regs; -+ -+ memset(®s, 0, sizeof(regs)); -+ regs.ARM_r8 = (unsigned long) __actual_isr; -+ regs.ARM_sp = 0xffff001c + FIQ_C_ISR_STACK_SIZE; -+ -+ set_fiq_handler(__jump_to_isr, 4); -+ -+ current_fiq_c_isr = isr; -+ -+ set_fiq_regs(®s); -+} -+/* -------- FIQ handler in C ---------*/ -+ - int claim_fiq(struct fiq_handler *f) - { - int ret = 0; -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/kernel/iblock.c linux-2.6.29-rc3.owrt.om/arch/arm/kernel/iblock.c ---- linux-2.6.29-rc3.owrt/arch/arm/kernel/iblock.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/kernel/iblock.c 2009-05-10 22:27:59.000000000 +0200 -@@ -0,0 +1,158 @@ -+/* -+ * -+ * /sys/kernel/iblock/ -+ * All times are in microseconds (us). -+ * -+ * - limit -+ * Interrupt blocking time reporting limit, in microseconds. -+ * 0 disables reporting. Auto-resets to zero after reporting. -+ * -+ * - max -+ * Maximum blocking time recorded. Reset to zero by writing anything. -+ * -+ * - test -+ * Force a delay with interrupts disabled. -+ * -+ */ -+ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+ -+unsigned long s3c2410_gettimeoffset(void); -+ -+ -+static unsigned long iblock_t0; -+int iblock_limit; -+static int iblock_max; -+ -+ -+void iblock_start(void) -+{ -+ unsigned long flags; -+ -+ raw_local_save_flags(flags); -+ if (raw_irqs_disabled_flags(flags)) -+ return; -+ iblock_t0 = s3c2410_gettimeoffset(); -+} -+EXPORT_SYMBOL_GPL(iblock_start); -+ -+void iblock_end(void) -+{ -+ unsigned long flags; -+ unsigned long t, us; -+ -+ raw_local_save_flags(flags); -+ if (!raw_irqs_disabled_flags(flags)) -+ return; -+ if (!iblock_t0) -+ return; -+ t = s3c2410_gettimeoffset(); -+ us = t-iblock_t0; -+ if (us > 40000000) -+ return; -+ if (us > iblock_max) -+ iblock_max = us; -+ if (!iblock_limit) -+ return; -+ if (us < iblock_limit) -+ return; -+// iblock_limit = 0; -+ printk(KERN_ERR "interrupts were disabled for %lu us !\n", us); -+// WARN_ON(1); -+} -+EXPORT_SYMBOL_GPL(iblock_end); -+ -+void iblock_end_maybe(unsigned long flags) -+{ -+ if (raw_irqs_disabled_flags(flags)) -+ return; -+ iblock_end(); -+} -+EXPORT_SYMBOL_GPL(iblock_end_maybe); -+ -+static ssize_t limit_read(struct device *dev, struct device_attribute *attr, -+ char *buf) -+{ -+ return sprintf(buf, "%u us\n", iblock_limit); -+} -+ -+ -+static ssize_t limit_write(struct device *dev, struct device_attribute *attr, -+ const char *buf, size_t count) -+{ -+ unsigned long tmp; -+ char *end; -+ -+ tmp = simple_strtoul(buf, &end, 0); -+ if (end == buf) -+ return -EINVAL; -+ iblock_limit = tmp; -+ return count; -+} -+ -+ -+static ssize_t max_read(struct device *dev, struct device_attribute *attr, -+ char *buf) -+{ -+ return sprintf(buf, "%u us\n", iblock_max); -+} -+ -+ -+static ssize_t max_write(struct device *dev, struct device_attribute *attr, -+ const char *buf, size_t count) -+{ -+ iblock_max = 0; -+ return count; -+} -+ -+ -+static ssize_t test_write(struct device *dev, -+ struct device_attribute *attr, const char *buf, size_t count) -+{ -+ unsigned long tmp, flags; -+ char *end; -+ -+ tmp = simple_strtoul(buf, &end, 0); -+ if (end == buf) -+ return -EINVAL; -+ local_irq_save(flags); -+ udelay(tmp); -+ local_irq_restore(flags); -+ return count; -+} -+ -+ -+static DEVICE_ATTR(limit, 0644, limit_read, limit_write); -+static DEVICE_ATTR(max, 0644, max_read, max_write); -+static DEVICE_ATTR(test, 0200, NULL, test_write); -+ -+ -+static struct attribute *sysfs_entries[] = { -+ &dev_attr_limit.attr, -+ &dev_attr_max.attr, -+ &dev_attr_test.attr, -+ NULL -+}; -+ -+ -+static struct attribute_group attr_group = { -+ .name = "iblock", -+ .attrs = sysfs_entries, -+}; -+ -+ -+static int __devinit iblock_init(void) -+{ -+ return sysfs_create_group(kernel_kobj, &attr_group); -+} -+ -+ -+module_init(iblock_init); -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/kernel/irq.c linux-2.6.29-rc3.owrt.om/arch/arm/kernel/irq.c ---- linux-2.6.29-rc3.owrt/arch/arm/kernel/irq.c 2009-05-10 22:08:41.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/kernel/irq.c 2009-05-10 22:27:59.000000000 +0200 -@@ -104,6 +104,11 @@ - .lock = SPIN_LOCK_UNLOCKED - }; - -+#ifdef CONFIG_FIND_IRQ_BLOCKERS -+extern int iblock_limit; -+unsigned long s3c2410_gettimeoffset(void); -+#endif -+ - /* - * do_IRQ handles all hardware IRQ's. Decoded IRQs should not - * come via this function. Instead, they should provide their -@@ -112,9 +117,15 @@ - asmlinkage void __exception asm_do_IRQ(unsigned int irq, struct pt_regs *regs) - { - struct pt_regs *old_regs = set_irq_regs(regs); -- -+#ifdef CONFIG_FIND_IRQ_BLOCKERS -+ unsigned long us; -+#endif - irq_enter(); - -+#ifdef CONFIG_FIND_IRQ_BLOCKERS -+ us = s3c2410_gettimeoffset(); -+#endif -+ - /* - * Some hardware gives randomly wrong interrupts. Rather - * than crashing, do something sensible. -@@ -124,6 +135,12 @@ - else - generic_handle_irq(irq); - -+#ifdef CONFIG_FIND_IRQ_BLOCKERS -+ us = s3c2410_gettimeoffset() - us; -+ -+ if (iblock_limit && us > iblock_limit && us < 10000000) -+ printk(KERN_ERR "asm_do_IRQ(%u): %lu us\n", irq, us); -+#endif - /* AT91 specific workaround */ - irq_finish(irq); - -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/kernel/Makefile linux-2.6.29-rc3.owrt.om/arch/arm/kernel/Makefile ---- linux-2.6.29-rc3.owrt/arch/arm/kernel/Makefile 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/kernel/Makefile 2009-05-10 22:27:59.000000000 +0200 -@@ -44,5 +44,6 @@ - - head-y := head$(MMUEXT).o - obj-$(CONFIG_DEBUG_LL) += debug.o -+obj-$(CONFIG_FIND_IRQ_BLOCKERS) += iblock.o - - extra-y := $(head-y) init_task.o vmlinux.lds -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/kernel/vmlinux.lds.S linux-2.6.29-rc3.owrt.om/arch/arm/kernel/vmlinux.lds.S ---- linux-2.6.29-rc3.owrt/arch/arm/kernel/vmlinux.lds.S 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/kernel/vmlinux.lds.S 2009-05-10 22:27:59.000000000 +0200 -@@ -106,6 +106,8 @@ - *(.got) /* Global offset table */ - } - -+ NOTES -+ - RODATA - - _etext = .; /* End of text and rodata section */ -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/dma.c linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/dma.c ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/dma.c 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/dma.c 2009-05-10 22:27:59.000000000 +0200 -@@ -17,18 +17,20 @@ - #include - #include - -+#include - #include - - #include --#include -+#include - - #include - #include - #include -+#include - #include - #include - #include --#include -+#include - #include - - static struct s3c24xx_dma_map __initdata s3c2410_dma_mappings[] = { -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/audio.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/audio.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/audio.h 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/audio.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,45 +0,0 @@ --/* arch/arm/mach-s3c2410/include/mach/audio.h -- * -- * Copyright (c) 2004-2005 Simtec Electronics -- * http://www.simtec.co.uk/products/SWLINUX/ -- * Ben Dooks -- * -- * S3C24XX - Audio platfrom_device info -- * -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License version 2 as -- * published by the Free Software Foundation. --*/ -- --#ifndef __ASM_ARCH_AUDIO_H --#define __ASM_ARCH_AUDIO_H __FILE__ -- --/* struct s3c24xx_iis_ops -- * -- * called from the s3c24xx audio core to deal with the architecture -- * or the codec's setup and control. -- * -- * the pointer to itself is passed through in case the caller wants to -- * embed this in an larger structure for easy reference to it's context. --*/ -- --struct s3c24xx_iis_ops { -- struct module *owner; -- -- int (*startup)(struct s3c24xx_iis_ops *me); -- void (*shutdown)(struct s3c24xx_iis_ops *me); -- int (*suspend)(struct s3c24xx_iis_ops *me); -- int (*resume)(struct s3c24xx_iis_ops *me); -- -- int (*open)(struct s3c24xx_iis_ops *me, struct snd_pcm_substream *strm); -- int (*close)(struct s3c24xx_iis_ops *me, struct snd_pcm_substream *strm); -- int (*prepare)(struct s3c24xx_iis_ops *me, struct snd_pcm_substream *strm, struct snd_pcm_runtime *rt); --}; -- --struct s3c24xx_platdata_iis { -- const char *codec_clk; -- struct s3c24xx_iis_ops *ops; -- int (*match_dev)(struct device *dev); --}; -- --#endif /* __ASM_ARCH_AUDIO_H */ -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/dma.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/dma.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/dma.h 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/dma.h 2009-05-10 22:27:59.000000000 +0200 -@@ -3,7 +3,7 @@ - * Copyright (C) 2003,2004,2006 Simtec Electronics - * Ben Dooks - * -- * Samsung S3C241XX DMA support -+ * Samsung S3C24XX DMA support - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as -@@ -13,8 +13,8 @@ - #ifndef __ASM_ARCH_DMA_H - #define __ASM_ARCH_DMA_H __FILE__ - -+#include - #include --#include - - #define MAX_DMA_TRANSFER_SIZE 0x100000 /* Data Unit is half word */ - -@@ -55,9 +55,9 @@ - - /* we have 4 dma channels */ - #ifndef CONFIG_CPU_S3C2443 --#define S3C2410_DMA_CHANNELS (4) -+#define S3C_DMA_CHANNELS (4) - #else --#define S3C2410_DMA_CHANNELS (6) -+#define S3C_DMA_CHANNELS (6) - #endif - - /* types */ -@@ -68,7 +68,6 @@ - S3C2410_DMA_PAUSED - }; - -- - /* enum s3c2410_dma_loadst - * - * This represents the state of the DMA engine, wrt to the loaded / running -@@ -104,32 +103,6 @@ - S3C2410_DMALOAD_1LOADED_1RUNNING, - }; - --enum s3c2410_dma_buffresult { -- S3C2410_RES_OK, -- S3C2410_RES_ERR, -- S3C2410_RES_ABORT --}; -- --enum s3c2410_dmasrc { -- S3C2410_DMASRC_HW, /* source is memory */ -- S3C2410_DMASRC_MEM /* source is hardware */ --}; -- --/* enum s3c2410_chan_op -- * -- * operation codes passed to the DMA code by the user, and also used -- * to inform the current channel owner of any changes to the system state --*/ -- --enum s3c2410_chan_op { -- S3C2410_DMAOP_START, -- S3C2410_DMAOP_STOP, -- S3C2410_DMAOP_PAUSE, -- S3C2410_DMAOP_RESUME, -- S3C2410_DMAOP_FLUSH, -- S3C2410_DMAOP_TIMEOUT, /* internal signal to handler */ -- S3C2410_DMAOP_STARTED, /* indicate channel started */ --}; - - /* flags */ - -@@ -137,19 +110,18 @@ - * waiting for reloads */ - #define S3C2410_DMAF_AUTOSTART (1<<1) /* auto-start if buffer queued */ - -+#define S3C2410_DMAF_CIRCULAR (0x00) /* circular enqueue not supp. */ -+ - /* dma buffer */ - --struct s3c2410_dma_client { -- char *name; --}; -+struct s3c2410_dma_buf; - --/* s3c2410_dma_buf_s -+/* s3c2410_dma_buf - * - * internally used buffer structure to describe a queued or running - * buffer. - */ - --struct s3c2410_dma_buf; - struct s3c2410_dma_buf { - struct s3c2410_dma_buf *next; - int magic; /* magic */ -@@ -161,20 +133,6 @@ - - /* [1] is this updated for both recv/send modes? */ - --struct s3c2410_dma_chan; -- --/* s3c2410_dma_cbfn_t -- * -- * buffer callback routine type --*/ -- --typedef void (*s3c2410_dma_cbfn_t)(struct s3c2410_dma_chan *, -- void *buf, int size, -- enum s3c2410_dma_buffresult result); -- --typedef int (*s3c2410_dma_opfn_t)(struct s3c2410_dma_chan *, -- enum s3c2410_chan_op ); -- - struct s3c2410_dma_stats { - unsigned long loads; - unsigned long timeout_longest; -@@ -206,10 +164,10 @@ - - /* channel configuration */ - enum s3c2410_dmasrc source; -+ enum dma_ch req_ch; - unsigned long dev_addr; - unsigned long load_timeout; - unsigned int flags; /* channel flags */ -- unsigned int hw_cfg; /* last hw config */ - - struct s3c24xx_dma_map *map; /* channel hw maps */ - -@@ -236,213 +194,12 @@ - struct sys_device dev; - }; - --/* the currently allocated channel information */ --extern struct s3c2410_dma_chan s3c2410_chans[]; -- --/* note, we don't really use dma_device_t at the moment */ - typedef unsigned long dma_device_t; - --/* functions --------------------------------------------------------------- */ -- --/* s3c2410_dma_request -- * -- * request a dma channel exclusivley --*/ -- --extern int s3c2410_dma_request(unsigned int channel, -- struct s3c2410_dma_client *, void *dev); -- -- --/* s3c2410_dma_ctrl -- * -- * change the state of the dma channel --*/ -- --extern int s3c2410_dma_ctrl(unsigned int channel, enum s3c2410_chan_op op); -- --/* s3c2410_dma_setflags -- * -- * set the channel's flags to a given state --*/ -- --extern int s3c2410_dma_setflags(unsigned int channel, -- unsigned int flags); -- --/* s3c2410_dma_free -- * -- * free the dma channel (will also abort any outstanding operations) --*/ -- --extern int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *); -- --/* s3c2410_dma_enqueue -- * -- * place the given buffer onto the queue of operations for the channel. -- * The buffer must be allocated from dma coherent memory, or the Dcache/WB -- * drained before the buffer is given to the DMA system. --*/ -- --extern int s3c2410_dma_enqueue(unsigned int channel, void *id, -- dma_addr_t data, int size); -- --/* s3c2410_dma_config -- * -- * configure the dma channel --*/ -- --extern int s3c2410_dma_config(unsigned int channel, int xferunit, int dcon); -- --/* s3c2410_dma_devconfig -- * -- * configure the device we're talking to --*/ -- --extern int s3c2410_dma_devconfig(int channel, enum s3c2410_dmasrc source, -- int hwcfg, unsigned long devaddr); -- --/* s3c2410_dma_getposition -- * -- * get the position that the dma transfer is currently at --*/ -- --extern int s3c2410_dma_getposition(unsigned int channel, -- dma_addr_t *src, dma_addr_t *dest); -- --extern int s3c2410_dma_set_opfn(unsigned int, s3c2410_dma_opfn_t rtn); --extern int s3c2410_dma_set_buffdone_fn(unsigned int, s3c2410_dma_cbfn_t rtn); -- --/* DMA Register definitions */ -- --#define S3C2410_DMA_DISRC (0x00) --#define S3C2410_DMA_DISRCC (0x04) --#define S3C2410_DMA_DIDST (0x08) --#define S3C2410_DMA_DIDSTC (0x0C) --#define S3C2410_DMA_DCON (0x10) --#define S3C2410_DMA_DSTAT (0x14) --#define S3C2410_DMA_DCSRC (0x18) --#define S3C2410_DMA_DCDST (0x1C) --#define S3C2410_DMA_DMASKTRIG (0x20) --#define S3C2412_DMA_DMAREQSEL (0x24) --#define S3C2443_DMA_DMAREQSEL (0x24) -- --#define S3C2410_DISRCC_INC (1<<0) --#define S3C2410_DISRCC_APB (1<<1) -- --#define S3C2410_DMASKTRIG_STOP (1<<2) --#define S3C2410_DMASKTRIG_ON (1<<1) --#define S3C2410_DMASKTRIG_SWTRIG (1<<0) -- --#define S3C2410_DCON_DEMAND (0<<31) --#define S3C2410_DCON_HANDSHAKE (1<<31) --#define S3C2410_DCON_SYNC_PCLK (0<<30) --#define S3C2410_DCON_SYNC_HCLK (1<<30) -- --#define S3C2410_DCON_INTREQ (1<<29) -- --#define S3C2410_DCON_CH0_XDREQ0 (0<<24) --#define S3C2410_DCON_CH0_UART0 (1<<24) --#define S3C2410_DCON_CH0_SDI (2<<24) --#define S3C2410_DCON_CH0_TIMER (3<<24) --#define S3C2410_DCON_CH0_USBEP1 (4<<24) -- --#define S3C2410_DCON_CH1_XDREQ1 (0<<24) --#define S3C2410_DCON_CH1_UART1 (1<<24) --#define S3C2410_DCON_CH1_I2SSDI (2<<24) --#define S3C2410_DCON_CH1_SPI (3<<24) --#define S3C2410_DCON_CH1_USBEP2 (4<<24) -- --#define S3C2410_DCON_CH2_I2SSDO (0<<24) --#define S3C2410_DCON_CH2_I2SSDI (1<<24) --#define S3C2410_DCON_CH2_SDI (2<<24) --#define S3C2410_DCON_CH2_TIMER (3<<24) --#define S3C2410_DCON_CH2_USBEP3 (4<<24) -- --#define S3C2410_DCON_CH3_UART2 (0<<24) --#define S3C2410_DCON_CH3_SDI (1<<24) --#define S3C2410_DCON_CH3_SPI (2<<24) --#define S3C2410_DCON_CH3_TIMER (3<<24) --#define S3C2410_DCON_CH3_USBEP4 (4<<24) -- --#define S3C2410_DCON_SRCSHIFT (24) --#define S3C2410_DCON_SRCMASK (7<<24) -- --#define S3C2410_DCON_BYTE (0<<20) --#define S3C2410_DCON_HALFWORD (1<<20) --#define S3C2410_DCON_WORD (2<<20) -- --#define S3C2410_DCON_AUTORELOAD (0<<22) --#define S3C2410_DCON_NORELOAD (1<<22) --#define S3C2410_DCON_HWTRIG (1<<23) -- --#ifdef CONFIG_CPU_S3C2440 --#define S3C2440_DIDSTC_CHKINT (1<<2) -- --#define S3C2440_DCON_CH0_I2SSDO (5<<24) --#define S3C2440_DCON_CH0_PCMIN (6<<24) -- --#define S3C2440_DCON_CH1_PCMOUT (5<<24) --#define S3C2440_DCON_CH1_SDI (6<<24) -- --#define S3C2440_DCON_CH2_PCMIN (5<<24) --#define S3C2440_DCON_CH2_MICIN (6<<24) -- --#define S3C2440_DCON_CH3_MICIN (5<<24) --#define S3C2440_DCON_CH3_PCMOUT (6<<24) --#endif -- --#ifdef CONFIG_CPU_S3C2412 -- --#define S3C2412_DMAREQSEL_SRC(x) ((x)<<1) -- --#define S3C2412_DMAREQSEL_HW (1) -- --#define S3C2412_DMAREQSEL_SPI0TX S3C2412_DMAREQSEL_SRC(0) --#define S3C2412_DMAREQSEL_SPI0RX S3C2412_DMAREQSEL_SRC(1) --#define S3C2412_DMAREQSEL_SPI1TX S3C2412_DMAREQSEL_SRC(2) --#define S3C2412_DMAREQSEL_SPI1RX S3C2412_DMAREQSEL_SRC(3) --#define S3C2412_DMAREQSEL_I2STX S3C2412_DMAREQSEL_SRC(4) --#define S3C2412_DMAREQSEL_I2SRX S3C2412_DMAREQSEL_SRC(5) --#define S3C2412_DMAREQSEL_TIMER S3C2412_DMAREQSEL_SRC(9) --#define S3C2412_DMAREQSEL_SDI S3C2412_DMAREQSEL_SRC(10) --#define S3C2412_DMAREQSEL_USBEP1 S3C2412_DMAREQSEL_SRC(13) --#define S3C2412_DMAREQSEL_USBEP2 S3C2412_DMAREQSEL_SRC(14) --#define S3C2412_DMAREQSEL_USBEP3 S3C2412_DMAREQSEL_SRC(15) --#define S3C2412_DMAREQSEL_USBEP4 S3C2412_DMAREQSEL_SRC(16) --#define S3C2412_DMAREQSEL_XDREQ0 S3C2412_DMAREQSEL_SRC(17) --#define S3C2412_DMAREQSEL_XDREQ1 S3C2412_DMAREQSEL_SRC(18) --#define S3C2412_DMAREQSEL_UART0_0 S3C2412_DMAREQSEL_SRC(19) --#define S3C2412_DMAREQSEL_UART0_1 S3C2412_DMAREQSEL_SRC(20) --#define S3C2412_DMAREQSEL_UART1_0 S3C2412_DMAREQSEL_SRC(21) --#define S3C2412_DMAREQSEL_UART1_1 S3C2412_DMAREQSEL_SRC(22) --#define S3C2412_DMAREQSEL_UART2_0 S3C2412_DMAREQSEL_SRC(23) --#define S3C2412_DMAREQSEL_UART2_1 S3C2412_DMAREQSEL_SRC(24) -- --#endif -- --#define S3C2443_DMAREQSEL_SRC(x) ((x)<<1) -- --#define S3C2443_DMAREQSEL_HW (1) - --#define S3C2443_DMAREQSEL_SPI0TX S3C2443_DMAREQSEL_SRC(0) --#define S3C2443_DMAREQSEL_SPI0RX S3C2443_DMAREQSEL_SRC(1) --#define S3C2443_DMAREQSEL_SPI1TX S3C2443_DMAREQSEL_SRC(2) --#define S3C2443_DMAREQSEL_SPI1RX S3C2443_DMAREQSEL_SRC(3) --#define S3C2443_DMAREQSEL_I2STX S3C2443_DMAREQSEL_SRC(4) --#define S3C2443_DMAREQSEL_I2SRX S3C2443_DMAREQSEL_SRC(5) --#define S3C2443_DMAREQSEL_TIMER S3C2443_DMAREQSEL_SRC(9) --#define S3C2443_DMAREQSEL_SDI S3C2443_DMAREQSEL_SRC(10) --#define S3C2443_DMAREQSEL_XDREQ0 S3C2443_DMAREQSEL_SRC(17) --#define S3C2443_DMAREQSEL_XDREQ1 S3C2443_DMAREQSEL_SRC(18) --#define S3C2443_DMAREQSEL_UART0_0 S3C2443_DMAREQSEL_SRC(19) --#define S3C2443_DMAREQSEL_UART0_1 S3C2443_DMAREQSEL_SRC(20) --#define S3C2443_DMAREQSEL_UART1_0 S3C2443_DMAREQSEL_SRC(21) --#define S3C2443_DMAREQSEL_UART1_1 S3C2443_DMAREQSEL_SRC(22) --#define S3C2443_DMAREQSEL_UART2_0 S3C2443_DMAREQSEL_SRC(23) --#define S3C2443_DMAREQSEL_UART2_1 S3C2443_DMAREQSEL_SRC(24) --#define S3C2443_DMAREQSEL_UART3_0 S3C2443_DMAREQSEL_SRC(25) --#define S3C2443_DMAREQSEL_UART3_1 S3C2443_DMAREQSEL_SRC(26) --#define S3C2443_DMAREQSEL_PCMOUT S3C2443_DMAREQSEL_SRC(27) --#define S3C2443_DMAREQSEL_PCMIN S3C2443_DMAREQSEL_SRC(28) --#define S3C2443_DMAREQSEL_MICIN S3C2443_DMAREQSEL_SRC(29) -+static int s3c_dma_has_circular(void) -+{ -+ return 0; -+} - - #endif /* __ASM_ARCH_DMA_H */ -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/gpio-core.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/gpio-core.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/gpio-core.h 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/gpio-core.h 2009-05-10 22:27:59.000000000 +0200 -@@ -15,20 +15,7 @@ - #ifndef __ASM_ARCH_GPIO_CORE_H - #define __ASM_ARCH_GPIO_CORE_H __FILE__ - -+/* currently we just include the platform support */ - #include --#include -- --extern struct s3c_gpio_chip s3c24xx_gpios[]; -- --static inline struct s3c_gpio_chip *s3c_gpiolib_getchip(unsigned int pin) --{ -- struct s3c_gpio_chip *chip; -- -- if (pin > S3C2410_GPG10) -- return NULL; -- -- chip = &s3c24xx_gpios[pin/32]; -- return (S3C2410_GPIO_OFFSET(pin) > chip->chip.ngpio) ? chip : NULL; --} - - #endif /* __ASM_ARCH_GPIO_CORE_H */ -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/gpio.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/gpio.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/gpio.h 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/gpio.h 2009-05-10 22:27:59.000000000 +0200 -@@ -22,4 +22,13 @@ - - #define ARCH_NR_GPIOS (256 + CONFIG_S3C24XX_GPIO_EXTRA) - -+/* These two defines should be removed as soon as the -+ * generic irq handling makes it upstream */ -+#include -+#define irq_to_gpio(irq) s3c2410_gpio_irq2pin(irq) -+/* -- cut to here when generic irq makes it */ -+ - #include -+#include -+ -+#define S3C_GPIO_END (S3C2410_GPIO_BANKH + 32) -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h 2009-05-10 22:27:59.000000000 +0200 -@@ -0,0 +1,23 @@ -+/* arch/arm/mach-s3c2410/include/mach/gpio-nrs.h -+ * -+ * Copyright (c) 2008 Simtec Electronics -+ * http://armlinux.simtec.co.uk/ -+ * Ben Dooks -+ * -+ * S3C2410 - GPIO bank numbering -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+*/ -+ -+#define S3C2410_GPIONO(bank,offset) ((bank) + (offset)) -+ -+#define S3C2410_GPIO_BANKA (32*0) -+#define S3C2410_GPIO_BANKB (32*1) -+#define S3C2410_GPIO_BANKC (32*2) -+#define S3C2410_GPIO_BANKD (32*3) -+#define S3C2410_GPIO_BANKE (32*4) -+#define S3C2410_GPIO_BANKF (32*5) -+#define S3C2410_GPIO_BANKG (32*6) -+#define S3C2410_GPIO_BANKH (32*7) -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/gta01.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/gta01.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/gta01.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/gta01.h 2009-05-10 22:27:59.000000000 +0200 -@@ -0,0 +1,76 @@ -+#ifndef _GTA01_H -+#define _GTA01_H -+ -+#include -+#include -+ -+/* Different hardware revisions, passed in ATAG_REVISION by u-boot */ -+#define GTA01v3_SYSTEM_REV 0x00000130 -+#define GTA01v4_SYSTEM_REV 0x00000140 -+#define GTA01Bv2_SYSTEM_REV 0x00000220 -+#define GTA01Bv3_SYSTEM_REV 0x00000230 -+#define GTA01Bv4_SYSTEM_REV 0x00000240 -+ -+/* Backlight */ -+ -+extern void gta01bl_deferred_resume(void); -+ -+struct gta01bl_machinfo { -+ unsigned int default_intensity; -+ unsigned int max_intensity; -+ unsigned int limit_mask; -+ unsigned int defer_resume_backlight; -+}; -+ -+/* Definitions common to all revisions */ -+#define GTA01_GPIO_BACKLIGHT S3C2410_GPB0 -+#define GTA01_GPIO_GPS_PWRON S3C2410_GPB1 -+#define GTA01_GPIO_MODEM_RST S3C2410_GPB6 -+#define GTA01_GPIO_MODEM_ON S3C2410_GPB7 -+#define GTA01_GPIO_LCD_RESET S3C2410_GPC6 -+#define GTA01_GPIO_PMU_IRQ S3C2410_GPG8 -+#define GTA01_GPIO_JACK_INSERT S3C2410_GPF4 -+#define GTA01_GPIO_nSD_DETECT S3C2410_GPF5 -+#define GTA01_GPIO_AUX_KEY S3C2410_GPF6 -+#define GTA01_GPIO_HOLD_KEY S3C2410_GPF7 -+#define GTA01_GPIO_VIBRATOR_ON S3C2410_GPG11 -+ -+#define GTA01_IRQ_MODEM IRQ_EINT1 -+#define GTA01_IRQ_JACK_INSERT IRQ_EINT4 -+#define GTA01_IRQ_nSD_DETECT IRQ_EINT5 -+#define GTA01_IRQ_AUX_KEY IRQ_EINT6 -+#define GTA01_IRQ_PCF50606 IRQ_EINT16 -+ -+/* GTA01v3 */ -+#define GTA01v3_GPIO_nGSM_EN S3C2410_GPG9 -+ -+/* GTA01v4 */ -+#define GTA01_GPIO_MODEM_DNLOAD S3C2410_GPG0 -+ -+/* GTA01Bv2 */ -+#define GTA01Bv2_GPIO_nGSM_EN S3C2410_GPF2 -+#define GTA01Bv2_GPIO_VIBRATOR_ON S3C2410_GPB10 -+ -+/* GTA01Bv3 */ -+#define GTA01_GPIO_GPS_EN_3V3 S3C2410_GPG9 -+ -+#define GTA01_GPIO_SDMMC_ON S3C2410_GPB2 -+#define GTA01_GPIO_BT_EN S3C2410_GPB5 -+#define GTA01_GPIO_AB_DETECT S3C2410_GPB8 -+#define GTA01_GPIO_USB_PULLUP S3C2410_GPB9 -+#define GTA01_GPIO_USB_ATTACH S3C2410_GPB10 -+ -+#define GTA01_GPIO_GPS_EN_2V8 S3C2410_GPG9 -+#define GTA01_GPIO_GPS_EN_3V S3C2410_GPG10 -+#define GTA01_GPIO_GPS_RESET S3C2410_GPC0 -+ -+/* GTA01Bv4 */ -+#define GTA01Bv4_GPIO_nNAND_WP S3C2410_GPA16 -+#define GTA01Bv4_GPIO_VIBRATOR_ON S3C2410_GPB3 -+#define GTA01Bv4_GPIO_PMU_IRQ S3C2410_GPG1 -+ -+#define GTA01Bv4_IRQ_PCF50606 IRQ_EINT9 -+ -+extern struct pcf50606 *gta01_pcf; -+ -+#endif /* _GTA01_H */ -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/gta02-pm-wlan.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/gta02-pm-wlan.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/gta02-pm-wlan.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/gta02-pm-wlan.h 2009-05-10 22:27:59.000000000 +0200 -@@ -0,0 +1,10 @@ -+#ifndef __MACH_GTA02_PM_WLAN_H -+#define __MACH_GTA02_PM_WLAN_H -+ -+void gta02_wlan_reset(int assert_reset); -+int gta02_wlan_query_rfkill_lock(void); -+void gta02_wlan_query_rfkill_unlock(void); -+void gta02_wlan_set_rfkill_cb(int (*cb)(void *user, int on), void *user); -+void gta02_wlan_clear_rfkill_cb(void); -+ -+#endif /* __MACH_GTA02_PM_WLAN_H */ -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/hardware.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/hardware.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/hardware.h 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/hardware.h 2009-05-10 22:27:59.000000000 +0200 -@@ -131,7 +131,4 @@ - - /* machine specific hardware definitions should go after this */ - --/* currently here until moved into config (todo) */ --#define CONFIG_NO_MULTIWORD_IO -- - #endif /* __ASM_ARCH_HARDWARE_H */ -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/io.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/io.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/io.h 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/io.h 2009-05-10 22:27:59.000000000 +0200 -@@ -9,7 +9,7 @@ - #ifndef __ASM_ARM_ARCH_IO_H - #define __ASM_ARM_ARCH_IO_H - --#include -+#include - - #define IO_SPACE_LIMIT 0xffffffff - -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/irqs.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/irqs.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/irqs.h 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/irqs.h 2009-05-10 22:27:59.000000000 +0200 -@@ -80,7 +80,7 @@ - #define IRQ_EINT22 S3C2410_IRQ(50) - #define IRQ_EINT23 S3C2410_IRQ(51) - -- -+#define IRQ_EINT_BIT(x) ((x) - IRQ_EINT4 + 4) - #define IRQ_EINT(x) (((x) >= 4) ? (IRQ_EINT4 + (x) - 4) : (IRQ_EINT0 + (x))) - - #define IRQ_LCD_FIFO S3C2410_IRQ(52) -@@ -153,9 +153,9 @@ - #define IRQ_S3C2443_AC97 S3C2410_IRQSUB(28) - - #ifdef CONFIG_CPU_S3C2443 --#define NR_IRQS (IRQ_S3C2443_AC97+1) -+#define _NR_IRQS (IRQ_S3C2443_AC97+1) - #else --#define NR_IRQS (IRQ_S3C2440_AC97+1) -+#define _NR_IRQS (IRQ_S3C2440_AC97+1) - #endif - - /* compatibility define. */ -@@ -167,4 +167,33 @@ - /* Our FIQs are routable from IRQ_EINT0 to IRQ_ADCPARENT */ - #define FIQ_START IRQ_EINT0 - -+ -+/* -+ * The next 16 interrupts are for board specific purposes. Since -+ * the kernel can only run on one machine at a time, we can re-use -+ * these. If you need more, increase IRQ_BOARD_END, but keep it -+ * within sensible limits. -+ */ -+#define IRQ_BOARD_START _NR_IRQS -+#define IRQ_BOARD_END (_NR_IRQS + 10) -+ -+#if defined(CONFIG_MACH_NEO1973_GTA02) -+#define NR_IRQS (IRQ_BOARD_END) -+#else -+#define NR_IRQS (IRQ_BOARD_START) -+#endif -+ -+/* Neo1973 GTA02 interrupts */ -+#define NEO1973_GTA02_IRQ(x) (IRQ_BOARD_START + (x)) -+#define IRQ_GLAMO(x) NEO1973_GTA02_IRQ(x) -+#define IRQ_GLAMO_HOSTBUS IRQ_GLAMO(0) -+#define IRQ_GLAMO_JPEG IRQ_GLAMO(1) -+#define IRQ_GLAMO_MPEG IRQ_GLAMO(2) -+#define IRQ_GLAMO_MPROC1 IRQ_GLAMO(3) -+#define IRQ_GLAMO_MPROC0 IRQ_GLAMO(4) -+#define IRQ_GLAMO_CMDQUEUE IRQ_GLAMO(5) -+#define IRQ_GLAMO_2D IRQ_GLAMO(6) -+#define IRQ_GLAMO_MMC IRQ_GLAMO(7) -+#define IRQ_GLAMO_RISC IRQ_GLAMO(8) -+ - #endif /* __ASM_ARCH_IRQ_H */ -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/map.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/map.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/map.h 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/map.h 2009-05-10 22:27:59.000000000 +0200 -@@ -84,7 +84,6 @@ - - #define S3C24XX_PA_IRQ S3C2410_PA_IRQ - #define S3C24XX_PA_MEMCTRL S3C2410_PA_MEMCTRL --#define S3C24XX_PA_USBHOST S3C2410_PA_USBHOST - #define S3C24XX_PA_DMA S3C2410_PA_DMA - #define S3C24XX_PA_CLKPWR S3C2410_PA_CLKPWR - #define S3C24XX_PA_LCD S3C2410_PA_LCD -@@ -102,6 +101,7 @@ - - #define S3C_PA_IIC S3C2410_PA_IIC - #define S3C_PA_UART S3C24XX_PA_UART -+#define S3C_PA_USBHOST S3C2410_PA_USBHOST - #define S3C_PA_HSMMC0 S3C2443_PA_HSMMC - - #endif /* __ASM_ARCH_MAP_H */ -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/mci.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/mci.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/mci.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/mci.h 2009-05-10 22:27:59.000000000 +0200 -@@ -0,0 +1,13 @@ -+#ifndef _ARCH_MCI_H -+#define _ARCH_MCI_H -+ -+struct s3c24xx_mci_pdata { -+ unsigned int gpio_detect; -+ unsigned int gpio_wprotect; -+ unsigned long ocr_avail; -+ unsigned int do_dma; -+ void (*set_power)(unsigned char power_mode, -+ unsigned short vdd); -+}; -+ -+#endif /* _ARCH_NCI_H */ -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/neo1973-pm-gsm.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/neo1973-pm-gsm.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/neo1973-pm-gsm.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/neo1973-pm-gsm.h 2009-05-10 22:27:59.000000000 +0200 -@@ -0,0 +1 @@ -+extern int gta_gsm_interrupts; -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/regs-gpio.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/regs-gpio.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/regs-gpio.h 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/regs-gpio.h 2009-05-10 22:27:59.000000000 +0200 -@@ -14,16 +14,7 @@ - #ifndef __ASM_ARCH_REGS_GPIO_H - #define __ASM_ARCH_REGS_GPIO_H - --#define S3C2410_GPIONO(bank,offset) ((bank) + (offset)) -- --#define S3C2410_GPIO_BANKA (32*0) --#define S3C2410_GPIO_BANKB (32*1) --#define S3C2410_GPIO_BANKC (32*2) --#define S3C2410_GPIO_BANKD (32*3) --#define S3C2410_GPIO_BANKE (32*4) --#define S3C2410_GPIO_BANKF (32*5) --#define S3C2410_GPIO_BANKG (32*6) --#define S3C2410_GPIO_BANKH (32*7) -+#include - - #ifdef CONFIG_CPU_S3C2400 - #define S3C24XX_GPIO_BASE(x) S3C2400_GPIO_BASE(x) -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/regs-sdi.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/regs-sdi.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/regs-sdi.h 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/regs-sdi.h 2009-05-10 22:27:59.000000000 +0200 -@@ -30,6 +30,7 @@ - #define S3C2410_SDIFSTA (0x38) - - #define S3C2410_SDIDATA (0x3C) -+#define S3C2410_SDIDATA_BYTE (0x3C) - #define S3C2410_SDIIMSK (0x40) - - #define S3C2440_SDIDATA (0x40) -@@ -37,6 +38,8 @@ - - #define S3C2440_SDICON_SDRESET (1<<8) - #define S3C2440_SDICON_MMCCLOCK (1<<5) -+#define S3C2440_SDIDATA_BYTE (0x48) -+ - #define S3C2410_SDICON_BYTEORDER (1<<4) - #define S3C2410_SDICON_SDIOIRQ (1<<3) - #define S3C2410_SDICON_RWAITEN (1<<2) -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/s3c24xx-serial.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/s3c24xx-serial.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/s3c24xx-serial.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/s3c24xx-serial.h 2009-05-10 22:27:59.000000000 +0200 -@@ -0,0 +1,5 @@ -+#include -+ -+extern void s3c24xx_serial_console_set_silence(int silence); -+extern void s3c24xx_serial_register_resume_dependency(struct resume_dependency * -+ resume_dependency, int uart_index); -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/spi-gpio.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/spi-gpio.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/spi-gpio.h 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/spi-gpio.h 2009-05-10 22:27:59.000000000 +0200 -@@ -21,7 +21,8 @@ - int num_chipselect; - int bus_num; - -- void (*chip_select)(struct s3c2410_spigpio_info *spi, int cs); -+ int non_blocking_transfer; -+ void (*chip_select)(struct s3c2410_spigpio_info *spi, int csid, int cs); - }; - - -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/ts.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/ts.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/ts.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/ts.h 2009-05-10 22:27:59.000000000 +0200 -@@ -0,0 +1,35 @@ -+/* arch/arm/mach-s3c2410/include/mach/ts.h -+ * -+ * Copyright (c) 2005 Arnaud Patard -+ * -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ * -+ * Changelog: -+ * 24-Mar-2005 RTP Created file -+ * 03-Aug-2005 RTP Renamed to ts.h -+ */ -+ -+#ifndef __ASM_ARM_TS_H -+#define __ASM_ARM_TS_H -+ -+#include <../drivers/input/touchscreen/ts_filter.h> -+ -+struct s3c2410_ts_mach_info { -+ /* Touchscreen delay. */ -+ int delay; -+ /* Prescaler value. */ -+ int presc; -+ /* -+ * Null-terminated array of pointers to filter APIs and configurations -+ * we want to use. In the same order they will be applied. -+ */ -+ const struct ts_filter_chain_configuration *filter_config; -+}; -+ -+void set_s3c2410ts_info(const struct s3c2410_ts_mach_info *hard_s3c2410ts_info); -+ -+#endif /* __ASM_ARM_TS_H */ -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/usb-control.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/usb-control.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/include/mach/usb-control.h 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/include/mach/usb-control.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,41 +0,0 @@ --/* arch/arm/mach-s3c2410/include/mach/usb-control.h -- * -- * Copyright (c) 2004 Simtec Electronics -- * Ben Dooks -- * -- * S3C2410 - usb port information -- * -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License version 2 as -- * published by the Free Software Foundation. --*/ -- --#ifndef __ASM_ARCH_USBCONTROL_H --#define __ASM_ARCH_USBCONTROL_H "arch/arm/mach-s3c2410/include/mach/usb-control.h" -- --#define S3C_HCDFLG_USED (1) -- --struct s3c2410_hcd_port { -- unsigned char flags; -- unsigned char power; -- unsigned char oc_status; -- unsigned char oc_changed; --}; -- --struct s3c2410_hcd_info { -- struct usb_hcd *hcd; -- struct s3c2410_hcd_port port[2]; -- -- void (*power_control)(int port, int to); -- void (*enable_oc)(struct s3c2410_hcd_info *, int on); -- void (*report_oc)(struct s3c2410_hcd_info *, int ports); --}; -- --static void inline s3c2410_usb_report_oc(struct s3c2410_hcd_info *info, int ports) --{ -- if (info->report_oc != NULL) { -- (info->report_oc)(info, ports); -- } --} -- --#endif /*__ASM_ARCH_USBCONTROL_H */ -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/Kconfig linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/Kconfig ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/Kconfig 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/Kconfig 2009-05-10 22:27:59.000000000 +0200 -@@ -10,6 +10,7 @@ - select CPU_ARM920T - select S3C2410_CLOCK - select S3C2410_GPIO -+ select S3C_PWM - select CPU_LLSERIAL_S3C2410 - select S3C2410_PM if PM - help -@@ -45,6 +46,7 @@ - Internal node for machines with an BAST style IDE - interface - -+ - menu "S3C2410 Machines" - - config ARCH_SMDK2410 -@@ -59,6 +61,7 @@ - bool "IPAQ H1940" - select CPU_S3C2410 - select PM_H1940 if PM -+ select S3C_DEV_USB_HOST - help - Say Y here if you are using the HP IPAQ H1940 - -@@ -70,6 +73,7 @@ - config MACH_N30 - bool "Acer N30 family" - select CPU_S3C2410 -+ select S3C_DEV_USB_HOST - help - Say Y here if you want suppt for the Acer N30, Acer N35, - Navman PiN570, Yakumo AlphaX or Airis NC05 PDAs. -@@ -82,6 +86,7 @@ - select MACH_BAST_IDE - select S3C24XX_DCLK - select ISA -+ select S3C_DEV_USB_HOST - help - Say Y here if you are using the Simtec Electronics EB2410ITX - development board (also known as BAST) -@@ -89,6 +94,7 @@ - config MACH_OTOM - bool "NexVision OTOM Board" - select CPU_S3C2410 -+ select S3C_DEV_USB_HOST - help - Say Y here if you are using the Nex Vision OTOM board - -@@ -96,6 +102,7 @@ - bool "AML M5900 Series" - select CPU_S3C2410 - select PM_SIMTEC if PM -+ select S3C_DEV_USB_HOST - help - Say Y here if you are using the American Microsystems M5900 Series - -@@ -111,6 +118,7 @@ - config MACH_TCT_HAMMER - bool "TCT Hammer Board" - select CPU_S3C2410 -+ select S3C_DEV_USB_HOST - help - Say Y here if you are using the TinCanTools Hammer Board - -@@ -128,7 +136,27 @@ - config MACH_QT2410 - bool "QT2410" - select CPU_S3C2410 -+ select DISPLAY_JBT6K74 - 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 S3C_DEV_USB_HOST -+ select MFD_PCF50606 -+ select INPUT_PCF50606_PMU -+ select PCF50606_ADC -+ select PCF50606_GPIO -+ select RTC_DRV_PCF50606 -+ select REGULATOR_PCF50606 -+ select CHARGER_PCF50606 -+ select PCF50606_WATCHDOG -+ select POWER_SUPPLY -+ select BATTERY_GTA01 -+ -+ help -+ Say Y here if you are using the FIC Neo1973 GSM Phone -+ - endmenu -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/mach-gta01.c linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/mach-gta01.c ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/mach-gta01.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/mach-gta01.c 2009-05-10 22:27:59.000000000 +0200 -@@ -0,0 +1,1008 @@ -+/* -+ * linux/arch/arm/mach-s3c2410/mach-gta01.c -+ * -+ * S3C2410 Machine Support for the FIC Neo1973 GTA01 -+ * -+ * Copyright (C) 2006-2007 by Openmoko, Inc. -+ * Author: Harald Welte -+ * 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 -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+ -+#include -+ -+#include -+#include -+#include -+#include -+ -+#include -+ -+#include -+#include -+ -+ -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+#include <../drivers/input/touchscreen/ts_filter_chain.h> -+#ifdef CONFIG_TOUCHSCREEN_FILTER -+#include <../drivers/input/touchscreen/ts_filter_linear.h> -+#include <../drivers/input/touchscreen/ts_filter_mean.h> -+#include <../drivers/input/touchscreen/ts_filter_median.h> -+#include <../drivers/input/touchscreen/ts_filter_group.h> -+#endif -+ -+ -+static struct map_desc gta01_iodesc[] __initdata = { -+ { -+ .virtual = 0xe0000000, -+ .pfn = __phys_to_pfn(S3C2410_CS3+0x01000000), -+ .length = SZ_1M, -+ .type = 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 -+/* UFCON for the gta01 sets the FIFO trigger level at 4, not 8 */ -+#define UFCON_GTA01_PORT0 S3C2410_UFCON_FIFOMODE -+ -+static struct s3c2410_uartcfg gta01_uartcfgs[] = { -+ [0] = { -+ .hwport = 0, -+ .flags = 0, -+ .ucon = UCON, -+ .ulcon = ULCON, -+ .ufcon = UFCON_GTA01_PORT0, -+ }, -+ [1] = { -+ .hwport = 1, -+ .flags = 0, -+ .ucon = UCON, -+ .ulcon = ULCON, -+ .ufcon = UFCON, -+ }, -+}; -+ -+/* TODO */ -+static void gta01_pmu_event_callback(struct pcf50606 *pcf, int irq) -+{ -+ /*TODO : Handle ACD here */ -+} -+ -+/* FIXME : Goes away when ACD is handled above */ -+#if 0 -+static int pmu_callback(struct device *dev, unsigned int feature, -+ enum pmu_event event) -+{ -+ switch (feature) { -+ case PCF50606_FEAT_ACD: -+ switch (event) { -+ case PMU_EVT_INSERT: -+ pcf50606_charge_fast(pcf50606_global, 1); -+ break; -+ case PMU_EVT_REMOVE: -+ pcf50606_charge_fast(pcf50606_global, 0); -+ break; -+ default: -+ break; -+ } -+ break; -+ default: -+ break; -+ } -+ -+ return 0; -+} -+#endif -+ -+struct pcf50606 *gta01_pcf; -+ -+static struct platform_device gta01_pm_gsm_dev = { -+ .name = "neo1973-pm-gsm", -+}; -+ -+static struct platform_device gta01_pm_bt_dev = { -+ .name = "neo1973-pm-bt", -+}; -+static struct platform_device gta01_pm_gps_dev = { -+ .name = "neo1973-pm-gps", -+}; -+ -+static struct regulator_consumer_supply ioreg_consumers[] = { -+ { -+ .dev = >a01_pm_gps_dev.dev, -+ .supply = "GPS_2V8", -+ }, -+}; -+ -+static struct regulator_consumer_supply d1reg_consumers[] = { -+ { -+ .dev = >a01_pm_gps_dev.dev, -+ .supply = "GPS_3V", -+ }, -+ { -+ .dev = >a01_pm_bt_dev.dev, -+ .supply = "BT_3V1", -+ }, -+}; -+ -+static struct regulator_consumer_supply dcd_consumers[] = { -+ { -+ .dev = >a01_pm_gps_dev.dev, -+ .supply = "GPS_3V3", -+ }, -+ { -+ .dev = >a01_pm_gps_dev.dev, -+ .supply = "GPS_1V5", -+ }, -+}; -+ -+static struct regulator_consumer_supply d2reg_consumers[] = { -+ { -+ .dev = >a01_pm_gps_dev.dev, -+ .supply = "GPS_2V5", -+ }, -+ { -+ .dev = &s3c_device_sdi.dev, -+ .supply = "SD_3V3", -+ }, -+}; -+ -+static int gta01_bat_get_charging_status(void) -+{ -+ struct pcf50606 *pcf = gta01_pcf; -+ u8 mbcc1, chgmod; -+ -+ mbcc1 = pcf50606_reg_read(pcf, PCF50606_REG_MBCC1); -+ chgmod = mbcc1 & PCF50606_MBCC1_CHGMOD_MASK; -+ -+ if (chgmod == PCF50606_MBCC1_CHGMOD_IDLE) -+ return 0; -+ else -+ return 1; -+} -+ -+static int gta01_bat_get_voltage(void) -+{ -+ struct pcf50606 *pcf = gta01_pcf; -+ u16 adc, mv = 0; -+ -+ adc = pcf50606_adc_sync_read(pcf, PCF50606_ADCMUX_BATVOLT_RES); -+ mv = (adc * 6000) / 1024; -+ -+ return mv; -+} -+ -+static int gta01_bat_get_current(void) -+{ -+ struct pcf50606 *pcf = gta01_pcf; -+ u16 adc_battvolt, adc_adcin1; -+ s32 res; -+ -+ adc_battvolt = pcf50606_adc_sync_read(pcf, PCF50606_ADCMUX_BATVOLT_SUBTR); -+ adc_adcin1 = pcf50606_adc_sync_read(pcf, PCF50606_ADCMUX_ADCIN1_SUBTR); -+ res = (adc_adcin1 - adc_battvolt) * 2400; -+ -+ /*rsense is 220 milli */ -+ return (res * 1000) / (220 * 1024); -+} -+ -+static struct gta01_bat_platform_data gta01_bat_pdata = { -+ .get_charging_status = gta01_bat_get_charging_status, -+ .get_voltage = gta01_bat_get_voltage, -+ .get_current = gta01_bat_get_current, -+}; -+ -+struct platform_device gta01_bat = { -+ .name = "gta01_battery", -+ .id = -1, -+ .dev = { -+ .platform_data = >a01_bat_pdata, -+ } -+}; -+ -+static void gta01_pcf_probe_done(struct pcf50606 *pcf) -+{ -+ gta01_pcf = pcf; -+ gta01_bat.dev.parent = pcf->dev; -+ platform_device_register(>a01_bat); -+} -+ -+static int gps_registered_regulators = 0; -+ -+static void gta01_pmu_regulator_registered(struct pcf50606 *pcf, int id) -+{ -+ switch(id) { -+ case PCF50606_REGULATOR_D1REG: -+ platform_device_register(>a01_pm_bt_dev); -+ gps_registered_regulators++; -+ break; -+ case PCF50606_REGULATOR_D2REG: -+ gps_registered_regulators++; -+ break; -+ case PCF50606_REGULATOR_IOREG: -+ case PCF50606_REGULATOR_DCD: -+ gps_registered_regulators++; -+ break; -+ } -+ -+ /* All GPS related regulators registered ? */ -+ if (gps_registered_regulators == 4) -+ platform_device_register(>a01_pm_gps_dev); -+ -+} -+ -+static struct pcf50606_platform_data gta01_pcf_pdata = { -+ .resumers = { -+ [0] = PCF50606_INT1_ALARM | -+ PCF50606_INT1_ONKEYF | -+ PCF50606_INT1_EXTONR, -+ [1] = PCF50606_INT2_CHGWD10S | -+ PCF50606_INT2_CHGPROT | -+ PCF50606_INT2_CHGERR, -+ [2] = PCF50606_INT3_LOWBAT | -+ PCF50606_INT3_HIGHTMP | -+ PCF50606_INT3_ACDINS, -+ }, -+ .mbc_event_callback = gta01_pmu_event_callback, -+ .reg_init_data = { -+ [PCF50606_REGULATOR_D1REG] = { -+ .constraints = { -+ .min_uV = 3000000, -+ .max_uV = 3150000, -+ .valid_modes_mask = REGULATOR_MODE_NORMAL, -+ .apply_uV = 1, -+ }, -+ .num_consumer_supplies = ARRAY_SIZE(d1reg_consumers), -+ .consumer_supplies = d1reg_consumers, -+ }, -+ -+ [PCF50606_REGULATOR_D2REG] = { -+ .constraints = { -+ .min_uV = 1650000, -+ .max_uV = 3300000, -+ .valid_modes_mask = REGULATOR_MODE_NORMAL, -+ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, -+ .apply_uV = 1, -+ }, -+ .num_consumer_supplies = ARRAY_SIZE(d2reg_consumers), -+ .consumer_supplies = d2reg_consumers, -+ -+ }, -+ -+ [PCF50606_REGULATOR_D3REG] = { -+ .constraints = { -+ .min_uV = 1800000, -+ .max_uV = 2100000, -+ .valid_modes_mask = REGULATOR_MODE_NORMAL, -+ .state_mem = { -+ .enabled = 1, -+ }, -+ }, -+ .num_consumer_supplies = 0, -+ }, -+ -+ [PCF50606_REGULATOR_DCD] = { -+ .constraints = { -+ .min_uV = 1500000, -+ .max_uV = 1500000, -+ .valid_modes_mask = REGULATOR_MODE_NORMAL, -+ .apply_uV = 1, -+ }, -+ .num_consumer_supplies = ARRAY_SIZE(dcd_consumers), -+ .consumer_supplies = dcd_consumers, -+ }, -+ -+ [PCF50606_REGULATOR_DCDE] = { -+ .constraints = { -+ .min_uV = 3300000, -+ .max_uV = 3300000, -+ .valid_modes_mask = REGULATOR_MODE_NORMAL, -+ .apply_uV = 1, -+ .state_mem = { -+ .enabled = 1, -+ }, -+ }, -+ .num_consumer_supplies = 0, -+ }, -+ -+ [PCF50606_REGULATOR_DCUD] = { -+ .constraints = { -+ .min_uV = 2100000, -+ .max_uV = 2100000, -+ .valid_modes_mask = REGULATOR_MODE_NORMAL, -+ .apply_uV = 1, -+ .state_mem = { -+ .enabled = 1, -+ }, -+ }, -+ .num_consumer_supplies = 0, -+ }, -+ -+ [PCF50606_REGULATOR_IOREG] = { -+ .constraints = { -+ .min_uV = 3300000, -+ .max_uV = 3300000, -+ .valid_modes_mask = REGULATOR_MODE_NORMAL, -+ .apply_uV = 1, -+ }, -+ .num_consumer_supplies = ARRAY_SIZE(ioreg_consumers), -+ .consumer_supplies = ioreg_consumers, -+ -+ }, -+ -+ [PCF50606_REGULATOR_LPREG] = { -+ .constraints = { -+ .min_uV = 3300000, -+ .max_uV = 3300000, -+ .valid_modes_mask = REGULATOR_MODE_NORMAL, -+ .apply_uV = 1, -+ }, -+ .num_consumer_supplies = 0, -+ }, -+ }, -+ .probe_done = gta01_pcf_probe_done, -+ .regulator_registered = gta01_pmu_regulator_registered, -+}; -+ -+static void cfg_pmu_vrail(struct regulator_init_data *vrail, -+ unsigned int suspend_on, unsigned int min, -+ unsigned int max) -+{ -+ vrail->constraints.state_mem.enabled = suspend_on; -+ vrail->constraints.min_uV = min; -+ vrail->constraints.max_uV = min; -+ vrail->constraints.apply_uV = 1; -+} -+ -+static void mangle_pmu_pdata_by_system_rev(void) -+{ -+ struct regulator_init_data *reg_init_data; -+ -+ reg_init_data = gta01_pcf_pdata.reg_init_data; -+ -+ switch (S3C_SYSTEM_REV_ATAG) { -+ case GTA01Bv4_SYSTEM_REV: -+ -+ /* FIXME : gta01_pcf_pdata.used_features |= PCF50606_FEAT_ACD; */ -+ break; -+ case GTA01Bv3_SYSTEM_REV: -+ case GTA01Bv2_SYSTEM_REV: -+ reg_init_data[PCF50606_REGULATOR_D3REG].constraints.state_mem.enabled = 1; -+ break; -+ case GTA01v4_SYSTEM_REV: -+ cfg_pmu_vrail(®_init_data[PCF50606_REGULATOR_DCUD], -+ 1, 18000000, 1800000); -+ cfg_pmu_vrail(®_init_data[PCF50606_REGULATOR_D1REG], -+ 0, 3000000, 3000000); -+ cfg_pmu_vrail(®_init_data[PCF50606_REGULATOR_D3REG], -+ 0, 2800000, 2800000); -+ cfg_pmu_vrail(®_init_data[PCF50606_REGULATOR_DCD], -+ 0, 3500000, 3500000); -+ break; -+ case GTA01v3_SYSTEM_REV: -+ cfg_pmu_vrail(®_init_data[PCF50606_REGULATOR_D1REG], -+ 0, 3000000, 3000000); -+ cfg_pmu_vrail(®_init_data[PCF50606_REGULATOR_D2REG], -+ 0, 3300000, 3300000); -+ cfg_pmu_vrail(®_init_data[PCF50606_REGULATOR_D3REG], -+ 0, 3300000, 3300000); -+ cfg_pmu_vrail(®_init_data[PCF50606_REGULATOR_DCD], -+ 0, 3300000, 3300000); -+ cfg_pmu_vrail(®_init_data[PCF50606_REGULATOR_DCUD], -+ 1, 1800000, 1800000); -+ cfg_pmu_vrail(®_init_data[PCF50606_REGULATOR_IOREG], -+ 0, 2800000, 2800000); -+ break; -+ } -+} -+ -+static void gta01_power_off(void) -+{ -+ pcf50606_reg_write(gta01_pcf, PCF50606_REG_OOCC1, -+ PCF50606_OOCC1_GOSTDBY); -+} -+ -+/* LCD driver info */ -+ -+/* Configuration for 480x640 toppoly TD028TTEC1. -+ * Do not mark this as __initdata or it will break! */ -+static struct s3c2410fb_display gta01_displays[] = { -+ { -+ .type = S3C2410_LCDCON1_TFT, -+ .width = 43, -+ .height = 58, -+ .xres = 480, -+ .yres = 640, -+ .bpp = 16, -+ -+ .pixclock = 40000, /* HCLK/4 */ -+ .left_margin = 104, -+ .right_margin = 8, -+ .hsync_len = 8, -+ .upper_margin = 2, -+ .lower_margin = 16, -+ .vsync_len = 2, -+ .lcdcon5 = S3C2410_LCDCON5_FRM565 | -+ S3C2410_LCDCON5_INVVCLK | -+ S3C2410_LCDCON5_INVVLINE | -+ S3C2410_LCDCON5_INVVFRAME | -+ S3C2410_LCDCON5_PWREN | -+ S3C2410_LCDCON5_HWSWP, -+ }, -+ { -+ .type = S3C2410_LCDCON1_TFT, -+ .width = 43, -+ .height = 58, -+ .xres = 480, -+ .yres = 640, -+ .bpp = 32, -+ -+ .pixclock = 40000, /* HCLK/4 */ -+ .left_margin = 104, -+ .right_margin = 8, -+ .hsync_len = 8, -+ .upper_margin = 2, -+ .lower_margin = 16, -+ .vsync_len = 2, -+ .lcdcon5 = S3C2410_LCDCON5_FRM565 | -+ S3C2410_LCDCON5_INVVCLK | -+ S3C2410_LCDCON5_INVVLINE | -+ S3C2410_LCDCON5_INVVFRAME | -+ S3C2410_LCDCON5_PWREN | -+ S3C2410_LCDCON5_HWSWP, -+ }, -+ { -+ .type = S3C2410_LCDCON1_TFT, -+ .width = 43, -+ .height = 58, -+ .xres = 240, -+ .yres = 320, -+ .bpp = 16, -+ -+ .pixclock = 40000, /* HCLK/4 */ -+ .left_margin = 104, -+ .right_margin = 8, -+ .hsync_len = 8, -+ .upper_margin = 2, -+ .lower_margin = 16, -+ .vsync_len = 2, -+ .lcdcon5 = S3C2410_LCDCON5_FRM565 | -+ S3C2410_LCDCON5_INVVCLK | -+ S3C2410_LCDCON5_INVVLINE | -+ S3C2410_LCDCON5_INVVFRAME | -+ S3C2410_LCDCON5_PWREN | -+ S3C2410_LCDCON5_HWSWP, -+ }, -+}; -+ -+static struct s3c2410fb_mach_info gta01_lcd_cfg __initdata = { -+ .displays = gta01_displays, -+ .num_displays = ARRAY_SIZE(gta01_displays), -+ .default_display = 0, -+ -+ .lpcsel = ((0xCE6) & ~7) | 1<<4, -+}; -+ -+static struct platform_device *gta01_devices[] __initdata = { -+ &s3c_device_usb, -+ &s3c_device_lcd, -+ &s3c_device_wdt, -+ &s3c_device_i2c0, -+ &s3c_device_iis, -+ &s3c_device_sdi, -+ &s3c_device_usbgadget, -+ &s3c_device_nand, -+ &s3c_device_ts, -+}; -+ -+static struct s3c2410_nand_set gta01_nand_sets[] = { -+ [0] = { -+ .name = "neo1973-nand", -+ .nr_chips = 1, -+ .flags = S3C2410_NAND_BBT, -+ }, -+}; -+ -+static struct s3c2410_platform_nand gta01_nand_info = { -+ .tacls = 20, -+ .twrph0 = 60, -+ .twrph1 = 20, -+ .nr_sets = ARRAY_SIZE(gta01_nand_sets), -+ .sets = gta01_nand_sets, -+}; -+ -+static struct regulator *s3c_sdi_regulator; -+ -+static void gta01_mmc_set_power(unsigned char power_mode, unsigned short vdd) -+{ -+ int bit; -+ int mv = 1700; /* 1.7V for MMC_VDD_165_195 */ -+ struct regulator *regulator; -+ -+ printk(KERN_DEBUG "mmc_set_power(power_mode=%u, vdd=%u)\n", -+ power_mode, vdd); -+ -+ if (!s3c_sdi_regulator) { -+ s3c_sdi_regulator = -+ regulator_get(&s3c_device_sdi.dev, "SD_3V3"); -+ if (!s3c_sdi_regulator) { -+ printk(KERN_ERR "gta01_mmc_set_power : Cannot get regulator"); -+ return; -+ } -+ } -+ -+ regulator = s3c_sdi_regulator; -+ -+ return; -+ switch (S3C_SYSTEM_REV_ATAG) { -+ case GTA01v3_SYSTEM_REV: -+ switch (power_mode) { -+ case MMC_POWER_OFF: -+ regulator_disable(regulator); -+ break; -+ case MMC_POWER_ON: -+ /* translate MMC_VDD_* VDD bit to mv */ -+ for (bit = 8; bit != 24; bit++) -+ if (vdd == (1 << bit)) -+ mv += 100 * (bit - 4); -+ regulator_set_voltage(regulator, mv * 1000, mv * 10000); -+ break; -+ case MMC_POWER_UP: -+ regulator_enable(regulator); -+ break; -+ } -+ break; -+ case GTA01v4_SYSTEM_REV: -+ case GTA01Bv2_SYSTEM_REV: -+ case GTA01Bv3_SYSTEM_REV: -+ case GTA01Bv4_SYSTEM_REV: -+ switch (power_mode) { -+ case MMC_POWER_OFF: -+ neo1973_gpb_setpin(GTA01_GPIO_SDMMC_ON, 1); -+ break; -+ case MMC_POWER_ON: -+ neo1973_gpb_setpin(GTA01_GPIO_SDMMC_ON, 0); -+ break; -+ } -+ break; -+ } -+ -+ if (regulator) -+ regulator_put(regulator); -+} -+ -+static struct s3c24xx_mci_pdata gta01_mmc_cfg = { -+ .gpio_detect = GTA01_GPIO_nSD_DETECT, -+ .set_power = >a01_mmc_set_power, -+ .ocr_avail = MMC_VDD_165_195|MMC_VDD_20_21| -+ MMC_VDD_21_22|MMC_VDD_22_23|MMC_VDD_23_24| -+ 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, -+}; -+ -+static void gta01_udc_command(enum s3c2410_udc_cmd_e cmd) -+{ -+ printk(KERN_DEBUG "%s(%d)\n", __func__, cmd); -+ -+ switch (cmd) { -+ case S3C2410_UDC_P_ENABLE: -+ neo1973_gpb_setpin(GTA01_GPIO_USB_PULLUP, 1); -+ break; -+ case S3C2410_UDC_P_DISABLE: -+ neo1973_gpb_setpin(GTA01_GPIO_USB_PULLUP, 0); -+ break; -+ default: -+ break; -+ } -+} -+ -+/* use a work queue, since I2C API inherently schedules -+ * and we get called in hardirq context from UDC driver */ -+ -+struct vbus_draw { -+ struct work_struct work; -+ int ma; -+}; -+static struct vbus_draw gta01_udc_vbus_drawer; -+ -+static void __gta01_udc_vbus_draw(struct work_struct *work) -+{ -+ /* -+ * 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 (!gta01_pcf) -+ return; -+ -+ if (gta01_udc_vbus_drawer.ma >= 500) { -+ /* enable fast charge */ -+ printk(KERN_DEBUG "udc: enabling fast charge\n"); -+ pcf50606_charge_fast(gta01_pcf, 1); -+ } else { -+ /* disable fast charge */ -+ printk(KERN_DEBUG "udc: disabling fast charge\n"); -+ pcf50606_charge_fast(gta01_pcf, 0); -+ } -+} -+ -+static void gta01_udc_vbus_draw(unsigned int ma) -+{ -+ gta01_udc_vbus_drawer.ma = ma; -+ schedule_work(>a01_udc_vbus_drawer.work); -+} -+ -+static struct s3c2410_udc_mach_info gta01_udc_cfg = { -+ .vbus_draw = gta01_udc_vbus_draw, -+}; -+ -+/* Touchscreen configuration. */ -+ -+#ifdef CONFIG_TOUCHSCREEN_FILTER -+const static struct ts_filter_group_configuration gta01_ts_group = { -+ .length = 12, -+ .close_enough = 10, -+ .threshold = 6, /* At least half of the points in a group. */ -+ .attempts = 10, -+}; -+ -+const static struct ts_filter_median_configuration gta01_ts_median = { -+ .extent = 20, -+ .decimation_below = 3, -+ .decimation_threshold = 8 * 3, -+ .decimation_above = 4, -+}; -+ -+const static struct ts_filter_mean_configuration gta01_ts_mean = { -+ .length = 4, -+}; -+ -+const static struct ts_filter_linear_configuration gta01_ts_linear = { -+ .constants = {1, 0, 0, 0, 1, 0, 1}, /* Don't modify coords. */ -+ .coord0 = 0, -+ .coord1 = 1, -+}; -+#endif -+ -+const static struct ts_filter_chain_configuration gta01_filter_configuration[] = -+{ -+#ifdef CONFIG_TOUCHSCREEN_FILTER -+ {&ts_filter_group_api, >a01_ts_group.config}, -+ {&ts_filter_median_api, >a01_ts_median.config}, -+ {&ts_filter_mean_api, >a01_ts_mean.config}, -+ {&ts_filter_linear_api, >a01_ts_linear.config}, -+#endif -+ {NULL, NULL}, -+}; -+ -+const static struct s3c2410_ts_mach_info gta01_ts_cfg = { -+ .delay = 10000, -+ .presc = 0xff, /* slow as we can go */ -+ .filter_config = gta01_filter_configuration, -+}; -+ -+/* SPI */ -+ -+static void gta01_jbt6k74_reset(int devidx, int level) -+{ -+ /* empty place holder; gta01 does not yet use this */ -+ printk(KERN_DEBUG "gta01_jbt6k74_reset\n"); -+} -+ -+static void gta01_jbt6k74_resuming(int devidx) -+{ -+ gta01bl_deferred_resume(); -+} -+ -+const struct jbt6k74_platform_data gta01_jbt6k74_pdata = { -+ .reset = gta01_jbt6k74_reset, -+ .resuming = gta01_jbt6k74_resuming, -+}; -+ -+static struct spi_board_info gta01_spi_board_info[] = { -+ { -+ .modalias = "jbt6k74", -+ .platform_data = >a01_jbt6k74_pdata, -+ /* 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 csidx, int cs) -+{ -+ switch (cs) { -+ case BITBANG_CS_ACTIVE: -+ s3c2410_gpio_setpin(S3C2410_GPG3, 0); -+ break; -+ case BITBANG_CS_INACTIVE: -+ s3c2410_gpio_setpin(S3C2410_GPG3, 1); -+ break; -+ } -+} -+ -+static struct s3c2410_spigpio_info spi_gpio_cfg = { -+ .pin_clk = S3C2410_GPG7, -+ .pin_mosi = S3C2410_GPG6, -+ .pin_miso = S3C2410_GPG5, -+ .chip_select = &spi_gpio_cs, -+ .num_chipselect = 2, /*** Should be 1 or 2 for gta01? ***/ -+}; -+ -+static struct resource s3c_spi_lcm_resource[] = { -+ [0] = { -+ .start = S3C2410_GPG3, -+ .end = S3C2410_GPG3, -+ }, -+ [1] = { -+ .start = S3C2410_GPG5, -+ .end = S3C2410_GPG5, -+ }, -+ [2] = { -+ .start = S3C2410_GPG6, -+ .end = S3C2410_GPG6, -+ }, -+ [3] = { -+ .start = S3C2410_GPG7, -+ .end = S3C2410_GPG7, -+ }, -+}; -+ -+struct platform_device s3c_device_spi_lcm = { -+ .name = "spi_s3c24xx_gpio", -+ .id = 1, -+ .num_resources = ARRAY_SIZE(s3c_spi_lcm_resource), -+ .resource = s3c_spi_lcm_resource, -+ .dev = { -+ .platform_data = &spi_gpio_cfg, -+ }, -+}; -+ -+static struct gta01bl_machinfo backlight_machinfo = { -+ .default_intensity = 1, -+ .max_intensity = 1, -+ .limit_mask = 1, -+ .defer_resume_backlight = 1, -+}; -+ -+static struct resource gta01_bl_resources[] = { -+ [0] = { -+ .start = GTA01_GPIO_BACKLIGHT, -+ .end = GTA01_GPIO_BACKLIGHT, -+ }, -+}; -+ -+struct platform_device gta01_bl_dev = { -+ .name = "gta01-bl", -+ .num_resources = ARRAY_SIZE(gta01_bl_resources), -+ .resource = gta01_bl_resources, -+ .dev = { -+ .platform_data = &backlight_machinfo, -+ }, -+}; -+ -+static struct resource gta01_led_resources[] = { -+ [0] = { -+ .start = GTA01_GPIO_VIBRATOR_ON, -+ .end = GTA01_GPIO_VIBRATOR_ON, -+ }, -+}; -+ -+struct platform_device gta01_led_dev = { -+ .name = "neo1973-vibrator", -+ .num_resources = ARRAY_SIZE(gta01_led_resources), -+ .resource = gta01_led_resources, -+}; -+ -+static struct resource gta01_button_resources[] = { -+ [0] = { -+ .start = GTA01_GPIO_AUX_KEY, -+ .end = GTA01_GPIO_AUX_KEY, -+ }, -+ [1] = { -+ .start = GTA01_GPIO_HOLD_KEY, -+ .end = GTA01_GPIO_HOLD_KEY, -+ }, -+ [2] = { -+ .start = GTA01_GPIO_JACK_INSERT, -+ .end = GTA01_GPIO_JACK_INSERT, -+ }, -+}; -+ -+struct platform_device gta01_button_dev = { -+ .name = "neo1973-button", -+ .num_resources = ARRAY_SIZE(gta01_button_resources), -+ .resource = gta01_button_resources, -+}; -+ -+/* USB */ -+static struct s3c2410_hcd_info gta01_usb_info = { -+ .port[0] = { -+ .flags = S3C_HCDFLG_USED, -+ }, -+ .port[1] = { -+ .flags = 0, -+ }, -+}; -+ -+static void __init gta01_map_io(void) -+{ -+ s3c24xx_init_io(gta01_iodesc, ARRAY_SIZE(gta01_iodesc)); -+ s3c24xx_init_clocks(12*1000*1000); -+ s3c24xx_init_uarts(gta01_uartcfgs, ARRAY_SIZE(gta01_uartcfgs)); -+} -+ -+static irqreturn_t gta01_modem_irq(int irq, void *param) -+{ -+ printk(KERN_DEBUG "GSM wakeup interrupt (IRQ %d)\n", irq); -+ gta_gsm_interrupts++; -+ return IRQ_HANDLED; -+} -+ -+static struct i2c_board_info gta01_i2c_devs[] __initdata = { -+ { -+ I2C_BOARD_INFO("pcf50606", 0x08), -+ .irq = GTA01_IRQ_PCF50606, -+ .platform_data = >a01_pcf_pdata, -+ }, -+ { -+ I2C_BOARD_INFO("lm4857", 0x7c), -+ }, -+ { -+ I2C_BOARD_INFO("wm8753", 0x1a), -+ }, -+}; -+ -+static void __init gta01_machine_init(void) -+{ -+ int rc; -+ -+ if (S3C_SYSTEM_REV_ATAG == GTA01v4_SYSTEM_REV || -+ S3C_SYSTEM_REV_ATAG == GTA01Bv2_SYSTEM_REV || -+ S3C_SYSTEM_REV_ATAG == GTA01Bv3_SYSTEM_REV || -+ S3C_SYSTEM_REV_ATAG == 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; -+ s3c_device_sdi.dev.platform_data = >a01_mmc_cfg; -+ -+ s3c24xx_fb_set_platdata(>a01_lcd_cfg); -+ -+ INIT_WORK(>a01_udc_vbus_drawer.work, __gta01_udc_vbus_draw); -+ s3c24xx_udc_set_platdata(>a01_udc_cfg); -+ s3c_i2c0_set_platdata(NULL); -+ set_s3c2410ts_info(>a01_ts_cfg); -+ -+ /* Set LCD_RESET / XRES to high */ -+ s3c2410_gpio_cfgpin(S3C2410_GPC6, S3C2410_GPIO_OUTPUT); -+ s3c2410_gpio_setpin(S3C2410_GPC6, 1); -+ -+ /* 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); -+ -+ platform_device_register(>a01_bl_dev); -+ platform_device_register(>a01_button_dev); -+ platform_device_register(>a01_pm_gsm_dev); -+ -+ switch (S3C_SYSTEM_REV_ATAG) { -+ case GTA01v3_SYSTEM_REV: -+ case GTA01v4_SYSTEM_REV: -+ /* just use the default (GTA01_IRQ_PCF50606) */ -+ break; -+ case GTA01Bv2_SYSTEM_REV: -+ case GTA01Bv3_SYSTEM_REV: -+ /* just use the default (GTA01_IRQ_PCF50606) */ -+ gta01_led_resources[0].start = -+ gta01_led_resources[0].end = GTA01Bv2_GPIO_VIBRATOR_ON; -+ break; -+ case GTA01Bv4_SYSTEM_REV: -+ gta01_i2c_devs[0].irq = GTA01Bv4_IRQ_PCF50606; -+ gta01_led_resources[0].start = -+ gta01_led_resources[0].end = GTA01Bv4_GPIO_VIBRATOR_ON; -+ break; -+ } -+ mangle_pmu_pdata_by_system_rev(); -+ i2c_register_board_info(0, gta01_i2c_devs, ARRAY_SIZE(gta01_i2c_devs)); -+ spi_register_board_info(gta01_spi_board_info, ARRAY_SIZE(gta01_spi_board_info)); -+ -+ platform_device_register(>a01_led_dev); -+ -+ platform_add_devices(gta01_devices, ARRAY_SIZE(gta01_devices)); -+ -+ s3c_pm_init(); -+ -+ set_irq_type(GTA01_IRQ_MODEM, IRQ_TYPE_EDGE_RISING); -+ rc = request_irq(GTA01_IRQ_MODEM, gta01_modem_irq, IRQF_DISABLED, -+ "modem", NULL); -+ enable_irq_wake(GTA01_IRQ_MODEM); -+ printk(KERN_DEBUG "Enabled GSM wakeup IRQ %d (rc=%d)\n", -+ GTA01_IRQ_MODEM, rc); -+ -+ pm_power_off = >a01_power_off; -+} -+ -+MACHINE_START(NEO1973_GTA01, "GTA01") -+ .phys_io = S3C2410_PA_UART, -+ .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, -+ .boot_params = S3C2410_SDRAM_PA + 0x100, -+ .map_io = gta01_map_io, -+ .init_irq = s3c24xx_init_irq, -+ .init_machine = gta01_machine_init, -+ .timer = &s3c24xx_timer, -+MACHINE_END -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/mach-h1940.c linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/mach-h1940.c ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/mach-h1940.c 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/mach-h1940.c 2009-05-10 22:27:59.000000000 +0200 -@@ -131,6 +131,11 @@ - .vbus_pin_inverted = 1, - }; - -+static struct s3c2410_ts_mach_info h1940_ts_cfg __initdata = { -+ .delay = 10000, -+ .presc = 49, -+ .oversampling_shift = 2, -+}; - - /** - * Set lcd on or off -@@ -188,6 +193,7 @@ - &s3c_device_i2c0, - &s3c_device_iis, - &s3c_device_usbgadget, -+ &s3c_device_ts, - &s3c_device_leds, - &s3c_device_bluetooth, - }; -@@ -203,7 +209,7 @@ - #ifdef CONFIG_PM_H1940 - memcpy(phys_to_virt(H1940_SUSPEND_RESUMEAT), h1940_pm_return, 1024); - #endif -- s3c2410_pm_init(); -+ s3c_pm_init(); - } - - static void __init h1940_init_irq(void) -@@ -216,6 +222,7 @@ - u32 tmp; - - s3c24xx_fb_set_platdata(&h1940_fb_info); -+ set_s3c2410ts_info(&h1940_ts_cfg); - s3c24xx_udc_set_platdata(&h1940_udc_cfg); - s3c_i2c0_set_platdata(NULL); - -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/mach-qt2410.c linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/mach-qt2410.c ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/mach-qt2410.c 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/mach-qt2410.c 2009-05-10 22:27:59.000000000 +0200 -@@ -1,6 +1,6 @@ - /* linux/arch/arm/mach-s3c2410/mach-qt2410.c - * -- * Copyright (C) 2006 by OpenMoko, Inc. -+ * Copyright (C) 2006 by Openmoko, Inc. - * Author: Harald Welte - * All rights reserved. - * -@@ -214,7 +214,7 @@ - - /* SPI */ - --static void spi_gpio_cs(struct s3c2410_spigpio_info *spi, int cs) -+static void spi_gpio_cs(struct s3c2410_spigpio_info *spi, int csidx, int cs) - { - switch (cs) { - case BITBANG_CS_ACTIVE: -@@ -321,6 +321,24 @@ - - __setup("tft=", qt2410_tft_setup); - -+static struct resource qt2410_button_resources[] = { -+ [0] = { -+ .start = S3C2410_GPF0, -+ .end = S3C2410_GPF0, -+ }, -+ [1] = { -+ .start = S3C2410_GPF2, -+ .end = S3C2410_GPF2, -+ }, -+}; -+ -+struct platform_device qt2410_button_dev = { -+ .name ="qt2410-button", -+ .num_resources = ARRAY_SIZE(qt2410_button_resources), -+ .resource = qt2410_button_resources, -+}; -+ -+ - static void __init qt2410_map_io(void) - { - s3c24xx_init_io(qt2410_iodesc, ARRAY_SIZE(qt2410_iodesc)); -@@ -355,7 +373,7 @@ - s3c2410_gpio_cfgpin(S3C2410_GPB5, S3C2410_GPIO_OUTPUT); - - platform_add_devices(qt2410_devices, ARRAY_SIZE(qt2410_devices)); -- s3c2410_pm_init(); -+ s3c_pm_init(); - } - - MACHINE_START(QT2410, "QT2410") -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/Makefile linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/Makefile ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/Makefile 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/Makefile 2009-05-10 22:27:59.000000000 +0200 -@@ -15,6 +15,7 @@ - obj-$(CONFIG_CPU_S3C2410_DMA) += dma.o - obj-$(CONFIG_S3C2410_PM) += pm.o sleep.o - obj-$(CONFIG_S3C2410_GPIO) += gpio.o -+#obj-$(CONFIG_S3C2410_CLOCK) += clock.o - - # Machine support - -@@ -37,3 +38,5 @@ - # machine additions - - obj-$(CONFIG_MACH_BAST_IDE) += bast-ide.o -+obj-$(CONFIG_MACH_NEO1973_GTA01)+= mach-gta01.o -+ -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/pm.c linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/pm.c ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2410/pm.c 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2410/pm.c 2009-05-10 22:27:59.000000000 +0200 -@@ -37,21 +37,14 @@ - #include - #include - --#ifdef CONFIG_S3C2410_PM_DEBUG --extern void pm_dbg(const char *fmt, ...); --#define DBG(fmt...) pm_dbg(fmt) --#else --#define DBG(fmt...) printk(KERN_DEBUG fmt) --#endif -- - static void s3c2410_pm_prepare(void) - { - /* ensure at least GSTATUS3 has the resume address */ - -- __raw_writel(virt_to_phys(s3c2410_cpu_resume), S3C2410_GSTATUS3); -+ __raw_writel(virt_to_phys(s3c_cpu_resume), S3C2410_GSTATUS3); - -- DBG("GSTATUS3 0x%08x\n", __raw_readl(S3C2410_GSTATUS3)); -- DBG("GSTATUS4 0x%08x\n", __raw_readl(S3C2410_GSTATUS4)); -+ S3C_PMDBG("GSTATUS3 0x%08x\n", __raw_readl(S3C2410_GSTATUS3)); -+ S3C_PMDBG("GSTATUS4 0x%08x\n", __raw_readl(S3C2410_GSTATUS4)); - - if (machine_is_h1940()) { - void *base = phys_to_virt(H1940_SUSPEND_CHECK); -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2412/dma.c linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2412/dma.c ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2412/dma.c 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2412/dma.c 2009-05-10 22:27:59.000000000 +0200 -@@ -20,17 +20,18 @@ - - #include - --#include -+#include - #include - - #include - #include - #include -+#include - #include - #include - #include --#include --#include -+#include -+#include - #include - - #define MAP(x) { (x)| DMA_CH_VALID, (x)| DMA_CH_VALID, (x)| DMA_CH_VALID, (x)| DMA_CH_VALID } -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2412/Kconfig linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2412/Kconfig ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2412/Kconfig 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2412/Kconfig 2009-05-10 22:27:59.000000000 +0200 -@@ -38,6 +38,7 @@ - config MACH_JIVE - bool "Logitech Jive" - select CPU_S3C2412 -+ select S3C_DEV_USB_HOST - help - Say Y here if you are using the Logitech Jive. - -@@ -50,6 +51,7 @@ - select CPU_S3C2412 - select MACH_S3C2413 - select MACH_SMDK -+ select S3C_DEV_USB_HOST - help - Say Y here if you are using an SMDK2413 - -@@ -72,6 +74,7 @@ - config MACH_VSTMS - bool "VMSTMS" - select CPU_S3C2412 -+ select S3C_DEV_USB_HOST - help - Say Y here if you are using an VSTMS board - -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2412/mach-jive.c linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2412/mach-jive.c ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2412/mach-jive.c 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2412/mach-jive.c 2009-05-10 22:27:59.000000000 +0200 -@@ -494,7 +494,7 @@ - * correct address to resume from. */ - - __raw_writel(0x2BED, S3C2412_INFORM0); -- __raw_writel(virt_to_phys(s3c2410_cpu_resume), S3C2412_INFORM1); -+ __raw_writel(virt_to_phys(s3c_cpu_resume), S3C2412_INFORM1); - - return 0; - } -@@ -630,7 +630,7 @@ - - /* initialise the power management now we've setup everything. */ - -- s3c2410_pm_init(); -+ s3c_pm_init(); - - s3c_device_nand.dev.platform_data = &jive_nand_info; - -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2412/pm.c linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2412/pm.c ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2412/pm.c 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2412/pm.c 2009-05-10 22:27:59.000000000 +0200 -@@ -85,7 +85,7 @@ - - static int s3c2412_pm_suspend(struct sys_device *dev, pm_message_t state) - { -- s3c2410_pm_do_save(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep)); -+ s3c_pm_do_save(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep)); - return 0; - } - -@@ -98,7 +98,7 @@ - tmp |= S3C2412_PWRCFG_STANDBYWFI_IDLE; - __raw_writel(tmp, S3C2412_PWRCFG); - -- s3c2410_pm_do_restore(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep)); -+ s3c_pm_do_restore(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep)); - return 0; - } - -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2412/s3c2412.c linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2412/s3c2412.c ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2412/s3c2412.c 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2412/s3c2412.c 2009-05-10 22:27:59.000000000 +0200 -@@ -231,5 +231,8 @@ - { - printk("S3C2412: Initialising architecture\n"); - -+ /* make sure SD/MMC driver can distinguish 2412 from 2410 */ -+ s3c_device_sdi.name = "s3c2412-sdi"; -+ - return sysdev_register(&s3c2412_sysdev); - } -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2440/dma.c linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2440/dma.c ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2440/dma.c 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2440/dma.c 2009-05-10 22:27:59.000000000 +0200 -@@ -17,18 +17,20 @@ - #include - #include - -+#include - #include - --#include -+#include - #include - - #include - #include - #include -+#include - #include - #include - #include --#include -+#include - #include - - static struct s3c24xx_dma_map __initdata s3c2440_dma_mappings[] = { -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2440/Kconfig linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2440/Kconfig ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2440/Kconfig 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2440/Kconfig 2009-05-10 22:27:59.000000000 +0200 -@@ -23,7 +23,6 @@ - help - Support for S3C2440 specific DMA code5A - -- - menu "S3C2440 Machines" - - config MACH_ANUBIS -@@ -33,6 +32,7 @@ - select PM_SIMTEC if PM - select HAVE_PATA_PLATFORM - select S3C24XX_GPIO_EXTRA64 -+ select S3C_DEV_USB_HOST - help - Say Y here if you are using the Simtec Electronics ANUBIS - development system -@@ -43,6 +43,7 @@ - select S3C24XX_DCLK - select PM_SIMTEC if PM - select S3C24XX_GPIO_EXTRA128 -+ select S3C_DEV_USB_HOST - help - Say Y here if you are using the Simtec IM2440D20 module, also - known as the Osiris. -@@ -58,12 +59,14 @@ - bool "SMDK2440" - select CPU_S3C2440 - select MACH_SMDK -+ select S3C_DEV_USB_HOST - help - Say Y here if you are using the SMDK2440. - - config MACH_NEXCODER_2440 - bool "NexVision NEXCODER 2440 Light Board" - select CPU_S3C2440 -+ select S3C_DEV_USB_HOST - help - Say Y here if you are using the Nex Vision NEXCODER 2440 Light Board - -@@ -76,8 +79,17 @@ - config MACH_AT2440EVB - bool "Avantech AT2440EVB development board" - select CPU_S3C2440 -+ select S3C_DEV_USB_HOST - help - Say Y here if you are using the AT2440EVB development board - -+config NEO1973_GTA02_2440 -+ bool "Old FIC Neo1973 GTA02 hardware using S3C2440 CPU" -+ depends on MACH_NEO1973_GTA02 -+ select CPU_S3C2440 -+ help -+ Say Y here if you are using an early hardware revision -+ of the FIC/Openmoko Neo1973 GTA02 GSM Phone. -+ - endmenu - -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2440/mach-rx3715.c linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2440/mach-rx3715.c ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2440/mach-rx3715.c 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2440/mach-rx3715.c 2009-05-10 22:27:59.000000000 +0200 -@@ -203,7 +203,7 @@ - #ifdef CONFIG_PM_H1940 - memcpy(phys_to_virt(H1940_SUSPEND_RESUMEAT), h1940_pm_return, 1024); - #endif -- s3c2410_pm_init(); -+ s3c_pm_init(); - - s3c24xx_fb_set_platdata(&rx3715_fb_info); - platform_add_devices(rx3715_devices, ARRAY_SIZE(rx3715_devices)); -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2440/Makefile linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2440/Makefile ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2440/Makefile 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2440/Makefile 2009-05-10 22:27:59.000000000 +0200 -@@ -22,3 +22,5 @@ - obj-$(CONFIG_ARCH_S3C2440) += mach-smdk2440.o - obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o - obj-$(CONFIG_MACH_AT2440EVB) += mach-at2440evb.o -+obj-$(CONFIG_MACH_HXD8) += mach-hxd8.o -+ -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2440/s3c2440.c linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2440/s3c2440.c ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2440/s3c2440.c 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2440/s3c2440.c 2009-05-10 22:27:59.000000000 +0200 -@@ -46,6 +46,9 @@ - s3c_device_wdt.resource[1].start = IRQ_S3C2440_WDT; - s3c_device_wdt.resource[1].end = IRQ_S3C2440_WDT; - -+ /* make sure SD/MMC driver can distinguish 2440 from 2410 */ -+ s3c_device_sdi.name = "s3c2440-sdi"; -+ - /* register our system device for everything else */ - - return sysdev_register(&s3c2440_sysdev); -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2442/include/mach/gta02.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2442/include/mach/gta02.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2442/include/mach/gta02.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2442/include/mach/gta02.h 2009-05-10 22:27:59.000000000 +0200 -@@ -0,0 +1,85 @@ -+#ifndef _GTA02_H -+#define _GTA02_H -+ -+#include -+#include -+ -+/* Different hardware revisions, passed in ATAG_REVISION by u-boot */ -+#define GTA02v1_SYSTEM_REV 0x00000310 -+#define GTA02v2_SYSTEM_REV 0x00000320 -+#define GTA02v3_SYSTEM_REV 0x00000330 -+#define GTA02v4_SYSTEM_REV 0x00000340 -+#define GTA02v5_SYSTEM_REV 0x00000350 -+#define GTA02v6_SYSTEM_REV 0x00000360 -+ -+#define GTA02_GPIO_n3DL_GSM S3C2410_GPA13 /* v1 + v2 + v3 only */ -+ -+#define GTA02_GPIO_PWR_LED1 S3C2410_GPB0 -+#define GTA02_GPIO_PWR_LED2 S3C2410_GPB1 -+#define GTA02_GPIO_AUX_LED S3C2410_GPB2 -+#define GTA02_GPIO_VIBRATOR_ON S3C2410_GPB3 -+#define GTA02_GPIO_MODEM_RST S3C2410_GPB5 -+#define GTA02_GPIO_BT_EN S3C2410_GPB6 -+#define GTA02_GPIO_MODEM_ON S3C2410_GPB7 -+#define GTA02_GPIO_EXTINT8 S3C2410_GPB8 -+#define GTA02_GPIO_USB_PULLUP S3C2410_GPB9 -+ -+#define GTA02_GPIO_PIO5 S3C2410_GPC5 /* v3 + v4 only */ -+#define GTA02v3_GPIO_nG1_CS S3C2410_GPD12 /* v3 + v4 only */ -+#define GTA02v3_GPIO_nG2_CS S3C2410_GPD13 /* v3 + v4 only */ -+#define GTA02v5_GPIO_HDQ S3C2410_GPD14 /* v5 + */ -+ -+#define GTA02_GPIO_nG1_INT S3C2410_GPF0 -+#define GTA02_GPIO_IO1 S3C2410_GPF1 -+#define GTA02_GPIO_PIO_2 S3C2410_GPF2 /* v2 + v3 + v4 only */ -+#define GTA02_GPIO_JACK_INSERT S3C2410_GPF4 -+#define GTA02_GPIO_WLAN_GPIO1 S3C2410_GPF5 /* v2 + v3 + v4 only */ -+#define GTA02_GPIO_AUX_KEY S3C2410_GPF6 -+#define GTA02_GPIO_HOLD_KEY S3C2410_GPF7 -+ -+#define GTA02_GPIO_3D_IRQ S3C2410_GPG4 -+#define GTA02v2_GPIO_nG2_INT S3C2410_GPG8 /* v2 + v3 + v4 only */ -+#define GTA02v3_GPIO_nUSB_OC S3C2410_GPG9 /* v3 + v4 only */ -+#define GTA02v3_GPIO_nUSB_FLT S3C2410_GPG10 /* v3 + v4 only */ -+#define GTA02v3_GPIO_nGSM_OC S3C2410_GPG11 /* v3 + v4 only */ -+ -+#define GTA02_GPIO_AMP_SHUT S3C2440_GPJ1 /* v2 + v3 + v4 only */ -+#define GTA02v1_GPIO_WLAN_GPIO10 S3C2440_GPJ2 -+#define GTA02_GPIO_HP_IN S3C2440_GPJ2 /* v2 + v3 + v4 only */ -+#define GTA02_GPIO_INT0 S3C2440_GPJ3 /* v2 + v3 + v4 only */ -+#define GTA02_GPIO_nGSM_EN S3C2440_GPJ4 -+#define GTA02_GPIO_3D_RESET S3C2440_GPJ5 -+#define GTA02_GPIO_nDL_GSM S3C2440_GPJ6 /* v4 + v5 only */ -+#define GTA02_GPIO_WLAN_GPIO0 S3C2440_GPJ7 -+#define GTA02v1_GPIO_BAT_ID S3C2440_GPJ8 -+#define GTA02_GPIO_KEEPACT S3C2440_GPJ8 -+#define GTA02v1_GPIO_HP_IN S3C2440_GPJ10 -+#define GTA02_CHIP_PWD S3C2440_GPJ11 /* v2 + v3 + v4 only */ -+#define GTA02_GPIO_nWLAN_RESET S3C2440_GPJ12 /* v2 + v3 + v4 only */ -+ -+#define GTA02_IRQ_GSENSOR_1 IRQ_EINT0 -+#define GTA02_IRQ_MODEM IRQ_EINT1 -+#define GTA02_IRQ_PIO_2 IRQ_EINT2 /* v2 + v3 + v4 only */ -+#define GTA02_IRQ_nJACK_INSERT IRQ_EINT4 -+#define GTA02_IRQ_WLAN_GPIO1 IRQ_EINT5 -+#define GTA02_IRQ_AUX IRQ_EINT6 -+#define GTA02_IRQ_nHOLD IRQ_EINT7 -+#define GTA02_IRQ_PCF50633 IRQ_EINT9 -+#define GTA02_IRQ_3D IRQ_EINT12 -+#define GTA02_IRQ_GSENSOR_2 IRQ_EINT16 /* v2 + v3 + v4 only */ -+#define GTA02v3_IRQ_nUSB_OC IRQ_EINT17 /* v3 + v4 only */ -+#define GTA02v3_IRQ_nUSB_FLT IRQ_EINT18 /* v3 + v4 only */ -+#define GTA02v3_IRQ_nGSM_OC IRQ_EINT19 /* v3 + v4 only */ -+ -+/* returns 00 000 on GTA02 A5 and earlier, A6 returns 01 001 */ -+#define GTA02_PCB_ID1_0 S3C2410_GPC13 -+#define GTA02_PCB_ID1_1 S3C2410_GPC15 -+#define GTA02_PCB_ID1_2 S3C2410_GPD0 -+#define GTA02_PCB_ID2_0 S3C2410_GPD3 -+#define GTA02_PCB_ID2_1 S3C2410_GPD4 -+ -+int gta02_get_pcb_revision(void); -+ -+extern struct pcf50633 *gta02_pcf; -+ -+#endif /* _GTA02_H */ -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2442/Kconfig linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2442/Kconfig ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2442/Kconfig 2009-05-10 22:05:02.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2442/Kconfig 2009-05-10 22:27:59.000000000 +0200 -@@ -11,6 +11,7 @@ - select S3C2410_CLOCK - select S3C2410_GPIO - select S3C2410_PM if PM -+ select S3C2440_DMA if S3C2410_DMA - select CPU_S3C244X - select CPU_LLSERIAL_S3C2440 - help -@@ -24,6 +25,20 @@ - depends on ARCH_S3C2440 - select CPU_S3C2442 - -+config MACH_NEO1973_GTA02 -+ bool "FIC Neo1973 GSM Phone (GTA02 Hardware)" -+ select CPU_S3C2442 -+ select MFD_PCF50633 -+ select PCF50633_GPIO -+ select I2C -+ select POWER_SUPPLY -+ select MACH_NEO1973 -+ select S3C_PWM -+ select FIQ -+ select S3C_DEV_USB_HOST -+ help -+ Say Y here if you are using the FIC Neo1973 GSM Phone -+ - - endmenu - -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2442/mach-gta02.c linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2442/mach-gta02.c ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2442/mach-gta02.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2442/mach-gta02.c 2009-05-10 22:27:59.000000000 +0200 -@@ -0,0 +1,1706 @@ -+/* -+ * linux/arch/arm/mach-s3c2440/mach-gta02.c -+ * -+ * S3C2440 Machine Support for the FIC GTA02 (Neo1973) -+ * -+ * Copyright (C) 2006-2007 by Openmoko, Inc. -+ * Author: Harald Welte -+ * 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 -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+#include -+ -+#include -+#include -+ -+#include "../plat-s3c24xx/neo1973_pm_gps.h" -+ -+#include <../drivers/input/touchscreen/ts_filter_chain.h> -+#ifdef CONFIG_TOUCHSCREEN_FILTER -+#include <../drivers/input/touchscreen/ts_filter_linear.h> -+#include <../drivers/input/touchscreen/ts_filter_mean.h> -+#include <../drivers/input/touchscreen/ts_filter_median.h> -+#include <../drivers/input/touchscreen/ts_filter_group.h> -+#endif -+ -+#include -+ -+#include -+ -+/* arbitrates which sensor IRQ owns the shared SPI bus */ -+static spinlock_t motion_irq_lock; -+ -+ -+/* ------------------------------------------------------------------------------- -+ * GTA02 FIQ related -+ * -+ * Calls into vibrator and hdq and based on the return values -+ * determines if we the FIQ source be kept alive -+ */ -+ -+#define DIVISOR_FROM_US(x) ((x) << 3) -+ -+#ifdef CONFIG_HDQ_GPIO_BITBANG -+#define FIQ_DIVISOR_HDQ DIVISOR_FROM_US(HDQ_SAMPLE_PERIOD_US) -+extern int hdq_fiq_handler(void); -+#endif -+ -+#ifdef CONFIG_LEDS_NEO1973_VIBRATOR -+#define FIQ_DIVISOR_VIBRATOR DIVISOR_FROM_US(100) -+extern int neo1973_vibrator_fiq_handler(void); -+#endif -+ -+/* Global data related to our fiq source */ -+static u32 gta02_fiq_ack_mask; -+static struct s3c2410_pwm gta02_fiq_pwm_timer; -+static u16 gta02_fiq_timer_index; -+static int gta02_fiq_irq; -+ -+static void gta02_fiq_handler(void) -+{ -+ u16 divisor = 0xffff; -+ -+ /* Vibrator servicing */ -+ -+ /* disable further timer interrupts if nobody has any work -+ * or adjust rate according to who still has work -+ * -+ * CAUTION: it means forground code must disable FIQ around -+ * its own non-atomic S3C2410_INTMSK changes... not common -+ * thankfully and taken care of by the fiq-basis patch -+ */ -+ -+#ifdef CONFIG_LEDS_NEO1973_VIBRATOR -+ if (neo1973_vibrator_fiq_handler()) -+ divisor = FIQ_DIVISOR_VIBRATOR; -+#endif -+ -+#ifdef CONFIG_HDQ_GPIO_BITBANG -+ if (hdq_fiq_handler()) -+ divisor = FIQ_DIVISOR_HDQ; -+#endif -+ -+ if (divisor == 0xffff) /* mask the fiq irq source */ -+ __raw_writel(__raw_readl(S3C2410_INTMSK) | gta02_fiq_ack_mask, -+ S3C2410_INTMSK); -+ else /* still working, maybe at a different rate */ -+ __raw_writel(divisor, S3C2410_TCNTB(gta02_fiq_timer_index)); -+ -+ __raw_writel(gta02_fiq_ack_mask, S3C2410_SRCPND); -+} -+ -+static void gta02_fiq_kick(void) -+{ -+ unsigned long flags; -+ u32 tcon; -+ -+ /* we have to take care about FIQ because this modification is -+ * non-atomic, FIQ could come in after the read and before the -+ * writeback and its changes to the register would be lost -+ * (platform INTMSK mod code is taken care of already) -+ */ -+ local_save_flags(flags); -+ local_fiq_disable(); -+ /* allow FIQs to resume */ -+ __raw_writel(__raw_readl(S3C2410_INTMSK) & -+ ~(1 << (gta02_fiq_irq - S3C2410_CPUIRQ_OFFSET)), -+ S3C2410_INTMSK); -+ tcon = __raw_readl(S3C2410_TCON) & ~S3C2410_TCON_T3START; -+ /* fake the timer to a count of 1 */ -+ __raw_writel(1, S3C2410_TCNTB(gta02_fiq_timer_index)); -+ __raw_writel(tcon | S3C2410_TCON_T3MANUALUPD, S3C2410_TCON); -+ __raw_writel(tcon | S3C2410_TCON_T3MANUALUPD | S3C2410_TCON_T3START, -+ S3C2410_TCON); -+ __raw_writel(tcon | S3C2410_TCON_T3START, S3C2410_TCON); -+ local_irq_restore(flags); -+} -+ -+static int gta02_fiq_enable(void) -+{ -+ int irq_index_fiq = IRQ_TIMER3; -+ int rc = 0; -+ -+ local_fiq_disable(); -+ -+ gta02_fiq_irq = irq_index_fiq; -+ gta02_fiq_ack_mask = 1 << (irq_index_fiq - S3C2410_CPUIRQ_OFFSET); -+ gta02_fiq_timer_index = (irq_index_fiq - IRQ_TIMER0); -+ -+ /* set up the timer to operate as a pwm device */ -+ -+ rc = s3c2410_pwm_init(>a02_fiq_pwm_timer); -+ if (rc) -+ goto bail; -+ -+ gta02_fiq_pwm_timer.timerid = PWM0 + gta02_fiq_timer_index; -+ gta02_fiq_pwm_timer.prescaler = (6 - 1) / 2; -+ gta02_fiq_pwm_timer.divider = S3C2410_TCFG1_MUX3_DIV2; -+ /* default rate == ~32us */ -+ gta02_fiq_pwm_timer.counter = gta02_fiq_pwm_timer.comparer = 3000; -+ -+ rc = s3c2410_pwm_enable(>a02_fiq_pwm_timer); -+ if (rc) -+ goto bail; -+ -+ s3c2410_pwm_start(>a02_fiq_pwm_timer); -+ -+ /* let our selected interrupt be a magic FIQ interrupt */ -+ __raw_writel(gta02_fiq_ack_mask, S3C2410_INTMOD); -+ -+ /* it's ready to go as soon as we unmask the source in S3C2410_INTMSK */ -+ local_fiq_enable(); -+ -+ set_fiq_c_handler(gta02_fiq_handler); -+ -+ return 0; -+ -+bail: -+ printk(KERN_ERR "Could not initialize FIQ for GTA02: %d\n", rc); -+ -+ return rc; -+} -+ -+static void gta02_fiq_disable(void) -+{ -+ __raw_writel(0, S3C2410_INTMOD); -+ local_fiq_disable(); -+ gta02_fiq_irq = 0; /* no active source interrupt now either */ -+ -+} -+/* -------------------- /GTA02 FIQ Handler ------------------------------------- */ -+ -+/* -+ * this gets called every 1ms when we paniced. -+ */ -+ -+static long gta02_panic_blink(long count) -+{ -+ long delay = 0; -+ static long last_blink; -+ static char led; -+ -+ if (count - last_blink < 100) /* 200ms period, fast blink */ -+ return 0; -+ -+ led ^= 1; -+ s3c2410_gpio_cfgpin(GTA02_GPIO_AUX_LED, S3C2410_GPIO_OUTPUT); -+ neo1973_gpb_setpin(GTA02_GPIO_AUX_LED, led); -+ -+ last_blink = count; -+ return delay; -+} -+ -+ -+/** -+ * returns PCB revision information in b9,b8 and b2,b1,b0 -+ * Pre-GTA02 A6 returns 0x000 -+ * GTA02 A6 returns 0x101 -+ * ... -+ */ -+ -+int gta02_get_pcb_revision(void) -+{ -+ int n; -+ int u = 0; -+ static unsigned long pinlist[] = { -+ GTA02_PCB_ID1_0, -+ GTA02_PCB_ID1_1, -+ GTA02_PCB_ID1_2, -+ GTA02_PCB_ID2_0, -+ GTA02_PCB_ID2_1, -+ }; -+ static int pin_offset[] = { -+ 0, 1, 2, 8, 9 -+ }; -+ -+ for (n = 0 ; n < ARRAY_SIZE(pinlist); n++) { -+ /* -+ * set the PCB version GPIO to be pulled-down input -+ * force low briefly first -+ */ -+ s3c2410_gpio_cfgpin(pinlist[n], S3C2410_GPIO_OUTPUT); -+ s3c2410_gpio_setpin(pinlist[n], 0); -+ /* misnomer: it is a pullDOWN in 2442 */ -+ s3c2410_gpio_pullup(pinlist[n], 1); -+ s3c2410_gpio_cfgpin(pinlist[n], S3C2410_GPIO_INPUT); -+ -+ udelay(10); -+ -+ if (s3c2410_gpio_getpin(pinlist[n])) -+ u |= 1 << pin_offset[n]; -+ -+ /* -+ * when not being interrogated, all of the revision GPIO -+ * are set to output HIGH without pulldown so no current flows -+ * if they are NC or pulled up. -+ */ -+ s3c2410_gpio_setpin(pinlist[n], 1); -+ s3c2410_gpio_cfgpin(pinlist[n], S3C2410_GPIO_OUTPUT); -+ /* misnomer: it is a pullDOWN in 2442 */ -+ s3c2410_gpio_pullup(pinlist[n], 0); -+ } -+ -+ return u; -+} -+ -+struct platform_device gta02_version_device = { -+ .name = "neo1973-version", -+ .num_resources = 0, -+}; -+ -+struct platform_device gta02_resume_reason_device = { -+ .name = "neo1973-resume", -+ .num_resources = 0, -+}; -+ -+struct platform_device gta02_memconfig_device = { -+ .name = "neo1973-memconfig", -+ .num_resources = 0, -+}; -+ -+static struct map_desc gta02_iodesc[] __initdata = { -+ { -+ .virtual = 0xe0000000, -+ .pfn = __phys_to_pfn(S3C2410_CS3+0x01000000), -+ .length = SZ_1M, -+ .type = MT_DEVICE -+ }, -+}; -+ -+#define UCON (S3C2410_UCON_DEFAULT | S3C2443_UCON_RXERR_IRQEN) -+#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB -+#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE -+ -+static struct s3c2410_uartcfg gta02_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, -+ }, -+ -+}; -+ -+struct pcf50633 *gta02_pcf; -+ -+#ifdef CONFIG_CHARGER_PCF50633 -+static int gta02_get_charger_online_status(void) -+{ -+ struct pcf50633 *pcf = gta02_pcf; -+ -+ return pcf50633_mbc_get_status(pcf) & PCF50633_MBC_USB_ONLINE; -+} -+ -+static int gta02_get_charger_active_status(void) -+{ -+ struct pcf50633 *pcf = gta02_pcf; -+ -+ return pcf50633_mbc_get_status(pcf) & PCF50633_MBC_USB_ACTIVE; -+} -+ -+#define ADC_NOM_CHG_DETECT_1A 6 -+#define ADC_NOM_CHG_DETECT_USB 43 -+ -+static void -+gta02_configure_pmu_for_charger(struct pcf50633 *pcf, void *unused, int res) -+{ -+ int ma; -+ -+ /* Interpret charger type */ -+ if (res < ((ADC_NOM_CHG_DETECT_USB + ADC_NOM_CHG_DETECT_1A) / 2)) { -+ -+ /* Stop GPO driving out now that we have a IA charger */ -+ pcf50633_gpio_set(pcf, PCF50633_GPO, 0); -+ -+ ma = 1000; -+ } else -+ ma = 100; -+ -+ pcf50633_mbc_usb_curlim_set(pcf, ma); -+} -+ -+static struct delayed_work gta02_charger_work; -+static int gta02_usb_vbus_draw; -+ -+static void gta02_charger_worker(struct work_struct *work) -+{ -+ struct pcf50633 *pcf = gta02_pcf; -+ -+ if (gta02_usb_vbus_draw) { -+ pcf50633_mbc_usb_curlim_set(pcf, gta02_usb_vbus_draw); -+ return; -+ } else { -+#ifdef CONFIG_PCF50633_ADC -+ pcf50633_adc_async_read(pcf, -+ PCF50633_ADCC1_MUX_ADCIN1, -+ PCF50633_ADCC1_AVERAGE_16, -+ gta02_configure_pmu_for_charger, NULL); -+#else -+ /* If the PCF50633 ADC is disabled we fallback to a 100mA limit for safety. */ -+ pcf50633_mbc_usb_curlim_set(pcf, 100); -+#endif -+ return; -+ } -+} -+ -+#define GTA02_CHARGER_CONFIGURE_TIMEOUT ((3000 * HZ) / 1000) -+static void gta02_pmu_event_callback(struct pcf50633 *pcf, int irq) -+{ -+ if (irq == PCF50633_IRQ_USBINS) { -+ schedule_delayed_work(>a02_charger_work, -+ GTA02_CHARGER_CONFIGURE_TIMEOUT); -+ return; -+ } else if (irq == PCF50633_IRQ_USBREM) { -+ cancel_delayed_work_sync(>a02_charger_work); -+ gta02_usb_vbus_draw = 0; -+ } -+} -+ -+static void gta02_pmu_force_shutdown(struct pcf50633 *pcf) -+{ -+ pcf50633_reg_set_bit_mask(pcf, PCF50633_REG_OOCSHDWN, -+ PCF50633_OOCSHDWN_GOSTDBY, PCF50633_OOCSHDWN_GOSTDBY); -+} -+ -+ -+static void gta02_udc_vbus_draw(unsigned int ma) -+{ -+ if (!gta02_pcf) -+ return; -+ -+ gta02_usb_vbus_draw = ma; -+ -+ schedule_delayed_work(>a02_charger_work, -+ GTA02_CHARGER_CONFIGURE_TIMEOUT); -+} -+#else /* !CONFIG_CHARGER_PCF50633 */ -+#define gta02_get_charger_online_status NULL -+#define gta02_get_charger_active_status NULL -+#define gta02_pmu_event_callback NULL -+#define gta02_udc_vbus_draw NULL -+#endif -+ -+static struct platform_device gta01_pm_gps_dev = { -+ .name = "neo1973-pm-gps", -+}; -+ -+static struct platform_device gta01_pm_bt_dev = { -+ .name = "neo1973-pm-bt", -+}; -+ -+static struct platform_device gta02_pm_gsm_dev = { -+ .name = "neo1973-pm-gsm", -+}; -+ -+/* this is called when pc50633 is probed, unfortunately quite late in the -+ * day since it is an I2C bus device. Here we can belatedly define some -+ * platform devices with the advantage that we can mark the pcf50633 as the -+ * parent. This makes them get suspended and resumed with their parent -+ * the pcf50633 still around. -+ */ -+ -+static struct platform_device gta02_glamo_dev; -+static void mangle_glamo_res_by_system_rev(void); -+ -+static void gta02_pmu_attach_child_devices(struct pcf50633 *pcf); -+static void gta02_pmu_regulator_registered(struct pcf50633 *pcf, int id); -+ -+static struct platform_device gta02_pm_wlan_dev = { -+ .name = "gta02-pm-wlan", -+}; -+ -+static struct regulator_consumer_supply ldo4_consumers[] = { -+ { -+ .dev = >a01_pm_bt_dev.dev, -+ .supply = "BT_3V2", -+ }, -+}; -+ -+static struct regulator_consumer_supply ldo5_consumers[] = { -+ { -+ .dev = >a01_pm_gps_dev.dev, -+ .supply = "RF_3V", -+ }, -+}; -+ -+/* -+ * We need this dummy thing to fill the regulator consumers -+ */ -+static struct platform_device gta02_mmc_dev = { -+ /* details filled in by glamo core */ -+}; -+ -+static struct regulator_consumer_supply hcldo_consumers[] = { -+ { -+ .dev = >a02_mmc_dev.dev, -+ .supply = "SD_3V3", -+ }, -+}; -+ -+static char *gta02_batteries[] = { -+ "battery", -+}; -+ -+struct pcf50633_platform_data gta02_pcf_pdata = { -+ .resumers = { -+ [0] = PCF50633_INT1_USBINS | -+ PCF50633_INT1_USBREM | -+ PCF50633_INT1_ALARM, -+ [1] = PCF50633_INT2_ONKEYF, -+ [2] = PCF50633_INT3_ONKEY1S, -+ [3] = PCF50633_INT4_LOWSYS | -+ PCF50633_INT4_LOWBAT | -+ PCF50633_INT4_HIGHTMP, -+ }, -+ -+ .batteries = gta02_batteries, -+ .num_batteries = ARRAY_SIZE(gta02_batteries), -+ .charging_restart_interval = (900 * HZ), -+ .chg_ref_current_ma = 1000, -+ -+ .reg_init_data = { -+ [PCF50633_REGULATOR_AUTO] = { -+ .constraints = { -+ .name = "IO_3V3", -+ .min_uV = 3300000, -+ .max_uV = 3300000, -+ .valid_modes_mask = REGULATOR_MODE_NORMAL, -+ .boot_on = 1, -+ .apply_uV = 1, -+ .state_mem = { -+ .enabled = 1, -+ }, -+ }, -+ .num_consumer_supplies = 0, -+ }, -+ [PCF50633_REGULATOR_DOWN1] = { -+ .constraints = { -+ .name = "CORE_1V3", -+ .min_uV = 1300000, -+ .max_uV = 1600000, -+ .valid_modes_mask = REGULATOR_MODE_NORMAL, -+ .boot_on = 1, -+ .apply_uV = 1, -+ }, -+ .num_consumer_supplies = 0, -+ }, -+ [PCF50633_REGULATOR_DOWN2] = { -+ .constraints = { -+ .name = "IO_1V8", -+ .min_uV = 1800000, -+ .max_uV = 1800000, -+ .valid_modes_mask = REGULATOR_MODE_NORMAL, -+ .apply_uV = 1, -+ .boot_on = 1, -+ .state_mem = { -+ .enabled = 1, -+ }, -+ }, -+ .num_consumer_supplies = 0, -+ }, -+ [PCF50633_REGULATOR_HCLDO] = { -+ .constraints = { -+ .name = "SD_3V3", -+ .min_uV = 2000000, -+ .max_uV = 3300000, -+ .valid_modes_mask = REGULATOR_MODE_NORMAL, -+ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, -+ .boot_on = 1, -+ }, -+ .num_consumer_supplies = 1, -+ .consumer_supplies = hcldo_consumers, -+ }, -+ [PCF50633_REGULATOR_LDO1] = { -+ .constraints = { -+ .name = "GSENSOR_3V3", -+ .min_uV = 1300000, -+ .max_uV = 1300000, -+ .valid_modes_mask = REGULATOR_MODE_NORMAL, -+ .apply_uV = 1, -+ }, -+ .num_consumer_supplies = 0, -+ }, -+ [PCF50633_REGULATOR_LDO2] = { -+ .constraints = { -+ .name = "CODEC_3V3", -+ .min_uV = 3300000, -+ .max_uV = 3300000, -+ .valid_modes_mask = REGULATOR_MODE_NORMAL, -+ .apply_uV = 1, -+ }, -+ .num_consumer_supplies = 0, -+ }, -+ [PCF50633_REGULATOR_LDO3] = { -+ .constraints = { -+ .min_uV = 3000000, -+ .max_uV = 3000000, -+ .valid_modes_mask = REGULATOR_MODE_NORMAL, -+ .apply_uV = 1, -+ }, -+ .num_consumer_supplies = 0, -+ }, -+ [PCF50633_REGULATOR_LDO4] = { -+ .constraints = { -+ .name = "BT_3V2", -+ .min_uV = 3200000, -+ .max_uV = 3200000, -+ .valid_modes_mask = REGULATOR_MODE_NORMAL, -+ .apply_uV = 1, -+ }, -+ .num_consumer_supplies = 1, -+ .consumer_supplies = ldo4_consumers, -+ }, -+ [PCF50633_REGULATOR_LDO5] = { -+ .constraints = { -+ .name = "RF_3V", -+ .min_uV = 1500000, -+ .max_uV = 1500000, -+ .valid_modes_mask = REGULATOR_MODE_NORMAL, -+ .apply_uV = 1, -+ .state_mem = { -+ .enabled = 1, -+ }, -+ }, -+ .num_consumer_supplies = 1, -+ .consumer_supplies = ldo5_consumers, -+ }, -+ [PCF50633_REGULATOR_LDO6] = { -+ .constraints = { -+ .name = "LCM_3V", -+ .min_uV = 0, -+ .max_uV = 3300000, -+ .valid_modes_mask = REGULATOR_MODE_NORMAL, -+ }, -+ .num_consumer_supplies = 0, -+ }, -+ [PCF50633_REGULATOR_MEMLDO] = { -+ .constraints = { -+ .min_uV = 1800000, -+ .max_uV = 1800000, -+ .valid_modes_mask = REGULATOR_MODE_NORMAL, -+ .state_mem = { -+ .enabled = 1, -+ }, -+ }, -+ .num_consumer_supplies = 0, -+ }, -+ -+ }, -+ .probe_done = gta02_pmu_attach_child_devices, -+ .regulator_registered = gta02_pmu_regulator_registered, -+ .mbc_event_callback = gta02_pmu_event_callback, -+ .force_shutdown = gta02_pmu_force_shutdown, -+}; -+ -+static void mangle_pmu_pdata_by_system_rev(void) -+{ -+ struct regulator_init_data *reg_init_data; -+ -+ reg_init_data = gta02_pcf_pdata.reg_init_data; -+ -+ switch (S3C_SYSTEM_REV_ATAG) { -+ case GTA02v1_SYSTEM_REV: -+ /* FIXME: this is only in v1 due to wrong PMU variant */ -+ reg_init_data[PCF50633_REGULATOR_DOWN2] -+ .constraints.state_mem.enabled = 1; -+ break; -+ case GTA02v2_SYSTEM_REV: -+ case GTA02v3_SYSTEM_REV: -+ case GTA02v4_SYSTEM_REV: -+ case GTA02v5_SYSTEM_REV: -+ case GTA02v6_SYSTEM_REV: -+ reg_init_data[PCF50633_REGULATOR_LDO1] -+ .constraints.min_uV = 3300000; -+ reg_init_data[PCF50633_REGULATOR_LDO1] -+ .constraints.min_uV = 3300000; -+ reg_init_data[PCF50633_REGULATOR_LDO1] -+ .constraints.state_mem.enabled = 0; -+ -+ reg_init_data[PCF50633_REGULATOR_LDO5] -+ .constraints.min_uV = 3000000; -+ reg_init_data[PCF50633_REGULATOR_LDO5] -+ .constraints.max_uV = 3000000; -+ -+ reg_init_data[PCF50633_REGULATOR_LDO6] -+ .constraints.min_uV = 3000000; -+ reg_init_data[PCF50633_REGULATOR_LDO6] -+ .constraints.max_uV = 3000000; -+ reg_init_data[PCF50633_REGULATOR_LDO6] -+ .constraints.apply_uV = 1; -+ break; -+ default: -+ break; -+ } -+} -+ -+#ifdef CONFIG_HDQ_GPIO_BITBANG -+/* BQ27000 Battery */ -+ -+struct bq27000_platform_data bq27000_pdata = { -+ .name = "battery", -+ .rsense_mohms = 20, -+ .hdq_read = hdq_read, -+ .hdq_write = hdq_write, -+ .hdq_initialized = hdq_initialized, -+ .get_charger_online_status = gta02_get_charger_online_status, -+ .get_charger_active_status = gta02_get_charger_active_status -+}; -+ -+struct platform_device bq27000_battery_device = { -+ .name = "bq27000-battery", -+ .dev = { -+ .platform_data = &bq27000_pdata, -+ }, -+}; -+ -+/* HDQ */ -+ -+static void gta02_hdq_attach_child_devices(struct device *parent_device) -+{ -+ switch (S3C_SYSTEM_REV_ATAG) { -+ case GTA02v5_SYSTEM_REV: -+ case GTA02v6_SYSTEM_REV: -+ bq27000_battery_device.dev.parent = parent_device; -+ platform_device_register(&bq27000_battery_device); -+ break; -+ default: -+ break; -+ } -+} -+ -+static void gta02_hdq_gpio_direction_out(void) -+{ -+ s3c2410_gpio_cfgpin(GTA02v5_GPIO_HDQ, S3C2410_GPIO_OUTPUT); -+} -+ -+static void gta02_hdq_gpio_direction_in(void) -+{ -+ s3c2410_gpio_cfgpin(GTA02v5_GPIO_HDQ, S3C2410_GPIO_INPUT); -+} -+ -+static void gta02_hdq_gpio_set_value(int val) -+{ -+ -+ s3c2410_gpio_setpin(GTA02v5_GPIO_HDQ, val); -+} -+ -+static int gta02_hdq_gpio_get_value(void) -+{ -+ return s3c2410_gpio_getpin(GTA02v5_GPIO_HDQ); -+} -+ -+static struct resource gta02_hdq_resources[] = { -+ [0] = { -+ .start = GTA02v5_GPIO_HDQ, -+ .end = GTA02v5_GPIO_HDQ, -+ }, -+}; -+ -+struct hdq_platform_data gta02_hdq_platform_data = { -+ .attach_child_devices = gta02_hdq_attach_child_devices, -+ .gpio_dir_out = gta02_hdq_gpio_direction_out, -+ .gpio_dir_in = gta02_hdq_gpio_direction_in, -+ .gpio_set = gta02_hdq_gpio_set_value, -+ .gpio_get = gta02_hdq_gpio_get_value, -+ -+ .enable_fiq = gta02_fiq_enable, -+ .disable_fiq = gta02_fiq_disable, -+ .kick_fiq = gta02_fiq_kick, -+ -+}; -+ -+struct platform_device gta02_hdq_device = { -+ .name = "hdq", -+ .num_resources = 1, -+ .resource = gta02_hdq_resources, -+ .dev = { -+ .platform_data = >a02_hdq_platform_data, -+ }, -+}; -+#endif -+ -+ -+#ifdef CONFIG_LEDS_NEO1973_VIBRATOR -+/* vibrator (child of FIQ) */ -+ -+static struct resource gta02_vibrator_resources[] = { -+ [0] = { -+ .start = GTA02_GPIO_VIBRATOR_ON, -+ .end = GTA02_GPIO_VIBRATOR_ON, -+ }, -+}; -+struct neo1973_vib_platform_data gta02_vib_pdata = { -+ .enable_fiq = gta02_fiq_enable, -+ .disable_fiq = gta02_fiq_disable, -+ .kick_fiq = gta02_fiq_kick, -+}; -+ -+static struct platform_device gta02_vibrator_dev = { -+ .name = "neo1973-vibrator", -+ .num_resources = ARRAY_SIZE(gta02_vibrator_resources), -+ .resource = gta02_vibrator_resources, -+ .dev = { -+ .platform_data = >a02_vib_pdata, -+ }, -+}; -+#endif -+ -+/* NOR Flash */ -+ -+#define GTA02_FLASH_BASE 0x18000000 /* GCS3 */ -+#define GTA02_FLASH_SIZE 0x200000 /* 2MBytes */ -+ -+static struct physmap_flash_data gta02_nor_flash_data = { -+ .width = 2, -+}; -+ -+static struct resource gta02_nor_flash_resource = { -+ .start = GTA02_FLASH_BASE, -+ .end = GTA02_FLASH_BASE + GTA02_FLASH_SIZE - 1, -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct platform_device gta02_nor_flash = { -+ .name = "physmap-flash", -+ .id = 0, -+ .dev = { -+ .platform_data = >a02_nor_flash_data, -+ }, -+ .resource = >a02_nor_flash_resource, -+ .num_resources = 1, -+}; -+ -+ -+struct platform_device s3c24xx_pwm_device = { -+ .name = "s3c24xx_pwm", -+ .num_resources = 0, -+}; -+ -+static struct i2c_board_info gta02_i2c_devs[] __initdata = { -+ { -+ I2C_BOARD_INFO("pcf50633", 0x73), -+ .irq = GTA02_IRQ_PCF50633, -+ .platform_data = >a02_pcf_pdata, -+ }, -+ { -+ I2C_BOARD_INFO("wm8753", 0x1a), -+ }, -+}; -+ -+static struct s3c2410_nand_set gta02_nand_sets[] = { -+ [0] = { -+ .name = "neo1973-nand", -+ .nr_chips = 1, -+ .flags = S3C2410_NAND_BBT, -+ }, -+}; -+ -+/* choose a set of timings derived from S3C@2442B MCP54 -+ * data sheet (K5D2G13ACM-D075 MCP Memory) -+ */ -+ -+static struct s3c2410_platform_nand gta02_nand_info = { -+ .tacls = 0, -+ .twrph0 = 25, -+ .twrph1 = 15, -+ .nr_sets = ARRAY_SIZE(gta02_nand_sets), -+ .sets = gta02_nand_sets, -+ .software_ecc = 1, -+}; -+ -+ -+static void gta02_s3c_mmc_set_power(unsigned char power_mode, -+ unsigned short vdd) -+{ -+ static int is_on = -1; -+ int on; -+ -+ on = power_mode == MMC_POWER_ON || power_mode == MMC_POWER_UP; -+ if (is_on != on) -+ gta02_wlan_reset(!on); -+ is_on = on; -+} -+ -+ -+static struct s3c24xx_mci_pdata gta02_s3c_mmc_cfg = { -+ .set_power = gta02_s3c_mmc_set_power, -+}; -+ -+static void gta02_udc_command(enum s3c2410_udc_cmd_e cmd) -+{ -+ switch (cmd) { -+ case S3C2410_UDC_P_ENABLE: -+ printk(KERN_DEBUG "%s S3C2410_UDC_P_ENABLE\n", __func__); -+ neo1973_gpb_setpin(GTA02_GPIO_USB_PULLUP, 1); -+ break; -+ case S3C2410_UDC_P_DISABLE: -+ printk(KERN_DEBUG "%s S3C2410_UDC_P_DISABLE\n", __func__); -+ neo1973_gpb_setpin(GTA02_GPIO_USB_PULLUP, 0); -+ break; -+ case S3C2410_UDC_P_RESET: -+ printk(KERN_DEBUG "%s S3C2410_UDC_P_RESET\n", __func__); -+ /* FIXME! */ -+ break; -+ default: -+ break; -+ } -+} -+ -+/* get PMU to set USB current limit accordingly */ -+ -+static struct s3c2410_udc_mach_info gta02_udc_cfg = { -+ .vbus_draw = gta02_udc_vbus_draw, -+ .udc_command = gta02_udc_command, -+ -+}; -+ -+ -+/* Touchscreen configuration. */ -+ -+#ifdef CONFIG_TOUCHSCREEN_FILTER -+const static struct ts_filter_group_configuration gta02_ts_group = { -+ .length = 12, -+ .close_enough = 10, -+ .threshold = 6, /* At least half of the points in a group. */ -+ .attempts = 10, -+}; -+ -+const static struct ts_filter_median_configuration gta02_ts_median = { -+ .extent = 20, -+ .decimation_below = 3, -+ .decimation_threshold = 8 * 3, -+ .decimation_above = 4, -+}; -+ -+const static struct ts_filter_mean_configuration gta02_ts_mean = { -+ .length = 4, -+}; -+ -+const static struct ts_filter_linear_configuration gta02_ts_linear = { -+ .constants = {1, 0, 0, 0, 1, 0, 1}, /* Don't modify coords. */ -+ .coord0 = 0, -+ .coord1 = 1, -+}; -+#endif -+ -+const static struct ts_filter_chain_configuration gta02_filter_configuration[] = -+{ -+#ifdef CONFIG_TOUCHSCREEN_FILTER -+ {&ts_filter_group_api, >a02_ts_group.config}, -+ {&ts_filter_median_api, >a02_ts_median.config}, -+ {&ts_filter_mean_api, >a02_ts_mean.config}, -+ {&ts_filter_linear_api, >a02_ts_linear.config}, -+#endif -+ {NULL, NULL}, -+}; -+ -+const static struct s3c2410_ts_mach_info gta02_ts_cfg = { -+ .delay = 10000, -+ .presc = 0xff, /* slow as we can go */ -+ .filter_config = gta02_filter_configuration, -+}; -+ -+ -+ -+static void gta02_bl_set_intensity(int intensity) -+{ -+ struct pcf50633 *pcf = gta02_pcf; -+ int old_intensity = pcf50633_reg_read(pcf, PCF50633_REG_LEDOUT); -+ int ret; -+ -+ intensity >>= 2; -+ -+ /* -+ * One code path that leads here is from a kernel panic. Trying to turn -+ * the backlight on just gives us a nearly endless stream of complaints -+ * and accomplishes nothing. We can't win. Just give up. -+ * -+ * In the unlikely event that there's another path leading here while -+ * we're atomic, we print at least a warning. -+ */ -+ if (in_atomic()) { -+ printk(KERN_ERR -+ "gta02_bl_set_intensity called while atomic\n"); -+ return; -+ } -+ -+ if (!(pcf50633_reg_read(pcf, PCF50633_REG_LEDENA) & 3)) -+ old_intensity = 0; -+ else -+ old_intensity = pcf50633_reg_read(pcf, PCF50633_REG_LEDOUT); -+ -+ if (intensity == old_intensity) -+ return; -+ -+ /* We can't do this anywhere else */ -+ pcf50633_reg_write(pcf, PCF50633_REG_LEDDIM, 5); -+ -+ /* -+ * The PCF50633 cannot handle LEDOUT = 0 (datasheet p60) -+ * if seen, you have to re-enable the LED unit -+ */ -+ if (!intensity || !old_intensity) -+ pcf50633_reg_write(pcf, PCF50633_REG_LEDENA, 0); -+ -+ if (!intensity) /* illegal to set LEDOUT to 0 */ -+ ret = pcf50633_reg_set_bit_mask(pcf, PCF50633_REG_LEDOUT, 0x3f, -+ 2); -+ else -+ ret = pcf50633_reg_set_bit_mask(pcf, PCF50633_REG_LEDOUT, 0x3f, -+ intensity); -+ -+ if (intensity) -+ pcf50633_reg_write(pcf, PCF50633_REG_LEDENA, 2); -+ -+} -+ -+static struct generic_bl_info gta02_bl_info = { -+ .name = "gta02-bl", -+ .max_intensity = 0xff, -+ .default_intensity = 0xff, -+ .set_bl_intensity = gta02_bl_set_intensity, -+}; -+ -+static struct platform_device gta02_bl_dev = { -+ .name = "generic-bl", -+ .id = 1, -+ .dev = { -+ .platform_data = >a02_bl_info, -+ }, -+}; -+ -+/* SPI: LCM control interface attached to Glamo3362 */ -+ -+static void gta02_jbt6k74_reset(int devidx, int level) -+{ -+ glamo_lcm_reset(level); -+} -+ -+static void gta02_jbt6k74_probe_completed(struct device *dev) -+{ -+ struct pcf50633 *pcf = gta02_pcf; -+ -+ /* Switch on backlight. Qi does not do it for us */ -+ pcf50633_reg_write(pcf, PCF50633_REG_LEDOUT, 0x01); -+ pcf50633_reg_write(pcf, PCF50633_REG_LEDENA, 0x00); -+ pcf50633_reg_write(pcf, PCF50633_REG_LEDDIM, 0x01); -+ pcf50633_reg_write(pcf, PCF50633_REG_LEDENA, 0x01); -+ -+ gta02_bl_dev.dev.parent = dev; -+ platform_device_register(>a02_bl_dev); -+} -+ -+const struct jbt6k74_platform_data jbt6k74_pdata = { -+ .reset = gta02_jbt6k74_reset, -+ .probe_completed = gta02_jbt6k74_probe_completed, -+}; -+ -+#if 0 /* currently this is not used and we use gpio spi */ -+static struct glamo_spi_info glamo_spi_cfg = { -+ .board_size = ARRAY_SIZE(gta02_spi_board_info), -+ .board_info = gta02_spi_board_info, -+}; -+#endif /* 0 */ -+ -+static struct glamo_spigpio_info glamo_spigpio_cfg = { -+ .pin_clk = GLAMO_GPIO10_OUTPUT, -+ .pin_mosi = GLAMO_GPIO11_OUTPUT, -+ .pin_cs = GLAMO_GPIO12_OUTPUT, -+ .pin_miso = 0, -+ .bus_num = 2, -+}; -+ -+/*----------- SPI: Accelerometers attached to SPI of s3c244x ----------------- */ -+ -+void gta02_lis302dl_suspend_io(struct lis302dl_info *lis, int resume) -+{ -+ struct lis302dl_platform_data *pdata = lis->pdata; -+ -+ if (!resume) { -+ /* -+ * we don't want to power them with a high level -+ * because GSENSOR_3V3 is not up during suspend -+ */ -+ s3c2410_gpio_setpin(pdata->pin_chip_select, 0); -+ s3c2410_gpio_setpin(pdata->pin_clk, 0); -+ s3c2410_gpio_setpin(pdata->pin_mosi, 0); -+ /* misnomer: it is a pullDOWN in 2442 */ -+ s3c2410_gpio_pullup(pdata->pin_miso, 1); -+ return; -+ } -+ -+ /* back to normal */ -+ s3c2410_gpio_setpin(pdata->pin_chip_select, 1); -+ s3c2410_gpio_setpin(pdata->pin_clk, 1); -+ /* misnomer: it is a pullDOWN in 2442 */ -+ s3c2410_gpio_pullup(pdata->pin_miso, 0); -+ -+ s3c2410_gpio_cfgpin(pdata->pin_chip_select, S3C2410_GPIO_OUTPUT); -+ s3c2410_gpio_cfgpin(pdata->pin_clk, S3C2410_GPIO_OUTPUT); -+ s3c2410_gpio_cfgpin(pdata->pin_mosi, S3C2410_GPIO_OUTPUT); -+ s3c2410_gpio_cfgpin(pdata->pin_miso, S3C2410_GPIO_INPUT); -+ -+} -+ -+struct lis302dl_platform_data lis302_pdata_top = { -+ .name = "lis302-1 (top)", -+ .pin_chip_select= S3C2410_GPD12, -+ .pin_clk = S3C2410_GPG7, -+ .pin_mosi = S3C2410_GPG6, -+ .pin_miso = S3C2410_GPG5, -+ .interrupt = GTA02_IRQ_GSENSOR_1, -+ .open_drain = 1, /* altered at runtime by PCB rev */ -+ .lis302dl_suspend_io = gta02_lis302dl_suspend_io, -+}; -+ -+struct lis302dl_platform_data lis302_pdata_bottom = { -+ .name = "lis302-2 (bottom)", -+ .pin_chip_select= S3C2410_GPD13, -+ .pin_clk = S3C2410_GPG7, -+ .pin_mosi = S3C2410_GPG6, -+ .pin_miso = S3C2410_GPG5, -+ .interrupt = GTA02_IRQ_GSENSOR_2, -+ .open_drain = 1, /* altered at runtime by PCB rev */ -+ .lis302dl_suspend_io = gta02_lis302dl_suspend_io, -+}; -+ -+static struct spi_board_info gta02_spi_board_info[] = { -+ { -+ .modalias = "jbt6k74", -+ /* platform_data */ -+ .platform_data = &jbt6k74_pdata, -+ /* controller_data */ -+ /* irq */ -+ .max_speed_hz = 100 * 1000, -+ .bus_num = 2, -+ /* chip_select */ -+ }, -+ { -+ .modalias = "lis302dl", -+ /* platform_data */ -+ .platform_data = &lis302_pdata_top, -+ /* controller_data */ -+ /* irq */ -+ .max_speed_hz = 100 * 1000, -+ .bus_num = 3, -+ .chip_select = 0, -+ }, -+ -+ { -+ .modalias = "lis302dl", -+ /* platform_data */ -+ .platform_data = &lis302_pdata_bottom, -+ /* controller_data */ -+ /* irq */ -+ .max_speed_hz = 100 * 1000, -+ .bus_num = 3, -+ .chip_select = 1, -+ }, -+ -+}; -+ -+static void gta02_lis302_chip_select(struct s3c2410_spigpio_info *info, int csid, int cs) -+{ -+ -+ /* -+ * Huh... "quirk"... CS on this device is not really "CS" like you can -+ * expect. -+ * -+ * When it is 0 it selects SPI interface mode. -+ * When it is 1 it selects I2C interface mode. -+ * -+ * Because we have 2 devices on one interface we have to make sure -+ * that the "disabled" device (actually in I2C mode) don't think we're -+ * talking to it. -+ * -+ * When we talk to the "enabled" device, the "disabled" device sees -+ * the clocks as I2C clocks, creating havoc. -+ * -+ * I2C sees MOSI going LOW while CLK HIGH as a START action, thus we -+ * must ensure this is never issued. -+ */ -+ -+ int cs_gpio, other_cs_gpio; -+ -+ cs_gpio = csid ? S3C2410_GPD13 : S3C2410_GPD12; -+ other_cs_gpio = (1 - csid) ? S3C2410_GPD13 : S3C2410_GPD12; -+ -+ -+ if (cs == BITBANG_CS_ACTIVE) { -+ s3c2410_gpio_setpin(other_cs_gpio, 1); -+ s3c2410_gpio_setpin(cs_gpio, 1); -+ s3c2410_gpio_setpin(info->pin_clk, 1); -+ s3c2410_gpio_setpin(cs_gpio, 0); -+ } else { -+ s3c2410_gpio_setpin(cs_gpio, 1); -+ s3c2410_gpio_setpin(other_cs_gpio, 1); -+ } -+} -+ -+static struct s3c2410_spigpio_info gta02_spigpio_cfg = { -+ .pin_clk = S3C2410_GPG7, -+ .pin_mosi = S3C2410_GPG6, -+ .pin_miso = S3C2410_GPG5, -+ .bus_num = 3, -+ .num_chipselect = 2, -+ .chip_select = gta02_lis302_chip_select, -+ .non_blocking_transfer = 1, -+}; -+ -+static struct platform_device gta02_spi_gpio_dev = { -+ .name = "spi_s3c24xx_gpio", -+ .dev = { -+ .platform_data = >a02_spigpio_cfg, -+ }, -+}; -+ -+/*----------- / SPI: Accelerometers attached to SPI of s3c244x ----------------- */ -+ -+static struct resource gta02_led_resources[] = { -+ { -+ .name = "gta02-power:orange", -+ .start = GTA02_GPIO_PWR_LED1, -+ .end = GTA02_GPIO_PWR_LED1, -+ }, { -+ .name = "gta02-power:blue", -+ .start = GTA02_GPIO_PWR_LED2, -+ .end = GTA02_GPIO_PWR_LED2, -+ }, { -+ .name = "gta02-aux:red", -+ .start = GTA02_GPIO_AUX_LED, -+ .end = GTA02_GPIO_AUX_LED, -+ }, -+}; -+ -+struct platform_device gta02_led_dev = { -+ .name = "gta02-led", -+ .num_resources = ARRAY_SIZE(gta02_led_resources), -+ .resource = gta02_led_resources, -+}; -+ -+static struct resource gta02_button_resources[] = { -+ [0] = { -+ .start = GTA02_GPIO_AUX_KEY, -+ .end = GTA02_GPIO_AUX_KEY, -+ }, -+ [1] = { -+ .start = GTA02_GPIO_HOLD_KEY, -+ .end = GTA02_GPIO_HOLD_KEY, -+ }, -+ [2] = { -+ .start = GTA02_GPIO_JACK_INSERT, -+ .end = GTA02_GPIO_JACK_INSERT, -+ }, -+ [3] = { -+ .start = 0, -+ .end = 0, -+ }, -+ [4] = { -+ .start = 0, -+ .end = 0, -+ }, -+}; -+ -+static struct platform_device gta02_button_dev = { -+ .name = "neo1973-button", -+ .num_resources = ARRAY_SIZE(gta02_button_resources), -+ .resource = gta02_button_resources, -+}; -+ -+ -+static struct platform_device gta02_pm_usbhost_dev = { -+ .name = "neo1973-pm-host", -+}; -+ -+ -+/* USB */ -+static struct s3c2410_hcd_info gta02_usb_info = { -+ .port[0] = { -+ .flags = S3C_HCDFLG_USED, -+ }, -+ .port[1] = { -+ .flags = 0, -+ }, -+}; -+ -+static int glamo_irq_is_wired(void) -+{ -+ int rc; -+ int count = 0; -+ -+ /* -+ * GTA02 S-Media IRQs prior to A5 are broken due to a lack of -+ * a pullup on the INT# line. Check for the bad behaviour. -+ */ -+ s3c2410_gpio_setpin(S3C2410_GPG4, 0); -+ s3c2410_gpio_cfgpin(S3C2410_GPG4, S3C2410_GPG4_OUTP); -+ s3c2410_gpio_cfgpin(S3C2410_GPG4, S3C2410_GPG4_INP); -+ /* -+ * we force it low ourselves for a moment and resume being input. -+ * If there is a pullup, it won't stay low for long. But if the -+ * level converter is there as on < A5 revision, the weak keeper -+ * on the input of the LC will hold the line low indefinitiely -+ */ -+ do -+ rc = s3c2410_gpio_getpin(S3C2410_GPG4); -+ while ((!rc) && ((count++) < 10)); -+ if (rc) { /* it got pulled back up, it's good */ -+ printk(KERN_INFO "Detected S-Media IRQ# pullup, " -+ "enabling interrupt\n"); -+ return 0; -+ } else /* Gah we can't work with this level converter */ -+ printk(KERN_WARNING "** Detected bad IRQ# circuit found" -+ " on pre-A5 GTA02: S-Media interrupt disabled **\n"); -+ return -ENODEV; -+} -+ -+static int gta02_glamo_can_set_mmc_power(void) -+{ -+ switch (S3C_SYSTEM_REV_ATAG) { -+ case GTA02v3_SYSTEM_REV: -+ case GTA02v4_SYSTEM_REV: -+ case GTA02v5_SYSTEM_REV: -+ case GTA02v6_SYSTEM_REV: -+ return 1; -+ } -+ -+ return 0; -+} -+ -+/* Smedia Glamo 3362 */ -+ -+/* -+ * we crank down SD Card clock dynamically when GPS is powered -+ */ -+ -+static int gta02_glamo_mci_use_slow(void) -+{ -+ return neo1973_pm_gps_is_on(); -+} -+ -+static void gta02_glamo_external_reset(int level) -+{ -+ s3c2410_gpio_setpin(GTA02_GPIO_3D_RESET, level); -+ s3c2410_gpio_cfgpin(GTA02_GPIO_3D_RESET, S3C2410_GPIO_OUTPUT); -+} -+ -+static struct glamofb_platform_data gta02_glamo_pdata = { -+ .width = 43, -+ .height = 58, -+ /* 24.5MHz --> 40.816ns */ -+ .pixclock = 40816, -+ .left_margin = 8, -+ .right_margin = 16, -+ .upper_margin = 2, -+ .lower_margin = 16, -+ .hsync_len = 8, -+ .vsync_len = 2, -+ .fb_mem_size = 0x400000, /* glamo has 8 megs of SRAM. we use 4 */ -+ .xres = { -+ .min = 240, -+ .max = 640, -+ .defval = 480, -+ }, -+ .yres = { -+ .min = 320, -+ .max = 640, -+ .defval = 640, -+ }, -+ .bpp = { -+ .min = 16, -+ .max = 16, -+ .defval = 16, -+ }, -+ //.spi_info = &glamo_spi_cfg, -+ .spigpio_info = &glamo_spigpio_cfg, -+ -+ /* glamo MMC function platform data */ -+ .mmc_dev = >a02_mmc_dev, -+ .glamo_can_set_mci_power = gta02_glamo_can_set_mmc_power, -+ .glamo_mci_use_slow = gta02_glamo_mci_use_slow, -+ .glamo_irq_is_wired = glamo_irq_is_wired, -+ .glamo_external_reset = gta02_glamo_external_reset -+}; -+ -+static struct resource gta02_glamo_resources[] = { -+ [0] = { -+ .start = S3C2410_CS1, -+ .end = S3C2410_CS1 + 0x1000000 - 1, -+ .flags = IORESOURCE_MEM, -+ }, -+ [1] = { -+ .start = GTA02_IRQ_3D, -+ .end = GTA02_IRQ_3D, -+ .flags = IORESOURCE_IRQ, -+ }, -+ [2] = { -+ .start = GTA02_GPIO_3D_RESET, -+ .end = GTA02_GPIO_3D_RESET, -+ }, -+}; -+ -+static struct platform_device gta02_glamo_dev = { -+ .name = "glamo3362", -+ .num_resources = ARRAY_SIZE(gta02_glamo_resources), -+ .resource = gta02_glamo_resources, -+ .dev = { -+ .platform_data = >a02_glamo_pdata, -+ }, -+}; -+ -+static void mangle_glamo_res_by_system_rev(void) -+{ -+ switch (S3C_SYSTEM_REV_ATAG) { -+ case GTA02v1_SYSTEM_REV: -+ break; -+ default: -+ gta02_glamo_resources[2].start = GTA02_GPIO_3D_RESET; -+ gta02_glamo_resources[2].end = GTA02_GPIO_3D_RESET; -+ break; -+ } -+ -+ switch (S3C_SYSTEM_REV_ATAG) { -+ case GTA02v1_SYSTEM_REV: -+ case GTA02v2_SYSTEM_REV: -+ case GTA02v3_SYSTEM_REV: -+ /* case GTA02v4_SYSTEM_REV: - FIXME: handle this later */ -+ /* The hardware is missing a pull-up resistor and thus can't -+ * support the Smedia Glamo IRQ */ -+ gta02_glamo_resources[1].start = 0; -+ gta02_glamo_resources[1].end = 0; -+ break; -+ } -+} -+ -+static void __init gta02_map_io(void) -+{ -+ s3c24xx_init_io(gta02_iodesc, ARRAY_SIZE(gta02_iodesc)); -+ s3c24xx_init_clocks(12000000); -+ s3c24xx_init_uarts(gta02_uartcfgs, ARRAY_SIZE(gta02_uartcfgs)); -+} -+ -+static irqreturn_t gta02_modem_irq(int irq, void *param) -+{ -+ printk(KERN_DEBUG "modem wakeup interrupt\n"); -+ gta_gsm_interrupts++; -+ return IRQ_HANDLED; -+} -+ -+static irqreturn_t ar6000_wow_irq(int irq, void *param) -+{ -+ printk(KERN_DEBUG "ar6000_wow interrupt\n"); -+ return IRQ_HANDLED; -+} -+ -+/* -+ * hardware_ecc=1|0 -+ */ -+static char hardware_ecc_str[4] __initdata = ""; -+ -+static int __init hardware_ecc_setup(char *str) -+{ -+ if (str) -+ strlcpy(hardware_ecc_str, str, sizeof(hardware_ecc_str)); -+ return 1; -+} -+ -+__setup("hardware_ecc=", hardware_ecc_setup); -+ -+/* these are the guys that don't need to be children of PMU */ -+ -+static struct platform_device *gta02_devices[] __initdata = { -+ >a02_version_device, -+ &s3c_device_usb, -+ &s3c_device_wdt, -+ >a02_memconfig_device, -+ &s3c_device_sdi, -+ &s3c_device_usbgadget, -+ &s3c_device_nand, -+ >a02_nor_flash, -+ -+ &s3c24xx_pwm_device, -+ >a02_led_dev, -+ >a02_pm_wlan_dev, /* not dependent on PMU */ -+ -+ &s3c_device_iis, -+ &s3c_device_i2c0, -+}; -+ -+/* these guys DO need to be children of PMU */ -+ -+static struct platform_device *gta02_devices_pmu_children[] = { -+ &s3c_device_ts, /* input 1 */ -+ >a02_pm_gsm_dev, -+ >a02_pm_usbhost_dev, -+ >a02_spi_gpio_dev, /* input 2 and 3 */ -+ >a02_button_dev, /* input 4 */ -+ >a02_resume_reason_device, -+}; -+ -+static void gta02_pmu_regulator_registered(struct pcf50633 *pcf, int id) -+{ -+ struct platform_device *regulator, *pdev; -+ -+ gta02_pcf = pcf; -+ -+ regulator = pcf->regulator_pdev[id]; -+ -+ switch(id) { -+ case PCF50633_REGULATOR_LDO4: -+ pdev = >a01_pm_bt_dev; -+ break; -+ case PCF50633_REGULATOR_LDO5: -+ pdev = >a01_pm_gps_dev; -+ break; -+ case PCF50633_REGULATOR_HCLDO: -+ pdev = >a02_glamo_dev; -+ break; -+ default: -+ return; -+ } -+ -+ pdev->dev.parent = ®ulator->dev; -+ platform_device_register(pdev); -+} -+ -+/* this is called when pc50633 is probed, unfortunately quite late in the -+ * day since it is an I2C bus device. Here we can belatedly define some -+ * platform devices with the advantage that we can mark the pcf50633 as the -+ * parent. This makes them get suspended and resumed with their parent -+ * the pcf50633 still around. -+ */ -+ -+static void gta02_pmu_attach_child_devices(struct pcf50633 *pcf) -+{ -+ int n; -+ -+ for (n = 0; n < ARRAY_SIZE(gta02_devices_pmu_children); n++) -+ gta02_devices_pmu_children[n]->dev.parent = pcf->dev; -+ -+ mangle_glamo_res_by_system_rev(); -+ platform_add_devices(gta02_devices_pmu_children, -+ ARRAY_SIZE(gta02_devices_pmu_children)); -+} -+ -+static void gta02_poweroff(void) -+{ -+ pcf50633_reg_set_bit_mask(gta02_pcf, PCF50633_REG_OOCSHDWN, -+ PCF50633_OOCSHDWN_GOSTDBY, PCF50633_OOCSHDWN_GOSTDBY); -+} -+ -+static void __init gta02_machine_init(void) -+{ -+ int rc; -+ -+ /* set the panic callback to make AUX blink fast */ -+ panic_blink = gta02_panic_blink; -+ -+ switch (S3C_SYSTEM_REV_ATAG) { -+ case GTA02v6_SYSTEM_REV: -+ /* we need push-pull interrupt from motion sensors */ -+ lis302_pdata_top.open_drain = 0; -+ lis302_pdata_bottom.open_drain = 0; -+ break; -+ default: -+ break; -+ } -+ -+ spin_lock_init(&motion_irq_lock); -+ -+#ifdef CONFIG_CHARGER_PCF50633 -+ INIT_DELAYED_WORK(>a02_charger_work, gta02_charger_worker); -+#endif -+ -+ /* Glamo chip select optimization */ -+/* *((u32 *)(S3C2410_MEMREG(((1 + 1) << 2)))) = 0x1280; */ -+ -+ /* do not force soft ecc if we are asked to use hardware_ecc */ -+ if (hardware_ecc_str[0] == '1') -+ gta02_nand_info.software_ecc = 0; -+ -+ 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_s3c_mmc_cfg; -+ -+ /* acc sensor chip selects */ -+ s3c2410_gpio_setpin(S3C2410_GPD12, 1); -+ s3c2410_gpio_cfgpin(S3C2410_GPD12, S3C2410_GPIO_OUTPUT); -+ s3c2410_gpio_setpin(S3C2410_GPD13, 1); -+ s3c2410_gpio_cfgpin(S3C2410_GPD13, S3C2410_GPIO_OUTPUT); -+ -+ s3c24xx_udc_set_platdata(>a02_udc_cfg); -+ s3c_i2c0_set_platdata(NULL); -+ set_s3c2410ts_info(>a02_ts_cfg); -+ -+ mangle_glamo_res_by_system_rev(); -+ -+ i2c_register_board_info(0, gta02_i2c_devs, ARRAY_SIZE(gta02_i2c_devs)); -+ spi_register_board_info(gta02_spi_board_info, -+ ARRAY_SIZE(gta02_spi_board_info)); -+ -+ mangle_pmu_pdata_by_system_rev(); -+ -+ platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices)); -+ -+ s3c_pm_init(); -+ -+ /* Make sure the modem can wake us up */ -+ set_irq_type(GTA02_IRQ_MODEM, IRQ_TYPE_EDGE_RISING); -+ 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); -+ -+ /* Make sure the wifi module can wake us up*/ -+ set_irq_type(GTA02_IRQ_WLAN_GPIO1, IRQ_TYPE_EDGE_RISING); -+ rc = request_irq(GTA02_IRQ_WLAN_GPIO1, ar6000_wow_irq, IRQF_DISABLED, -+ "ar6000", NULL); -+ -+ if (rc < 0) -+ printk(KERN_ERR "GTA02: can't request ar6k wakeup IRQ\n"); -+ enable_irq_wake(GTA02_IRQ_WLAN_GPIO1); -+ -+ pm_power_off = gta02_poweroff; -+ -+ /* Register the HDQ and vibrator as children of pwm device */ -+#ifdef CONFIG_HDQ_GPIO_BITBANG -+ gta02_hdq_device.dev.parent = &s3c24xx_pwm_device.dev; -+ platform_device_register(>a02_hdq_device); -+#endif -+#ifdef CONFIG_LEDS_NEO1973_VIBRATOR -+ gta02_vibrator_dev.dev.parent = &s3c24xx_pwm_device.dev; -+ platform_device_register(>a02_vibrator_dev); -+#endif -+} -+ -+void DEBUG_LED(int n) -+{ -+// int *p = NULL; -+ switch (n) { -+ case 0: -+ neo1973_gpb_setpin(GTA02_GPIO_PWR_LED1, 1); -+ break; -+ case 1: -+ neo1973_gpb_setpin(GTA02_GPIO_PWR_LED2, 1); -+ break; -+ default: -+ neo1973_gpb_setpin(GTA02_GPIO_AUX_LED, 1); -+ break; -+ } -+// printk(KERN_ERR"die %d\n", *p); -+} -+EXPORT_SYMBOL_GPL(DEBUG_LED); -+ -+MACHINE_START(NEO1973_GTA02, "GTA02") -+ .phys_io = S3C2410_PA_UART, -+ .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, -+ .boot_params = S3C2410_SDRAM_PA + 0x100, -+ .map_io = gta02_map_io, -+ .init_irq = s3c24xx_init_irq, -+ .init_machine = gta02_machine_init, -+ .timer = &s3c24xx_timer, -+MACHINE_END -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2442/Makefile linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2442/Makefile ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2442/Makefile 2009-05-10 22:05:02.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2442/Makefile 2009-05-10 22:27:59.000000000 +0200 -@@ -9,8 +9,11 @@ - obj-n := - obj- := - -+obj-$(CONFIG_S3C2440_C_FIQ) += fiq_c_isr.o -+ - obj-$(CONFIG_CPU_S3C2442) += s3c2442.o - obj-$(CONFIG_CPU_S3C2442) += clock.o -+obj-$(CONFIG_MACH_NEO1973_GTA02) += mach-gta02.o - - # Machine support - -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2442/s3c2442.c linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2442/s3c2442.c ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2442/s3c2442.c 2009-05-10 22:05:02.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2442/s3c2442.c 2009-05-10 22:27:59.000000000 +0200 -@@ -21,6 +21,7 @@ - - #include - #include -+#include - - static struct sys_device s3c2442_sysdev = { - .cls = &s3c2442_sysclass, -@@ -30,5 +31,8 @@ - { - printk("S3C2442: Initialising architecture\n"); - -+ /* make sure SD/MMC driver can distinguish 2440 from 2410 */ -+ s3c_device_sdi.name = "s3c2440-sdi"; -+ - return sysdev_register(&s3c2442_sysdev); - } -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2443/dma.c linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2443/dma.c ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c2443/dma.c 2009-05-10 22:05:03.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c2443/dma.c 2009-05-10 22:27:59.000000000 +0200 -@@ -20,16 +20,17 @@ - - #include - --#include -+#include - #include - - #include - #include - #include -+#include - #include - #include - #include --#include -+#include - #include - - #define MAP(x) { \ -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c24a0/include/mach/io.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c24a0/include/mach/io.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c24a0/include/mach/io.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c24a0/include/mach/io.h 2009-05-10 22:27:59.000000000 +0200 -@@ -0,0 +1,16 @@ -+/* arch/arm/mach-s3c24a0/include/mach/io.h -+ * -+ * Copyright 2008 Simtec Electronics -+ * Ben Dooks -+ * -+ * IO access and mapping routines for the S3C24A0 -+ */ -+ -+#ifndef __ASM_ARM_ARCH_IO_H -+#define __ASM_ARM_ARCH_IO_H -+ -+/* No current ISA/PCI bus support. */ -+#define __io(a) ((void __iomem *)(a)) -+#define __mem_pci(a) (a) -+ -+#endif -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c24a0/include/mach/irqs.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c24a0/include/mach/irqs.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c24a0/include/mach/irqs.h 2009-05-10 22:05:03.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c24a0/include/mach/irqs.h 2009-05-10 22:27:59.000000000 +0200 -@@ -70,6 +70,8 @@ - #define IRQ_EINT17 S3C2410_IRQ(49) - #define IRQ_EINT18 S3C2410_IRQ(50) - -+#define IRQ_EINT_BIT(x) ((x) - IRQ_EINT00) -+ - /* SUB IRQS */ - #define IRQ_S3CUART_RX0 S3C2410_IRQ(51) /* 67 */ - #define IRQ_S3CUART_TX0 S3C2410_IRQ(52) -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c6400/include/mach/dma.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c6400/include/mach/dma.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c6400/include/mach/dma.h 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c6400/include/mach/dma.h 2009-05-10 22:27:59.000000000 +0200 -@@ -11,6 +11,63 @@ - #ifndef __ASM_ARCH_DMA_H - #define __ASM_ARCH_DMA_H __FILE__ - --/* currently nothing here, placeholder */ -+#define S3C_DMA_CHANNELS (16) -+ -+/* see mach-s3c2410/dma.h for notes on dma channel numbers */ -+ -+/* Note, for the S3C64XX architecture we keep the DMACH_ -+ * defines in the order they are allocated to [S]DMA0/[S]DMA1 -+ * so that is easy to do DHACH_ -> DMA controller conversion -+ */ -+enum dma_ch { -+ /* DMA0/SDMA0 */ -+ DMACH_UART0 = 0, -+ DMACH_UART0_SRC2, -+ DMACH_UART1, -+ DMACH_UART1_SRC2, -+ DMACH_UART2, -+ DMACH_UART2_SRC2, -+ DMACH_UART3, -+ DMACH_UART3_SRC2, -+ DMACH_PCM0_TX, -+ DMACH_PCM0_RX, -+ DMACH_I2S0_OUT, -+ DMACH_I2S0_IN, -+ DMACH_SPI0_TX, -+ DMACH_SPI0_RX, -+ DMACH_HSI_I2SV40_TX, -+ DMACH_HSI_I2SV40_RX, -+ -+ /* DMA1/SDMA1 */ -+ DMACH_PCM1_TX = 16, -+ DMACH_PCM1_RX, -+ DMACH_I2S1_OUT, -+ DMACH_I2S1_IN, -+ DMACH_SPI1_TX, -+ DMACH_SPI1_RX, -+ DMACH_AC97_PCMOUT, -+ DMACH_AC97_PCMIN, -+ DMACH_AC97_MICIN, -+ DMACH_PWM, -+ DMACH_IRDA, -+ DMACH_EXTERNAL, -+ DMACH_RES1, -+ DMACH_RES2, -+ DMACH_SECURITY_RX, /* SDMA1 only */ -+ DMACH_SECURITY_TX, /* SDMA1 only */ -+ DMACH_MAX /* the end */ -+}; -+ -+static __inline__ int s3c_dma_has_circular(void) -+{ -+ /* we will be supporting ciruclar buffers as soon as we have DMA -+ * engine support. -+ */ -+ return 1; -+} -+ -+#define S3C2410_DMAF_CIRCULAR (1 << 0) -+ -+#include - - #endif /* __ASM_ARCH_IRQ_H */ -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c6400/include/mach/map.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c6400/include/mach/map.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c6400/include/mach/map.h 2009-05-10 22:05:03.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c6400/include/mach/map.h 2009-05-10 22:27:59.000000000 +0200 -@@ -40,6 +40,8 @@ - - #define S3C64XX_PA_FB (0x77100000) - #define S3C64XX_PA_SYSCON (0x7E00F000) -+#define S3C64XX_PA_IIS0 (0x7F002000) -+#define S3C64XX_PA_IIS1 (0x7F003000) - #define S3C64XX_PA_TIMER (0x7F006000) - #define S3C64XX_PA_IIC0 (0x7F004000) - #define S3C64XX_PA_IIC1 (0x7F00F000) -@@ -49,12 +51,21 @@ - #define S3C64XX_SZ_GPIO SZ_4K - - #define S3C64XX_PA_SDRAM (0x50000000) -+#define S3C64XX_PA_TZIC0 (0x71000000) -+#define S3C64XX_PA_TZIC1 (0x71100000) - #define S3C64XX_PA_VIC0 (0x71200000) - #define S3C64XX_PA_VIC1 (0x71300000) - -+#define S3C64XX_PA_MODEM (0x74108000) -+#define S3C64XX_VA_MODEM S3C_ADDR(0x00600000) -+ -+#define S3C64XX_PA_USBHOST (0x74300000) -+ - /* place VICs close together */ - #define S3C_VA_VIC0 (S3C_VA_IRQ + 0x00) - #define S3C_VA_VIC1 (S3C_VA_IRQ + 0x10000) -+#define S3C_VA_TZIC0 (S3C_VA_IRQ + 0x20000) -+#define S3C_VA_TZIC1 (S3C_VA_IRQ + 0x30000) - - /* compatibiltiy defines. */ - #define S3C_PA_TIMER S3C64XX_PA_TIMER -@@ -64,5 +75,12 @@ - #define S3C_PA_IIC S3C64XX_PA_IIC0 - #define S3C_PA_IIC1 S3C64XX_PA_IIC1 - #define S3C_PA_FB S3C64XX_PA_FB -+#define S3C_PA_USBHOST S3C64XX_PA_USBHOST -+ -+#define S3C64XX_VA_OTG S3C_VA_OTG -+#define S3C64XX_PA_OTG (0x7C000000) -+ -+#define S3C64XX_VA_OTGSFR S3C_VA_OTGSFR -+#define S3C64XX_PA_OTGSFR (0x7C100000) - - #endif /* __ASM_ARCH_6400_MAP_H */ -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c6400/include/mach/regs-clock.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c6400/include/mach/regs-clock.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c6400/include/mach/regs-clock.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c6400/include/mach/regs-clock.h 2009-05-10 22:27:59.000000000 +0200 -@@ -0,0 +1,16 @@ -+/* linux/arch/arm/mach-s3c6400/include/mach/regs-clock.h -+ * -+ * Copyright 2008 Openmoko, Inc. -+ * Copyright 2008 Simtec Electronics -+ * http://armlinux.simtec.co.uk/ -+ * Ben Dooks -+ * -+ * S3C64XX - clock register compatibility with s3c24xx -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+*/ -+ -+#include -+ -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c6400/include/mach/system.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c6400/include/mach/system.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c6400/include/mach/system.h 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c6400/include/mach/system.h 2009-05-10 22:27:59.000000000 +0200 -@@ -11,9 +11,29 @@ - #ifndef __ASM_ARCH_SYSTEM_H - #define __ASM_ARCH_SYSTEM_H __FILE__ - -+#include -+#include -+ -+#include -+#include -+ - static void arch_idle(void) - { -- /* nothing here yet */ -+ unsigned long flags; -+ u32 mode; -+ -+ /* ensure that if we execute the cpu idle sequence that we -+ * go into idle mode instead of powering off. */ -+ -+ local_irq_save(flags); -+ mode = __raw_readl(S3C64XX_PWR_CFG); -+ mode &= ~S3C64XX_PWRCFG_CFG_WFI_MASK; -+ mode |= S3C64XX_PWRCFG_CFG_WFI_IDLE; -+ __raw_writel(mode, S3C64XX_PWR_CFG); -+ -+ local_irq_restore(flags); -+ -+ cpu_do_idle(); - } - - static void arch_reset(char mode) -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c6410/include/mach/om-3d7k.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c6410/include/mach/om-3d7k.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c6410/include/mach/om-3d7k.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c6410/include/mach/om-3d7k.h 2009-05-10 22:27:59.000000000 +0200 -@@ -0,0 +1,98 @@ -+/* -+ * 3D7K GPIO Mappings -+ * -+ * (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 version 2 as -+ * published by the Free Software Foundation -+ * -+ */ -+ -+#ifndef _OM_3D7K_H -+#define _OM_3D7K_H -+ -+#include -+#include -+#include -+ -+extern struct pcf50633 *om_3d7k_pcf; -+ -+/* ATAG_REVISION from bootloader */ -+#define OM_3D7Kv1_SYSTEM_REV 0x00000001 -+ -+#define OM_3D7K_GPIO_VIBRATOR_ON S3C64XX_GPF(13) -+#define OM_3D7K_GPIO_CLKOUT S3C64XX_GPF(14) -+ -+#define OM_3D7K_GPIO_ACCEL_MISO S3C64XX_GPC(0) -+#define OM_3D7K_GPIO_ACCEL_CLK S3C64XX_GPC(1) -+#define OM_3D7K_GPIO_ACCEL_MOSI S3C64XX_GPC(2) -+ -+#define OM_3D7K_GPIO_LCM_MISO S3C64XX_GPC(4) -+#define OM_3D7K_GPIO_LCM_CLK S3C64XX_GPC(5) -+#define OM_3D7K_GPIO_LCM_MOSI S3C64XX_GPC(6) -+#define OM_3D7K_GPIO_LCM_CS S3C64XX_GPC(7) -+ -+#define OM_3D7K_GPIO_BTPCM_SHARED_SCLK S3C64XX_GPE(0) -+#define OM_3D7K_GPIO_BTPCM_SHARED_EXTCLK S3C64XX_GPE(1) -+#define OM_3D7K_GPIO_BTPCM_SHARED_FSYNC S3C64XX_GPE(2) -+#define OM_3D7K_GPIO_BTPCM_SHARED_SIN S3C64XX_GPE(3) -+#define OM_3D7K_GPIO_BTPCM_SHARED_SOUT S3C64XX_GPE(4) -+ -+#define OM_3D7K_GPIO_WLAN_RESET S3C64XX_GPH(6) -+#define OM_3D7K_GPIO_HDQ S3C64XX_GPH(7) -+#define OM_3D7K_GPIO_WLAN_PWRDN S3C64XX_GPH(8) -+ -+#define OM_3D7K_GPIO_VERSION2 S3C64XX_GPI(0) -+#define OM_3D7K_GPIO_VERSION1 S3C64XX_GPI(1) -+#define OM_3D7K_GPIO_VERSION0 S3C64XX_GPI(8) -+ -+#define OM_3D7K_GPIO_NWLAN_POWER S3C64XX_GPK(0) -+#define OM_3D7K_GPIO_MODEM_ON S3C64XX_GPK(2) -+#define OM_3D7K_GPIO_LED_TRIG S3C64XX_GPK(3) -+#define OM_3D7K_GPIO_LED_EN S3C64XX_GPK(4) -+#define OM_3D7K_GPIO_LCM_RESET S3C64XX_GPK(6) -+ -+#define OM_3D7K_GPIO_LCM_SD S3C64XX_GPL(0) -+ -+#define OM_3D7K_GPIO_TP_RESET S3C64XX_GPM(0) -+#define OM_3D7K_GPIO_GPS_LNA_EN S3C64XX_GPM(2) -+ -+#define OM_3D7K_GPIO_USB_FLT S3C64XX_GPM(4) -+#define OM_3D7K_GPIO_USB_OC S3C64XX_GPM(5) -+ -+#define OM_3D7K_GPIO_ACCEL_INT1 S3C64XX_GPN(0) -+#define OM_3D7K_GPIO_KEY_MINUS S3C64XX_GPN(1) -+#define OM_3D7K_GPIO_KEY_PLUS S3C64XX_GPN(2) -+#define OM_3D7K_GPIO_PWR_IND S3C64XX_GPN(3) -+#define OM_3D7K_GPIO_PWR_IRQ S3C64XX_GPN(4) -+#define OM_3D7K_GPIO_TOUCH S3C64XX_GPN(5) -+#define OM_3D7K_GPIO_JACK_INSERT S3C64XX_GPN(6) -+#define OM_3D7K_GPIO_GPS_INT S3C64XX_GPN(7) -+#define OM_3D7K_GPIO_HOLD S3C64XX_GPN(8) -+#define OM_3D7K_GPIO_WLAN_WAKEUP S3C64XX_GPN(9) -+#define OM_3D7K_GPIO_ACCEL_INT2 S3C64XX_GPN(10) -+#define OM_3D7K_GPIO_IO1 S3C64XX_GPN(11) -+#define OM_3D7K_GPIO_NONKEYWAKE S3C64XX_GPN(12) -+ -+#define OM_3D7K_GPIO_N_MODEM_RESET S3C64XX_GPO(1) -+ -+#define OM_3D7K_IRQ_GSENSOR_1 S3C_EINT(0) -+#define OM_3D7K_IRQ_KEY_MINUS S3C_EINT(1) -+#define OM_3D7K_IRQ_KEY_PLUS S3C_EINT(2) -+#define OM_3D7K_IRQ_PWR_IND S3C_EINT(3) -+#define OM_3D7K_IRQ_PMU S3C_EINT(4) -+#define OM_3D7K_IRQ_TOUCH S3C_EINT(5) -+#define OM_3D7K_IRQ_JACK_INSERT S3C_EINT(6) -+#define OM_3D7K_IRQ_GPS_INT S3C_EINT(7) -+#define OM_3D7K_IRQ_NHOLD S3C_EINT(8) -+#define OM_3D7K_IRQ_WLAN_WAKEUP S3C_EINT(9) -+#define OM_3D7K_IRQ_GSENSOR_2 S3C_EINT(10) -+#define OM_3D7K_IRQ_IO1 S3C_EINT(11) -+#define OM_3D7K_IRQ_NONKEYWAKE S3C_EINT(12) -+ -+#define OM_3D7K_IRQ_LED IRQ_EINT_GROUP(6, 9) -+ -+#endif /* _OM_3D7K_H */ -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c6410/include/mach/spi-gpio.h linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c6410/include/mach/spi-gpio.h ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c6410/include/mach/spi-gpio.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c6410/include/mach/spi-gpio.h 2009-05-10 22:27:59.000000000 +0200 -@@ -0,0 +1,28 @@ -+/* arch/arm/mach-s3c6400/include/mach/spi-gpio.h -+ * -+ * Copyright (c) 2006 Simtec Electronics -+ * Ben Dooks -+ * -+ * S3C64XX - SPI Controller platfrom_device info -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+*/ -+ -+#ifndef __ASM_ARCH_SPIGPIO_H -+#define __ASM_ARCH_SPIGPIO_H __FILE__ -+ -+struct s3c64xx_spigpio_info { -+ unsigned long pin_clk; -+ unsigned long pin_mosi; -+ unsigned long pin_miso; -+ -+ int bus_num; -+ int num_chipselect; -+ -+ void (*chip_select)(struct s3c64xx_spigpio_info *spi, int csid, int cs); -+}; -+ -+ -+#endif /* __ASM_ARCH_SPIGPIO_H */ -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c6410/Kconfig linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c6410/Kconfig ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c6410/Kconfig 2009-05-10 22:05:04.000000000 +0200 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c6410/Kconfig 2009-05-10 22:27:59.000000000 +0200 -@@ -26,6 +26,7 @@ - select S3C_DEV_HSMMC1 - select S3C_DEV_I2C1 - select S3C_DEV_FB -+ select S3C_DEV_USB_HOST - select S3C6410_SETUP_SDHCI - select S3C64XX_SETUP_I2C1 - select S3C64XX_SETUP_FB_24BPP -@@ -60,3 +61,25 @@ - channels 0 and 1 are the same. - - endchoice -+ -+config MACH_OM_3D7K -+ bool "Openmoko 3D7K Phone" -+ select CPU_S3C6410 -+ select S3C_DEV_HSMMC -+ select S3C_DEV_HSMMC1 -+ select S3C_DEV_I2C1 -+ select S3C_DEV_USB_HOST -+ select S3C6410_SETUP_SDHCI -+ select S3C64XX_SETUP_I2C1 -+ select S3C_DEV_FB -+ select S3C_DEV_CAMIF -+ select S3C64XX_SETUP_FB_24BPP -+# select SENSORS_PCF50633 -+ select POWER_SUPPLY -+ select HDQ_GPIO_BITBANG -+ select S3C_PWM -+ select FIQ -+ select MACH_NEO1973 -+ help -+ Machine support for the Openmoko 3D7K Phone -+ -diff -ruN --exclude='*.orig' --exclude='*.rej' linux-2.6.29-rc3.owrt/arch/arm/mach-s3c6410/mach-om-3d7k.c linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c6410/mach-om-3d7k.c ---- linux-2.6.29-rc3.owrt/arch/arm/mach-s3c6410/mach-om-3d7k.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.29-rc3.owrt.om/arch/arm/mach-s3c6410/mach-om-3d7k.c 2009-05-10 22:27:59.000000000 +0200 -@@ -0,0 +1,1196 @@ -+/* linux/arch/arm/mach-s3c6410/mach-om-3d7k.c -+ * -+ * Copyright 2008 Openmoko, Inc. -+ * Andy Green -+ * -+ * based on mach_smdk6410.c which is -+ * -+ * Copyright 2008 Openmoko, Inc. -+ * Copyright 2008 Simtec Electronics -+ * Ben Dooks -+ * http://armlinux.simtec.co.uk/ -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+*/ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include