diff options
author | Mark Brown <broonie@kernel.org> | 2023-04-11 16:11:32 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-04-11 16:11:32 +0100 |
commit | 53e59b5c4645236f0014d3cc5c24bc71ad3f6120 (patch) | |
tree | 64c6005d6ffd496454fffb05b584ffb7011e12b4 /drivers/usb/chipidea/core.c | |
parent | 60bbee7db43b97bf8c0978cc91f78d1746351871 (diff) | |
parent | a27e71a66ee0f887fefcc31b85a804b0905fa865 (diff) |
Add support for Rockchip RK860X regulators
Merge series from Cristian Ciocaltea <cristian.ciocaltea@collabora.com>:
This patch series introduces support for the Rockchip RK860X regulators,
while also providing a few fixes and improvements to the existing fan53555
driver.
RK8600/RK8601 are quite similar to the FAN53555 regulators.
RK8602/RK8603 are a bit different, having a wider output voltage
selection range, from 0.5 V to 1.5 V in 6.25 mV steps. They are used
in the Rock 5B board to power the ARM Cortex-A76 cores and the NPU.
Diffstat (limited to 'drivers/usb/chipidea/core.c')
-rw-r--r-- | drivers/usb/chipidea/core.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 27c601296130..281fc51720ce 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -984,9 +984,16 @@ static ssize_t role_store(struct device *dev, strlen(ci->roles[role]->name))) break; - if (role == CI_ROLE_END || role == ci->role) + if (role == CI_ROLE_END) return -EINVAL; + mutex_lock(&ci->mutex); + + if (role == ci->role) { + mutex_unlock(&ci->mutex); + return n; + } + pm_runtime_get_sync(dev); disable_irq(ci->irq); ci_role_stop(ci); @@ -995,6 +1002,7 @@ static ssize_t role_store(struct device *dev, ci_handle_vbus_change(ci); enable_irq(ci->irq); pm_runtime_put_sync(dev); + mutex_unlock(&ci->mutex); return (ret == 0) ? n : ret; } @@ -1030,6 +1038,7 @@ static int ci_hdrc_probe(struct platform_device *pdev) return -ENOMEM; spin_lock_init(&ci->lock); + mutex_init(&ci->mutex); ci->dev = dev; ci->platdata = dev_get_platdata(dev); ci->imx28_write_fix = !!(ci->platdata->flags & |