Android regulator 常见使用

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qwertyuiop159158/article/details/47910469
#include <linux/regulator/consumer.h>
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\n");
return;
}
if(flag){
 regulator_set_voltage(ldo, 3300000, 3300000);
   regulator_enable(ldo);
   regulator_put(ldo);

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

猜你喜欢

转载自blog.csdn.net/qwertyuiop159158/article/details/47910469