From 17c3f1a6c095167db5258d77496aa60bf7994f74 Mon Sep 17 00:00:00 2001 From: "lw@rock-chips.com" Date: Wed, 30 Nov 2011 17:27:45 +0800 Subject: [PATCH] A22:modify rk29_a22_defconfig and touchscreen --- arch/arm/configs/rk29_a22_defconfig | 28 ++++++++---- drivers/input/touchscreen/ili2102_ts.c | 61 +++++++++++++++----------- 2 files changed, 55 insertions(+), 34 deletions(-) diff --git a/arch/arm/configs/rk29_a22_defconfig b/arch/arm/configs/rk29_a22_defconfig index 00e537e30da8..f1b222290e23 100644 --- a/arch/arm/configs/rk29_a22_defconfig +++ b/arch/arm/configs/rk29_a22_defconfig @@ -265,10 +265,12 @@ CONFIG_ARCH_RK29=y # CONFIG_MACH_RK29SDK is not set # CONFIG_MACH_RK29SDK_DDR3 is not set # CONFIG_MACH_RK29WINACCORD is not set +# CONFIG_MACH_RK29_K97 is not set # CONFIG_MACH_RK29FIH is not set # CONFIG_MACH_RK29_MALATA is not set # CONFIG_MACH_RK29_PHONESDK is not set CONFIG_MACH_RK29_A22=y +# CONFIG_MACH_RK29_TD8801_V2 is not set # CONFIG_MACH_RK29_PHONEPADSDK is not set # CONFIG_MACH_RK29_newton is not set # CONFIG_MACH_RK29_P91 is not set @@ -754,7 +756,6 @@ CONFIG_ANDROID_PMEM=y # CONFIG_INTEL_MID_PTI is not set # CONFIG_ICS932S401 is not set # CONFIG_ENCLOSURE_SERVICES is not set -# CONFIG_KERNEL_DEBUGGER_CORE is not set # CONFIG_APDS9802ALS is not set # CONFIG_ISL29003 is not set # CONFIG_ISL29020 is not set @@ -772,11 +773,13 @@ CONFIG_UID_STAT=y CONFIG_APANIC=y CONFIG_APANIC_PLABEL="kpanic" # CONFIG_STE is not set -# CONFIG_MTK23D is not set +CONFIG_MTK23D=y # CONFIG_FM580X is not set # CONFIG_MU509 is not set # CONFIG_MW100 is not set # CONFIG_RK29_NEWTON is not set +# CONFIG_RK29_SC8800 is not set +# CONFIG_TDSC8800 is not set # CONFIG_C2PORT is not set # @@ -788,7 +791,8 @@ CONFIG_APANIC_PLABEL="kpanic" # CONFIG_EEPROM_MAX6875 is not set # CONFIG_EEPROM_93CX6 is not set # CONFIG_RK29_SUPPORT_MODEM is not set -# CONFIG_RK29_GPS is not set +CONFIG_RK29_GPS=y +CONFIG_GPS_GNS7560=y # # Motion Sensors Support @@ -921,8 +925,9 @@ CONFIG_WLAN=y CONFIG_WLAN_80211=y # CONFIG_WIFI_NONE is not set CONFIG_BCM4329=y -# CONFIG_MV8686 is not set # CONFIG_BCM4319 is not set +# CONFIG_MV8686 is not set +# CONFIG_AR6003 is not set # # Enable WiMAX (Networking options) to see the WiMAX drivers @@ -1001,7 +1006,8 @@ CONFIG_INPUT_TOUCHSCREEN=y # CONFIG_TOUCHSCREEN_XPT2046_SPI is not set # CONFIG_TOUCHSCREEN_ADS7846 is not set # CONFIG_TOUCHSCREEN_AD7877 is not set -# CONFIG_TOUCHSCREEN_ILI2102_IIC is not set +CONFIG_TOUCHSCREEN_ILI2102_IIC=y +# CONFIG_TOUCHSCREEN_GT8XX is not set # CONFIG_TOUCHSCREEN_IT7250 is not set # CONFIG_TOUCHSCREEN_AD7879 is not set # CONFIG_TOUCHSCREEN_ATMEL_MXT is not set @@ -1041,6 +1047,7 @@ CONFIG_INPUT_TOUCHSCREEN=y # CONFIG_LAIBAO_TS is not set # CONFIG_TOUCHSCREEN_GT801_IIC is not set # CONFIG_TOUCHSCREEN_GT818_IIC is not set +# CONFIG_TOUCHSCREEN_PIXCIR is not set # CONFIG_D70_L3188A is not set # CONFIG_TOUCHSCREEN_GT819 is not set # CONFIG_TOUCHSCREEN_FT5406 is not set @@ -1048,6 +1055,7 @@ CONFIG_INPUT_TOUCHSCREEN=y CONFIG_INPUT_MISC=y # CONFIG_INPUT_LPSENSOR_ISL29028 is not set # CONFIG_INPUT_LPSENSOR_CM3602 is not set +# CONFIG_INPUT_LPSENSOR_AL3006 is not set # CONFIG_INPUT_AD714X is not set # CONFIG_INPUT_ATI_REMOTE is not set # CONFIG_INPUT_ATI_REMOTE2 is not set @@ -1073,6 +1081,7 @@ CONFIG_GS_MMA8452=y # CONFIG_GS_KXTF9 is not set # CONFIG_GS_LIS3DH is not set # CONFIG_GS_L3G4200D is not set +# CONFIG_GS_BMA023 is not set # CONFIG_GYRO_SENSOR_DEVICE is not set # CONFIG_INPUT_JOGBALL is not set # CONFIG_LIGHT_SENSOR_DEVICE is not set @@ -1223,7 +1232,7 @@ CONFIG_ADC_RK29=y # # Headset device support # -# CONFIG_RK_HEADSET_DET is not set +CONFIG_RK_HEADSET_DET=y # # PPS support @@ -1601,6 +1610,7 @@ CONFIG_DISPLAY_SUPPORT=y # Display hardware drivers # # CONFIG_LCD_NULL is not set +# CONFIG_LCD_LG_LP097X02 is not set # CONFIG_LCD_TD043MGEA1 is not set # CONFIG_LCD_HX8357 is not set # CONFIG_LCD_TJ048NC01CA is not set @@ -1612,6 +1622,7 @@ CONFIG_DISPLAY_SUPPORT=y # CONFIG_LCD_BYD8688FTGF is not set # CONFIG_LCD_B101AW06 is not set # CONFIG_LCD_LS035Y8DX02A is not set +# CONFIG_LCD_LS035Y8DX04A is not set # CONFIG_LCD_CPTCLAA038LA31XE is not set # CONFIG_LCD_A060SE02 is not set # CONFIG_LCD_S1D13521 is not set @@ -1668,11 +1679,12 @@ CONFIG_SND_SOC=y CONFIG_SND_RK29_SOC=y # CONFIG_SND_RK29_SOC_WM8988 is not set # CONFIG_SND_RK29_SOC_WM8900 is not set -# CONFIG_SND_RK29_SOC_alc5621 is not set -# CONFIG_SND_RK29_SOC_alc5631 is not set +# CONFIG_SND_RK29_SOC_RT5621 is not set +# CONFIG_SND_RK29_SOC_RT5631 is not set # CONFIG_SND_RK29_SOC_RT5625 is not set # CONFIG_SND_RK29_SOC_WM8994 is not set # CONFIG_SND_RK29_SOC_CS42L52 is not set +# CONFIG_SND_RK29_SOC_AIC3111 is not set CONFIG_SND_SOC_I2C_AND_SPI=y # CONFIG_SND_SOC_ALL_CODECS is not set # CONFIG_SOUND_PRIME is not set diff --git a/drivers/input/touchscreen/ili2102_ts.c b/drivers/input/touchscreen/ili2102_ts.c index ff3775d646be..367cf5f04876 100755 --- a/drivers/input/touchscreen/ili2102_ts.c +++ b/drivers/input/touchscreen/ili2102_ts.c @@ -16,7 +16,7 @@ #include #include #include - +#include #include "ili2102_ts.h" static int ts_dbg_enable = 0; @@ -201,7 +201,9 @@ static ssize_t ilitek_file_write(struct file *filp, const char *buf, size_t coun } -static int ilitek_file_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) +//static int ilitek_file_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) +long ilitek_file_ioctl (struct file *filp, unsigned int cmd, unsigned long arg) + { static unsigned char buffer[64]={0}; static int len=0; @@ -286,7 +288,7 @@ static int ilitek_file_close(struct inode *inode, struct file *filp) // declare file operations struct file_operations ilitek_fops = { - .ioctl = ilitek_file_ioctl, + .unlocked_ioctl = ilitek_file_ioctl, .read = ilitek_file_read, .write = ilitek_file_write, .open = ilitek_file_open, @@ -362,7 +364,7 @@ static void ili2102_ts_work_func(struct work_struct *work) printk("%s:i2c_transfer fail, ret=%d\n",__FUNCTION__,ret); goto out; } - if(buf[0]&0x02 == 0x02) + if((buf[0]&0x02) == 0x02) num = 2; else num = 1; @@ -375,9 +377,10 @@ static void ili2102_ts_work_func(struct work_struct *work) if (touch_state[i] == TOUCH_DOWN) { DBG("ili2102_ts_work_func:buf[%d]=%d\n",i,buf[i]); - input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, 0); //Finger Size - input_report_abs(ts->input_dev, ABS_MT_WIDTH_MAJOR, 0); //Touch Size - input_mt_sync(ts->input_dev); + //input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, 0); + //input_report_abs(ts->input_dev, ABS_MT_PRESSURE, 0); + input_mt_slot(ts->input_dev, i); + input_mt_report_slot_state(ts->input_dev, MT_TOOL_FINGER, false); syn_flag = 1; touch_state[i] = TOUCH_UP; DBG("i=%d,touch_up \n",i); @@ -400,18 +403,16 @@ static void ili2102_ts_work_func(struct work_struct *work) x = g_x[i]; y = g_y[i]; } - #ifdef CONFIG_MACH_RK29_TD8801_V2 - if( y >=80 ) y-=80; - if( x >= 50 ) x-=50; - #endif g_x[i] = x; - g_y[i] = y; - input_event(ts->input_dev, EV_ABS, ABS_MT_TRACKING_ID, i); - input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, 1); //Finger Size - input_report_abs(ts->input_dev, ABS_MT_POSITION_X, x); - input_report_abs(ts->input_dev, ABS_MT_POSITION_Y, y); - input_report_abs(ts->input_dev, ABS_MT_WIDTH_MAJOR, 5); //Touch Size - input_mt_sync(ts->input_dev); + g_y[i] = y; + + input_mt_slot(ts->input_dev, i); + input_mt_report_slot_state(ts->input_dev, MT_TOOL_FINGER, true); + input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, 1); + input_report_abs(ts->input_dev, ABS_MT_PRESSURE, 100); + input_report_abs(ts->input_dev, ABS_MT_POSITION_X, x); + input_report_abs(ts->input_dev, ABS_MT_POSITION_Y, y); + syn_flag = 1; touch_state[i] = TOUCH_DOWN; ts->pendown = 1; @@ -679,10 +680,14 @@ static int ili2102_ts_probe(struct i2c_client *client, const struct i2c_device_i ts->pendown = 0; ts->valid_i2c_register = 1; - ts->input_dev->evbit[0] = BIT_MASK(EV_SYN) | BIT_MASK(EV_ABS); + //ts->input_dev->evbit[0] = BIT_MASK(EV_SYN) | BIT_MASK(EV_ABS); //ts->input_dev->absbit[0] = //BIT(ABS_MT_POSITION_X) | BIT(ABS_MT_POSITION_Y) | //BIT(ABS_MT_TOUCH_MAJOR) | BIT(ABS_MT_WIDTH_MAJOR); // for android + + __set_bit(INPUT_PROP_DIRECT, ts->input_dev->propbit); + __set_bit(EV_ABS, ts->input_dev->evbit); + input_set_abs_params(ts->input_dev, ABS_MT_POSITION_X, ts->x_min ? : 0, ts->x_max ? : 480, @@ -691,8 +696,9 @@ static int ili2102_ts_probe(struct i2c_client *client, const struct i2c_device_i ts->y_min ? : 0, ts->y_max ? : 800, 0, 0); - input_set_abs_params(ts->input_dev, ABS_MT_TOUCH_MAJOR, 0, 1, 0, 0); //Finger Size - input_set_abs_params(ts->input_dev, ABS_MT_WIDTH_MAJOR, 0, 10, 0, 0); //Touch Size + input_mt_init_slots(ts->input_dev, TOUCH_NUMBER); + input_set_abs_params(ts->input_dev, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0); + //input_set_abs_params(ts->input_dev, ABS_MT_PRESSURE, 0, 255, 0, 0); /* ts->input_dev->name = ts->keypad_info->name; */ ret = input_register_device(ts->input_dev); @@ -844,13 +850,16 @@ static int ili2102_ts_suspend(struct i2c_client *client, pm_message_t mesg) static void ili2102_ts_resume_work_func(struct work_struct *work) { struct ili2102_ts_data *ts = container_of(work, struct ili2102_ts_data, work); - int ret; + int ret,i; //report touch up to android - input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, 0); //Finger Size - input_report_abs(ts->input_dev, ABS_MT_WIDTH_MAJOR, 0); //Touch Size - input_mt_sync(ts->input_dev); - input_sync(ts->input_dev); + for(i=0; iinput_dev, ABS_MT_TOUCH_MAJOR, 0); + input_report_abs(ts->input_dev, ABS_MT_PRESSURE, 0); + input_mt_slot(ts->input_dev, i); + input_mt_report_slot_state(ts->input_dev, MT_TOOL_FINGER, false); + } PREPARE_DELAYED_WORK(&ts->work, ili2102_ts_work_func); mdelay(100); //wait for 100ms before i2c operation -- 2.34.1