From 8eaff33d66e016329de9b4baebd5006e8694219b Mon Sep 17 00:00:00 2001 From: kfx Date: Tue, 6 Nov 2012 10:40:53 +0800 Subject: [PATCH] rk2928 defconfig: v86(v1.1) support --- arch/arm/configs/rk2928_defconfig | 1 + arch/arm/mach-rk2928/board-rk2928-config.c | 6 +- arch/arm/mach-rk2928/board-rk2928.c | 32 +++-- arch/arm/mach-rk2928/include/mach/config.h | 146 ++++++++++++++++++++- drivers/input/touchscreen/gt811_ts.c | 10 +- 5 files changed, 177 insertions(+), 18 deletions(-) mode change 100644 => 100755 arch/arm/mach-rk2928/include/mach/config.h diff --git a/arch/arm/configs/rk2928_defconfig b/arch/arm/configs/rk2928_defconfig index 33390033ffd5..634b00f5705f 100644 --- a/arch/arm/configs/rk2928_defconfig +++ b/arch/arm/configs/rk2928_defconfig @@ -241,6 +241,7 @@ CONFIG_INPUT_TOUCHSCREEN=y CONFIG_EETI_EGALAX=y CONFIG_EETI_EGALAX_MAX_X=1087 CONFIG_EETI_EGALAX_MAX_Y=800 +CONFIG_TOUCHSCREEN_GT811_IIC=y CONFIG_TOUCHSCREEN_I30=y CONFIG_TOUCHSCREEN_BYD693X=y CONFIG_TOUCHSCREEN_SITRONIX_A720=y diff --git a/arch/arm/mach-rk2928/board-rk2928-config.c b/arch/arm/mach-rk2928/board-rk2928-config.c index b7cde0fb3252..3d4ddcdbf7ee 100644 --- a/arch/arm/mach-rk2928/board-rk2928-config.c +++ b/arch/arm/mach-rk2928/board-rk2928-config.c @@ -115,10 +115,12 @@ static inline int check_usb_param(void) int inline otg_drv_init(int on) { if(otg_drv == -1){ + return 0; + }else if (get_port_config(otg_drv).gpio == RK2928_PIN3_PC1){ rk30_mux_api_set(GPIO3C1_OTG_DRVVBUS_NAME, GPIO3C_OTG_DRVVBUS); return 0; - } - return port_output_init(otg_drv, on, "otg_drv"); + }else + return port_output_init(otg_drv, on, "otg_drv"); } void inline otg_drv_on(void) { diff --git a/arch/arm/mach-rk2928/board-rk2928.c b/arch/arm/mach-rk2928/board-rk2928.c index 973931268811..dd5f6066a4bf 100755 --- a/arch/arm/mach-rk2928/board-rk2928.c +++ b/arch/arm/mach-rk2928/board-rk2928.c @@ -660,13 +660,7 @@ static struct rk30_adc_battery_platform_data rk30_adc_battery_platdata = { .batt_low_pin = INVALID_GPIO, .charge_set_pin = INVALID_GPIO, .charge_ok_pin = INVALID_GPIO, - - //.io_init = rk30_battery_adc_io_init, - #if defined(CONFIG_REGULATOR_ACT8931) - .is_dc_charging = rk30_battery_adc_is_dc_charging, - .charging_ok = rk30_battery_adc_charging_ok , - #endif - + .io_init = rk30_battery_adc_io_init, .charging_sleep = 0 , .save_capacity = 1 , }; @@ -684,10 +678,26 @@ static int __init chg_board_init(void) if(ret < 0) return ret; rk30_adc_battery_platdata.adc_channel = chg_adc; - rk30_adc_battery_platdata.dc_det_pin = get_port_config(dc_det).gpio; - rk30_adc_battery_platdata.batt_low_pin = get_port_config(bat_low).gpio; - rk30_adc_battery_platdata.charge_ok_pin = get_port_config(chg_ok).gpio; - rk30_adc_battery_platdata.charge_set_pin = get_port_config(chg_set).gpio; + if(dc_det != -1){ + rk30_adc_battery_platdata.dc_det_pin = get_port_config(dc_det).gpio; + rk30_adc_battery_platdata.dc_det_level = !get_port_config(dc_det).io.active_low; + } + if(bat_low != -1){ + rk30_adc_battery_platdata.batt_low_pin = get_port_config(bat_low).gpio; + rk30_adc_battery_platdata.batt_low_level = !get_port_config(bat_low).io.active_low; + } + if(chg_ok != -1){ + rk30_adc_battery_platdata.charge_ok_pin = get_port_config(chg_ok).gpio; + rk30_adc_battery_platdata.charge_ok_level = !get_port_config(chg_ok).io.active_low; + } + if(chg_set != -1){ + rk30_adc_battery_platdata.charge_set_pin = get_port_config(chg_set).gpio; + rk30_adc_battery_platdata.charge_set_level = !get_port_config(chg_set).io.active_low; + } + if(pmic_is_act8931()){ + rk30_adc_battery_platdata.is_dc_charging = rk30_battery_adc_is_dc_charging; + rk30_adc_battery_platdata.charging_ok = rk30_battery_adc_charging_ok; + }; return 0; } diff --git a/arch/arm/mach-rk2928/include/mach/config.h b/arch/arm/mach-rk2928/include/mach/config.h old mode 100644 new mode 100755 index 4f3b1a58a7e5..cb45ceadd247 --- a/arch/arm/mach-rk2928/include/mach/config.h +++ b/arch/arm/mach-rk2928/include/mach/config.h @@ -4,6 +4,7 @@ #define RK2926_TB_DEFAULT_CONFIG //#define RK2928_TB_DEFAULT_CONFIG +//#define RK2926_V86_DEFAULT_CONFIG //#define RK2926_SDK_DEFAULT_CONFIG //#define RK2928_SDK_DEFAULT_CONFIG //#define RK2928_PHONEPAD_DEFAULT_CONFIG @@ -85,7 +86,7 @@ enum{ }; /* usb */ enum { - DEF_OTG_DRV = -1, + DEF_OTG_DRV = 0x000003c1, DEF_HOST_DRV = 0x000002b4, }; /* lcd */ @@ -222,7 +223,7 @@ enum{ }; /* usb */ enum { - DEF_OTG_DRV = -1, + DEF_OTG_DRV = 0x000003c1, DEF_HOST_DRV = 0x000001b2, }; /* lcd */ @@ -472,6 +473,145 @@ enum { DEF_CHG_SEL = 0x000001a1, }; +/* global */ +enum { + DEF_IS_PHONEPAD = 0, + DEF_PWR_ON = 0x000001a2, +}; +/**************************** rk2926 sdk(v86) ******************************/ +#elif defined(RK2926_V86_DEFAULT_CONFIG) +/* keyboard */ +enum{ + DEF_KEY_ADC = 1, + DEF_PLAY_KEY = 0x000101a4, + DEF_VOLDN_KEY = 512 | (1<<31), + DEF_VOLUP_KEY = 1 | (1<<31), + DEF_MENU_KEY = 0 | (1<<31), + DEF_ESC_KEY = 0 | (1<<31), + DEF_HOME_KEY = 0 | (1<<31), + DEF_CAM_KEY = 0 | (1<<31), +}; +/* backlight */ +enum{ + DEF_BL_PWM = 0, + DEF_BL_REF = 0, + DEF_BL_MIN = 80, + DEF_BL_EN = 0x000003c1, +}; + +/* usb */ +enum { + DEF_OTG_DRV = -1, + DEF_HOST_DRV = -1, +}; +/* lcd */ +enum { + DEF_LCD_CABC = -1, + DEF_LCD_EN = 0x000101b3, + DEF_LCD_STD = -1, +}; + +#define DEF_LCD_PARAM {SCREEN_RGB, OUT_P666, \ + 33000000, 15000000, \ + 30, 10, 800, 210, \ + 13, 10, 480, 22, \ + 154, 85, \ + 0, 0 } +/* gsensor */ +enum { + DEF_GS_TYPE = GS_TYPE_MMA7660, + DEF_GS_I2C = 1, + DEF_GS_ADDR = 0x4c, + DEF_GS_IRQ = 0x008001b2, + DEF_GS_PWR = -1, +}; +#define DEF_GS_ORIG {0, 1, 0, 0, 0, -1, 1, 0, 0} +/* lsensor */ +enum { + DEF_LS_TYPE = LS_TYPE_NONE, + DEF_LS_I2C = -1, + DEF_LS_ADDR = -1, + DEF_LS_IRQ = -1, + DEF_LS_PWR = -1, +}; +/* psensor */ +enum { + DEF_PS_TYPE = PS_TYPE_NONE, + DEF_PS_I2C = -1, + DEF_PS_ADDR = -1, + DEF_PS_IRQ = -1, + DEF_PS_PWR = -1, +}; + +/* camera */ +enum { + DEF_FRONT_CAM_ID = CAM_ID_FRONT_SENSOR_0, + DEF_FRONT_CAM_I2C = 1, + DEF_FRONT_CAM_PWR = 0x000003b3, +}; +enum { + DEF_BACK_CAM_ID = -1, + DEF_BACK_CAM_I2C = -1, + DEF_BACK_CAM_PWR = -1, +}; + +/* pwm regulator */ +enum { + DEF_REG_PWM = 1, +}; +/* pmic */ +enum { + DEF_PMIC_TYPE = PMIC_TYPE_TPS65910, + DEF_PMIC_SLP = 0x000001a1, + DEF_PMIC_IRQ = 0x000001b1, + DEF_PMIC_I2C = 0, + DEF_PMIC_ADDR = 0x2d, +}; +/* tps656910_dcdc: vdd_cpu, vdd2, vdd3, vio + * tps65910_ldo: vdig1, vdig2, vaux1, vaux2, vaux33, vmmc, vdac, vpll + * act8931_dcdc: act_dcdc1, act_dcdc2, vdd_cpu + * act8931_ldo: act_ldo1, act_ldo2, act_ldo3, act_ldo4 + */ +#define DEF_TPS65910_DCDC {1200000,1200000,1200000,1200000,0,0,3300000,3300000} +#define DEF_TPS65910_LDO {1500000,1500000,1200000,1200000,2800000,2800000,3300000,3300000,3300000,3300000,3300000,3300000,0,0,0,0} +#define DEF_ACT8931_DCDC {3300000,3300000,1500000,1500000,1200000,1200000} +#define DEF_ACT8931_LDO {2800000,2800000,1800000,1800000,3000000,3000000,3300000,3300000} +/* ion */ +enum { + DEF_ION_SIZE = 80 * 1024 * 1024, +}; +/* codec */ +enum { + DEF_SPK_CTL = 0x000001a0, + DEF_HP_DET = -1, +}; +/* sdmmc */ +enum { + DEF_SD_DET = 0x000102a7, +}; +/* wifi */ +enum { + DEF_WIFI_RST = -1, + DEF_WIFI_PWR = -1, + DEF_WIFI_TYPE = WIFI_NONE, + DEF_WIFI_LDO = 5, +}; +/* rtc */ +enum { + DEF_RTC_I2C = 0, + DEF_RTC_ADDR = 0x51, + DEF_RTC_IRQ = -1, +}; +/* charge */ +enum { + DEF_CHG_ADC = 0, + DEF_DC_DET = 0x001101a5, + DEF_BAT_LOW = -1, + DEF_CHG_OK = -1, + DEF_CHG_SET = -1, + DEF_CHG_SEL = -1, +}; + /* global */ enum { DEF_IS_PHONEPAD = 0, @@ -637,7 +777,7 @@ enum{ }; /* usb */ enum { - DEF_OTG_DRV = -1, + DEF_OTG_DRV = 0x000003c1, DEF_HOST_DRV = -1, }; /* lcd */ diff --git a/drivers/input/touchscreen/gt811_ts.c b/drivers/input/touchscreen/gt811_ts.c index dacac778b182..b06628722b12 100755 --- a/drivers/input/touchscreen/gt811_ts.c +++ b/drivers/input/touchscreen/gt811_ts.c @@ -56,11 +56,17 @@ enum { #if defined(RK2928_SDK_DEFAULT_CONFIG) DEF_EN = 1, + DEF_IRQ = 0x008003c7, + DEF_RST = 0X000003c3, +#elif defined(RK2926_V86_DEFAULT_CONFIG) + DEF_EN = 1, + DEF_IRQ = 0x008001b0, + DEF_RST = 0X000000d3, #else DEF_EN = 0, + DEF_IRQ = -1, + DEF_RST = -1, #endif - DEF_IRQ = 0x008003c7, - DEF_RST = 0X000003c3, DEF_I2C = 2, DEF_ADDR = 0x5d, DEF_X_MAX = 800, -- 2.34.1