android内核函数说明

pmu相关常用函数:

#include <linux/regulator/machine.h>
static struct regulator *regulator_LDO23;

 regulator_LDO23 = regulator_get(NULL, "LCD_3V3");
  if (IS_ERR(regulator_LDO23)) {
   printk("failed to get resource %s\n", "LCD_3V3\n");
  }

  if(blank_mode == FB_BLANK_POWERDOWN) {
   regulator_disable(regulator_LDO23);
   printk(" Disable LCD_3V3\n");
  }
  regulator_put(regulator_LDO23);
  regulator_LDO23 = ERR_PTR(-ENODEV);

 

 regulator_LDO23 = regulator_get(NULL, "LCD_3V3");
  if (IS_ERR(regulator_LDO23)) {
   printk("failed to get resource %s\n", "LCD_3V3\n");
  }
  regulator_enable(regulator_LDO23);
  printk(" Enable LCD_3V3\n");
  regulator_put(regulator_LDO23);
  regulator_LDO23 = ERR_PTR(-ENODEV);

 

######################################################################

#include <linux/wakelock.h>

 

struct wake_lock vbus_wake_lock;

wake_lock_init(&vbus_wake_lock, WAKE_LOCK_SUSPEND, "vbus_present");

wake_lock(&vbus_wake_lock);

wake_lock_timeout(&vbus_wake_lock, HZ / 2);

wake_unlock(&vbus_wake_lock);

#####################################################################

#include <linux/workqueue.h>

 

 struct delayed_work charge_curr_work;

INIT_DELAYED_WORK_DEFERRABLE(&charge_curr_work, change_curr_work);

static void change_curr_work(struct work_struct *work)
{

}

schedule_delayed_work(&data->charge_curr_work, 5000);

 

 ####################################################################

 

#define PQ24166_DEBUG 0

 

void bq24166_DEBUG (char *format, ...){
#if PQ24166_DEBUG
    char    buf[512];
    va_list arg_pt;
    va_start(arg_pt, format);
    vsprintf(buf,format,arg_pt);
    printk("PQ24166_DEBUG:: %s",buf);
#endif
}

bq24166_DEBUG("+++Supply-IN disconnected\n");

 ####################################################################

   irq_set_irq_wake(gpio_to_irq(CHARGE_USB), 1);

####################################################################

#include <plat/gpio-cfg.h>

#include <linux/gpio.h>

  err = gpio_request(EXYNOS5_GPY5(5), "GPD5");
  if (err)
  printk(KERN_ERR "#### failed to request GPD5_5 ####\n");

  s3c_gpio_setpull(EXYNOS5_GPY5(5), S3C_GPIO_PULL_NONE);
  gpio_direction_output(EXYNOS5_GPY5(5), 0);
  gpio_free(EXYNOS5_GPY5(5));

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值