phone_pad:add keyboard,lcd and tp
authorhzf <hzf@rock-chips.com>
Thu, 26 Jul 2012 10:09:51 +0000 (18:09 +0800)
committerhzf <hzf@rock-chips.com>
Thu, 26 Jul 2012 10:15:21 +0000 (18:15 +0800)
arch/arm/mach-rk30/board-rk30-phonepad-key.c
arch/arm/mach-rk30/board-rk30-phonepad.c
drivers/input/touchscreen/Kconfig
drivers/input/touchscreen/Makefile
drivers/video/display/screen/Kconfig
drivers/video/display/screen/Makefile
drivers/video/display/screen/lcd_hv070wsa.c [new file with mode: 0755]
include/linux/goodix_touch_82x.h [new file with mode: 0755]

index f31366330ab76d8fa3209607988771aeb3993c4d..a30ef4454d8320844096624f4d6a41acc76fd30a 100755 (executable)
@@ -21,14 +21,12 @@ static struct rk29_keys_button key_button[] = {
                .gpio   = RK30_PIN6_PA1,
                .active_low = PRESS_LEV_LOW,
        },
-       #endif
        {
                .desc   = "vol-",
                .code   = KEY_VOLUMEDOWN,
                .gpio   = RK30_PIN4_PC5,
                .active_low = PRESS_LEV_LOW,
        },
