[malta] update to 3.2
[openwrt.git] / target / linux / xburst / patches-2.6.37 / 060-adc-touchscreen.patch
1 From 424b737e5a1858dafc8138fd59d154f0493b21d0 Mon Sep 17 00:00:00 2001
2 From: Lars-Peter Clausen <lars@metafoo.de>
3 Date: Sun, 5 Sep 2010 20:36:59 +0200
4 Subject: [PATCH 13/23] MFD: jz4740-adc: Add support for the touchscreen part of the adc unit
5
6 ---
7 drivers/mfd/jz4740-adc.c | 39 ++++++++++++++++++++++++++++++++++++---
8 include/linux/jz4740-adc.h | 2 +-
9 2 files changed, 37 insertions(+), 4 deletions(-)
10
11 --- a/drivers/mfd/jz4740-adc.c
12 +++ b/drivers/mfd/jz4740-adc.c
13 @@ -46,9 +46,9 @@
14 enum {
15 JZ_ADC_IRQ_ADCIN = 0,
16 JZ_ADC_IRQ_BATTERY,
17 - JZ_ADC_IRQ_TOUCH,
18 - JZ_ADC_IRQ_PENUP,
19 - JZ_ADC_IRQ_PENDOWN,
20 + JZ_ADC_IRQ_TS_DATA_READY,
21 + JZ_ADC_IRQ_TS_PENUP,
22 + JZ_ADC_IRQ_TS_PENDOWN,
23 };
24
25 struct jz4740_adc {
26 @@ -101,6 +101,7 @@ static void jz4740_adc_irq_ack(unsigned
27 struct jz4740_adc *adc = get_irq_chip_data(irq);
28
29 irq -= adc->irq_base;
30 +
31 writeb(BIT(irq), adc->base + JZ_REG_ADC_STATUS);
32 }
33
34 @@ -227,6 +228,27 @@ static struct resource jz4740_battery_re
35 },
36 };
37
38 +static struct resource jz4740_ts_resources[] = {
39 + {
40 + .start = JZ_ADC_IRQ_TS_DATA_READY,
41 + .flags = IORESOURCE_IRQ,
42 + },
43 + {
44 + .start = JZ_ADC_IRQ_TS_PENUP,
45 + .flags = IORESOURCE_IRQ,
46 + },
47 + {
48 + .start = JZ_ADC_IRQ_TS_PENDOWN,
49 + .flags = IORESOURCE_IRQ,
50 + },
51 + {
52 + .start = JZ_REG_ADC_TOUCHSCREEN_BASE,
53 + .end = JZ_REG_ADC_TOUCHSCREEN_BASE + 0xb,
54 + .flags = IORESOURCE_MEM,
55 + },
56 +};
57 +
58 +
59 const struct mfd_cell jz4740_adc_cells[] = {
60 {
61 .id = 0,
62 @@ -248,6 +270,17 @@ const struct mfd_cell jz4740_adc_cells[]
63 .data_size = sizeof(struct mfd_cell),
64
65 .enable = jz4740_adc_cell_enable,
66 + .disable = jz4740_adc_cell_disable,
67 + },
68 + {
69 + .id = 2,
70 + .name = "jz4740-ts",
71 + .num_resources = ARRAY_SIZE(jz4740_ts_resources),
72 + .resources = jz4740_ts_resources,
73 + .platform_data = (void *)&jz4740_adc_cells[2],
74 + .data_size = sizeof(struct mfd_cell),
75 +
76 + .enable = jz4740_adc_cell_enable,
77 .disable = jz4740_adc_cell_disable,
78 },
79 };
80 --- a/include/linux/jz4740-adc.h
81 +++ b/include/linux/jz4740-adc.h
82 @@ -25,7 +25,7 @@ int jz4740_adc_set_config(struct device
83 #define JZ_ADC_CONFIG_BAT_MB BIT(4)
84
85 #define JZ_ADC_CONFIG_DNUM(dnum) ((dnum) << 16)
86 -#define JZ_ADC_CONFIG_XYZ_OFFSET(dnum) ((xyz) << 13)
87 +#define JZ_ADC_CONFIG_XYZ_OFFSET(xyz) ((xyz) << 13)
88 #define JZ_ADC_CONFIG_SAMPLE_NUM(x) ((x) << 10)
89 #define JZ_ADC_CONFIG_CLKDIV(div) ((div) << 5)
90
This page took 0.043313 seconds and 5 git commands to generate.