Commit 1da3d8fa158def6ff6cdc6698d4129b63a833ce1
Committed by
Afzal Mohammed
1 parent
91be49f6f2
Exists in
master
arm:omap:am33xx: Add TSC driver board hookup
Also enable the driver config option in defconfig Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Showing 2 changed files with 54 additions and 0 deletions Side-by-side Diff
arch/arm/configs/omap2plus_defconfig
arch/arm/mach-omap2/board-am335xevm.c
... | ... | @@ -68,6 +68,36 @@ |
68 | 68 | .type = "TFC_S9700RTWV35TR_01B", |
69 | 69 | }; |
70 | 70 | |
71 | +/* TSc controller */ | |
72 | +#include <linux/input/ti_tscadc.h> | |
73 | + | |
74 | +static struct resource tsc_resources[] = { | |
75 | + [0] = { | |
76 | + .start = AM33XX_TSC_BASE, | |
77 | + .end = AM33XX_TSC_BASE + SZ_8K - 1, | |
78 | + .flags = IORESOURCE_MEM, | |
79 | + }, | |
80 | + [1] = { | |
81 | + .start = AM33XX_IRQ_ADC_GEN, | |
82 | + .end = AM33XX_IRQ_ADC_GEN, | |
83 | + .flags = IORESOURCE_IRQ, | |
84 | + }, | |
85 | +}; | |
86 | + | |
87 | +static struct tsc_data am335x_touchscreen_data = { | |
88 | + .wires = 4, | |
89 | +}; | |
90 | + | |
91 | +static struct platform_device tsc_device = { | |
92 | + .name = "tsc", | |
93 | + .id = -1, | |
94 | + .dev = { | |
95 | + .platform_data = &am335x_touchscreen_data, | |
96 | + }, | |
97 | + .num_resources = ARRAY_SIZE(tsc_resources), | |
98 | + .resource = tsc_resources, | |
99 | +}; | |
100 | + | |
71 | 101 | #include "mux.h" |
72 | 102 | |
73 | 103 | #ifdef CONFIG_OMAP_MUX |
... | ... | @@ -223,6 +253,17 @@ |
223 | 253 | {NULL, 0}, |
224 | 254 | }; |
225 | 255 | |
256 | +static struct pinmux_config tsc_pin_mux[] = { | |
257 | + {"ain0.ain0", OMAP_MUX_MODE0 | AM33XX_INPUT_EN}, | |
258 | + {"ain1.ain1", OMAP_MUX_MODE0 | AM33XX_INPUT_EN}, | |
259 | + {"ain2.ain2", OMAP_MUX_MODE0 | AM33XX_INPUT_EN}, | |
260 | + {"ain3.ain3", OMAP_MUX_MODE0 | AM33XX_INPUT_EN}, | |
261 | + {"vrefp.vrefp", OMAP_MUX_MODE0 | AM33XX_INPUT_EN}, | |
262 | + {"vrefn.vrefn", OMAP_MUX_MODE0 | AM33XX_INPUT_EN}, | |
263 | + {NULL, 0}, | |
264 | +}; | |
265 | + | |
266 | + | |
226 | 267 | /* Module pin mux for rgmii1 */ |
227 | 268 | static struct pinmux_config rgmii1_pin_mux[] = { |
228 | 269 | {"mii1_txen.rgmii1_tctl", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT}, |
... | ... | @@ -403,6 +444,15 @@ |
403 | 444 | return; |
404 | 445 | } |
405 | 446 | |
447 | +static void tsc_init(int evm_id, int profile) | |
448 | +{ | |
449 | + int err; | |
450 | + setup_pin_mux(tsc_pin_mux); | |
451 | + err = platform_device_register(&tsc_device); | |
452 | + if (err) | |
453 | + pr_err("failed to register touchscreen device\n"); | |
454 | +} | |
455 | + | |
406 | 456 | static void rgmii1_init(int evm_id, int profile) |
407 | 457 | { |
408 | 458 | setup_pin_mux(rgmii1_pin_mux); |
... | ... | @@ -433,6 +483,8 @@ |
433 | 483 | PROFILE_2 | PROFILE_7) }, |
434 | 484 | {lcdc_init, DEV_ON_DGHTR_BRD, (PROFILE_0 | PROFILE_1 | |
435 | 485 | PROFILE_2 | PROFILE_7) }, |
486 | + {tsc_init, DEV_ON_DGHTR_BRD, (PROFILE_0 | PROFILE_1 | | |
487 | + PROFILE_2 | PROFILE_7) }, | |
436 | 488 | {rgmii1_init, DEV_ON_BASEBOARD, PROFILE_ALL}, |
437 | 489 | {rgmii2_init, DEV_ON_DGHTR_BRD, (PROFILE_1 | PROFILE_2 | |
438 | 490 | PROFILE_4 | PROFILE_6) }, |
... | ... | @@ -449,6 +501,7 @@ |
449 | 501 | static struct evm_dev_cfg ip_phn_evm_dev_cfg[] = { |
450 | 502 | {enable_ecap0, DEV_ON_DGHTR_BRD, PROFILE_NONE}, |
451 | 503 | {lcdc_init, DEV_ON_DGHTR_BRD, PROFILE_NONE}, |
504 | + {tsc_init, DEV_ON_DGHTR_BRD, PROFILE_NONE}, | |
452 | 505 | {rgmii1_init, DEV_ON_BASEBOARD, PROFILE_NONE}, |
453 | 506 | {rgmii2_init, DEV_ON_DGHTR_BRD, PROFILE_NONE}, |
454 | 507 | {NULL, 0, 0}, |