mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 23:24:22 -04:00
charger: add gpio request protection for WLS control
For WLS gpio control, if GPIO is requested failed. We should block the driver. Or if the driver use the gpio that is requested failed, there will be some unexpected problems. Change-Id: I8460d64032d673e5fcd32acd135e1f7b65f677d3 Reviewed-on: https://gerrit.mot.com/2239374 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Reviewed-by: Huosheng Liao <liaohs@motorola.com> Tested-by: Jira Key Reviewed-by: Haijian Ma <mahj8@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
32b4c6c612
commit
208033c97d
2 changed files with 10 additions and 6 deletions
|
|
@ -1416,10 +1416,12 @@ static int bq2589x_parse_dt(struct device *dev, struct bq2589x *bq)
|
|||
if (gpio_is_valid(bq->wls_en_gpio))
|
||||
{
|
||||
ret = gpio_request(bq->wls_en_gpio, "mmi wls en pin");
|
||||
if (ret)
|
||||
if (ret) {
|
||||
dev_err(bq->dev, "%s: %d gpio(wls en) request failed\n", __func__, bq->wls_en_gpio);
|
||||
else
|
||||
gpio_direction_output(bq->wls_en_gpio, 0);//default enable wls charge
|
||||
return ret;
|
||||
}
|
||||
|
||||
gpio_direction_output(bq->wls_en_gpio, 0);//default enable wls charge
|
||||
}
|
||||
|
||||
ret = of_property_read_u32(np, "ti,bq2589x,vbus-volt-high-level", &pe.high_volt_level);
|
||||
|
|
|
|||
|
|
@ -2495,10 +2495,12 @@ static int sgm4154x_parse_dt(struct sgm4154x_device *sgm)
|
|||
if (gpio_is_valid(sgm->wls_en_gpio))
|
||||
{
|
||||
ret = gpio_request(sgm->wls_en_gpio, "mmi wls en pin");
|
||||
if (ret)
|
||||
if (ret) {
|
||||
dev_err(sgm->dev, "%s: %d gpio(wls en) request failed\n", __func__, sgm->wls_en_gpio);
|
||||
else
|
||||
gpio_direction_output(sgm->wls_en_gpio, 0);//default enable wls charge
|
||||
return ret;
|
||||
}
|
||||
|
||||
gpio_direction_output(sgm->wls_en_gpio, 0);//default enable wls charge
|
||||
}
|
||||
|
||||
/* sw jeita */
|
||||
|
|
|
|||
Loading…
Reference in a new issue