[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.1 / adc / 0005-tscadc-Add-board-file-mfd-support-fix-warning.patch
1 From 0d765160ef94e0ab6f30725b01e5102ca119449f Mon Sep 17 00:00:00 2001
2 From: Joel A Fernandes <joelagnel@ti.com>
3 Date: Wed, 30 Nov 2011 15:02:17 +0100
4 Subject: [PATCH 5/9] tscadc: Add board file mfd support, fix warning
6 Signed-off-by: Joel A Fernandes <joelagnel@ti.com>
7 ---
8 arch/arm/mach-omap2/board-am335xevm.c | 27 ++++++++++++++++++++++++++-
9 drivers/input/touchscreen/ti_tscadc.c | 2 +-
10 2 files changed, 27 insertions(+), 2 deletions(-)
12 diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
13 index 8221ba9..30f23d7 100644
14 --- a/arch/arm/mach-omap2/board-am335xevm.c
15 +++ b/arch/arm/mach-omap2/board-am335xevm.c
16 @@ -195,6 +195,11 @@ static struct resource tsc_resources[] = {
17 static struct tsc_data am335x_touchscreen_data = {
18 .wires = 4,
19 .x_plate_resistance = 200,
20 + .mode = TI_TSCADC_TSCMODE,
21 +};
22 +
23 +static struct tsc_data bone_touchscreen_data = {
24 + .mode = TI_TSCADC_GENMODE,
25 };
27 static struct platform_device tsc_device = {
28 @@ -207,6 +212,16 @@ static struct platform_device tsc_device = {
29 .resource = tsc_resources,
30 };
32 +static struct platform_device bone_tsc_device = {
33 + .name = "tsc",
34 + .id = -1,
35 + .dev = {
36 + .platform_data = &bone_touchscreen_data,
37 + },
38 + .num_resources = ARRAY_SIZE(tsc_resources),
39 + .resource = tsc_resources,
40 +};
41 +
42 static u8 am335x_iis_serializer_direction1[] = {
43 INACTIVE_MODE, INACTIVE_MODE, TX_MODE, RX_MODE,
44 INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
45 @@ -927,6 +942,16 @@ static void tsc_init(int evm_id, int profile)
46 pr_err("failed to register touchscreen device\n");
47 }
49 +static void bone_tsc_init(int evm_id, int profile)
50 +{
51 + int err;
52 + setup_pin_mux(tsc_pin_mux);
53 + err = platform_device_register(&bone_tsc_device);
54 + if (err)
55 + pr_err("failed to register touchscreen device\n");
56 +}
57 +
58 +
59 static void boneleds_init(int evm_id, int profile )
60 {
61 int err;
62 @@ -1541,7 +1566,7 @@ static struct evm_dev_cfg beaglebone_old_dev_cfg[] = {
63 {i2c2_init, DEV_ON_BASEBOARD, PROFILE_NONE},
64 {mmc0_init, DEV_ON_BASEBOARD, PROFILE_NONE},
65 {boneleds_init, DEV_ON_BASEBOARD, PROFILE_ALL},
66 - {tsc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
67 + {bone_tsc_init, DEV_ON_BASEBOARD, PROFILE_ALL},
68 {NULL, 0, 0},
69 };
71 diff --git a/drivers/input/touchscreen/ti_tscadc.c b/drivers/input/touchscreen/ti_tscadc.c
72 index 76fc7b6..49a5a70 100644
73 --- a/drivers/input/touchscreen/ti_tscadc.c
74 +++ b/drivers/input/touchscreen/ti_tscadc.c
75 @@ -462,7 +462,7 @@ static irqreturn_t tsc_interrupt(int irq, void *dev)
76 static int __devinit tscadc_probe(struct platform_device *pdev)
77 {
78 struct tscadc *ts_dev;
79 - struct input_dev *input_dev;
80 + struct input_dev *input_dev = NULL;
81 int err;
82 int clk_value;
83 int clock_rate, irqenable, ctrl;
84 --
85 1.7.2.5