-       #if 0
        {
                .desc   = "home",
                .code   = KEY_HOME,
@@ -62,6 +60,7 @@ static struct rk29_keys_button key_button[] = {
                //.code_long_press = EV_ENCALL,
                .wakeup = 1,
        },
+       #if 0
        {
                .desc   = "vol+",
                .code   = KEY_VOLUMEUP,
@@ -69,7 +68,6 @@ static struct rk29_keys_button key_button[] = {
                .gpio = INVALID_GPIO,
                .active_low = PRESS_LEV_LOW,
        },
-       #if 0
        {
                .desc   = "vol-",
                .code   = KEY_VOLUMEUP,
@@ -78,32 +76,25 @@ static struct rk29_keys_button key_button[] = {
                .active_low = PRESS_LEV_LOW,
        },
        #endif
-#ifdef CONFIG_MACH_RK3066_SDK
+#ifdef CONFIG_MACH_RK30_PHONE_PAD
        {
-               .desc   = "menu",
-               .code   = EV_MENU,
-               .adc_value      = 135,
+               .desc   = "vol+",
+               .code   = KEY_VOLUMEUP,
+               .adc_value      = 180,
                .gpio = INVALID_GPIO,
                .active_low = PRESS_LEV_LOW,
        },
        {
-               .desc   = "home",
-               .code   = KEY_HOME,
-               .adc_value      = 550,
+               .desc   = "vol-",
+               .code   = KEY_VOLUMEDOWN,
+               .adc_value      = 1,
                .gpio = INVALID_GPIO,
                .active_low = PRESS_LEV_LOW,
        },
        {
                .desc   = "esc",
                .code   = KEY_BACK,
-               .adc_value      = 334,
-               .gpio = INVALID_GPIO,
-               .active_low = PRESS_LEV_LOW,
-       },
-       {
-               .desc   = "camera",
-               .code   = KEY_CAMERA,
-               .adc_value      = 743,
+               .adc_value      = 460,
                .gpio = INVALID_GPIO,
                .active_low = PRESS_LEV_LOW,
        },
index a59432802b7eaf2bdaf3a29a5293699d2a0ef871..8e219c9735606b7d009b0d75764e4879699465e6 100755 (executable)
        #include "../../../drivers/video/rockchip/hdmi/rk_hdmi.h"
 #endif
 
+#define TPS65910_HOST_IRQ        RK30_PIN6_PA4
+#ifdef CONFIG_TOUCHSCREEN_GT82X_IIC
+#include <linux/goodix_touch_82x.h>
+#endif
+
 #if defined(CONFIG_SPIM_RK29)
 #include "../../../drivers/spi/rk29_spim.h"
 #endif
@@ -72,6 +77,7 @@
 #else
 #define RK30_FB0_MEM_SIZE 8*SZ_1M
 #endif
+int PMIC_IS_WM831X = 0;
 
 #ifdef CONFIG_VIDEO_RK29
 /*---------------- Camera Sensor Macro Define Begin  ------------------------*/
@@ -522,6 +528,73 @@ static rk_sensor_user_init_data_s rk_init_data_sensor[RK_CAM_NUM] =
 
 #endif /* CONFIG_VIDEO_RK29 */
 
+#ifdef  CONFIG_TOUCHSCREEN_GT82X_IIC
+#define TOUCH_ENABLE_PIN       INVALID_GPIO
+#define TOUCH_RESET_PIN  RK30_PIN4_PD0
+#define TOUCH_INT_PIN    RK30_PIN4_PC2
+int goodix_init_platform_hw(void)
+{
+       int ret;
+       
+       rk30_mux_api_set(GPIO4D0_SMCDATA8_TRACEDATA8_NAME, GPIO4D_GPIO4D0);
+       rk30_mux_api_set(GPIO4C2_SMCDATA2_TRACEDATA2_NAME, GPIO4C_GPIO4C2);
+       //printk("%s:0x%x,0x%x\n",__func__,rk30_mux_api_get(GPIO4D0_SMCDATA8_TRACEDATA8_NAME),rk30_mux_api_get(GPIO4C2_SMCDATA2_TRACEDATA2_NAME));
+       if (TOUCH_ENABLE_PIN != INVALID_GPIO) {
+               ret = gpio_request(TOUCH_ENABLE_PIN, "goodix power pin");
+               if (ret != 0) {
+                       gpio_free(TOUCH_ENABLE_PIN);
+                       printk("goodix power error\n");
+                       return -EIO;
+               }
+               gpio_direction_output(TOUCH_ENABLE_PIN, 0);
+               gpio_set_value(TOUCH_ENABLE_PIN, GPIO_LOW);
+               msleep(100);
+       }
+
+       if (TOUCH_RESET_PIN != INVALID_GPIO) {
+               ret = gpio_request(TOUCH_RESET_PIN, "goodix reset pin");
+               if (ret != 0) {
+                       gpio_free(TOUCH_RESET_PIN);
+                       printk("goodix gpio_request error\n");
+                       return -EIO;
+               }
+               gpio_direction_output(TOUCH_RESET_PIN, 0);
+               gpio_set_value(TOUCH_RESET_PIN, GPIO_LOW);
+               msleep(10);
+               gpio_set_value(TOUCH_RESET_PIN, GPIO_HIGH);
+               msleep(500);
+       }
+       return 0;
+}
+u8 ts82x_config_data[] = {
+       // æ·»å\8a å\9bºä»¶ä¿®æ\94¹å·¥å\85·å\90\8eæ­¤æ\95°ç»\84æ\97 æ\95\88ï¼\8cå\8fªç\94¨äº\8eè\8e·å\8f\96æ\95°ç»\84é\95¿åº¦ä½¿ç\94¨
+       0x65,0x00,0x04,0x00,0x03,0x00,0x0A,0x0D,0x1E,0xE7,
+       0x32,0x03,0x08,0x10,0x48,0x42,0x42,0x20,0x00,0x01,
+       0x60,0x60,0x4B,0x6E,0x0E,0x0D,0x0C,0x0B,0x0A,0x09,
+       0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01,0x00,0x1D,
+       0x1C,0x1B,0x1A,0x19,0x18,0x17,0x16,0x15,0x14,0x13,
+       0x12,0x11,0x10,0x0F,0x50,0x00,0x00,0x00,0x00,0x00,
+       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2B,0x00,0x00,
+       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+       0x00,0x00,0x00,0x00
+};
+static struct goodix_i2c_rmi_platform_data ts82x_pdata = {
+    .gpio_shutdown = TOUCH_ENABLE_PIN,
+    .gpio_irq = TOUCH_INT_PIN,
+    .gpio_reset = TOUCH_RESET_PIN,
+    .irq_edge = 1, /* 0:rising edge, 1:falling edge */
+
+    .ypol = 1,
+       .swap_xy = 1,
+       .xpol = 0,
+       .xmax = 1024,
+    .ymax = 600,
+    .config_info_len =ARRAY_SIZE(ts82x_config_data),
+    .config_info = ts82x_config_data,
+       .init_platform_hw= goodix_init_platform_hw,
+};
+#endif
+
 #if defined(CONFIG_TOUCHSCREEN_GT8XX)
 #define TOUCH_RESET_PIN  RK30_PIN4_PD0
 #define TOUCH_PWR_PIN    INVALID_GPIO
@@ -596,6 +669,11 @@ static struct spi_board_info board_spi_devices[] = {
 static int rk29_backlight_io_init(void)
 {
        int ret = 0;
+       rk30_mux_api_set(GPIO0D6_PWM2_NAME, GPIO0D_GPIO0D6);
+       gpio_request(RK30_PIN0_PD6, NULL);
+       gpio_direction_output(RK30_PIN0_PD6, GPIO_HIGH);
+
+       //rk30_mux_api_set(GPIO0D6_PWM2_NAME, GPIO0D_PWM2);
        rk30_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE);
 #ifdef  LCD_DISP_ON_PIN
        // rk30_mux_api_set(BL_EN_MUX_NAME, BL_EN_MUX_MODE);
@@ -605,7 +683,7 @@ static int rk29_backlight_io_init(void)
                gpio_free(BL_EN_PIN);
        }
 
-       gpio_direction_output(BL_EN_PIN, 0);
+       gpio_direction_output(BL_EN_PIN, BL_EN_VALUE);
        gpio_set_value(BL_EN_PIN, BL_EN_VALUE);
 #endif
        return ret;
@@ -1334,6 +1412,61 @@ static struct platform_device rk30_device_adc_battery = {
         },
 };
 #endif
+#if CONFIG_RK30_PWM_REGULATOR
+struct pwm_platform_data {
+       int     pwm_id;
+       int     pwm_gpio;
+       //char  pwm_iomux_name[50];
+       char*   pwm_iomux_name;
+       unsigned int    pwm_iomux_pwm;
+       int     pwm_iomux_gpio;
+       int     pwm_voltage;
+       struct regulator_init_data *init_data;
+};
+
+static struct regulator_consumer_supply pwm_dcdc1_consumers[] = {
+       {
+               .supply = "vdd_core",
+       }
+};
+
+struct regulator_init_data pwm_regulator_init_dcdc[1] =
+{
+       {
+               .constraints = {
+                       .name = "PWM_DCDC1",
+                       .min_uV = 600000,
+                       .max_uV = 1800000,      //0.6-1.8V
+                       .apply_uV = true,
+                       .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE,
+               },
+               .num_consumer_supplies = ARRAY_SIZE(pwm_dcdc1_consumers),
+               .consumer_supplies = pwm_dcdc1_consumers,
+       },
+};
+
+static struct pwm_platform_data pwm_regulator_info[1] = {
+       {
+               .pwm_id = 3,
+               .pwm_gpio = RK30_PIN0_PD7,
+               .pwm_iomux_name = GPIO0D7_PWM3_NAME,
+               .pwm_iomux_pwm = GPIO0D_PWM3,
+               .pwm_iomux_gpio = GPIO0D_GPIO0D6,
+               .pwm_voltage = 1100000,
+               .init_data      = &pwm_regulator_init_dcdc[0],
+       },
+};
+
+struct platform_device pwm_regulator_device[1] = {
+       {
+               .name = "pwm-voltage-regulator",
+               .id = 0,
+               .dev            = {
+                       .platform_data = &pwm_regulator_info[0],
+               }
+       },
+};
+#endif
 
 #ifdef CONFIG_RK29_VMAC
 #define PHY_PWR_EN_GPIO        RK30_PIN1_PD6
@@ -1555,7 +1688,12 @@ static struct i2c_board_info __initdata i2c0_info[] = {
 #endif
 
 #ifdef CONFIG_I2C1_RK30
+#ifdef CONFIG_MFD_WM831X_I2C
 #include "board-rk30-sdk-wm8326.c"
+#endif
+#ifdef CONFIG_MFD_TPS65910
+#include "board-rk30-sdk-tps65910.c"
+#endif
 
 static struct i2c_board_info __initdata i2c1_info[] = {
 #if defined (CONFIG_MFD_WM831X_I2C)
@@ -1567,6 +1705,15 @@ static struct i2c_board_info __initdata i2c1_info[] = {
                .platform_data = &wm831x_platdata,
        },
 #endif
+#if defined (CONFIG_MFD_TPS65910)
+       {
+        .type           = "tps659102",
+        .addr           = TPS65910_I2C_ID0,
+        .flags          = 0,
+        .irq            = TPS65910_HOST_IRQ,
+       .platform_data = &tps65910_data,
+       },
+#endif
 };
 #endif
 
@@ -1581,6 +1728,15 @@ static struct i2c_board_info __initdata i2c2_info[] = {
                .platform_data = &goodix_info,
        },
 #endif
+#if defined(CONFIG_TOUCHSCREEN_GT82X_IIC)
+       {
+               .type          = "Goodix-TS-82X",
+               .addr          = 0x5D,
+               .flags         = 0,
+               .irq           = RK30_PIN4_PC2,
+               .platform_data = &ts82x_pdata,
+       },
+#endif
 #if defined (CONFIG_LS_CM3217)
        {
                .type          = "lightsensor",
@@ -1648,18 +1804,59 @@ static void __init rk30_i2c_register_board_info(void)
 }
 //end of i2c
 
+static void dcr_en_low(void)
+{
+  int ret;
+  ret=gpio_request(RK30_PIN4_PB7,"dcr_en");
+  if(ret<0){
+     printk("dcr_en_low request io error");
+     gpio_free(RK30_PIN4_PB7);
+     return;
+  }
+  gpio_direction_output(RK30_PIN4_PB7, GPIO_LOW);
+}
+
 #define POWER_ON_PIN RK30_PIN6_PB0   //power_hold
-static void rk30_pm_power_off(void)
+void rk30_pm_power_off(void)
 {
+  int pwr_cnt;
+  
        printk(KERN_ERR "rk30_pm_power_off start...\n");
-       gpio_direction_output(POWER_ON_PIN, GPIO_LOW);
+       
+#if 0
+       //²å×ųäµçÆ÷£¬Ñ­»·²»¿ª»ú£¬Ö±µ½°´POWER¼ü»òÕ߰εô³äµçÆ÷
+       if(gpio_get_value (rk30_adc_battery_platdata.dc_det_pin) == rk30_adc_battery_platdata.dc_det_level){
+               pwr_cnt=0;
+               while(1){
+                        if(gpio_get_value (rk30_adc_battery_platdata.dc_det_pin) != rk30_adc_battery_platdata.dc_det_level){
+                                 break;
+                        }
+                        if((gpio_get_value(RK30_PIN6_PA2)==GPIO_LOW)){
+                                if(pwr_cnt++>40)
+                                  break;
+                        }else{
+                                //printk("0\n");
+                                pwr_cnt=0;
+                        }              
+                        mdelay(50);
+               }       
+              arm_pm_restart(0, NULL);
+       }
+#endif
+#if PMIC_IS_WM831X 
 #if defined(CONFIG_MFD_WM831X)
        wm831x_set_bits(Wm831x,WM831X_GPIO_LEVEL,0x0001,0x0000);  //set sys_pwr 0
        wm831x_device_shutdown(Wm831x);//wm8326 shutdown
 #endif
-       while (1);
+#else
+#if defined(CONFIG_MFD_TPS65910)
+       tps65910_device_shutdown();//tps65910 shutdown
+#endif
+#endif
+  gpio_direction_output(POWER_ON_PIN, GPIO_LOW);
+       while(1);
 }
-
+EXPORT_SYMBOL_GPL(rk30_pm_power_off);
 static void __init machine_rk30_board_init(void)
 {
        avs_init();
@@ -1676,6 +1873,7 @@ static void __init machine_rk30_board_init(void)
 #ifdef CONFIG_WIFI_CONTROL_FUNC
        rk29sdk_wifi_bt_gpio_control_init();
 #endif
+  dcr_en_low();
 }
 
 static void __init rk30_reserve(void)
@@ -1706,14 +1904,14 @@ static void __init rk30_reserve(void)
  */
 static struct dvfs_arm_table dvfs_cpu_logic_table[] = {
        {.frequency = 252 * 1000,       .cpu_volt = 1075 * 1000,        .logic_volt = 1125 * 1000},//0.975V/1.000V
-       {.frequency = 504 * 1000,       .cpu_volt = 1100 * 1000,        .logic_volt = 1125 * 1000},//0.975V/1.000V
-       {.frequency = 816 * 1000,       .cpu_volt = 1125 * 1000,        .logic_volt = 1150 * 1000},//1.000V/1.025V
+       {.frequency = 504 * 1000,       .cpu_volt = 1075 * 1000,        .logic_volt = 1125* 1000},//0.975V/1.000V
+       {.frequency = 816 * 1000,       .cpu_volt = 1100 * 1000,        .logic_volt = 1150 * 1000},//1.000V/1.025V
        {.frequency = 1008 * 1000,      .cpu_volt = 1125 * 1000,        .logic_volt = 1150 * 1000},//1.025V/1.050V
        {.frequency = 1200 * 1000,      .cpu_volt = 1175 * 1000,        .logic_volt = 1200 * 1000},//1.100V/1.050V
-       {.frequency = 1272 * 1000,      .cpu_volt = 1225 * 1000,        .logic_volt = 1200 * 1000},//1.150V/1.100V
-       {.frequency = 1416 * 1000,      .cpu_volt = 1300 * 1000,        .logic_volt = 1200 * 1000},//1.225V/1.100V
-       {.frequency = 1512 * 1000,      .cpu_volt = 1350 * 1000,        .logic_volt = 1250 * 1000},//1.300V/1.150V
-       {.frequency = 1608 * 1000,      .cpu_volt = 1425 * 1000,        .logic_volt = 1300 * 1000},//1.325V/1.175V
+       //{.frequency = 1272 * 1000,    .cpu_volt = 1225 * 1000,        .logic_volt = 1200 * 1000},//1.150V/1.100V
+       //{.frequency = 1416 * 1000,    .cpu_volt = 1300 * 1000,        .logic_volt = 1200 * 1000},//1.225V/1.100V
+       //{.frequency = 1512 * 1000,    .cpu_volt = 1350 * 1000,        .logic_volt = 1250 * 1000},//1.300V/1.150V
+       //{.frequency = 1608 * 1000,    .cpu_volt = 1375 * 1000,        .logic_volt = 1275 * 1000},//1.325V/1.175V
        {.frequency = CPUFREQ_TABLE_END},
 };
 
index 1aafaaf4469e43043706a3a1e1e1381f2ef0b742..6e95e50980398fd4c0e25018c29674c9a03f7728 100755 (executable)
@@ -969,6 +969,9 @@ config LAIBAO_TS
 config TOUCHSCREEN_GT801_IIC
        tristate "GT801_IIC based touchscreens"
        depends on I2C2_RK29
+config TOUCHSCREEN_GT82X_IIC
+       tristate "GT82x_IIC based touchscreens"
+       depends on I2C2_RK30
 
 config TOUCHSCREEN_GT818_IIC
        tristate "GT818_IIC based touchscreens"
index 61ccb8719731a8a4cb3d1f3d431c8ab231cb5d7e..d64b4a9063f539f52fe5e65d444e7c13f299a995 100644 (file)
@@ -75,6 +75,7 @@ obj-$(CONFIG_EETI_EGALAX)             += eeti_egalax_i2c.o
 obj-$(CONFIG_ATMEL_MXT224)             += atmel_maxtouch.o
 obj-$(CONFIG_ATMEL_MXT1386)            += atmel_mxt1386.o
 obj-$(CONFIG_TOUCHSCREEN_GT801_IIC)    += gt801_ts.o
+obj-$(CONFIG_TOUCHSCREEN_GT82X_IIC)    += goodix_touch_82x.o
 obj-$(CONFIG_TOUCHSCREEN_GT818_IIC)    += gt818_ts.o
 obj-$(CONFIG_TOUCHSCREEN_ILI2102_IIC)  += ili2102_ts.o
 obj-$(CONFIG_D70_L3188A)               += goodix_touch.o
index fb50de1744c49d3b6b8ff9106ced646d5f720423..850ba6518c8dd4d186e669481b5da8e1c500432d 100644 (file)
@@ -88,6 +88,8 @@ config LCD_HDMI_800x480
        bool "RGB Hannstar LCD_HDMI_800x480"
        ---help---
        if support RK610, this setting can support dual screen output
+config LCD_HV070WSA100
+       bool "HV070WSA-100 1024X600"
 endchoice
 
 
index 4a1bc783ec061e61d93cbfdfb0e3fb0b9894900d..93aff20cc013116652ea3cc4021dec22ee00d34d 100644 (file)
@@ -40,3 +40,4 @@ obj-$(CONFIG_LCD_A050VL01)    += lcd_A050VL01.o
 obj-$(CONFIG_LCD_B101EW05)    += lcd_b101ew05.o
 obj-$(CONFIG_LCD_HJ050NA_06A)    += lcd_hj050na_06a.o
 obj-$(CONFIG_LCD_HSD100PXN_FOR_TDW851) += lcd_hsd100pxn_for_tdw851.o
+obj-$(CONFIG_LCD_HV070WSA100)    += lcd_hv070wsa.o
diff --git a/drivers/video/display/screen/lcd_hv070wsa.c b/drivers/video/display/screen/lcd_hv070wsa.c
new file mode 100755 (executable)
index 0000000..b13c20f
--- /dev/null
@@ -0,0 +1,76 @@
+#include <linux/fb.h>\r
+#include <linux/delay.h>\r
+#include "../../rk29_fb.h"\r
+#include <mach/gpio.h>\r
+#include <mach/iomux.h>\r
+#include <mach/board.h>\r
+#include "screen.h"\r
+\r
+\r
+/* Base */\r
+#define OUT_TYPE               SCREEN_RGB\r
+\r
+#define OUT_FACE               OUT_P888\r
+#define OUT_CLK                        50000000\r
+#define LCDC_ACLK       500000000//312000000           //29 lcdc axi DMA ÆµÂÊ\r
+\r
+/* Timing */\r
+#define H_PW                   100\r
+#define H_BP                   100\r
+#define H_VD                   1024\r
+#define H_FP                   120\r
+\r
+#define V_PW                   10\r
+#define V_BP                   10\r
+#define V_VD                   600\r
+#define V_FP                   15\r
+\r
+#define LCD_WIDTH       202\r
+#define LCD_HEIGHT      152\r
+/* Other */\r
+#define DCLK_POL               0\r
+#define SWAP_RB                        0   \r
+\r
+void set_lcd_info(struct rk29fb_screen *screen, struct rk29lcd_info *lcd_info )\r
+{\r
+    /* screen type & face */\r
+    screen->type = OUT_TYPE;\r
+    screen->face = OUT_FACE;\r
+\r
+    /* Screen size */\r
+    screen->x_res = H_VD;\r
+    screen->y_res = V_VD;\r
+\r
+    screen->width = LCD_WIDTH;\r
+    screen->height = LCD_HEIGHT;\r
+\r
+    /* Timing */\r
+    screen->lcdc_aclk = LCDC_ACLK;\r
+    screen->pixclock = OUT_CLK;\r
+       screen->left_margin = H_BP;\r
+       screen->right_margin = H_FP;\r
+       screen->hsync_len = H_PW;\r
+       screen->upper_margin = V_BP;\r
+       screen->lower_margin = V_FP;\r
+       screen->vsync_len = V_PW;\r
+\r
+       /* Pin polarity */\r
+       screen->pin_hsync = 0;\r
+       screen->pin_vsync = 0;\r
+       screen->pin_den = 0;\r
+       screen->pin_dclk = DCLK_POL;\r
+\r
+       /* Swap rule */\r
+    screen->swap_rb = SWAP_RB;\r
+    screen->swap_rg = 0;\r
+    screen->swap_gb = 0;\r
+    screen->swap_delta = 0;\r
+    screen->swap_dumy = 0;\r
+\r
+    /* Operation function*/\r
+    screen->init = NULL;\r
+    screen->standby = NULL;\r
+}\r
+\r
+\r
+\r
diff --git a/include/linux/goodix_touch_82x.h b/include/linux/goodix_touch_82x.h
new file mode 100755 (executable)
index 0000000..2fa4507
--- /dev/null
@@ -0,0 +1,163 @@
+/*
+ * 
+ * Copyright (C) 2011 Goodix, Inc.
+ * 
+ * Author: Scott
+ * Date: 2012.01.05
+ */
+
+#ifndef _LINUX_GOODIX_TOUCH_H
+#define _LINUX_GOODIX_TOUCH_H
+
+#include <linux/earlysuspend.h>
+#include <linux/hrtimer.h>
+#include <linux/i2c.h>
+#include <linux/input.h>
+
+#define fail    0
+#define success 1
+
+#define false   0
+#define true    1
+
+#define FLAG_UP                0
+#define FLAG_DOWN      1
+
+#define RELEASE_DATE "2012-02-07"
+
+#define GOODIX_I2C_NAME         "Goodix-TS-82X"
+#define GOODIX_I2C_ADDR     0X5D
+
+#if 1
+#define GTDEBUG(fmt, arg...) printk("<--GT-DEBUG-->"fmt, ##arg)
+#else
+#define DEBUG(fmt, arg...)
+#endif
+
+#if 1
+#define GTNOTICE(fmt, arg...) printk("<--GT-NOTICE-->"fmt, ##arg)
+#else
+#define NOTICE(fmt, arg...)
+#endif
+
+#if 1
+#define GTWARNING(fmt, arg...) printk("<--GT-WARNING-->"fmt, ##arg)
+#else
+#define WARNING(fmt, arg...)
+#endif
+
+#if 1
+#define GTDEBUG_MSG(fmt, arg...) printk("<--GT msg-->"fmt, ##arg)
+#else
+#define DEBUG_MSG(fmt, arg...)
+#endif
+
+#if 1
+#define GTDEBUG_UPDATE(fmt, arg...) printk("<--GT update-->"fmt, ##arg)
+#else
+#define DEBUG_UPDATE(fmt, arg...)
+#endif 
+
+#if 0   //w++
+#define GTDEBUG_COOR(fmt, arg...) printk(fmt, ##arg)
+#define GTDEBUG_COORD
+#else
+#define GTDEBUG_COOR(fmt, arg...)
+#define DEBUG_COOR(fmt, arg...)
+#endif
+
+#if 1
+#define GTDEBUG_ARRAY(array, num)   do{\
+                                   int i;\
+                                   u8* a = array;\
+                                   for (i = 0; i < (num); i++)\
+                                   {\
+                                       printk("%02x   ", (a)[i]);\
+                                       if ((i + 1 ) %10 == 0)\
+                                       {\
+                                           printk("\n");\
+                                       }\
+                                   }\
+                                   printk("\n");\
+                                  }while(0)
+#else
+#define DEBUG_ARRAY(array, num) 
+#endif 
+
+#define ADDR_MAX_LENGTH     2
+#define ADDR_LENGTH         ADDR_MAX_LENGTH
+
+//#define CREATE_WR_NODE
+//#define AUTO_UPDATE_GUITAR             //Èç¹û¶¨ÒåÁËÔòÉϵç»á×Ô¶¯ÅжÏÊÇ·ñÐèÒªÉý¼¶
+
+//--------------------------For user redefine-----------------------------//
+//-------------------------GPIO REDEFINE START----------------------------//
+#define GPIO_DIRECTION_INPUT(port)          gpio_direction_input(port)
+#define GPIO_DIRECTION_OUTPUT(port, val)    gpio_direction_output(port, val)
+#define GPIO_SET_VALUE(port, val)           gpio_set_value(port, val)
+#define GPIO_FREE(port)                     gpio_free(port)
+#define GPIO_REQUEST(port, name)            gpio_request(port, name)
+#define GPIO_PULL_UPDOWN(port, val)      gpio_pull_updown(port,val)  // s3c_gpio_setpull(port, val)
+#define GPIO_CFG_PIN(port, cfg)                 //s3c_gpio_cfgpin(port, cfg)
+//-------------------------GPIO REDEFINE END------------------------------//
+
+
+//*************************TouchScreen Work Part Start**************************
+
+#define RESET_PORT          S3C64XX_GPF(3)          //RESET¹Ü½ÅºÅ
+#define INT_PORT            S3C64XX_GPL(10)         //Int IO port
+#ifdef INT_PORT
+    #define TS_INT          gpio_to_irq(INT_PORT)      //Interrupt Number,EINT18(119)
+    #define INT_CFG         S3C_GPIO_SFN(3)            //IO configer as EINT
+#else
+    #define TS_INT          0
+#endif
+
+
+#define GT_IRQ_RISING       IRQ_TYPE_EDGE_RISING
+#define GT_IRQ_FALLING      IRQ_TYPE_EDGE_FALLING
+#define INT_TRIGGER         GT_IRQ_FALLING
+#define POLL_TIME           10        //actual query spacing interval:POLL_TIME+6
+
+#define GOODIX_MULTI_TOUCH
+#ifdef GOODIX_MULTI_TOUCH
+    #define MAX_FINGER_NUM    5
+#else
+    #define MAX_FINGER_NUM    1
+#endif
+
+#define gtswap(x, y) do { typeof(x) z = x; x = y; y = z; } while (0)
+
+struct goodix_i2c_rmi_platform_data {
+ /*   u8 bad_data;     
+    u8 irq_is_disable;
+    u16 addr;
+    s32 use_reset;        //use RESET flag
+    s32 use_irq;          //use EINT flag
+    u32 version;
+    s32 (*power)(struct goodix_ts_data * ts, s32 on);
+    struct i2c_client *client;
+    struct input_dev *input_dev;
+    struct hrtimer timer;
+    struct work_struct work;
+    struct early_suspend early_suspend;
+    s8 phys[32];
+*/     
+    uint32_t version;  /* Use this entry for panels with */
+    unsigned gpio_shutdown;
+    unsigned gpio_irq;
+    unsigned gpio_reset;
+    bool irq_edge; /* 0:rising edge, 1:falling edge */
+    bool swap_xy;
+    bool xpol;
+    bool ypol;
+    int xmax;
+    int ymax;
+    int config_info_len;
+    u8 *config_info;
+    int (*init_platform_hw)(void);
+
+};
+//*************************TouchScreen Work Part End****************************
+
+#endif /* _LINUX_GOODIX_TOUCH_H */