[alsa-devel] [PATCH 0/2] ASoC: soc-io, twl6040: Fix regression in linux-next
Hi,
I just noticed in linux-next that after the codec -> component conversion the twl6040 codec is not working (and most likely the twl4030 neither).
I have fixed it with the two patch in the series.
Regards, Peter --- Peter Ujfalusi (2): ASoC: twl6040: Add back missing write callback ASoC: soc-io: Fix snd_soc_component_update_bits_legacy
sound/soc/codecs/twl6040.c | 1 + sound/soc/soc-io.c | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-)
We need to have the write callback to use the code.
Fixes: 7480389fb0d8 ("ASoC: twl6040: replace codec to component")
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- sound/soc/codecs/twl6040.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c index 9bf23f8e7162..b56a6471f9c4 100644 --- a/sound/soc/codecs/twl6040.c +++ b/sound/soc/codecs/twl6040.c @@ -1157,6 +1157,7 @@ static const struct snd_soc_component_driver soc_component_dev_twl6040 = { .probe = twl6040_probe, .remove = twl6040_remove, .read = twl6040_read, + .write = twl6040_write, .remove = twl6040_remove, .set_bias_level = twl6040_set_bias_level, .controls = twl6040_snd_controls,
The patch
ASoC: twl6040: Add back missing write callback
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
From c9d066650cd5adf4ed4bf5734386699e765222b7 Mon Sep 17 00:00:00 2001
From: Peter Ujfalusi peter.ujfalusi@ti.com Date: Mon, 12 Mar 2018 16:24:22 +0200 Subject: [PATCH] ASoC: twl6040: Add back missing write callback
We need to have the write callback to use the code.
Fixes: 7480389fb0d8 ("ASoC: twl6040: replace codec to component")
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/codecs/twl6040.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c index 9bf23f8e7162..b56a6471f9c4 100644 --- a/sound/soc/codecs/twl6040.c +++ b/sound/soc/codecs/twl6040.c @@ -1157,6 +1157,7 @@ static const struct snd_soc_component_driver soc_component_dev_twl6040 = { .probe = twl6040_probe, .remove = twl6040_remove, .read = twl6040_read, + .write = twl6040_write, .remove = twl6040_remove, .set_bias_level = twl6040_set_bias_level, .controls = twl6040_snd_controls,
After the codec to component conversion codecs with custom read/write function will no longer able to use update_bits as their io callbacks are registered at component->driver level and not in component level.
To not complicate the code further, lets just use the snd_soc_component_read/snd_soc_component_write function and let them sort out the correct io function to call.
Fixes: e2c330b9b5665 ("ASoC: Move IO abstraction to the component level")
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- sound/soc/soc-io.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/sound/soc/soc-io.c b/sound/soc/soc-io.c index 2bc1c4c17896..d36a192fbece 100644 --- a/sound/soc/soc-io.c +++ b/sound/soc/soc-io.c @@ -88,19 +88,16 @@ static int snd_soc_component_update_bits_legacy( unsigned int old, new; int ret;
- if (!component->read || !component->write) - return -EIO; - mutex_lock(&component->io_mutex);
- ret = component->read(component, reg, &old); + ret = snd_soc_component_read(component, reg, &old); if (ret < 0) goto out_unlock;
new = (old & ~mask) | (val & mask); *change = old != new; if (*change) - ret = component->write(component, reg, new); + ret = snd_soc_component_write(component, reg, new); out_unlock: mutex_unlock(&component->io_mutex);
On 03/12/2018 04:24 PM, Peter Ujfalusi wrote:
After the codec to component conversion codecs with custom read/write function will no longer able to use update_bits as their io callbacks are registered at component->driver level and not in component level.
To not complicate the code further, lets just use the snd_soc_component_read/snd_soc_component_write function and let them sort out the correct io function to call.
Fixes: e2c330b9b5665 ("ASoC: Move IO abstraction to the component level")
Not this one, but: d0ff8ba57d965 ("ASoC: add Component level .read/.write")
Sorry.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com
sound/soc/soc-io.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/sound/soc/soc-io.c b/sound/soc/soc-io.c index 2bc1c4c17896..d36a192fbece 100644 --- a/sound/soc/soc-io.c +++ b/sound/soc/soc-io.c @@ -88,19 +88,16 @@ static int snd_soc_component_update_bits_legacy( unsigned int old, new; int ret;
if (!component->read || !component->write)
return -EIO;
mutex_lock(&component->io_mutex);
ret = component->read(component, reg, &old);
ret = snd_soc_component_read(component, reg, &old); if (ret < 0) goto out_unlock;
new = (old & ~mask) | (val & mask); *change = old != new; if (*change)
ret = component->write(component, reg, new);
ret = snd_soc_component_write(component, reg, new);
out_unlock: mutex_unlock(&component->io_mutex);
On Mon, Mar 12, 2018 at 04:24:23PM +0200, Peter Ujfalusi wrote:
Fixes: e2c330b9b5665 ("ASoC: Move IO abstraction to the component level")
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com
When you add a Fixes line for some reason you always seem to add a blank line before the signoff which is a bit weird and I'm worried will confuse some scripts.
The patch
ASoC: soc-io: Fix snd_soc_component_update_bits_legacy
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
From dead99e8579b6e2ebdf1e9c819e67d7f4a5cedbb Mon Sep 17 00:00:00 2001
From: Peter Ujfalusi peter.ujfalusi@ti.com Date: Mon, 12 Mar 2018 16:24:23 +0200 Subject: [PATCH] ASoC: soc-io: Fix snd_soc_component_update_bits_legacy
After the codec to component conversion codecs with custom read/write function will no longer able to use update_bits as their io callbacks are registered at component->driver level and not in component level.
To not complicate the code further, lets just use the snd_soc_component_read/snd_soc_component_write function and let them sort out the correct io function to call.
Fixes: d0ff8ba57d965 ("ASoC: add Component level .read/.write") Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/soc-io.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/sound/soc/soc-io.c b/sound/soc/soc-io.c index 2bc1c4c17896..d36a192fbece 100644 --- a/sound/soc/soc-io.c +++ b/sound/soc/soc-io.c @@ -88,19 +88,16 @@ static int snd_soc_component_update_bits_legacy( unsigned int old, new; int ret;
- if (!component->read || !component->write) - return -EIO; - mutex_lock(&component->io_mutex);
- ret = component->read(component, reg, &old); + ret = snd_soc_component_read(component, reg, &old); if (ret < 0) goto out_unlock;
new = (old & ~mask) | (val & mask); *change = old != new; if (*change) - ret = component->write(component, reg, new); + ret = snd_soc_component_write(component, reg, new); out_unlock: mutex_unlock(&component->io_mutex);
participants (2)
-
Mark Brown
-
Peter Ujfalusi