return -1;
}
#if defined(CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910)
- {
- gpio_direction_output(PWM_GPIO, GPIO_LOW);
- }
+ if (pmic_is_tps65910() )
+ gpio_direction_output(PWM_GPIO, GPIO_LOW);
#endif
#if defined(CONFIG_REGULATOR_ACT8931)
- if(g_pmic_type == PMIC_TYPE_ACT8931)
- {
- gpio_direction_output(PWM_GPIO, GPIO_HIGH);
- }
+ if (pmic_is_act8931() )
+ gpio_direction_output(PWM_GPIO, GPIO_HIGH);
#endif
#ifdef LCD_DISP_ON_PIN
gpio_direction_output(BL_EN_PIN, 0);
{
#if 0//defined(CONFIG_REGULATOR_ACT8931)
- if(g_pmic_type == PMIC_TYPE_ACT8931)
- {
+ if (pmic_is_act8931() ){
struct regulator *ldo;
ldo = regulator_get(NULL, "act_ldo4"); //vcc_lcd
regulator_disable(ldo);
static int rk_fb_io_enable(void)
{
#if 0//defined(CONFIG_REGULATOR_ACT8931)
- if(g_pmic_type == PMIC_TYPE_ACT8931)
- {
+ if (pmic_is_act8931() ){
struct regulator *ldo;
ldo = regulator_get(NULL, "act_ldo4"); //vcc_lcd
regulator_enable(ldo);
struct regulator *ldo = NULL;
#if defined(CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910) {
+ if (pmic_is_tps65910() )
ldo = regulator_get(NULL, "vmmc"); //vccio_wl
- }
#endif
#if defined(CONFIG_REGULATOR_ACT8931)
- if(g_pmic_type == PMIC_TYPE_ACT8931) {
+ if(pmic_is_act8931() )
ldo = regulator_get(NULL, "act_ldo4"); //vccio_wl
- }
#endif
if(on) {
void __sramfunc board_pmu_suspend(void)
{
#if defined (CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910)
- board_pmu_tps65910_suspend();
+ if(pmic_is_tps65910() )
+ board_pmu_tps65910_suspend();
#endif
}
void __sramfunc board_pmu_resume(void)
{
#if defined (CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910)
- board_pmu_tps65910_resume();
+ if(pmic_is_tps65910() )
+ board_pmu_tps65910_resume();
#endif
}
printk(KERN_ERR "rk2928_pm_power_off start...\n");
#if defined(CONFIG_REGULATOR_ACT8931)
- if(g_pmic_type == PMIC_TYPE_ACT8931)
- {
+ if (pmic_is_act8931() ){
if(act8931_charge_det)
arm_pm_restart(0, NULL);
- }
+ }
#endif
#if defined(CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910)
- {
+ if(pmic_is_tps65910() )
tps65910_device_shutdown();//tps65910 shutdown
- }
#endif
gpio_direction_output(POWER_ON_PIN, GPIO_LOW);
return -1;
}
#if defined(CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910)
+ if(pmic_is_tps65910())
{
gpio_direction_output(PWM_GPIO, GPIO_LOW);
}
#endif
#if defined(CONFIG_REGULATOR_ACT8931)
- if(g_pmic_type == PMIC_TYPE_ACT8931)
+ if(pmic_is_act8931())
{
gpio_direction_output(PWM_GPIO, GPIO_HIGH);
}
{
#if 0//defined(CONFIG_REGULATOR_ACT8931)
- if(g_pmic_type == PMIC_TYPE_ACT8931)
+ if(pmic_is_act8931())
{
struct regulator *ldo;
ldo = regulator_get(NULL, "act_ldo4"); //vcc_lcd
static int rk_fb_io_enable(void)
{
#if 0//defined(CONFIG_REGULATOR_ACT8931)
- if(g_pmic_type == PMIC_TYPE_ACT8931)
+ if(pmic_is_act8931())
{
struct regulator *ldo;
ldo = regulator_get(NULL, "act_ldo4"); //vcc_lcd
struct regulator *ldo = NULL;
#if defined(CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910) {
+ if(pmic_is_tps65910()) {
ldo = regulator_get(NULL, "vmmc"); //vccio_wl
}
#endif
#if defined(CONFIG_REGULATOR_ACT8931)
- if(g_pmic_type == PMIC_TYPE_ACT8931) {
+ if(pmic_is_act8931()) {
ldo = regulator_get(NULL, "act_ldo4"); //vccio_wl
}
#endif
void __sramfunc board_pmu_suspend(void)
{
#if defined (CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910)
+ if(pmic_is_tps65910())
board_pmu_tps65910_suspend();
#endif
}
void __sramfunc board_pmu_resume(void)
{
#if defined (CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910)
+ if(pmic_is_tps65910())
board_pmu_tps65910_resume();
#endif
}
printk(KERN_ERR "rk2928_pm_power_off start...\n");
#if defined(CONFIG_REGULATOR_ACT8931)
- if(g_pmic_type == PMIC_TYPE_ACT8931)
+ if(pmic_is_act8931())
{
if(act8931_charge_det)
arm_pm_restart(0, NULL);
#endif
#if defined(CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910)
+ if(pmic_is_tps65910())
{
tps65910_device_shutdown();//tps65910 shutdown
}
#include "board-rk2928-sdk-key.c"\r
\r
int __sramdata g_pmic_type = 0;\r
-#define PMIC_TYPE_TPS65910 2\r
-#define PMIC_TYPE_ACT8931 3\r
\r
#ifdef CONFIG_THREE_FB_BUFFER\r
#define RK30_FB0_MEM_SIZE 12*SZ_1M\r
return -1;\r
}\r
#if defined(CONFIG_MFD_TPS65910) \r
- if(g_pmic_type == PMIC_TYPE_TPS65910)\r
+ if(pmic_is_tps65910())\r
{\r
gpio_direction_output(PWM_GPIO, GPIO_LOW);\r
}\r
#endif\r
#if defined(CONFIG_REGULATOR_ACT8931)\r
- if(g_pmic_type == PMIC_TYPE_ACT8931)\r
+ if(pmic_is_act8931())\r
{\r
gpio_direction_output(PWM_GPIO, GPIO_HIGH);\r
}\r
{\r
\r
#if 0//defined(CONFIG_REGULATOR_ACT8931)\r
- if(g_pmic_type == PMIC_TYPE_ACT8931)\r
+ if(pmic_is_act8931())\r
{\r
struct regulator *ldo;\r
ldo = regulator_get(NULL, "act_ldo4"); //vcc_lcd\r
static int rk_fb_io_enable(void)\r
{\r
#if 0//defined(CONFIG_REGULATOR_ACT8931)\r
- if(g_pmic_type == PMIC_TYPE_ACT8931)\r
+ if(pmic_is_act8931())\r
{\r
struct regulator *ldo;\r
ldo = regulator_get(NULL, "act_ldo4"); //vcc_lcd\r
struct regulator *ldo = NULL;\r
\r
#if defined(CONFIG_MFD_TPS65910) \r
- if(g_pmic_type == PMIC_TYPE_TPS65910) {\r
+ if(pmic_is_tps65910()) {\r
ldo = regulator_get(NULL, "vmmc"); //vccio_wl\r
}\r
#endif\r
#if defined(CONFIG_REGULATOR_ACT8931)\r
- if(g_pmic_type == PMIC_TYPE_ACT8931) {\r
+ if(pmic_is_act8931()) {\r
ldo = regulator_get(NULL, "act_ldo4"); //vccio_wl\r
}\r
#endif \r
void __sramfunc board_pmu_suspend(void)\r
{ \r
#if defined (CONFIG_MFD_TPS65910)\r
- if(g_pmic_type == PMIC_TYPE_TPS65910)\r
+ if(pmic_is_tps65910())\r
board_pmu_tps65910_suspend(); \r
#endif \r
}\r
void __sramfunc board_pmu_resume(void)\r
{ \r
#if defined (CONFIG_MFD_TPS65910)\r
- if(g_pmic_type == PMIC_TYPE_TPS65910)\r
+ if(pmic_is_tps65910())\r
board_pmu_tps65910_resume(); \r
#endif\r
}\r
printk(KERN_ERR "rk2928_pm_power_off start...\n");\r
\r
#if defined(CONFIG_REGULATOR_ACT8931)\r
- if(g_pmic_type == PMIC_TYPE_ACT8931)\r
+ if(pmic_is_act8931())\r
{\r
#ifdef CONFIG_BATTERY_RK30_ADC_FAC\r
if (gpio_get_value (rk30_adc_battery_platdata.dc_det_pin) == rk30_adc_battery_platdata.dc_det_level)//if(act8931_charge_det)\r
#endif\r
\r
#if defined(CONFIG_MFD_TPS65910) \r
- if(g_pmic_type == PMIC_TYPE_TPS65910)\r
+ if(pmic_is_tps65910())\r
{\r
tps65910_device_shutdown();//tps65910 shutdown\r
}\r
#include "board-rk2928-a720-key.c"
int __sramdata g_pmic_type = 0;
-#define PMIC_TYPE_TPS65910 2
-#define PMIC_TYPE_ACT8931 3
#ifdef CONFIG_THREE_FB_BUFFER
#define RK30_FB0_MEM_SIZE 12*SZ_1M
return -1;
}
#if defined(CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910)
+ if(pmic_is_tps65910())
{
gpio_direction_output(PWM_GPIO, GPIO_LOW);
}
#endif
#if defined(CONFIG_REGULATOR_ACT8931)
- if(g_pmic_type == PMIC_TYPE_ACT8931)
+ if(pmic_is_act8931())
{
gpio_direction_output(PWM_GPIO, GPIO_HIGH);
}
{
#if 0//defined(CONFIG_REGULATOR_ACT8931)
- if(g_pmic_type == PMIC_TYPE_ACT8931)
+ if(pmic_is_act8931())
{
struct regulator *ldo;
ldo = regulator_get(NULL, "act_ldo4"); //vcc_lcd
static int rk_fb_io_enable(void)
{
#if 0//defined(CONFIG_REGULATOR_ACT8931)
- if(g_pmic_type == PMIC_TYPE_ACT8931)
+ if(pmic_is_act8931())
{
struct regulator *ldo;
ldo = regulator_get(NULL, "act_ldo4"); //vcc_lcd
struct regulator *ldo = NULL;
#if defined(CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910) {
+ if(pmic_is_tps65910()) {
ldo = regulator_get(NULL, "vmmc"); //vccio_wl
}
#endif
#if defined(CONFIG_REGULATOR_ACT8931)
- if(g_pmic_type == PMIC_TYPE_ACT8931) {
+ if(pmic_is_act8931()) {
ldo = regulator_get(NULL, "act_ldo4"); //vccio_wl
}
#endif
printk(KERN_ERR "rk2928_pm_power_off start...\n");
#if defined(CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910)
+ if(pmic_is_tps65910())
{
tps65910_device_shutdown();//tps65910 shutdown
}
sram_i2c_disenable();
return data;
}
-extern int __sramdata g_pmic_type ;
+
void __sramfunc rk30_suspend_voltage_set(unsigned int vol)
{
uint8 slaveaddr;
uint8 rtc_status_reg = 0x11;
sram_i2c_init(); //init i2c device
#if defined(CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910)
+ if(pmic_is_tps65910())
{
slaveaddr = 0x2d; //slave device addr
slavereg = 0x22; // reg addr
#endif
#if defined(CONFIG_REGULATOR_ACT8931)
- if(g_pmic_type == PMIC_TYPE_ACT8931)
+ if(pmic_is_act8931())
{
slaveaddr = 0x5b; //slave device addr
slavereg = 0x40; // reg addr
data = arm_voltage;
sram_i2c_init(); //init i2c device
#if defined(CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910)
+ if(pmic_is_tps65910())
{
slaveaddr = 0x2d; //slave device addr
slavereg = 0x22; // reg add
}
#endif
#if defined(CONFIG_REGULATOR_ACT8931)
- if(g_pmic_type == PMIC_TYPE_ACT8931)
+ if(pmic_is_act8931())
{
slaveaddr = 0x5b; //slave device addr
slavereg = 0x40; // reg addr
#define GPIO_SWPORTA_DR 0x0000
#define GPIO_SWPORTA_DDR 0x0004
-#define PMIC_TYPE_TPS65910 2
-#define PMIC_TYPE_ACT8931 3
-
extern struct rk29_sdmmc_platform_data default_sdmmc0_data;
extern struct rk29_sdmmc_platform_data default_sdmmc1_data;
};
#endif
-#define PMIC_TYPE_WM8326 1
-#define PMIC_TYPE_TPS65910 2
int __sramdata g_pmic_type = 0;
#ifdef CONFIG_I2C1_RK30
#ifdef CONFIG_MFD_WM831X_I2C
void __sramfunc board_pmu_suspend(void)
{
#if defined (CONFIG_MFD_WM831X_I2C)
- if(g_pmic_type == PMIC_TYPE_WM8326)
+ if(pmic_is_wm8326())
board_pmu_wm8326_suspend();
#endif
#if defined (CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910)
+ if(pmic_is_tps65910())
board_pmu_tps65910_suspend();
#endif
}
void __sramfunc board_pmu_resume(void)
{
#if defined (CONFIG_MFD_WM831X_I2C)
- if(g_pmic_type == PMIC_TYPE_WM8326)
+ if(pmic_is_wm8326())
board_pmu_wm8326_resume();
#endif
#if defined (CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910)
+ if(pmic_is_tps65910())
board_pmu_tps65910_resume();
#endif
}
}
#endif
#if defined(CONFIG_MFD_WM831X)
- if(g_pmic_type == PMIC_TYPE_WM8326)
+ if(pmic_is_wm8326())
{
wm831x_set_bits(Wm831x,WM831X_GPIO_LEVEL,0x0001,0x0000); //set sys_pwr 0
wm831x_device_shutdown(Wm831x);//wm8326 shutdown
}
#endif
#if defined(CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910)
+ if(pmic_is_tps65910())
{
tps65910_device_shutdown();//tps65910 shutdown
}
};
#endif
-#define PMIC_TYPE_WM8326 1
-#define PMIC_TYPE_TPS65910 2
int __sramdata g_pmic_type = 0;
#ifdef CONFIG_I2C1_RK30
#ifdef CONFIG_MFD_WM831X_I2C
void __sramfunc board_pmu_suspend(void)
{
#if defined (CONFIG_MFD_WM831X_I2C)
- if(g_pmic_type == PMIC_TYPE_WM8326)
+ if(pmic_is_wm8326())
board_pmu_wm8326_suspend();
#endif
#if defined (CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910)
+ if(pmic_is_tps65910())
board_pmu_tps65910_suspend();
#endif
}
void __sramfunc board_pmu_resume(void)
{
#if defined (CONFIG_MFD_WM831X_I2C)
- if(g_pmic_type == PMIC_TYPE_WM8326)
+ if(pmic_is_wm8326())
board_pmu_wm8326_resume();
#endif
#if defined (CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910)
+ if(pmic_is_tps65910())
board_pmu_tps65910_resume();
#endif
}
printk(KERN_ERR "rk30_pm_power_off start...\n");
gpio_direction_output(POWER_ON_PIN, GPIO_LOW);
#if defined(CONFIG_MFD_WM831X)
- if(g_pmic_type == PMIC_TYPE_WM8326)
+ if(pmic_is_wm8326())
{
wm831x_set_bits(Wm831x,WM831X_GPIO_LEVEL,0x0001,0x0000); //set sys_pwr 0
wm831x_device_shutdown(Wm831x);//wm8326 shutdown
}
#endif
#if defined(CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910)
+ if(pmic_is_tps65910())
{
tps65910_device_shutdown();//tps65910 shutdown
}
};
#endif
-#define PMIC_TYPE_WM8326 1
-#define PMIC_TYPE_TPS65910 2
int __sramdata g_pmic_type = 0;
#ifdef CONFIG_I2C1_RK30
#ifdef CONFIG_MFD_WM831X_I2C
void __sramfunc board_pmu_suspend(void)
{
#if defined (CONFIG_MFD_WM831X_I2C)
- if(g_pmic_type == PMIC_TYPE_WM8326)
+ if(pmic_is_wm8326())
board_pmu_wm8326_suspend();
#endif
#if defined (CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910)
+ if(pmic_is_tps65910())
board_pmu_tps65910_suspend();
#endif
}
void __sramfunc board_pmu_resume(void)
{
#if defined (CONFIG_MFD_WM831X_I2C)
- if(g_pmic_type == PMIC_TYPE_WM8326)
+ if(pmic_is_wm8326())
board_pmu_wm8326_resume();
#endif
#if defined (CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910)
+ if(pmic_is_tps65910())
board_pmu_tps65910_resume();
#endif
}
};
#endif
-#define PMIC_TYPE_WM8326 1
-#define PMIC_TYPE_TPS65910 2
int __sramdata g_pmic_type = 0;
#ifdef CONFIG_I2C1_RK30
#ifdef CONFIG_MFD_WM831X_I2C
void __sramfunc board_pmu_suspend(void)
{
#if defined (CONFIG_MFD_WM831X_I2C)
- if(g_pmic_type == PMIC_TYPE_WM8326)
+ if(pmic_is_wm8326())
board_pmu_wm8326_suspend();
#endif
#if defined (CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910)
+ if(pmic_is_tps65910())
board_pmu_tps65910_suspend();
#endif
}
void __sramfunc board_pmu_resume(void)
{
#if defined (CONFIG_MFD_WM831X_I2C)
- if(g_pmic_type == PMIC_TYPE_WM8326)
+ if(pmic_is_wm8326())
board_pmu_wm8326_resume();
#endif
#if defined (CONFIG_MFD_TPS65910)
- if(g_pmic_type == PMIC_TYPE_TPS65910)
+ if(pmic_is_tps65910())
board_pmu_tps65910_resume();
#endif
}
#include <linux/init.h>
#include <linux/device.h>
#include <linux/rk_screen.h>
+#include <plat/sram.h>
+
enum {
I2C_IDLE = 0,
int (*io_init)(void);
};
-
+enum {
+ PMIC_TYPE_NOE =0,
+ PMIC_TYPE_WM8326 =1,
+ PMIC_TYPE_TPS65910 =2,
+ PMIC_TYPE_ACT8931 =3,
+ PMIC_TYPE_MAX,
+};
+extern __sramdata int g_pmic_type;
+#define pmic_is_wm8326() (g_pmic_type == PMIC_TYPE_WM8326)
+#define pmic_is_tps65910() (g_pmic_type == PMIC_TYPE_TPS65910)
+#define pmic_is_act8931() (g_pmic_type == PMIC_TYPE_ACT8931)
struct rk29_fb_setting_info {
u8 data_num;