rk2928_defconfig: support 'rk2928 top board'

This commit is contained in:
kfx
2012-10-23 10:58:27 +08:00
parent 98fee4c608
commit 21c2aa159e
5 changed files with 132 additions and 5 deletions

View File

@@ -259,14 +259,15 @@ static int chg_set = -1;
module_param(chg_set, int, 0644);
static int chg_sel = -1;
module_param(chg_sel, int, 0644);
static inline int check_charge_param(void)
static inline int check_chg_param(void)
{
return 0;
}
/* dvfs */
static struct dvfs_arm_table dvfs_cpu_logic_table[] = {
#if defined(RK2926_TB_DEFAULT_CONFIG)
//#if defined(RK2926_TB_DEFAULT_CONFIG)
#if 1
{.frequency = 216 * 1000, .cpu_volt = 1200 * 1000, .logic_volt = 1200 * 1000},
{.frequency = 312 * 1000, .cpu_volt = 1200 * 1000, .logic_volt = 1200 * 1000},
{.frequency = 408 * 1000, .cpu_volt = 1200 * 1000, .logic_volt = 1200 * 1000},

View File

@@ -604,7 +604,6 @@ static struct rk30_adc_battery_platform_data rk30_adc_battery_platdata = {
.charging_sleep = 0 ,
.save_capacity = 1 ,
.adc_channel = 0 ,
};
static struct platform_device rk30_device_adc_battery = {
@@ -614,6 +613,19 @@ static struct platform_device rk30_device_adc_battery = {
.platform_data = &rk30_adc_battery_platdata,
},
};
static int __init chg_board_init(void)
{
int ret = check_chg_param();
if(ret < 0)
return ret;
rk30_adc_battery_platdata.adc_channel = chg_adc;
return 0;
}
#else
static int __init chg_board_init(void)
{
return 0;
}
#endif
static struct platform_device *devices[] __initdata = {
@@ -937,6 +949,9 @@ static int __init rk2928_config_init(void)
if(ret < 0)
return ret;
ret = sdmmc_board_init();
if(ret < 0)
return ret;
ret = chg_board_init();
if(ret < 0)
return ret;
return 0;

View File

@@ -3,7 +3,10 @@
#include <mach/board.h>
#define RK2926_TB_DEFAULT_CONFIG
//#define RK2928_TB_DEFAULT_CONFIG
//#define RK2926_SDK_DEFAULT_CONFIG
//#define RK2928_SDK_DEFAULT_CONFIG
enum {
WIFI_NONE = 0,
WIFI_USB_NONE = 1<<4,
@@ -20,6 +23,7 @@ enum {
DEF_AP_MULTI_CARD = -1,
DEF_AP_DATA_ONLY = -1,
};
/**************************** rk2926 top board ******************************/
#if defined(RK2926_TB_DEFAULT_CONFIG)
/* keyboard */
@@ -108,7 +112,7 @@ enum {
};
/* charge */
enum {
DEF_CHG_ADC = 0,
DEF_CHG_ADC = -1,
DEF_DC_DET = -1,
DEF_BAT_LOW = -1,
DEF_CHG_OK = -1,
@@ -120,6 +124,106 @@ enum {
enum {
DEF_PWR_ON = 0x000001a2,
};
/**************************** rk2928 top board ******************************/
#elif defined(RK2928_TB_DEFAULT_CONFIG)
/* keyboard */
enum{
DEF_KEY_ADC = 1,
DEF_PLAY_KEY = 0x000103c5,
DEF_VOLDN_KEY = 0x000100d1,
DEF_VOLUP_KEY = 1 | (1<<31),
DEF_MENU_KEY = 135 | (1<<31),
DEF_ESC_KEY = 334 | (1<<31),
DEF_HOME_KEY = 550 | (1<<31),
DEF_CAM_KEY = 700 | (1<<31),
};
/* backlight */
enum{
DEF_BL_PWM = 0,
DEF_BL_REF = 1,
DEF_BL_MIN = 60,
DEF_BL_EN = 0x000003c4,
};
/* lcd */
enum {
DEF_LCD_CABC = 0x000002d1,
DEF_LCD_EN = -1,
DEF_LCD_STD = -1,
};
#define DEF_LCD_PARAM {SCREEN_LVDS, OUT_D888_P666, \
65000000, 30000000, \
10, 100, 1024, 210, \
10, 10, 768, 18, \
202, 102, \
1, 0 }
/* gsensor */
enum {
GS_TYPE_NONE = 0,
GS_TYPE_MMA8452,
GS_TYPE_MMA7660,
GS_TYPE_MAX,
};
enum {
DEF_GS_TYPE = GS_TYPE_MMA8452,
DEF_GS_I2C = 0,
DEF_GS_ADDR = 0x1d,
DEF_GS_IRQ = 0x008003d1,
DEF_GS_PWR = -1,
};
#define DEF_GS_ORIG {-1, 0, 0, 0, 0, 1, 0,-1, 0}
/* pwm regulator */
enum {
DEF_REG_PWM = 1,
};
/* pmic */
enum {
DEF_PMIC_TYPE = PMIC_TYPE_TPS65910,
DEF_PMIC_SLP = 0x000003d2,
DEF_PMIC_IRQ = 0x000003c6,
DEF_PMIC_I2C = 1,
DEF_PMIC_ADDR = 0x2d,
};
/* ion */
enum {
DEF_ION_SIZE = 80 * 1024 * 1024,
};
/* codec */
enum {
DEF_SPK_CTL = 0x000003d4,
DEF_HP_DET = -1,
};
/* sdmmc */
enum {
DEF_SD_DET = 0x000101c1,
};
/* wifi */
enum {
DEF_WIFI_RST = -1,
DEF_WIFI_PWR = -1,
DEF_WIFI_TYPE = WIFI_NONE,
};
/* rtc */
enum {
DEF_RTC_I2C = 0,
DEF_RTC_ADDR = 0x51,
DEF_RTC_IRQ = -1,
};
/* charge */
enum {
DEF_CHG_ADC = -1,
DEF_DC_DET = -1,
DEF_BAT_LOW = -1,
DEF_CHG_OK = -1,
DEF_CHG_SET = -1,
DEF_CHG_SEL = -1,
};
/* global */
enum {
DEF_PWR_ON = 0x000003c5,
};
/**************************** rk2926 sdk(m713) ******************************/
#elif defined(RK2926_SDK_DEFAULT_CONFIG)

View File

@@ -45,6 +45,8 @@ struct adc_client *adc_register(int chn,
struct adc_client *client = NULL;
struct adc_host *adc = NULL;
if(chn < 0)
return NULL;
list_for_each_entry(adc, &adc_host_head, entry) {
if((chn == 0 && adc->mask == SARADC_CHN_MASK) ||
(chn & adc->mask)){

View File

@@ -53,13 +53,18 @@
#ifdef CONFIG_RK_CONFIG
enum {
#ifdef RK2926_TB_DEFAULT_CONFIG
#if defined(RK2926_TB_DEFAULT_CONFIG) || defined(RK2928_TB_DEFAULT_CONFIG)
DEF_EN = 1,
#else
DEF_EN = 0,
#endif
#if defined(RK2926_TB_DEFAULT_CONFIG)
DEF_IRQ = 0x008001b0,
DEF_RST = 0X000002b0,
#elif defined(RK2928_TB_DEFAULT_CONFIG)
DEF_IRQ = 0x008003c7,
DEF_RST = 0X000003c3,
#endif
DEF_I2C = 2,
DEF_ADDR = 0x04,
DEF_X_MAX = 1087,