};
#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
#include "board-rk30-sdk-wm8326.c"
};
#endif
+
+void __sramfunc board_pmu_suspend(void)
+{
+ if(g_pmic_type == PMIC_TYPE_WM8326)
+ board_pmu_wm8326_suspend();
+ else if(g_pmic_type == PMIC_TYPE_TPS65910)
+ board_pmu_tps65910_suspend();
+
+}
+
+void __sramfunc board_pmu_resume(void)
+{
+ if(g_pmic_type == PMIC_TYPE_WM8326)
+ board_pmu_wm8326_resume();
+ else if(g_pmic_type == PMIC_TYPE_TPS65910)
+ board_pmu_tps65910_resume();
+}
+
+
#ifdef CONFIG_I2C2_RK30
static struct i2c_board_info __initdata i2c2_info[] = {
#if defined (CONFIG_TOUCHSCREEN_GT8XX)
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
-#else
-#if defined(CONFIG_MFD_TPS65910)
- tps65910_device_shutdown();//tps65910 shutdown
-#endif
-#endif
+ #if defined(CONFIG_MFD_WM831X)
+ if(g_pmic_type == PMIC_TYPE_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)
+ {
+ tps65910_device_shutdown();//tps65910 shutdown
+ }
+ #endif
gpio_direction_output(POWER_ON_PIN, GPIO_LOW);
while(1);
}
struct regulator *ldo;
printk("%s,line=%d\n", __func__,__LINE__);
+ g_pmic_type = PMIC_TYPE_TPS65910;
+ printk("%s:g_pmic_type=%d\n",__func__,g_pmic_type);
+
dcdc = regulator_get(NULL, "vio"); //vcc_io
regulator_set_voltage(dcdc, 3000000, 3000000);
regulator_enable(dcdc);
.consumer_supplies = tps65910_ldo8_supply,
};
-void __sramfunc board_pmu_suspend(void)
+void __sramfunc board_pmu_tps65910_suspend(void)
{
grf_writel(GPIO6_PB1_DIR_OUT, GRF_GPIO6L_DIR_ADDR);
grf_writel(GPIO6_PB1_DO_HIGH, GRF_GPIO6L_DO_ADDR); //set gpio6_b1 output low
grf_writel(GPIO6_PB1_EN_MASK, GRF_GPIO6L_EN_ADDR);
}
-void __sramfunc board_pmu_resume(void)
+void __sramfunc board_pmu_tps65910_resume(void)
{
grf_writel(GPIO6_PB1_DIR_OUT, GRF_GPIO6L_DIR_ADDR);
grf_writel(GPIO6_PB1_DO_LOW, GRF_GPIO6L_DO_ADDR); //set gpio6_b1 output low
struct regulator *dcdc;
struct regulator *ldo;
-
+
+ g_pmic_type = PMIC_TYPE_WM8326;
+ printk("%s:g_pmic_type=%d\n",__func__,g_pmic_type);
+
ldo = regulator_get(NULL, "ldo6"); //vcc_33
regulator_set_voltage(ldo, 3300000, 3300000);
regulator_set_suspend_voltage(ldo, 3300000);
return 0;
}
-void __sramfunc board_pmu_suspend(void)
+void __sramfunc board_pmu_wm8326_suspend(void)
{
cru_writel(CRU_CLKGATE5_GRFCLK_ON,CRU_CLKGATE5_CON_ADDR); //open grf clk
grf_writel(GPIO6_PB1_DIR_OUT, GRF_GPIO6L_DIR_ADDR);
grf_writel(GPIO6_PB1_DO_HIGH, GRF_GPIO6L_DO_ADDR); //set gpio6_b1 output low
grf_writel(GPIO6_PB1_EN_MASK, GRF_GPIO6L_EN_ADDR);
}
-void __sramfunc board_pmu_resume(void)
+void __sramfunc board_pmu_wm8326_resume(void)
{
grf_writel(GPIO6_PB1_DIR_OUT, GRF_GPIO6L_DIR_ADDR);
grf_writel(GPIO6_PB1_DO_LOW, GRF_GPIO6L_DO_ADDR); //set gpio6_b1 output high
sram_udelay(10000);
#endif
}
+
static struct wm831x_pdata wm831x_platdata = {
/** Called before subdevices are set up */
};
#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
#include "board-rk30-sdk-wm8326.c"
+#endif
+#ifdef CONFIG_MFD_TPS65910
+#define TPS65910_HOST_IRQ RK30_PIN6_PA4
+#include "board-rk30-sdk-tps65910.c"
+#endif
static struct i2c_board_info __initdata i2c1_info[] = {
#if defined (CONFIG_MFD_WM831X_I2C)
.platform_data = &wm831x_platdata,
},
#endif
+#if defined (CONFIG_MFD_TPS65910)
+ {
+ .type = "tps65910",
+ .addr = TPS65910_I2C_ID0,
+ .flags = 0,
+ .irq = TPS65910_HOST_IRQ,
+ .platform_data = &tps65910_data,
+ },
+#endif
};
#endif
+
+void __sramfunc board_pmu_suspend(void)
+{
+ if(g_pmic_type == PMIC_TYPE_WM8326)
+ board_pmu_wm8326_suspend();
+ else if(g_pmic_type == PMIC_TYPE_TPS65910)
+ board_pmu_tps65910_suspend();
+
+}
+
+void __sramfunc board_pmu_resume(void)
+{
+ if(g_pmic_type == PMIC_TYPE_WM8326)
+ board_pmu_wm8326_resume();
+ else if(g_pmic_type == PMIC_TYPE_TPS65910)
+ board_pmu_tps65910_resume();
+}
+
#ifdef CONFIG_I2C2_RK30
static struct i2c_board_info __initdata i2c2_info[] = {
#if defined (CONFIG_TOUCHSCREEN_GT8XX)
{
printk(KERN_ERR "rk30_pm_power_off start...\n");
gpio_direction_output(POWER_ON_PIN, GPIO_LOW);
-#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
+ #if defined(CONFIG_MFD_WM831X)
+ if(g_pmic_type == PMIC_TYPE_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)
+ {
+ tps65910_device_shutdown();//tps65910 shutdown
+ }
+ #endif
+
while (1);
}