Skip to contentSkip to conversation

ASoC: soc-io, twl6040: Fix regression in linux-next

PATCH In review Peter Ujfalusi 2 participants 7 messages Mar 12, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover 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(-)
Signature · 4 lines
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
#1 lore raw

PATCH 1/2 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")
---
 sound/soc/codecs/twl6040.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/codecs/twl6040.c +1 -0
index 9bf23f8e7162..b56a6471f9c4 100644
@@ -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,
Signature · 4 lines
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
maintainer
#2 lore raw

Applied "ASoC: twl6040: Add back missing write callback" to the asoc tree

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

Quoted 1 line

From c9d066650cd5adf4ed4bf5734386699e765222b7 Mon Sep 17 00:00:00 2001

From: Peter Ujfalusi <[email protected]>
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")
---
 sound/soc/codecs/twl6040.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/codecs/twl6040.c +1 -0
index 9bf23f8e7162..b56a6471f9c4 100644
@@ -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,
Signature · 1 line
2.16.2
#3 lore raw

PATCH 2/2 ASoC: soc-io: Fix snd_soc_component_update_bits_legacy

In reply to Peter Ujfalusi

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")
---
 sound/soc/soc-io.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
sound/soc/soc-io.c +2 -5
index 2bc1c4c17896..d36a192fbece 100644
@@ -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);
 
Signature · 4 lines
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
#4 lore raw

Re: [PATCH 2/2] ASoC: soc-io: Fix snd_soc_component_update_bits_legacy

Quoted 9 lines · Peter Ujfalusi

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.

Quoted 33 lines
---
 sound/soc/soc-io.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
sound/soc/soc-io.c +2 -5
index 2bc1c4c17896..d36a192fbece 100644
@@ -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);
 
Signature · 8 lines
Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
maintainer
#5 lore raw

Re: [PATCH 2/2] ASoC: soc-io: Fix snd_soc_component_update_bits_legacy

In reply to Peter Ujfalusi
Quoted 3 lines · Peter Ujfalusi
Fixes e2c330b9b5665 ("ASoC: Move IO abstraction to the component level")

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.

maintainer
#6 lore raw

Applied "ASoC: soc-io: Fix snd_soc_component_update_bits_legacy" to the asoc tree

In reply to Peter Ujfalusi

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

Quoted 1 line

From dead99e8579b6e2ebdf1e9c819e67d7f4a5cedbb Mon Sep 17 00:00:00 2001

From: Peter Ujfalusi <[email protected]>
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")
---
 sound/soc/soc-io.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
sound/soc/soc-io.c +2 -5
index 2bc1c4c17896..d36a192fbece 100644
@@ -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);
 
Signature · 1 line
2.16.2