Commit 09beb807 authored by Lauri Leukkunen's avatar Lauri Leukkunen Committed by Tony Lindgren

INPUT: TOUCHSCREEN: Introduce tsc2005 driver

Introduce n810's tsc2005 driver
Signed-off-by: default avatarLauri Leukkunen <lauri.leukkunen@nokia.com>

Updated to build with current linux-omap.
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 386cc7c5
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/spi/tsc2301.h> #include <linux/spi/tsc2301.h>
#include <linux/spi/tsc2005.h>
#include <linux/input.h> #include <linux/input.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
...@@ -371,21 +372,34 @@ static struct omap2_mcspi_device_config cx3110x_mcspi_config = { ...@@ -371,21 +372,34 @@ static struct omap2_mcspi_device_config cx3110x_mcspi_config = {
.single_channel = 1, .single_channel = 1,
}; };
#ifdef CONFIG_TOUCHSCREEN_TSC2005
static struct tsc2005_platform_data tsc2005_config = {
.reset_gpio = 94,
.dav_gpio = 106
};
static struct omap2_mcspi_device_config tsc2005_mcspi_config = {
.turbo_mode = 0,
.single_channel = 1,
};
#endif
static struct spi_board_info n800_spi_board_info[] __initdata = { static struct spi_board_info n800_spi_board_info[] __initdata = {
[0] = { {
.modalias = "lcd_mipid", .modalias = "lcd_mipid",
.bus_num = 1, .bus_num = 1,
.chip_select = 1, .chip_select = 1,
.max_speed_hz = 4000000, .max_speed_hz = 4000000,
.controller_data= &mipid_mcspi_config, .controller_data= &mipid_mcspi_config,
.platform_data = &n800_mipid_platform_data, .platform_data = &n800_mipid_platform_data,
}, [1] = { }, {
.modalias = "cx3110x", .modalias = "cx3110x",
.bus_num = 2, .bus_num = 2,
.chip_select = 0, .chip_select = 0,
.max_speed_hz = 48000000, .max_speed_hz = 48000000,
.controller_data= &cx3110x_mcspi_config, .controller_data= &cx3110x_mcspi_config,
}, [2] = { },
{
.modalias = "tsc2301", .modalias = "tsc2301",
.bus_num = 1, .bus_num = 1,
.chip_select = 0, .chip_select = 0,
...@@ -395,6 +409,73 @@ static struct spi_board_info n800_spi_board_info[] __initdata = { ...@@ -395,6 +409,73 @@ static struct spi_board_info n800_spi_board_info[] __initdata = {
}, },
}; };
static struct spi_board_info n810_spi_board_info[] __initdata = {
{
.modalias = "lcd_mipid",
.bus_num = 1,
.chip_select = 1,
.max_speed_hz = 4000000,
.controller_data = &mipid_mcspi_config,
.platform_data = &n800_mipid_platform_data,
},
{
.modalias = "cx3110x",
.bus_num = 2,
.chip_select = 0,
.max_speed_hz = 48000000,
.controller_data = &cx3110x_mcspi_config,
},
{
.modalias = "tsc2005",
.bus_num = 1,
.chip_select = 0,
.max_speed_hz = 6000000,
.controller_data = &tsc2005_mcspi_config,
.platform_data = &tsc2005_config,
},
};
static void __init tsc2005_set_config(void)
{
const struct omap_lcd_config *conf;
conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config);
if (conf != NULL) {
#ifdef CONFIG_TOUCHSCREEN_TSC2005
if (strcmp(conf->panel_name, "lph8923") == 0) {
tsc2005_config.ts_x_plate_ohm = 180;
tsc2005_config.ts_hw_avg = 0;
tsc2005_config.ts_ignore_last = 0;
tsc2005_config.ts_touch_pressure = 1500;
tsc2005_config.ts_stab_time = 100;
tsc2005_config.ts_pressure_max = 2048;
tsc2005_config.ts_pressure_fudge = 2;
tsc2005_config.ts_x_max = 4096;
tsc2005_config.ts_x_fudge = 4;
tsc2005_config.ts_y_max = 4096;
tsc2005_config.ts_y_fudge = 7;
} else if (strcmp(conf->panel_name, "ls041y3") == 0) {
tsc2005_config.ts_x_plate_ohm = 280;
tsc2005_config.ts_hw_avg = 0;
tsc2005_config.ts_ignore_last = 0;
tsc2005_config.ts_touch_pressure = 1500;
tsc2005_config.ts_stab_time = 1000;
tsc2005_config.ts_pressure_max = 2048;
tsc2005_config.ts_pressure_fudge = 2;
tsc2005_config.ts_x_max = 4096;
tsc2005_config.ts_x_fudge = 4;
tsc2005_config.ts_y_max = 4096;
tsc2005_config.ts_y_fudge = 7;
} else {
printk(KERN_ERR "Unknown panel type, set default "
"touchscreen configuration\n");
tsc2005_config.ts_x_plate_ohm = 200;
tsc2005_config.ts_stab_time = 100;
}
#endif
}
}
#if defined(CONFIG_CBUS_RETU) && defined(CONFIG_LEDS_OMAP_PWM) #if defined(CONFIG_CBUS_RETU) && defined(CONFIG_LEDS_OMAP_PWM)
void retu_keypad_led_set_power(struct omap_pwm_led_platform_data *self, void retu_keypad_led_set_power(struct omap_pwm_led_platform_data *self,
...@@ -595,8 +676,14 @@ void __init nokia_n800_common_init(void) ...@@ -595,8 +676,14 @@ void __init nokia_n800_common_init(void)
n800_dsp_init(); n800_dsp_init();
n800_usb_init(); n800_usb_init();
n800_cam_init(); n800_cam_init();
spi_register_board_info(n800_spi_board_info, if (machine_is_nokia_n800())
spi_register_board_info(n800_spi_board_info,
ARRAY_SIZE(n800_spi_board_info)); ARRAY_SIZE(n800_spi_board_info));
if (machine_is_nokia_n810()) {
tsc2005_set_config();
spi_register_board_info(n810_spi_board_info,
ARRAY_SIZE(n810_spi_board_info));
}
omap_serial_init(); omap_serial_init();
omap_register_i2c_bus(1, 400, n800_i2c_board_info_1, omap_register_i2c_bus(1, 400, n800_i2c_board_info_1,
ARRAY_SIZE(n800_i2c_board_info_1)); ARRAY_SIZE(n800_i2c_board_info_1));
......
...@@ -185,6 +185,11 @@ config TOUCHSCREEN_UCB1400 ...@@ -185,6 +185,11 @@ config TOUCHSCREEN_UCB1400
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called ucb1400_ts. module will be called ucb1400_ts.
config TOUCHSCREEN_TSC2005
tristate "TSC2005 touchscreen support"
help
Say Y here for if you are using the touchscreen features of TSC2301.
config TOUCHSCREEN_TSC2102 config TOUCHSCREEN_TSC2102
tristate "TSC 2102 based touchscreens" tristate "TSC 2102 based touchscreens"
depends on SPI_MASTER depends on SPI_MASTER
......
...@@ -19,6 +19,7 @@ obj-$(CONFIG_TOUCHSCREEN_PENMOUNT) += penmount.o ...@@ -19,6 +19,7 @@ obj-$(CONFIG_TOUCHSCREEN_PENMOUNT) += penmount.o
obj-$(CONFIG_TOUCHSCREEN_TOUCHRIGHT) += touchright.o obj-$(CONFIG_TOUCHSCREEN_TOUCHRIGHT) += touchright.o
obj-$(CONFIG_TOUCHSCREEN_TOUCHWIN) += touchwin.o obj-$(CONFIG_TOUCHSCREEN_TOUCHWIN) += touchwin.o
obj-$(CONFIG_TOUCHSCREEN_UCB1400) += ucb1400_ts.o obj-$(CONFIG_TOUCHSCREEN_UCB1400) += ucb1400_ts.o
obj-$(CONFIG_TOUCHSCREEN_TSC2005) += tsc2005.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_TSC210X) += tsc210x_ts.o obj-$(CONFIG_TOUCHSCREEN_TSC210X) += tsc210x_ts.o
......
This diff is collapsed.
#ifndef _LINUX_SPI_TSC2005_H
#define _LINUX_SPI_TSC2005_H
#include <linux/types.h>
struct tsc2005_platform_data {
s16 reset_gpio;
s16 dav_gpio;
s16 pen_int_gpio;
u16 ts_x_plate_ohm;
u32 ts_stab_time; /* voltage settling time */
u8 ts_hw_avg; /* HW assiseted averaging. Can be
0, 4, 8, 16 samples per reading */
u32 ts_touch_pressure; /* Pressure limit until we report a
touch event. After that we switch
to ts_max_pressure. */
u32 ts_pressure_max;/* Samples with bigger pressure value will
be ignored, since the corresponding X, Y
values are unreliable */
u32 ts_pressure_fudge;
u32 ts_x_max;
u32 ts_x_fudge;
u32 ts_y_max;
u32 ts_y_fudge;
unsigned ts_ignore_last : 1;
};
#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