diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2017-01-28 00:47:11 -0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-01-28 00:47:11 -0800 |
| commit | e32d8d4081e6bf731284bc45a637de4d5d3d2fd5 (patch) | |
| tree | b60c7be74010c2e2635a20f0ef933dbc2855b0f3 | |
| parent | 68452b543d614a102f85089c90ec170cb73bbafe (diff) | |
| parent | 63cd5102a403b5ca68feacf1a02e451c6305e4e3 (diff) | |
Merge "drivers: mfd: fix audio mute issue after ADSP SSR"
| -rw-r--r-- | drivers/mfd/wcd9xxx-core.c | 17 | ||||
| -rw-r--r-- | drivers/mfd/wcd9xxx-irq.c | 3 | ||||
| -rw-r--r-- | include/linux/mfd/wcd9xxx/core.h | 3 |
3 files changed, 20 insertions, 3 deletions
diff --git a/drivers/mfd/wcd9xxx-core.c b/drivers/mfd/wcd9xxx-core.c index ceef607f67c0..5ffb21b8e1e5 100644 --- a/drivers/mfd/wcd9xxx-core.c +++ b/drivers/mfd/wcd9xxx-core.c @@ -505,6 +505,7 @@ static int wcd9xxx_device_init(struct wcd9xxx *wcd9xxx) mutex_init(&wcd9xxx->io_lock); mutex_init(&wcd9xxx->xfer_lock); + mutex_init(&wcd9xxx->reset_lock); ret = wcd9xxx_bringup(wcd9xxx->dev); if (ret) { @@ -583,6 +584,7 @@ err: err_bring_up: mutex_destroy(&wcd9xxx->io_lock); mutex_destroy(&wcd9xxx->xfer_lock); + mutex_destroy(&wcd9xxx->reset_lock); return ret; } @@ -595,6 +597,7 @@ static void wcd9xxx_device_exit(struct wcd9xxx *wcd9xxx) wcd9xxx_core_res_deinit(&wcd9xxx->core_res); mutex_destroy(&wcd9xxx->io_lock); mutex_destroy(&wcd9xxx->xfer_lock); + mutex_destroy(&wcd9xxx->reset_lock); if (wcd9xxx_get_intf_type() == WCD9XXX_INTERFACE_TYPE_SLIMBUS) slim_remove_device(wcd9xxx->slim_slave); } @@ -1480,9 +1483,11 @@ static int wcd9xxx_slim_device_reset(struct slim_device *sldev) if (wcd9xxx->dev_up) return 0; + mutex_lock(&wcd9xxx->reset_lock); ret = wcd9xxx_reset(wcd9xxx->dev); if (ret) dev_err(wcd9xxx->dev, "%s: Resetting Codec failed\n", __func__); + mutex_unlock(&wcd9xxx->reset_lock); return ret; } @@ -1490,6 +1495,7 @@ static int wcd9xxx_slim_device_reset(struct slim_device *sldev) static int wcd9xxx_slim_device_up(struct slim_device *sldev) { struct wcd9xxx *wcd9xxx = slim_get_devicedata(sldev); + int ret = 0; if (!wcd9xxx) { pr_err("%s: wcd9xxx is NULL\n", __func__); @@ -1501,7 +1507,12 @@ static int wcd9xxx_slim_device_up(struct slim_device *sldev) return 0; wcd9xxx->dev_up = true; - return wcd9xxx_device_up(wcd9xxx); + + mutex_lock(&wcd9xxx->reset_lock); + ret = wcd9xxx_device_up(wcd9xxx); + mutex_unlock(&wcd9xxx->reset_lock); + + return ret; } static int wcd9xxx_slim_device_down(struct slim_device *sldev) @@ -1519,10 +1530,14 @@ static int wcd9xxx_slim_device_down(struct slim_device *sldev) return 0; wcd9xxx->dev_up = false; + + mutex_lock(&wcd9xxx->reset_lock); if (wcd9xxx->dev_down) wcd9xxx->dev_down(wcd9xxx); wcd9xxx_irq_exit(&wcd9xxx->core_res); wcd9xxx_reset_low(wcd9xxx->dev); + mutex_unlock(&wcd9xxx->reset_lock); + return 0; } diff --git a/drivers/mfd/wcd9xxx-irq.c b/drivers/mfd/wcd9xxx-irq.c index 2bc8bdff54f1..856179b96f37 100644 --- a/drivers/mfd/wcd9xxx-irq.c +++ b/drivers/mfd/wcd9xxx-irq.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -304,6 +304,7 @@ static irqreturn_t wcd9xxx_irq_thread(int irq, void *data) goto err_disable_irq; } + memset(status, 0, sizeof(status)); ret = regmap_bulk_read(wcd9xxx_res->wcd_core_regmap, wcd9xxx_res->intr_reg[WCD9XXX_INTR_STATUS_BASE], status, num_irq_regs); diff --git a/include/linux/mfd/wcd9xxx/core.h b/include/linux/mfd/wcd9xxx/core.h index 11e8d89c337b..6eb8c1893a53 100644 --- a/include/linux/mfd/wcd9xxx/core.h +++ b/include/linux/mfd/wcd9xxx/core.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -334,6 +334,7 @@ struct wcd9xxx { struct slim_device *slim_slave; struct mutex io_lock; struct mutex xfer_lock; + struct mutex reset_lock; u8 version; int reset_gpio; |
