Android regulator 常见使用

2019-07-14 02:19发布

#include
static void set_codec_power(bool flag)
{
struct regulator *ldo=NULL;
ldo = regulator_get(NULL, "ldo2_my");
if(ldo==NULL){
printk("set_tp_power ldo is null ");
return;
}
if(flag){
 regulator_set_voltage(ldo, 3300000, 3300000);
   regulator_enable(ldo);
   regulator_put(ldo);

}else{
 regulator_disable(ldo);
                regulator_put(ldo);
}
}