mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
add sar svdd regulator in kernel driver
kernel module add sar svdd regulator sar sensor has tow power vdd and svdd regulator,now add svdd Change-Id: Ia8d0c8a24f9d633e323d69da846ed1d19e0a7580 Reviewed-on: https://gerrit.mot.com/1484941 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Jiacheng Ou <oujc1@motorola.com> Reviewed-by: Wen Xie <xiewen3@motorola.com> Reviewed-by: Tao Sun <suntao2@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
400ae84eb1
commit
f018b2e344
1 changed files with 24 additions and 2 deletions
|
|
@ -1591,6 +1591,28 @@ static int abov_probe(struct i2c_client *client, const struct i2c_device_id *id)
|
|||
"on" : "off");
|
||||
}
|
||||
|
||||
pplatData->cap_svdd = regulator_get(&client->dev, "cap_svdd");
|
||||
if (IS_ERR(pplatData->cap_svdd)) {
|
||||
if (PTR_ERR(pplatData->cap_svdd) == -EPROBE_DEFER) {
|
||||
ret = PTR_ERR(pplatData->cap_svdd);
|
||||
goto err_svdd_error;
|
||||
}
|
||||
LOG_ERR("%s: Failed to get regulator\n", __func__);
|
||||
} else {
|
||||
ret = regulator_enable(pplatData->cap_svdd);
|
||||
|
||||
if (ret) {
|
||||
regulator_put(pplatData->cap_svdd);
|
||||
LOG_ERR("%s: Error %d enable regulator\n",
|
||||
__func__, ret);
|
||||
goto err_svdd_error;
|
||||
}
|
||||
pplatData->cap_svdd_en = true;
|
||||
LOG_INFO("cap_svdd regulator is %s\n",
|
||||
regulator_is_enabled(pplatData->cap_svdd) ?
|
||||
"on" : "off");
|
||||
}
|
||||
|
||||
/* detect if abov exist or not */
|
||||
ret = abov_detect(client);
|
||||
if (ret == 0) {
|
||||
|
|
@ -1828,10 +1850,10 @@ free_ps_notifier:
|
|||
regulator_disable(pplatData->cap_svdd);
|
||||
regulator_put(pplatData->cap_svdd);
|
||||
|
||||
/*err_svdd_error:
|
||||
err_svdd_error:
|
||||
LOG_DBG("%s svdd defer.\n", __func__);
|
||||
regulator_disable(pplatData->cap_vdd);
|
||||
regulator_put(pplatData->cap_vdd);*/
|
||||
regulator_put(pplatData->cap_vdd);
|
||||
|
||||
err_vdd_defer:
|
||||
LOG_DBG("%s input free device.\n", __func__);
|
||||
|
|
|
|||
Loading…
Reference in a new issue