diff options
Diffstat (limited to 'packages/linux/linux-ezx-2.6.21/ezx-pcap.patch')
-rw-r--r-- | packages/linux/linux-ezx-2.6.21/ezx-pcap.patch | 161 |
1 files changed, 71 insertions, 90 deletions
diff --git a/packages/linux/linux-ezx-2.6.21/ezx-pcap.patch b/packages/linux/linux-ezx-2.6.21/ezx-pcap.patch index a077ad5ffb..41903260e6 100644 --- a/packages/linux/linux-ezx-2.6.21/ezx-pcap.patch +++ b/packages/linux/linux-ezx-2.6.21/ezx-pcap.patch @@ -1,8 +1,8 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx-pcap.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.21/arch/arm/mach-pxa/ezx-pcap.c 2007-05-04 03:07:37.000000000 -0300 -@@ -0,0 +1,425 @@ ++++ linux-2.6.21/arch/arm/mach-pxa/ezx-pcap.c 2007-05-08 16:13:29.000000000 -0300 +@@ -0,0 +1,428 @@ +/* Driver for Motorola PCAP2 as present in EZX phones + * + * This is both a SPI device driver for PCAP itself, as well as @@ -41,6 +41,7 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx-pcap.c + +extern unsigned long ezx_ssp_pcap_putget(ulong); + ++ +int ezx_pcap_write(u_int8_t reg_num, u_int32_t value) +{ + value &= SSP_PCAP_REGISTER_VALUE_MASK; @@ -51,7 +52,7 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx-pcap.c + ezx_ssp_pcap_putget(value); + local_irq_enable(); + -+// DEBUGP("pcap write r%x: 0x%08x\n", reg_num, value); ++ DEBUGP("pcap write r%x: 0x%08x\n", reg_num, value); + return 0; +} +EXPORT_SYMBOL_GPL(ezx_pcap_write); @@ -65,7 +66,7 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx-pcap.c + *value = ezx_ssp_pcap_putget(frame); + local_irq_enable(); + -+// DEBUGP("pcap read r%x: 0x%08x\n", reg_num, *value); ++ DEBUGP("pcap read r%x: 0x%08x\n", reg_num, *value); + return 0; +} +EXPORT_SYMBOL_GPL(ezx_pcap_read); @@ -107,32 +108,30 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx-pcap.c +EXPORT_SYMBOL_GPL(ezx_pcap_read_bit); + + -+static int ezx_pcap_vibrator_level(u_int32_t bit) ++void ezx_pcap_vibrator_level(u_int32_t value) +{ -+ /* FIXME */ -+ return 0; ++ u_int32_t tmp; ++ ++ ezx_pcap_read(SSP_PCAP_ADJ_AUX_VREG_REGISTER, &tmp); ++ ++ tmp &= (~SSP_PCAP_VIBRATOR_VOLTAGE_LEVEL_MASK); ++ tmp |= value; ++ ++ ezx_pcap_write(SSP_PCAP_ADJ_AUX_VREG_REGISTER, tmp); +} +EXPORT_SYMBOL_GPL(ezx_pcap_vibrator_level); + -+ -+static int pcap_init(void) ++static int __init pcap_init(void) +{ + /* initialize registers */ -+ /* FIXME: this should be board-level, not chip-level */ ++#warning FIXME: pcap_init still chip level + /* implement a per board pcap init reg array? */ + -+// ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_ISR_USB4VI, 1); -+// ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_MSR_USB4VM, 0); -+// ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_ISR_USB1VI, 1); -+// ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_MSR_USB1VM, 0); -+ // disable all interrupts + ezx_pcap_write(SSP_PCAP_ADJ_MSR_REGISTER, PCAP_MASK_ALL_INTERRUPT); -+ // clear all interrupts -+ ezx_pcap_write(SSP_PCAP_ADJ_ISR_REGISTER, PCAP_MASK_ALL_INTERRUPT); ++ ezx_pcap_write(SSP_PCAP_ADJ_ISR_REGISTER, PCAP_CLEAR_INTERRUPT_REGISTER); + + ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_AUD_RX_AMPS_A1CTRL, 1); + ezx_pcap_vibrator_level(PCAP_VIBRATOR_VOLTAGE_LEVEL3); -+ ezx_pcap_vibrator_level(PCAP_VIBRATOR_VOLTAGE_LEVEL3); + + /* set SW1 sleep to keep SW1 1.3v in sync mode */ + ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_LOWPWR_CTRL_SW1_MODE10, 0); @@ -217,8 +216,8 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx-pcap.c + [0] = EZX_IRQ_ADCDONE, + [1] = EZX_IRQ_TS, + [2] = 0, /* 1HZ */ -+ [3] = 0, /* WI */ -+ [4] = 0, /* WI */ ++ [3] = 0, /* WH */ ++ [4] = 0, /* WL */ + [5] = 0, /* TODA */ + [6] = EZX_IRQ_USB4V, + [7] = 0, /* ONOFF */ @@ -232,21 +231,21 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx-pcap.c + [15] = 0, /* WARM */ + [16] = 0, /* EOL */ + [17] = 0, /* CLK */ -+ [18] = 0, /* SYS_RST */ ++ [18] = 0, /* SYSRST */ + [19] = 0, + [20] = EZX_IRQ_ADCDONE2, -+ [21] = 0, /* SOFT_RESET */ ++ [21] = 0, /* SOFTRESET */ + [22] = 0, /* MNEXB */ +}; + +/* Array indexed by IRQ NUMBER, returns PCAP absolute value */ +static unsigned int irq2pcap[] = { -+ [EZX_IRQ_ADCDONE] = SSP_PCAP_ADJ_BIT_ISR_ADCDONEI, -+ [EZX_IRQ_TS] = SSP_PCAP_ADJ_BIT_ISR_TSI, + [EZX_IRQ_USB4V] = SSP_PCAP_ADJ_BIT_ISR_USB4VI, + [EZX_IRQ_USB1V] = SSP_PCAP_ADJ_BIT_ISR_USB1VI, + [EZX_IRQ_HEADJACK] = SSP_PCAP_ADJ_BIT_ISR_A1I, + [EZX_IRQ_MIC] = SSP_PCAP_ADJ_BIT_ISR_MB2I, ++ [EZX_IRQ_ADCDONE] = SSP_PCAP_ADJ_BIT_ISR_ADCDONEI, ++ [EZX_IRQ_TS] = SSP_PCAP_ADJ_BIT_ISR_TSI, + [EZX_IRQ_ADCDONE2] = SSP_PCAP_ADJ_BIT_ISR_ADCDONE2I, +}; + @@ -334,6 +333,8 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx-pcap.c + struct irq_desc *subdesc; + DEBUGP("found irq %u\n", pirq); + subdesc = irq_desc + pirq; ++ ++ kstat_cpu(cpu).irqs[pirq]++; + subdesc->chip->ack(pirq); + + spin_unlock(&desc->lock); @@ -382,7 +383,7 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx-pcap.c + } + set_irq_chained_handler(IRQ_GPIO1, pcap_irq_demux_handler); + -+ printk("PCAP2 SSP driver registered.\n"); ++ printk("ezx-pcap: ssp driver registered\n"); + + return 0; +} @@ -396,6 +397,8 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx-pcap.c +static int ezx_pcap_resume(struct platform_device *dev) +{ + DEBUGP("pcap resume!\n"); ++ /* ack all irqs */ ++ ezx_pcap_write(SSP_PCAP_ADJ_ISR_REGISTER, PCAP_CLEAR_INTERRUPT_REGISTER); + return 0; +} + @@ -431,7 +434,7 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx-pcap.c Index: linux-2.6.21/include/asm-arm/arch-pxa/ezx-pcap.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.21/include/asm-arm/arch-pxa/ezx-pcap.h 2007-05-03 17:43:48.000000000 -0300 ++++ linux-2.6.21/include/asm-arm/arch-pxa/ezx-pcap.h 2007-05-08 04:03:42.000000000 -0300 @@ -0,0 +1,665 @@ +/* (c) Copyright Motorola Beijing 2002 all rights reserved. + @@ -1100,8 +1103,8 @@ Index: linux-2.6.21/include/asm-arm/arch-pxa/ezx-pcap.h +#endif Index: linux-2.6.21/include/asm-arm/arch-pxa/irqs.h =================================================================== ---- linux-2.6.21.orig/include/asm-arm/arch-pxa/irqs.h 2007-05-03 17:41:55.000000000 -0300 -+++ linux-2.6.21/include/asm-arm/arch-pxa/irqs.h 2007-05-03 17:43:48.000000000 -0300 +--- linux-2.6.21.orig/include/asm-arm/arch-pxa/irqs.h 2007-05-08 03:43:19.000000000 -0300 ++++ linux-2.6.21/include/asm-arm/arch-pxa/irqs.h 2007-05-08 04:03:42.000000000 -0300 @@ -176,7 +176,8 @@ #define NR_IRQS (IRQ_LOCOMO_SPI_TEND + 1) #elif defined(CONFIG_ARCH_LUBBOCK) || \ @@ -1112,42 +1115,26 @@ Index: linux-2.6.21/include/asm-arm/arch-pxa/irqs.h #define NR_IRQS (IRQ_BOARD_END) #else #define NR_IRQS (IRQ_BOARD_START) -@@ -222,3 +223,16 @@ +@@ -222,3 +223,13 @@ #define IRQ_LOCOMO_GPIO_BASE (IRQ_BOARD_START + 1) #define IRQ_LOCOMO_LT_BASE (IRQ_BOARD_START + 2) #define IRQ_LOCOMO_SPI_BASE (IRQ_BOARD_START + 3) + +/* EZX Interrupts (CONFIG_EZX) */ +#define EZX_IRQ(x) (IRQ_BOARD_START + (x)) -+#define EZX_IRQ_ADCDONE EZX_IRQ(0) /* PCAP */ -+#define EZX_IRQ_TS EZX_IRQ(1) /* PCAP */ -+#define EZX_IRQ_USB4V EZX_IRQ(2) /* PCAP */ -+#define EZX_IRQ_USB1V EZX_IRQ(3) /* PCAP */ -+#define EZX_IRQ_HEADJACK EZX_IRQ(4) /* PCAP */ -+#define EZX_IRQ_MIC EZX_IRQ(5) /* PCAP */ -+#define EZX_IRQ_ADCDONE2 EZX_IRQ(6) /* PCAP */ -+#define EZX_IRQ_ONOFF EZX_IRQ(7) -+#define EZX_IRQ_ONOFF2 EZX_IRQ(8) -+ -Index: linux-2.6.21/arch/arm/mach-pxa/Makefile -=================================================================== ---- linux-2.6.21.orig/arch/arm/mach-pxa/Makefile 2007-05-03 17:42:02.000000000 -0300 -+++ linux-2.6.21/arch/arm/mach-pxa/Makefile 2007-05-04 04:17:33.000000000 -0300 -@@ -18,7 +18,7 @@ - obj-$(CONFIG_MACH_AKITA) += akita-ioexp.o - obj-$(CONFIG_MACH_POODLE) += poodle.o corgi_ssp.o - obj-$(CONFIG_MACH_TOSA) += tosa.o --obj-$(CONFIG_PXA_EZX) += ezx.o ezx_lcd.o ezx_ssp.o -+obj-$(CONFIG_PXA_EZX) += ezx.o ezx_lcd.o ezx_ssp.o ezx-pcap.o - - # Support for blinky lights - led-y := leds.o ++#define EZX_IRQ_USB4V EZX_IRQ(0) /* EMU */ ++#define EZX_IRQ_USB1V EZX_IRQ(1) /* EMU */ ++#define EZX_IRQ_HEADJACK EZX_IRQ(2) /* Audio connector */ ++#define EZX_IRQ_MIC EZX_IRQ(3) /* Audio connector */ ++#define EZX_IRQ_ADCDONE EZX_IRQ(4) ++#define EZX_IRQ_TS EZX_IRQ(5) /* TS touch */ ++#define EZX_IRQ_ADCDONE2 EZX_IRQ(6) /* TS x/y ADC ready */ Index: linux-2.6.21/arch/arm/mach-pxa/ezx.c =================================================================== ---- linux-2.6.21.orig/arch/arm/mach-pxa/ezx.c 2007-05-03 17:42:02.000000000 -0300 -+++ linux-2.6.21/arch/arm/mach-pxa/ezx.c 2007-05-04 04:17:33.000000000 -0300 -@@ -72,6 +72,24 @@ - .clk_pcap = 1, +--- linux-2.6.21.orig/arch/arm/mach-pxa/ezx.c 2007-05-08 04:03:40.000000000 -0300 ++++ linux-2.6.21/arch/arm/mach-pxa/ezx.c 2007-05-08 16:29:06.000000000 -0300 +@@ -131,11 +131,30 @@ + .resource = ezxbp_resources, }; +/* PCAP */ @@ -1169,43 +1156,37 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx.c + .resource = ezxpcap_resources, +}; - /* OHCI Controller */ - -@@ -235,7 +253,7 @@ - }; - - --static struct resource ezx_bp_resources[] = { -+static struct resource ezxbp_resources[] = { - [0] = { - .start = GPIO_BP_RDY, - .end = GPIO_BP_RDY, -@@ -255,15 +273,15 @@ - #endif - }; - --static struct platform_device ezx_bp_device = { -+static struct platform_device ezxbp_device = { - .name = "ezx-bp", - .dev = { - //.parent = - //.platform_data = - }, - .id = -1, -- .num_resources = ARRAY_SIZE(ezx_bp_resources), -- .resource = ezx_bp_resources, -+ .num_resources = ARRAY_SIZE(ezxbp_resources), -+ .resource = ezxbp_resources, - }; - - static void __init ezx_init_gpio_irq(void) -@@ -296,7 +314,8 @@ static struct platform_device *devices[] __initdata = { &ezxssp_device, -- &ezx_bp_device, + &ezxbp_device, + &ezxpcap_device, -+ &ezxbp_device, }; - static void __init a780_init(void) + /* PM */ +Index: linux-2.6.21/arch/arm/mach-pxa/Kconfig +=================================================================== +--- linux-2.6.21.orig/arch/arm/mach-pxa/Kconfig 2007-05-08 04:03:37.000000000 -0300 ++++ linux-2.6.21/arch/arm/mach-pxa/Kconfig 2007-05-08 16:29:06.000000000 -0300 +@@ -97,6 +97,9 @@ + config EZX_BP + bool "BP Control code for EZX Platform" + ++config EZX_PCAP ++ bool "PCAP Support" ++ + endif + + endmenu +Index: linux-2.6.21/arch/arm/mach-pxa/Makefile +=================================================================== +--- linux-2.6.21.orig/arch/arm/mach-pxa/Makefile 2007-05-08 04:03:37.000000000 -0300 ++++ linux-2.6.21/arch/arm/mach-pxa/Makefile 2007-05-08 16:29:06.000000000 -0300 +@@ -23,6 +23,7 @@ + obj-$(CONFIG_PXA_EZX_E680) += ezx-e680.o + obj-$(CONFIG_PXA_EZX_E2) += ezx-e2.o + obj-$(CONFIG_EZX_BP) += ezx-bp.o ++obj-$(CONFIG_EZX_PCAP) += ezx-pcap.o + + # Support for blinky lights + led-y := leds.o |