From 0a600e049ee9a06011a5133c92153ec5b2baa55b Mon Sep 17 00:00:00 2001 From: ywj Date: Wed, 14 Aug 2013 10:06:33 +0800 Subject: [PATCH] mend dislay bug on rk3168 and Compatible with 3188 for factoryV4.0 --- .../configs/rk3168_rk616_86v_fac_defconfig | 4 +- arch/arm/mach-rk30/Kconfig | 5 +- arch/arm/mach-rk30/Makefile | 2 +- arch/arm/mach-rk30/board-rk3168-fac.c | 69 +------------------ arch/arm/plat-rk/Kconfig | 3 + .../mach => plat-rk/include/plat}/config.h | 3 +- .../rk-fac-config.c} | 2 +- drivers/input/touchscreen/rk29_i2c_goodix.c | 10 ++- .../net/wireless/wifi_sys/rkwifi_sys_iface.c | 2 +- drivers/video/rockchip/screen/rk_screen.c | 6 +- sound/soc/rk29/rk29_es8323.c | 2 +- sound/soc/rk29/rk29_jetta_codec.c | 2 +- sound/soc/rk29/rk29_rt5631.c | 2 +- 13 files changed, 30 insertions(+), 82 deletions(-) rename arch/arm/{mach-rk30/include/mach => plat-rk/include/plat}/config.h (99%) rename arch/arm/{mach-rk30/board-rk-fac-config.c => plat-rk/rk-fac-config.c} (99%) diff --git a/arch/arm/configs/rk3168_rk616_86v_fac_defconfig b/arch/arm/configs/rk3168_rk616_86v_fac_defconfig index c95b29f3b1dd..a4f9734894da 100644 --- a/arch/arm/configs/rk3168_rk616_86v_fac_defconfig +++ b/arch/arm/configs/rk3168_rk616_86v_fac_defconfig @@ -26,7 +26,7 @@ CONFIG_DDR_SDRAM_FREQ=300 # CONFIG_DDR_TEST is not set CONFIG_CLK_SWITCH_TO_32K=y CONFIG_SOC_RK3168=y -CONFIG_MACH_RK_FAC=y +CONFIG_MACH_RK3168_FAC=y CONFIG_FIQ_DEBUGGER=y CONFIG_FIQ_DEBUGGER_NO_SLEEP=y CONFIG_FIQ_DEBUGGER_CONSOLE=y @@ -282,7 +282,6 @@ CONFIG_WATCHDOG=y CONFIG_MFD_TPS65910=y CONFIG_MFD_WM831X_I2C=y CONFIG_MFD_RK616=y -CONFIG_RK616_USE_MCLK_12M=y CONFIG_REGULATOR=y CONFIG_REGULATOR_TPS65910=y CONFIG_REGULATOR_WM831X=y @@ -311,7 +310,6 @@ CONFIG_LCD_RK3168_FAC=y CONFIG_RK_TRSM=y CONFIG_RK616_LVDS=y CONFIG_RK_HDMI=y -CONFIG_HDMI_RK616=y CONFIG_HDMI_SOURCE_LCDC1=y CONFIG_RGA_RK30=y CONFIG_LOGO=y diff --git a/arch/arm/mach-rk30/Kconfig b/arch/arm/mach-rk30/Kconfig index f40aa4085b95..8ef272973fc6 100755 --- a/arch/arm/mach-rk30/Kconfig +++ b/arch/arm/mach-rk30/Kconfig @@ -155,8 +155,11 @@ config MACH_RK3168_86V config MACH_RK3168_86V_OLD bool "RK3168 86V Old Board" - config MACH_RK_FAC + +config MACH_RK3168_FAC bool "RK3168 Board for factory" + select MACH_RK_FAC + endchoice choice diff --git a/arch/arm/mach-rk30/Makefile b/arch/arm/mach-rk30/Makefile index 29e4b58980de..701a60c49431 100755 --- a/arch/arm/mach-rk30/Makefile +++ b/arch/arm/mach-rk30/Makefile @@ -62,7 +62,7 @@ board-$(CONFIG_MACH_RK3168_LR097) += board-rk3168-LR097.o board-$(CONFIG_MACH_RK3168_DS1006H) += board-rk3168-ds1006h.o board-$(CONFIG_MACH_RK3168_86V) += board-rk3168-86v.o board-$(CONFIG_MACH_RK3168_86V_OLD) += board-rk3168-86v-old.o -board-$(CONFIG_MACH_RK_FAC) += board-rk3168-fac.o +board-$(CONFIG_MACH_RK3168_FAC) += board-rk3168-fac.o obj-$(CONFIG_SOC_RK3168M) += board.o board-$(CONFIG_MACH_RK3168M_TB) += board-rk3168m-tb.o diff --git a/arch/arm/mach-rk30/board-rk3168-fac.c b/arch/arm/mach-rk30/board-rk3168-fac.c index 056ca618d44e..77a2fb2cbe97 100644 --- a/arch/arm/mach-rk30/board-rk3168-fac.c +++ b/arch/arm/mach-rk30/board-rk3168-fac.c @@ -51,7 +51,7 @@ #include #endif #include -#include +#include @@ -88,7 +88,7 @@ #endif #include "board-rk3168-86v-camera.c" -#include "board-rk-fac-config.c" +#include "../plat-rk/rk-fac-config.c" #include /* @@ -152,64 +152,7 @@ struct rk29_keys_platform_data rk29_keys_pdata = { .buttons = key_button, .chn = -1, //chn: 0-7, if do not use ADC,set 'chn' -1 }; -#if defined(CONFIG_CT36X_TS) - -#define TOUCH_MODEL 363 -#define TOUCH_MAX_X 1280 -#define TOUCH_MAX_y 800 -#define TOUCH_RESET_PIN RK30_PIN0_PB6 -#define TOUCH_INT_PIN RK30_PIN1_PB7 - -static struct ct36x_platform_data ct36x_info = { - .model = TOUCH_MODEL, - .x_max = TOUCH_MAX_X, - .y_max = TOUCH_MAX_y, - - .rst_io = { - .gpio = TOUCH_RESET_PIN, - .active_low = 1, - }, - .irq_io = { - .gpio = TOUCH_INT_PIN, - .active_low = 1, - }, - .orientation = {1, 0, 1, 0}, -}; -#endif -#if defined(CONFIG_TOUCHSCREEN_GSLX680) -#define TOUCH_RESET_PIN RK30_PIN0_PB6 -#define TOUCH_EN_PIN NULL -#define TOUCH_INT_PIN RK30_PIN1_PB7 - -int gslx680_init_platform_hw(void) -{ - if(gpio_request(TOUCH_RESET_PIN,NULL) != 0){ - gpio_free(TOUCH_RESET_PIN); - printk("gslx680_init_platform_hw gpio_request error\n"); - return -EIO; - } - if(gpio_request(TOUCH_INT_PIN,NULL) != 0){ - gpio_free(TOUCH_INT_PIN); - printk("gslx680_init_platform_hw gpio_request error\n"); - return -EIO; - } - gpio_direction_output(TOUCH_RESET_PIN, GPIO_HIGH); - mdelay(10); - gpio_set_value(TOUCH_RESET_PIN,GPIO_LOW); - mdelay(10); - gpio_set_value(TOUCH_RESET_PIN,GPIO_HIGH); - msleep(300); - return 0; - -} - -struct ts_hw_data gslx680_info = { - .reset_gpio = TOUCH_RESET_PIN, - .touch_en_gpio = TOUCH_INT_PIN, - .init_platform_hw = gslx680_init_platform_hw, -}; -#endif #if defined (CONFIG_TOUCHSCREEN_GSLX680_RK3168) static int gslx680_init_platform_hw() { @@ -2056,14 +1999,6 @@ static struct i2c_board_info __initdata i2c2_info[] = { .platform_data = &cm3217_info, }, #endif -#if defined (CONFIG_TOUCHSCREEN_GSLX680) - { - .type = "gslX680", - .addr = 0x40, - .flags = 0, - .platform_data =&gslx680_info, - }, -#endif #if defined(CONFIG_TOUCHSCREEN_GT82X_IIC) { .type = "Goodix-TS-82X", diff --git a/arch/arm/plat-rk/Kconfig b/arch/arm/plat-rk/Kconfig index da2d8915950d..4ec8fea9c287 100755 --- a/arch/arm/plat-rk/Kconfig +++ b/arch/arm/plat-rk/Kconfig @@ -212,6 +212,9 @@ config RK_FPGA config RK_CONFIG bool + +config MACH_RK_FAC + bool config RK_TIMER bool diff --git a/arch/arm/mach-rk30/include/mach/config.h b/arch/arm/plat-rk/include/plat/config.h similarity index 99% rename from arch/arm/mach-rk30/include/mach/config.h rename to arch/arm/plat-rk/include/plat/config.h index be455df00f7e..31d0467156f7 100644 --- a/arch/arm/mach-rk30/include/mach/config.h +++ b/arch/arm/plat-rk/include/plat/config.h @@ -1,7 +1,7 @@ #ifndef __MACH_CONFIG_H #define __MACH_CONFIG_H #include -#include +//#include #define BOARD_DEFAULT //#define BOARD_RK3168_86V @@ -24,6 +24,7 @@ enum { TP_TYPE_NONE = 0, TP_TYPE_GSLX680, TP_TYPE_GT811_86V, + TP_TYPE_GT8XX, TP_TYPE_MAX, }; diff --git a/arch/arm/mach-rk30/board-rk-fac-config.c b/arch/arm/plat-rk/rk-fac-config.c similarity index 99% rename from arch/arm/mach-rk30/board-rk-fac-config.c rename to arch/arm/plat-rk/rk-fac-config.c index 2f85784fe41e..2e3e5b5d8f8b 100644 --- a/arch/arm/mach-rk30/board-rk-fac-config.c +++ b/arch/arm/plat-rk/rk-fac-config.c @@ -3,7 +3,7 @@ #else #define CONFIG_ERR(v, name) #endif -#include +#include /* keyboard */ diff --git a/drivers/input/touchscreen/rk29_i2c_goodix.c b/drivers/input/touchscreen/rk29_i2c_goodix.c index d607eccecc8d..1919c6604497 100755 --- a/drivers/input/touchscreen/rk29_i2c_goodix.c +++ b/drivers/input/touchscreen/rk29_i2c_goodix.c @@ -754,7 +754,11 @@ static int rk_ts_probe(struct i2c_client *client, const struct i2c_device_id *id { int ret = 0; struct rk_ts_data *ts; - struct goodix_platform_data *pdata ; + #ifdef CONFIG_MACH_RK_FAC + struct tp_platform_data *pdata; + #else + struct goodix_platform_data *pdata ; + #endif printk(KERN_INFO "Install touch driver.\n"); if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) @@ -773,7 +777,11 @@ static int rk_ts_probe(struct i2c_client *client, const struct i2c_device_id *id pdata = client->dev.platform_data; ts->irq_pin = pdata->irq_pin; +#ifdef CONFIG_MACH_RK_FAC + ts->rst_pin = pdata->reset_pin; +#else ts->rst_pin = pdata->rest_pin; +#endif ts->pendown =PEN_RELEASE; ts->client = client; ts->ts_init = goodix_ts_init; diff --git a/drivers/net/wireless/wifi_sys/rkwifi_sys_iface.c b/drivers/net/wireless/wifi_sys/rkwifi_sys_iface.c index 9ef75ed99312..66b20b4aac36 100755 --- a/drivers/net/wireless/wifi_sys/rkwifi_sys_iface.c +++ b/drivers/net/wireless/wifi_sys/rkwifi_sys_iface.c @@ -10,7 +10,7 @@ #include #ifdef CONFIG_MACH_RK_FAC -#include +#include extern int wifi_type; #endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) diff --git a/drivers/video/rockchip/screen/rk_screen.c b/drivers/video/rockchip/screen/rk_screen.c index e0f9a2be23eb..c92339c5e5d9 100644 --- a/drivers/video/rockchip/screen/rk_screen.c +++ b/drivers/video/rockchip/screen/rk_screen.c @@ -5,7 +5,7 @@ #include "../hdmi/rk_hdmi.h" #endif #if defined(CONFIG_MACH_RK_FAC) -#include +#include extern uint lcd_param[LCD_PARAM_MAX]; #endif @@ -321,7 +321,7 @@ size_t get_fb_size(void) if(pchar!=NULL) { do{ - if(count==15) + if(count==13) { num=strcspn(pchar,","); for(i=0;i #ifdef CONFIG_MACH_RK_FAC -#include +#include extern int codec_type; #endif diff --git a/sound/soc/rk29/rk29_jetta_codec.c b/sound/soc/rk29/rk29_jetta_codec.c index 5c26663b7062..8f39dbaecf5f 100755 --- a/sound/soc/rk29/rk29_jetta_codec.c +++ b/sound/soc/rk29/rk29_jetta_codec.c @@ -23,7 +23,7 @@ #include "rk29_pcm.h" #include "rk29_i2s.h" #ifdef CONFIG_MACH_RK_FAC -#include +#include extern int codec_type; #endif diff --git a/sound/soc/rk29/rk29_rt5631.c b/sound/soc/rk29/rk29_rt5631.c index b5b87843390d..c230f63fc58a 100755 --- a/sound/soc/rk29/rk29_rt5631.c +++ b/sound/soc/rk29/rk29_rt5631.c @@ -24,7 +24,7 @@ #include "rk29_i2s.h" #ifdef CONFIG_MACH_RK_FAC -#include +#include extern int codec_type; #endif #if 0 -- 2.34.1