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
7 drivers/mfd/jz4740-adc.c | 39 ++++++++++++++++++++++++++++++++++++---
8 include/linux/jz4740-adc.h | 2 +-
9 2 files changed, 37 insertions(+), 4 deletions(-)
11 --- a/drivers/mfd/jz4740-adc.c
12 +++ b/drivers/mfd/jz4740-adc.c
20 + JZ_ADC_IRQ_TS_DATA_READY,
21 + JZ_ADC_IRQ_TS_PENUP,
22 + JZ_ADC_IRQ_TS_PENDOWN,
26 @@ -101,6 +101,7 @@ static void jz4740_adc_irq_ack(unsigned
27 struct jz4740_adc *adc = get_irq_chip_data(irq);
31 writeb(BIT(irq), adc->base + JZ_REG_ADC_STATUS);
34 @@ -227,6 +228,27 @@ static struct resource jz4740_battery_re
38 +static struct resource jz4740_ts_resources[] = {
40 + .start = JZ_ADC_IRQ_TS_DATA_READY,
41 + .flags = IORESOURCE_IRQ,
44 + .start = JZ_ADC_IRQ_TS_PENUP,
45 + .flags = IORESOURCE_IRQ,
48 + .start = JZ_ADC_IRQ_TS_PENDOWN,
49 + .flags = IORESOURCE_IRQ,
52 + .start = JZ_REG_ADC_TOUCHSCREEN_BASE,
53 + .end = JZ_REG_ADC_TOUCHSCREEN_BASE + 0xb,
54 + .flags = IORESOURCE_MEM,
59 const struct mfd_cell jz4740_adc_cells[] = {
62 @@ -248,6 +270,17 @@ const struct mfd_cell jz4740_adc_cells[]
63 .data_size = sizeof(struct mfd_cell),
65 .enable = jz4740_adc_cell_enable,
66 + .disable = jz4740_adc_cell_disable,
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),
76 + .enable = jz4740_adc_cell_enable,
77 .disable = jz4740_adc_cell_disable,
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)
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)