From: zyk <“zyk@rock-chips.com”> Date: Tue, 11 Mar 2014 07:59:26 +0000 (+0800) Subject: ct36x compatible ct363 and ct365 X-Git-Tag: firefly_0821_release~6149 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e3a0fd5f7d9c290b6ae298d8b9581d1d1ddf13de;p=firefly-linux-kernel-4.4.55.git ct36x compatible ct363 and ct365 --- diff --git a/arch/arm/boot/dts/rk3188-tb.dts b/arch/arm/boot/dts/rk3188-tb.dts index a4cee92a2017..d56767193131 100755 --- a/arch/arm/boot/dts/rk3188-tb.dts +++ b/arch/arm/boot/dts/rk3188-tb.dts @@ -199,7 +199,7 @@ ts@01 { compatible = "ct,ct36x"; reg = <0x01>; - ct-model = <363>; + ct-model = <365>; touch-gpio = <&gpio1 GPIO_B7 IRQ_TYPE_LEVEL_LOW>; reset-gpio = <&gpio0 GPIO_B6 GPIO_ACTIVE_HIGH>; max-x = <1280>; diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig old mode 100644 new mode 100755 index 9d76f8df5160..7eb38c9e0e60 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig @@ -21,18 +21,6 @@ config TOUCHSCREEN_GT8XX config CT36X_TS tristate "CT36X touchscreens support" -choice - prompt "ct36x chip select" - depends on CT36X_TS - default CT365_TS - - config CT365_TS - bool "ct365" - config CT363_TS - bool "ct363" - config CT361_TS - bool "ct360" -endchoice config TOUCHSCREEN_88PM860X tristate "Marvell 88PM860x touchscreen" diff --git a/drivers/input/touchscreen/ct36x/core.c b/drivers/input/touchscreen/ct36x/core.c index b8a48b480539..d2af589c7890 100755 --- a/drivers/input/touchscreen/ct36x/core.c +++ b/drivers/input/touchscreen/ct36x/core.c @@ -7,14 +7,15 @@ #define CT36X_CHIP_FLASH_SECTOR_SIZE 128 #define CT36X_CHIP_FLASH_SOURCE_SIZE 8 -static unsigned char binary_data[] = { -#ifdef CONFIG_CT365_TS +static unsigned char ct365_binary_data[] = { #include "RK_DPT101_CT365_01_V02_099E_140107.dat" -#else +}; + +static unsigned char ct363_binary_data[] = { #include "wgj97112tsm01_CT363_01_V01_EA50_140224.dat" -#endif }; + int ct36x_chip_set_idle(struct ct36x_data *ts) { int ret = 0; @@ -86,7 +87,13 @@ static int ct36x_chip_set_code(unsigned short flash_addr, char *buf) buf[2] = (char)(flash_addr >> 8); buf[3] = (char)(flash_addr & 0xFF); buf[4] = 0x08; - + unsigned char *binary_data; + + if(flag_ct36x_model ==365) + binary_data = ct365_binary_data; + else if(flag_ct36x_model ==363) + binary_data = ct363_binary_data; + // Fill firmware source data if ( flash_addr == (160) || flash_addr == (168) ) { buf[6] = ~binary_data[flash_addr + 0]; diff --git a/drivers/input/touchscreen/ct36x/ct36x_priv.h b/drivers/input/touchscreen/ct36x/ct36x_priv.h index efd56d39bba7..770a4d9720c5 100755 --- a/drivers/input/touchscreen/ct36x/ct36x_priv.h +++ b/drivers/input/touchscreen/ct36x/ct36x_priv.h @@ -28,6 +28,8 @@ //#else //#define ct36x_dbg(ts, format, arg...) //#endif +int flag_ct36x_model; + int ct36x_dbg_level = 0; module_param_named(dbg_level, ct36x_dbg_level, int, 0644); #if 1 diff --git a/drivers/input/touchscreen/ct36x/ct36x_ts.c b/drivers/input/touchscreen/ct36x/ct36x_ts.c old mode 100644 new mode 100755 index 54671e0e1a74..5330f421c160 --- a/drivers/input/touchscreen/ct36x/ct36x_ts.c +++ b/drivers/input/touchscreen/ct36x/ct36x_ts.c @@ -10,6 +10,7 @@ int inline ct36x_set_ops(struct ct36x_data *ts, int model) switch(model){ case 360: ts->ops = &ct360_ops; break; case 363: ts->ops = &ct363_ops; break; + case 365: ts->ops = &ct363_ops; break; default: return -EINVAL; }; @@ -185,6 +186,7 @@ static int ct36x_ts_probe(struct i2c_client *client, const struct i2c_device_id return -EINVAL; } ts->model = val;//pdata->model; + flag_ct36x_model = ts->model; //ts->x_max = pdata->x_max; //ts->y_max = pdata->y_max; //ts->rst_io = pdata->rst_io;