本文整理汇总了C++中regulator_force_disable函数的典型用法代码示例。如果您正苦于以下问题:C++ regulator_force_disable函数的具体用法?C++ regulator_force_disable怎么用?C++ regulator_force_disable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了regulator_force_disable函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: muic_set_safeout
int muic_set_safeout(int safeout_path)
{
struct regulator *regulator;
int ret;
pr_info("%s:MUIC safeout path=%d\n", __func__, safeout_path);
if (safeout_path == MUIC_PATH_USB_CP) {
regulator = regulator_get(NULL, "safeout1_range");
if (IS_ERR(regulator) || regulator == NULL)
return -ENODEV;
if (regulator_is_enabled(regulator))
regulator_force_disable(regulator);
regulator_put(regulator);
regulator = regulator_get(NULL, "safeout2_range");
if (IS_ERR(regulator) || regulator == NULL)
return -ENODEV;
if (!regulator_is_enabled(regulator)) {
ret = regulator_enable(regulator);
if (ret)
goto err;
}
regulator_put(regulator);
} else if (safeout_path == MUIC_PATH_USB_AP) {
regulator = regulator_get(NULL, "safeout1_range");
if (IS_ERR(regulator) || regulator == NULL)
return -ENODEV;
if (!regulator_is_enabled(regulator)) {
ret = regulator_enable(regulator);
if (ret)
goto err;
}
regulator_put(regulator);
regulator = regulator_get(NULL, "safeout2_range");
if (IS_ERR(regulator) || regulator == NULL)
return -ENODEV;
if (regulator_is_enabled(regulator))
regulator_force_disable(regulator);
regulator_put(regulator);
} else {
pr_info("%s: not control safeout(%d)\n", __func__, safeout_path);
return -EINVAL;
}
return 0;
err:
pr_info("%s: cannot regulator_enable (%d)\n", __func__, ret);
regulator_put(regulator);
return ret;
}
示例2: db8131m_power_down
static int db8131m_power_down(void)
{
struct regulator *regulator;
int ret = 0;
pr_debug("%s: in", __func__);
db8131m_gpio_request();
/* VT_CAM_nSTBY(1.3M EN) DIS */
ret = gpio_direction_output(GPIO_VT_CAM_nSTBY, 0);
CAM_CHECK_ERR_RET(ret, "low VT_CAM_nSTBY");
/* CAM_VT_nRST(1.3M RESET) DIS */
ret = gpio_direction_output(GPIO_CAM_VT_nRST, 0);
CAM_CHECK_ERR_RET(ret, "low CAM_VT_nRST");
/* MCLK */
ret = s3c_gpio_cfgpin(GPIO_CAM_MCLK, S3C_GPIO_INPUT);
s3c_gpio_setpull(GPIO_CAM_MCLK, S3C_GPIO_PULL_DOWN);
CAM_CHECK_ERR(ret, "cfg mclk");
/* CAM_DVDD_1.5V(1.3M Core 1.8V) */
regulator = regulator_get(NULL, "cam_dvdd_1.5v");
if (IS_ERR(regulator))
return -ENODEV;
if (regulator_is_enabled(regulator))
ret = regulator_force_disable(regulator);
regulator_put(regulator);
CAM_CHECK_ERR_RET(ret, "disable cam_dvdd_1.5v");
/* CAM_SENSOR_A2.8V */
regulator = regulator_get(NULL, "cam_sensor_a2.8v");
if (IS_ERR(regulator))
return -ENODEV;
if (regulator_is_enabled(regulator))
ret = regulator_force_disable(regulator);
regulator_put(regulator);
CAM_CHECK_ERR_RET(ret, "disable cam_sensor_a2.8v");
/* VT_CAM_1.8V(VDDIO) */
regulator = regulator_get(NULL, "vt_cam_1.8v");
if (IS_ERR(regulator))
return -ENODEV;
if (regulator_is_enabled(regulator))
ret = regulator_force_disable(regulator);
regulator_put(regulator);
CAM_CHECK_ERR_RET(ret, "disable vt_cam_1.8v");
gpio_free(GPIO_VT_CAM_nSTBY);
gpio_free(GPIO_CAM_VT_nRST);
gpio_free(GPIO_VT_CAM_ID);
return ret;
}
示例3: ts_power_off
static int ts_power_off(void)
{
struct regulator *regulator;
regulator = regulator_get(NULL, "touch_avdd");
if (IS_ERR(regulator)) {
printk(KERN_ERR "[TSP]ts_power_off : regulator_get failed\n");
return -EIO;
}
if (regulator_is_enabled(regulator))
regulator_force_disable(regulator);
regulator_put(regulator);
/* CAUTION : EVT1 board has CHG_INT problem
* so it need a workaround code to ensure charging during sleep mode
*/
if (system_rev != 2) {
regulator = regulator_get(NULL, "touch_vdd_1.8v");
if (IS_ERR(regulator)) {
printk(KERN_ERR "[TSP]ts_power_on : regulator_get failed\n");
return -EIO;
}
if (regulator_is_enabled(regulator))
regulator_force_disable(regulator);
regulator_put(regulator);
}
/* touch interrupt pin */
s3c_gpio_cfgpin(GPIO_TOUCH_CHG, S3C_GPIO_INPUT);
s3c_gpio_setpull(GPIO_TOUCH_CHG, S3C_GPIO_PULL_NONE);
/* touch reset pin */
s3c_gpio_cfgpin(GPIO_TOUCH_RESET, S3C_GPIO_OUTPUT);
s3c_gpio_setpull(GPIO_TOUCH_RESET, S3C_GPIO_PULL_NONE);
gpio_set_value(GPIO_TOUCH_RESET, 0);
/* touch xvdd en pin */
s3c_gpio_cfgpin(GPIO_TOUCH_EN, S3C_GPIO_OUTPUT);
s3c_gpio_setpull(GPIO_TOUCH_EN, S3C_GPIO_PULL_NONE);
gpio_set_value(GPIO_TOUCH_EN, 0);
printk(KERN_ERR "mxt_power_off is finished\n");
return 0;
}
示例4: key_led_control
int key_led_control(bool on)
{
struct regulator *regulator;
if (tsp_keyled_enabled == on)
return 0;
printk(KERN_DEBUG "[TSP] %s %s\n",
__func__, on ? "on" : "off");
regulator = regulator_get(NULL, "vtouch_3.3v");
if (IS_ERR(regulator))
return PTR_ERR(regulator);
if (on) {
regulator_enable(regulator);
} else {
if (regulator_is_enabled(regulator))
regulator_disable(regulator);
else
regulator_force_disable(regulator);
}
regulator_put(regulator);
tsp_keyled_enabled = on;
return 0;
}
示例5: vreg_diag_disable
static int vreg_diag_disable(int vreg_no)
{
printk(DIAG_LOG_06 "[%04d]:%s() start. vreg_no = %d\n", __LINE__,
__func__, vreg_no);
vreg_no -= 1;
if (!reg_store[vreg_no]) {
reg_store[vreg_no] = regulator_get(NULL, vreg_data[vreg_no].id);
if (IS_ERR(reg_store[vreg_no])) {
reg_store[vreg_no] = NULL;
printk(DIAG_LOG_01 "[%04d]:%s() ERR\n", __LINE__,
__func__);
return -ENODEV;
}
}
if (vreg_data[vreg_no].vreg_type != PMIC_VREG_VS) {
regulator_set_voltage(reg_store[vreg_no], 0,
vreg_data[vreg_no].max_uV);
regulator_force_disable(reg_store[vreg_no]);
}
else
regulator_disable(reg_store[vreg_no]);
regulator_put(reg_store[vreg_no]);
reg_store[vreg_no] = NULL;
reg_volt_set_check[vreg_no] = 0;
printk(DIAG_LOG_06 "[%04d]:%s() end.\n", __LINE__, __func__);
return 0;
}
示例6: touchkey_led_power_on
static int touchkey_led_power_on(bool on)
{
#ifdef LED_LDO_WITH_REGULATOR
struct regulator *regulator;
if (on) {
regulator = regulator_get(NULL, TK_LED_REGULATOR_NAME);
if (IS_ERR(regulator)) {
printk(KERN_ERR
"[Touchkey] touchkey_led_power_on : TK_LED regulator_get failed\n");
return -EIO;
}
regulator_enable(regulator);
regulator_put(regulator);
} else {
regulator = regulator_get(NULL, TK_LED_REGULATOR_NAME);
if (IS_ERR(regulator)) {
printk(KERN_ERR
"[Touchkey] touchkey_led_power_on : TK_LED regulator_get failed\n");
return -EIO;
}
if (regulator_is_enabled(regulator))
regulator_force_disable(regulator);
regulator_put(regulator);
}
#else
if (on)
gpio_direction_output(GPIO_3_TOUCH_EN, 1);
else
gpio_direction_output(GPIO_3_TOUCH_EN, 0);
#endif
return 1;
}
开发者ID:turter99,项目名称:android_kernel_samsung_jaltektt_perseus_4.2.2,代码行数:35,代码来源:board-universal5410-input.c
示例7: touchkey_ldo_on
int touchkey_ldo_on(bool on)
{
struct regulator *regulator;
if (on) {
regulator = regulator_get(NULL, "touch");
if (IS_ERR(regulator)){
printk(KERN_ERR "[TouchKey] touchkey_ldo_on(1): regulator error \n");
return 0;
}
regulator_enable(regulator);
regulator_put(regulator);
} else {
regulator = regulator_get(NULL, "touch");
if (IS_ERR(regulator)) {
printk(KERN_ERR "[TouchKey] touchkey_ldo_on(0): regulator error \n");
return 0;
}
if (regulator_is_enabled(regulator))
regulator_force_disable(regulator);
regulator_put(regulator);
}
return 1;
}
示例8: usi_bm01a_power_onoff
static int usi_bm01a_power_onoff(int onoff)
{
struct regulator* wifi_ldo = NULL;
static int first = 1;
#ifndef CONFIG_AW_AXP
usi_msg("AXP driver is disabled, pls check !!\n");
return 0;
#endif
usi_msg("usi_bm01a_power_onoff\n");
wifi_ldo = regulator_get(NULL, "axp20_pll");
if (!wifi_ldo)
usi_msg("Get power regulator failed\n");
if (first) {
usi_msg("first time\n");
regulator_force_disable(wifi_ldo);
first = 0;
}
if (onoff) {
usi_msg("regulator on\n");
regulator_set_voltage(wifi_ldo, 3300000, 3300000);
regulator_enable(wifi_ldo);
} else {
usi_msg("regulator off\n");
regulator_disable(wifi_ldo);
}
return 0;
}
示例9: pmic_safeout2
static void pmic_safeout2(int onoff)
{
struct regulator *regulator;
regulator = regulator_get(NULL, "safeout2");
BUG_ON(IS_ERR_OR_NULL(regulator));
if (onoff) {
if (!regulator_is_enabled(regulator)) {
regulator_enable(regulator);
} else {
pr_err("%s: onoff:%d No change in safeout2\n",
__func__, onoff);
}
} else {
if (regulator_is_enabled(regulator)) {
regulator_force_disable(regulator);
} else {
pr_err("%s: onoff:%d No change in safeout2\n",
__func__, onoff);
}
}
regulator_put(regulator);
}
示例10: ts_led_power_on
static int ts_led_power_on(bool on)
{
struct regulator *regulator;
if (on) {
regulator = regulator_get(NULL, "key_led_3.3v");
if (IS_ERR(regulator)) {
printk(KERN_ERR "[TSP_KEY] ts_led_power_on : TK_LED regulator_get failed\n");
return -EIO;
}
regulator_enable(regulator);
regulator_put(regulator);
} else {
regulator = regulator_get(NULL, "key_led_3.3v");
if (IS_ERR(regulator)) {
printk(KERN_ERR "[TSP_KEY] ts_led_power_on : TK_LED regulator_get failed\n");
return -EIO;
}
if (regulator_is_enabled(regulator))
regulator_force_disable(regulator);
regulator_put(regulator);
}
printk(KERN_ERR "[TSP_KEY] %s %s\n", __func__, on ? "on" : "off");
return 0;
}
示例11: vibrator_work
static void vibrator_work(struct work_struct *_work)
{
struct vibrator_drvdata *data =
container_of(_work, struct vibrator_drvdata, work);
pr_debug("[VIB] time = %dms\n", data->timeout);
if (0 == data->timeout) {
if (!data->running)
return ;
pwm_disable(data->pwm);
i2c_max8997_hapticmotor(data, false);
if (data->pdata->motor_en)
data->pdata->motor_en(false);
else
regulator_force_disable(data->regulator);
data->running = false;
} else {
if (data->running)
return ;
if (data->pdata->motor_en)
data->pdata->motor_en(true);
else
regulator_enable(data->regulator);
i2c_max8997_hapticmotor(data, true);
pwm_config(data->pwm, pwm_duty, data->pdata->period);
pr_info("[VIB] %s: pwm_config duty=%d\n", __func__, pwm_duty);
pwm_enable(data->pwm);
data->running = true;
}
}
示例12: wacom_power
int wacom_power(bool on)
{
#ifdef GPIO_PEN_LDO_EN
gpio_direction_output(GPIO_PEN_LDO_EN, on);
#else
struct regulator *regulator_vdd;
if (wacom_power_enabled == on) {
printk(KERN_DEBUG "epen: %s %s\n",
__func__, on ? "on" : "off");
return 0;
}
regulator_vdd = regulator_get(NULL, "wacom_3.0v");
if (IS_ERR(regulator_vdd)) {
printk(KERN_ERR"epen: %s reg get err\n", __func__);
return PTR_ERR(regulator_vdd);
}
if (on) {
regulator_enable(regulator_vdd);
} else {
if (regulator_is_enabled(regulator_vdd))
regulator_disable(regulator_vdd);
else
regulator_force_disable(regulator_vdd);
}
regulator_put(regulator_vdd);
printk(KERN_DEBUG "epen: %s %s\n",
__func__, on ? "on" : "off");
wacom_power_enabled = on;
#endif
return 0;
}
示例13: vibtonz_en
void vibtonz_en(bool en)
{
struct vibrator_drvdata *data = g_data;
if (en) {
if (data->running)
return ;
if (data->pdata->motor_en)
data->pdata->motor_en(true);
else
regulator_enable(data->regulator);
i2c_max8997_hapticmotor(data, true);
pwm_enable(data->pwm);
data->running = true;
} else {
if (!data->running)
return ;
pwm_disable(data->pwm);
i2c_max8997_hapticmotor(data, false);
if (data->pdata->motor_en)
data->pdata->motor_en(false);
else
regulator_force_disable(data->regulator);
data->running = false;
}
}
示例14: lcd_power_on
static int lcd_power_on(struct lcd_device *ld, int enable)
{
struct regulator *regulator;
if (ld == NULL) {
printk(KERN_ERR "lcd device object is NULL.\n");
return 0;
}
if (enable) {
regulator = regulator_get(NULL, "vlcd_3.0v");
if (IS_ERR(regulator))
return 0;
regulator_enable(regulator);
regulator_put(regulator);
} else {
regulator = regulator_get(NULL, "vlcd_3.0v");
if (IS_ERR(regulator))
return 0;
if (regulator_is_enabled(regulator))
regulator_force_disable(regulator);
regulator_put(regulator);
}
return 1;
}
示例15: mxt_power_off
static int mxt_power_off(void)
{
struct regulator *regulator;
#if defined(TSP_DEBUG_LOG)
printk(KERN_DEBUG "[TSP] %s\n", __func__);
#endif
gpio_set_value(GPIO_TOUCH_RESET, 0);
/* disable XVDD */
gpio_set_value(GPIO_TOUCH_EN, 0);
usleep_range(3000, 3000);
gpio_set_value(GPIO_TOUCH_EN_1, 0);
usleep_range(3000, 3000);
/* disable I2C pullup */
regulator = regulator_get(NULL, "tsp_vdd_1.8v");
if (IS_ERR(regulator)) {
printk(KERN_ERR "[TSP] %s : regulator_get failed\n",
__func__);
return -EIO;
}
if (regulator_is_enabled(regulator))
regulator_disable(regulator);
else
regulator_force_disable(regulator);
regulator_put(regulator);
/* touch interrupt pin */
s3c_gpio_cfgpin(GPIO_TOUCH_CHG, S3C_GPIO_INPUT);
s3c_gpio_setpull(GPIO_TOUCH_CHG, S3C_GPIO_PULL_NONE);
return 0;
}