Commit 0bb239c1 authored by Kevin Hilman's avatar Kevin Hilman Committed by Tony Lindgren

ARM: OMAP: 2430SDP: Use ads7846 for touchscreen driver

Removes the tsc2046 specific driver, and changes the 2430SDP platform
code to use the ads7846 instead.
Signed-off-by: default avatarKevin Hilman <khilman@mvista.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 7fc39f1f
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include <linux/err.h> #include <linux/err.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/spi/tsc2046.h> #include <linux/spi/ads7846.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
...@@ -45,7 +45,10 @@ ...@@ -45,7 +45,10 @@
#define SDP2430_FLASH_CS 0 #define SDP2430_FLASH_CS 0
#define SDP2430_SMC91X_CS 5 #define SDP2430_SMC91X_CS 5
/* TSC2046 (touchscreen) */ /* GPIO used for TSC2046 (touchscreen)
*
* Also note that the tsc2046 is the same silicon as the ads7846, so
* that driver is used for the touchscreen. */
#define TS_GPIO 24 #define TS_GPIO 24
static struct mtd_partition sdp2430_partitions[] = { static struct mtd_partition sdp2430_partitions[] = {
...@@ -182,9 +185,25 @@ static struct platform_device *sdp2430_devices[] __initdata = { ...@@ -182,9 +185,25 @@ static struct platform_device *sdp2430_devices[] __initdata = {
&sdp2430_kp_device, &sdp2430_kp_device,
}; };
static struct tsc2046_platform_data tsc2046_config = { static void ads7846_dev_init(void)
.dav_gpio = TS_GPIO, {
.gpio_debounce = 0xa, if (omap_request_gpio(TS_GPIO) < 0)
printk(KERN_ERR "can't get ads746 pen down GPIO\n");
omap_set_gpio_direction(TS_GPIO, 1);
omap_set_gpio_debounce(TS_GPIO, 1);
omap_set_gpio_debounce_time(TS_GPIO, 0xa);
}
static int ads7846_get_pendown_state(void)
{
return !omap_get_gpio_datain(TS_GPIO);
}
static struct ads7846_platform_data tsc2046_config __initdata = {
.get_pendown_state = ads7846_get_pendown_state,
.keep_vref_on = 1,
}; };
static struct omap2_mcspi_device_config tsc2046_mcspi_config = { static struct omap2_mcspi_device_config tsc2046_mcspi_config = {
...@@ -198,11 +217,12 @@ static struct spi_board_info sdp2430_spi_board_info[] __initdata = { ...@@ -198,11 +217,12 @@ static struct spi_board_info sdp2430_spi_board_info[] __initdata = {
* TSC2046 operates at a max freqency of 2MHz, so * TSC2046 operates at a max freqency of 2MHz, so
* operate slightly below at 1.5MHz * operate slightly below at 1.5MHz
*/ */
.modalias = "tsc2046", .modalias = "ads7846",
.bus_num = 1, .bus_num = 1,
.chip_select = 0, .chip_select = 0,
.max_speed_hz = 1500000, .max_speed_hz = 1500000,
.controller_data = &tsc2046_mcspi_config, .controller_data = &tsc2046_mcspi_config,
.irq = OMAP_GPIO_IRQ(TS_GPIO),
.platform_data = &tsc2046_config, .platform_data = &tsc2046_config,
}, },
}; };
...@@ -367,6 +387,7 @@ static void __init omap_2430sdp_init(void) ...@@ -367,6 +387,7 @@ static void __init omap_2430sdp_init(void)
spi_register_board_info(sdp2430_spi_board_info, spi_register_board_info(sdp2430_spi_board_info,
ARRAY_SIZE(sdp2430_spi_board_info)); ARRAY_SIZE(sdp2430_spi_board_info));
ads7846_dev_init();
} }
static void __init omap_2430sdp_map_io(void) static void __init omap_2430sdp_map_io(void)
......
...@@ -185,12 +185,6 @@ config TOUCHSCREEN_TSC2301 ...@@ -185,12 +185,6 @@ config TOUCHSCREEN_TSC2301
help help
Say Y here for if you are using the touchscreen features of TSC2301. Say Y here for if you are using the touchscreen features of TSC2301.
config TOUCHSCREEN_TSC2046
tristate "TSC2046 touchscreen support"
default MACH_OMAP2430SDP
help
Say Y here for if you are using the touchscreen features of TSC2046
config TOUCHSCREEN_USB_COMPOSITE config TOUCHSCREEN_USB_COMPOSITE
tristate "USB Touchscreen Driver" tristate "USB Touchscreen Driver"
depends on USB_ARCH_HAS_HCD depends on USB_ARCH_HAS_HCD
......
...@@ -20,4 +20,3 @@ obj-$(CONFIG_TOUCHSCREEN_UCB1400) += ucb1400_ts.o ...@@ -20,4 +20,3 @@ obj-$(CONFIG_TOUCHSCREEN_UCB1400) += ucb1400_ts.o
obj-$(CONFIG_TOUCHSCREEN_TSC2102) += tsc2102_ts.o obj-$(CONFIG_TOUCHSCREEN_TSC2102) += tsc2102_ts.o
obj-$(CONFIG_TOUCHSCREEN_OMAP) += omap/ obj-$(CONFIG_TOUCHSCREEN_OMAP) += omap/
obj-$(CONFIG_TOUCHSCREEN_TSC2301) += tsc2301_ts.o obj-$(CONFIG_TOUCHSCREEN_TSC2301) += tsc2301_ts.o
obj-$(CONFIG_TOUCHSCREEN_TSC2046) += tsc2046_ts.o
This diff is collapsed.
#ifndef _LINUX_SPI_TSC2046_H
#define _LINUX_SPI_TSC2046_H
#include <linux/types.h>
#include <linux/timer.h>
struct tsc2046_platform_data {
s16 dav_gpio;
s16 gpio_debounce;
u16 ts_x_plate_ohm;
u32 ts_max_pressure; /* Samples with bigger pressure value will
be ignored, since the corresponding X, Y
values are unreliable */
u32 ts_touch_pressure;/* Pressure limit until we report a
touch event. After that we switch
to ts_max_pressure. */
unsigned ts_ignore_last : 1;
};
struct tsc2046_ts;
struct tsc2046 {
struct spi_device *spi;
int gpio;
struct tsc2046_ts *ts;
};
/* The TSC2046 operates at a maximum speed of 2MHz */
#define TSC2046_HZ 2000000
#define TSC2046_DECL_MOD(module) \
extern int tsc2046_##module##_init(struct tsc2046 *tsc, \
struct tsc2046_platform_data *pdata); \
extern void tsc2046_##module##_exit(struct tsc2046 *tsc); \
extern int tsc2046_##module##_suspend(struct tsc2046 *tsc); \
extern void tsc2046_##module##_resume(struct tsc2046 *tsc);
#define TSC2046_DECL_EMPTY_MOD(module) \
static inline int tsc2046_##module##_init(struct tsc2046 *tsc, \
struct tsc2046_platform_data *pdata) \
{ \
return 0; \
} \
static inline void tsc2046_##module##_exit(struct tsc2046 *tsc) {} \
static inline int tsc2046_##module##_suspend(struct tsc2046 *tsc) \
{ \
return 0; \
} \
static inline void tsc2046_##module##_resume(struct tsc2046 *tsc) {}
#if defined(CONFIG_TOUCHSCREEN_TSC2046) || \
defined(CONFIG_TOUCHSCREEN_TSC2046_MODULE)
TSC2046_DECL_MOD(ts)
#else
TSC2046_DECL_EMPTY_MOD(ts)
#endif
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment