All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] ASoC: soc-io, twl6040: Fix regression in linux-next
@ 2018-03-12 14:24 Peter Ujfalusi
  2018-03-12 14:24 ` [PATCH 1/2] ASoC: twl6040: Add back missing write callback Peter Ujfalusi
  2018-03-12 14:24 ` [PATCH 2/2] ASoC: soc-io: Fix snd_soc_component_update_bits_legacy Peter Ujfalusi
  0 siblings, 2 replies; 7+ messages in thread
From: Peter Ujfalusi @ 2018-03-12 14:24 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, lars, kuninori.morimoto.gx

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(-)

-- 
Peter

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] ASoC: twl6040: Add back missing write callback
  2018-03-12 14:24 [PATCH 0/2] ASoC: soc-io, twl6040: Fix regression in linux-next Peter Ujfalusi
@ 2018-03-12 14:24 ` Peter Ujfalusi
  2018-03-12 16:40   ` Applied "ASoC: twl6040: Add back missing write callback" to the asoc tree Mark Brown
  2018-03-12 14:24 ` [PATCH 2/2] ASoC: soc-io: Fix snd_soc_component_update_bits_legacy Peter Ujfalusi
  1 sibling, 1 reply; 7+ messages in thread
From: Peter Ujfalusi @ 2018-03-12 14:24 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, lars, kuninori.morimoto.gx

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,
-- 
Peter

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] ASoC: soc-io: Fix snd_soc_component_update_bits_legacy
  2018-03-12 14:24 [PATCH 0/2] ASoC: soc-io, twl6040: Fix regression in linux-next Peter Ujfalusi
  2018-03-12 14:24 ` [PATCH 1/2] ASoC: twl6040: Add back missing write callback Peter Ujfalusi
@ 2018-03-12 14:24 ` Peter Ujfalusi
  2018-03-12 14:57   ` Peter Ujfalusi
                     ` (2 more replies)
  1 sibling, 3 replies; 7+ messages in thread
From: Peter Ujfalusi @ 2018-03-12 14:24 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, lars, kuninori.morimoto.gx

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);
 
-- 
Peter

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] ASoC: soc-io: Fix snd_soc_component_update_bits_legacy
  2018-03-12 14:24 ` [PATCH 2/2] ASoC: soc-io: Fix snd_soc_component_update_bits_legacy Peter Ujfalusi
@ 2018-03-12 14:57   ` Peter Ujfalusi
  2018-03-12 16:58   ` Mark Brown
  2018-03-12 17:01   ` Applied "ASoC: soc-io: Fix snd_soc_component_update_bits_legacy" to the asoc tree Mark Brown
  2 siblings, 0 replies; 7+ messages in thread
From: Peter Ujfalusi @ 2018-03-12 14:57 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, lars, kuninori.morimoto.gx

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);
>  
> 


-- 
Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Applied "ASoC: twl6040: Add back missing write callback" to the asoc tree
  2018-03-12 14:24 ` [PATCH 1/2] ASoC: twl6040: Add back missing write callback Peter Ujfalusi
@ 2018-03-12 16:40   ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2018-03-12 16:40 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: alsa-devel, Mark Brown, Liam Girdwood, lars, kuninori.morimoto.gx

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,
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] ASoC: soc-io: Fix snd_soc_component_update_bits_legacy
  2018-03-12 14:24 ` [PATCH 2/2] ASoC: soc-io: Fix snd_soc_component_update_bits_legacy Peter Ujfalusi
  2018-03-12 14:57   ` Peter Ujfalusi
@ 2018-03-12 16:58   ` Mark Brown
  2018-03-12 17:01   ` Applied "ASoC: soc-io: Fix snd_soc_component_update_bits_legacy" to the asoc tree Mark Brown
  2 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2018-03-12 16:58 UTC (permalink / raw)
  To: Peter Ujfalusi; +Cc: alsa-devel, lars, Liam Girdwood, kuninori.morimoto.gx


[-- Attachment #1.1: Type: text/plain, Size: 371 bytes --]

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.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Applied "ASoC: soc-io: Fix snd_soc_component_update_bits_legacy" to the asoc tree
  2018-03-12 14:24 ` [PATCH 2/2] ASoC: soc-io: Fix snd_soc_component_update_bits_legacy Peter Ujfalusi
  2018-03-12 14:57   ` Peter Ujfalusi
  2018-03-12 16:58   ` Mark Brown
@ 2018-03-12 17:01   ` Mark Brown
  2 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2018-03-12 17:01 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: alsa-devel, Mark Brown, Liam Girdwood, lars, kuninori.morimoto.gx

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);
 
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-03-12 17:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-12 14:24 [PATCH 0/2] ASoC: soc-io, twl6040: Fix regression in linux-next Peter Ujfalusi
2018-03-12 14:24 ` [PATCH 1/2] ASoC: twl6040: Add back missing write callback Peter Ujfalusi
2018-03-12 16:40   ` Applied "ASoC: twl6040: Add back missing write callback" to the asoc tree Mark Brown
2018-03-12 14:24 ` [PATCH 2/2] ASoC: soc-io: Fix snd_soc_component_update_bits_legacy Peter Ujfalusi
2018-03-12 14:57   ` Peter Ujfalusi
2018-03-12 16:58   ` Mark Brown
2018-03-12 17:01   ` Applied "ASoC: soc-io: Fix snd_soc_component_update_bits_legacy" to the asoc tree Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.