int i = 0;
printk("%s,line=%d\n", __func__,__LINE__);
- #ifdef CONFIG_RK_CONFIG
- if(sram_gpio_init(get_port_config(pmic_slp).gpio, &pmic_sleep) < 0){
- printk(KERN_ERR "sram_gpio_init failed\n");
- return -EINVAL;
- }
- if(port_output_init(pmic_slp, 0, "pmic_slp") < 0){
- printk(KERN_ERR "port_output_init failed\n");
- return -EINVAL;
- }
- #else
- if(sram_gpio_init(PMU_POWER_SLEEP, &pmic_sleep) < 0){
- printk(KERN_ERR "sram_gpio_init failed\n");
- return -EINVAL;
- }
-
- gpio_request(PMU_POWER_SLEEP, "NULL");
- gpio_direction_output(PMU_POWER_SLEEP, GPIO_LOW);
- #endif
-
-
#ifndef CONFIG_RK_CONFIG
g_pmic_type = PMIC_TYPE_ACT8846;
#endif
regulator_put(ldo);
}
+ #ifdef CONFIG_RK_CONFIG
+ if(sram_gpio_init(get_port_config(pmic_slp).gpio, &pmic_sleep) < 0){
+ printk(KERN_ERR "sram_gpio_init failed\n");
+ return -EINVAL;
+ }
+ if(port_output_init(pmic_slp, 0, "pmic_slp") < 0){
+ printk(KERN_ERR "port_output_init failed\n");
+ return -EINVAL;
+ }
+ #else
+ if(sram_gpio_init(PMU_POWER_SLEEP, &pmic_sleep) < 0){
+ printk(KERN_ERR "sram_gpio_init failed\n");
+ return -EINVAL;
+ }
+ gpio_request(PMU_POWER_SLEEP, "NULL");
+ gpio_direction_output(PMU_POWER_SLEEP, GPIO_LOW);
+
+ #ifdef CONFIG_ACT8846_SUPPORT_RESET
+ if(sram_gpio_init(PMU_VSEL, &pmic_vsel) < 0){
+ printk(KERN_ERR "sram_gpio_init failed\n");
+ return -EINVAL;
+ }
+ rk30_mux_api_set(GPIO3D3_PWM0_NAME,GPIO3D_GPIO3D3);
+ gpio_request(PMU_VSEL, "NULL");
+ gpio_direction_output(PMU_VSEL, GPIO_HIGH);
+ #endif
+
+ #endif
+
printk("%s,line=%d END\n", __func__,__LINE__);
+
return 0;
}
{
}
#endif
-
-#endif
-
void __sramfunc board_pmu_act8846_suspend(void)
{
#ifdef CONFIG_CLK_SWITCH_TO_32K
#endif
}
+#endif
+
+
+
#ifdef CONFIG_REGULATOR_ACT8846
#define PMU_POWER_SLEEP RK30_PIN0_PA1
-
+#define PMU_VSEL RK30_PIN3_PD3
static struct pmu_info act8846_dcdc_info[] = {
{
.name = "act_dcdc1", //ddr
.name = "vdd_core", //logic
.min_uv = 1000000,
.max_uv = 1000000,
- .suspend_vol = 900000,
+ .suspend_vol = 1000000,
},
{
.name = "vdd_cpu", //arm
.min_uv = 1000000,
.max_uv = 1000000,
- .suspend_vol = 900000,
+ .suspend_vol = 1000000,
},
{
.name = "act_dcdc4", //vccio
.min_uv = 3000000,
.max_uv = 3000000,
- .suspend_vol = 2800000,
+ .suspend_vol = 3000000,
},
};
uint offset;
};
-extern struct sram_gpio_data __sramdata pmic_sleep;
+extern struct sram_gpio_data __sramdata pmic_sleep,pmic_vsel;
int sram_gpio_init(int gpio, struct sram_gpio_data *data);
void __sramfunc sram_gpio_set_value(struct sram_gpio_data data, uint value);
}
}
-struct sram_gpio_data __sramdata pmic_sleep;
+struct sram_gpio_data __sramdata pmic_sleep,pmic_vsel;
#if defined(CONFIG_ARCH_RK2928)
static void __iomem *gpio_base[] = {RK2928_GPIO0_BASE, RK2928_GPIO1_BASE, RK2928_GPIO2_BASE, RK2928_GPIO3_BASE};
#elif defined(CONFIG_ARCH_RK3066B) || defined(CONFIG_ARCH_RK3188)
help
Support the voltage and current regulators of the ACT8846 series of PMIC devices.
+config ACT8846_SUPPORT_RESET
+ tristate "ACT8846 PMIC SUPPORT RESET"
+ depends on REGULATOR_ACT8846=y
+ help
+ Support short press key to restart.
+
+
config RK29_PWM_REGULATOR
tristate "rk2918 pwm voltage regulator"
help
int buck = rdev_get_id(dev) - ACT8846_DCDC1;
u16 reg = 0;
int val;
+ #ifdef CONFIG_ACT8846_SUPPORT_RESET
+ reg = act8846_reg_read(act8846,(act8846_BUCK_SET_VOL_REG(buck)+0x1));
+ #else
reg = act8846_reg_read(act8846,act8846_BUCK_SET_VOL_REG(buck));
+ #endif
reg &= BUCK_VOL_MASK;
DBG("%d\n", reg);
val = 1000 * buck_voltage_map[reg];
if (vol_map[val] > max_vol)
printk("WARNING:this voltage is not support!voltage set is %d mv\n",vol_map[val]);
- ret = act8846_set_bits(act8846, act8846_BUCK_SET_VOL_REG(buck),
- BUCK_VOL_MASK, val);
+
+ #ifdef CONFIG_ACT8846_SUPPORT_RESET
+ ret = act8846_set_bits(act8846, (act8846_BUCK_SET_VOL_REG(buck) +0x1),BUCK_VOL_MASK, val);
+ #else
+ ret = act8846_set_bits(act8846, act8846_BUCK_SET_VOL_REG(buck) ,BUCK_VOL_MASK, val);
+ #endif
+
return ret;
}
static int act8846_dcdc_set_sleep_voltage(struct regulator_dev *dev,
if (vol_map[val] > max_vol)
printk("WARNING:this voltage is not support!voltage set is %d mv\n",vol_map[val]);
- ret = act8846_set_bits(act8846, (act8846_BUCK_SET_VOL_REG(buck) + 0x01),
- BUCK_VOL_MASK, val);
+ #ifdef CONFIG_ACT8846_SUPPORT_RESET
+ ret = act8846_set_bits(act8846, (act8846_BUCK_SET_VOL_REG(buck) ),BUCK_VOL_MASK, val);
+ #else
+ ret = act8846_set_bits(act8846, (act8846_BUCK_SET_VOL_REG(buck) +0x01),BUCK_VOL_MASK, val);
+ #endif
+
return ret;
}
static unsigned int act8846_dcdc_get_mode(struct regulator_dev *dev)