# CONFIG_TOUCHSCREEN_AD7877 is not set
# CONFIG_TOUCHSCREEN_XPT2046_SPI is not set
# CONFIG_TOUCHSCREEN_XPT2046_CBN_SPI is not set
-CONFIG_TOUCHSCREEN_XPT2046_320X480_SPI=y
-# CONFIG_TOUCHSCREEN_XPT2046_320X480_CBN_SPI is not set
+# CONFIG_TOUCHSCREEN_XPT2046_320X480_SPI is not set
+CONFIG_TOUCHSCREEN_XPT2046_320X480_CBN_SPI=y
# CONFIG_TOUCHSCREEN_IT7250 is not set
# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
# CONFIG_TOUCHSCREEN_AD7879_SPI is not set
if INPUT_TOUCHSCREEN
+choice
+ prompt "XPT2046 based touchscreens: SPI Interface"
+ default TOUCHSCREEN_XPT2046_CBN_SPI
+
+ config TOUCHSCREEN_XPT2046_SPI_NOCHOOSE
+ bool "DO NOT CHOOSE TOUCHSCREEN_XPT2046"
+
+ config TOUCHSCREEN_XPT2046_SPI
+ bool "800X480 TOUCHSCREEN"
+ depends on SPIM_RK2818
+
+ config TOUCHSCREEN_XPT2046_CBN_SPI
+ bool "800X480 CALIBRATION TOUCHSCREEN"
+ depends on SPIM_RK2818
+
+ config TOUCHSCREEN_XPT2046_320X480_SPI
+ bool "320X480 TOUCHSCREEN"
+ depends on SPIM_RK2818
+
+ config TOUCHSCREEN_XPT2046_320X480_CBN_SPI
+ bool "320X480 CALIBRATION TOUCHSCREEN"
+ depends on SPIM_RK2818
+
+endchoice
config TOUCHSCREEN_ADS7846
tristate "ADS7846/TSC2046 and ADS7843 based touchscreens"
depends on SPI_MASTER
To compile this driver as a module, choose M here: the
module will be called ad7877.
-config TOUCHSCREEN_XPT2046_SPI
- tristate "XPT2046 based touchscreens: XPT2046 SPI Interface"
- depends on SPIM_RK2818 && TOUCHSCREEN_XPT2046_CBN_SPI = n
- help
- Say Y here if you have a touchscreen interface using the
- xpt2046 controller, and your board-specific initialization
- code includes that in its table of SPI devices.
-
- If unsure, say N (but it's safe to say "Y").
-
- To compile this driver as a module, choose M here: the
- module will be called xpt2046_ts.
-
-config TOUCHSCREEN_XPT2046_CBN_SPI
- tristate "XPT2046 CALIBRATION based touchscreens: XPT2046 SPI Interface"
- depends on SPIM_RK2818
- help
- Say Y here if you have a touchscreen interface using the
- xpt2046 controller, and your board-specific initialization
- code includes that in its table of SPI devices.
-
- If unsure, say N (but it's safe to say "Y").
- To compile this driver as a module, choose M here: the
- module will be called xpt2046_cbn_ts.
-
-config TOUCHSCREEN_XPT2046_320X480_SPI
- tristate "XPT2046 320X480 based touchscreens: XPT2046 SPI Interface"
- depends on SPIM_RK2818 && TOUCHSCREEN_XPT2046_320X480_CBN_SPI = n
- help
- Say Y here if you have a touchscreen interface using the
- xpt2046 controller, and your board-specific initialization
- code includes that in its table of SPI devices.
-
- If unsure, say N (but it's safe to say "Y").
-
- To compile this driver as a module, choose M here: the
- module will be called xpt2046_ts.
-
-config TOUCHSCREEN_XPT2046_320X480_CBN_SPI
- tristate "XPT2046 320X480 CALIBRATION based touchscreens: XPT2046 SPI Interface"
- depends on SPIM_RK2818
- help
- Say Y here if you have a touchscreen interface using the
- xpt2046 controller, and your board-specific initialization
- code includes that in its table of SPI devices.
-
- If unsure, say N (but it's safe to say "Y").
-
- To compile this driver as a module, choose M here: the
- module will be called xpt2046_cbn_ts.
config TOUCHSCREEN_IT7250
tristate "IT7250 based touchscreens: IT7250 Interface"
To compile this driver as a module, choose M here: the
module will be called pcap_ts.
-choice
- prompt "Touch panel resolution"
- default TP_800x480
-
- config TP_800x480
- bool "800x480"
-
- config TP_1024x600
- bool "1024x600"
-
-endchoice
endif
obj-$(CONFIG_TOUCHSCREEN_XPT2046_SPI) += xpt2046_ts.o
obj-$(CONFIG_TOUCHSCREEN_XPT2046_CBN_SPI) += xpt2046_cbn_ts.o calibration_ts.o largenum_ts.o calib_iface_ts.o
obj-$(CONFIG_TOUCHSCREEN_XPT2046_320X480_SPI) += xpt2046_ts_320X480.o
-#obj-$(CONFIG_TOUCHSCREEN_XPT2046_320X480_CBN_SPI) += xpt2046_cbn_ts.o calibration_ts.o largenum_ts.o
+obj-$(CONFIG_TOUCHSCREEN_XPT2046_320X480_CBN_SPI) += xpt2046_cbn_ts.o calibration_ts.o largenum_ts.o calib_iface_ts.o
obj-$(CONFIG_TOUCHSCREEN_IT7250) += ctp_it7250.o
#ifdef TS_PRESSURE\r
extern volatile int gZvalue[3];\r
#endif\r
-#ifdef CONFIG_TP_1024x600\r
-int screen_x[5] = {50, 974, 50, 974, 512};\r
-int screen_y[5] = {50, 50, 550, 550, 300};\r
-#endif\r
\r
-#ifdef CONFIG_TP_800x480\r
-int screen_x[5] = { 50, 750, 50, 750, 400};\r
-int screen_y[5] = { 40, 40, 440, 440, 240};\r
+\r
+#if defined(CONFIG_TOUCHSCREEN_XPT2046_320X480_CBN_SPI)\r
+ int screen_x[5] = { 50, 270, 50, 270, 160}; \r
+ int screen_y[5] = { 40, 40, 440, 440, 240}; \r
+#elif defined(CONFIG_TOUCHSCREEN_XPT2046_CBN_SPI) \r
+ int screen_x[5] = { 50, 750, 50, 750, 400};\r
+ int screen_y[5] = { 40, 40, 440, 440, 240};\r
+#elif defined(CONFIG_TOUCHSCREEN_XPT2046_1024X600_CBN_SPI) \r
+ int screen_x[5] = {50, 974, 50, 974, 512};\r
+ int screen_y[5] = {50, 50, 550, 550, 300};\r
#endif\r
\r
-int uncali_x[5] = { 0 };\r
-int uncali_y[5] = { 0 };\r
\r
-#ifdef CONFIG_MACH_RK2818INFO_IT50\r
-int uncali_x_default[5] = { 3735, 301, 3754, 290, 1993 };\r
-int uncali_y_default[5] = { 3442, 3497, 413, 459, 1880 };\r
-#endif\r
\r
-#ifdef CONFIG_MACH_RK2818INFO \r
-int uncali_x_default[5] = { 438, 565, 3507, 3631, 2105 };\r
-int uncali_y_default[5] = { 3756, 489, 3792, 534, 2159 };\r
+\r
+#if defined(CONFIG_MACH_RK2818INFO_IT50) && defined(CONFIG_TOUCHSCREEN_XPT2046_CBN_SPI)\r
+ int uncali_x_default[5] = { 3735, 301, 3754, 290, 1993 };\r
+ int uncali_y_default[5] = { 3442, 3497, 413, 459, 1880 };\r
+#elif defined(CONFIG_MACH_RK2818INFO) && defined(CONFIG_TOUCHSCREEN_XPT2046_CBN_SPI) \r
+ int uncali_x_default[5] = { 438, 565, 3507, 3631, 2105 };\r
+ int uncali_y_default[5] = { 3756, 489, 3792, 534, 2159 };\r
+#elif (defined(CONFIG_MACH_RAHO) || defined(CONFIG_MACH_RK2818INFO))&& defined(CONFIG_TOUCHSCREEN_XPT2046_320X480_CBN_SPI)\r
+ int uncali_x_default[5] = { 812, 3341, 851, 3371, 2183 };\r
+ int uncali_y_default[5] = { 442, 435, 3193, 3195, 2004 };\r
#endif\r
\r
+int uncali_x[5] = { 0 };\r
+int uncali_y[5] = { 0 };\r
+\r
static ssize_t touch_mode_show(struct class *cls, char *_buf)\r
{\r
int count;\r
* note. The strength of filtering can be set in the board-* specific
* files.
*/
-#define XPT2046_DEBUG 0
+#define XPT2046_DEBUG 0
#if XPT2046_DEBUG
#define xpt2046printk(msg...) printk(msg);
#else
return err;
}
+ err = gpio_direction_input(pdata->gpio_pendown);
+ if (err) {
+ dev_err(&spi->dev, "failed to switch GPIO to input%d\n",
+ pdata->gpio_pendown);
+ return err;
+ }
+
+ gpio_pull_updown(pdata->gpio_pendown,GPIOPullUp);
+
ts->gpio_pendown = pdata->gpio_pendown;
return 0;
}
+
static int __devinit xpt2046_probe(struct spi_device *spi)
{
struct xpt2046 *ts;
goto err_free_gpio;
}
}
+
+
xpt2046printk("***>%s:touchscreen irq %d\n",__FUNCTION__,spi->irq);
/* take a first sample, leaving nPENIRQ active and vREF off; avoid
struct spi_transfer xfer[4];
};
-static struct xpt2046_platform_data xpt2046_info = {
- .model = 2046,
- .keep_vref_on = 1,
- .swap_xy = 0,
- .x_min = 0,
- .x_max = 320,
- .y_min = 0,
- .y_max = 480,
- .debounce_max = 7,
- .debounce_rep = DEBOUNCE_REPTIME,
- .debounce_tol = 20,
- .gpio_pendown = RK2818_PIN_PE1,//RK2818_PIN_PE3, //modify by zhao
- .penirq_recheck_delay_usecs = 1,
-
-};
-
//add by zhao
#define LEN_TO_PIX(x) (unsigned int)( 320 * (x) / 47 )
#define KEY1_X 6.3