All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] To simplify the code for ASoC probe.
@ 2014-02-27  9:49 ` Xiubo Li
  0 siblings, 0 replies; 24+ messages in thread
From: Xiubo Li @ 2014-02-27  9:49 UTC (permalink / raw)
  To: broonie; +Cc: alsa-devel, linux-kernel, shawn.guo, Xiubo Li


Xiubo Li (3):
  ASoC: io: Clean up snd_soc_codec_set_cache_io()
  ASoC: core: Set the default I/O up try regmap.
  ASoC: SGTL5000: Simplify ASoC probe code.

 sound/soc/codecs/sgtl5000.c | 8 --------
 sound/soc/soc-core.c        | 8 ++++----
 sound/soc/soc-io.c          | 5 -----
 3 files changed, 4 insertions(+), 17 deletions(-)

-- 
1.8.4



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

* [PATCH 0/3] To simplify the code for ASoC probe.
@ 2014-02-27  9:49 ` Xiubo Li
  0 siblings, 0 replies; 24+ messages in thread
From: Xiubo Li @ 2014-02-27  9:49 UTC (permalink / raw)
  To: broonie; +Cc: alsa-devel, linux-kernel, shawn.guo, Xiubo Li


Xiubo Li (3):
  ASoC: io: Clean up snd_soc_codec_set_cache_io()
  ASoC: core: Set the default I/O up try regmap.
  ASoC: SGTL5000: Simplify ASoC probe code.

 sound/soc/codecs/sgtl5000.c | 8 --------
 sound/soc/soc-core.c        | 8 ++++----
 sound/soc/soc-io.c          | 5 -----
 3 files changed, 4 insertions(+), 17 deletions(-)

-- 
1.8.4

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

* [PATCH 1/3] ASoC: io: Clean up snd_soc_codec_set_cache_io()
  2014-02-27  9:49 ` Xiubo Li
@ 2014-02-27  9:49   ` Xiubo Li
  -1 siblings, 0 replies; 24+ messages in thread
From: Xiubo Li @ 2014-02-27  9:49 UTC (permalink / raw)
  To: broonie; +Cc: alsa-devel, linux-kernel, shawn.guo, Xiubo Li

Now that all users have been converted to regmap and the config.reg_bits
and config.val_bits can be setted by each user through regmap core API.
So these two params are redundant here.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
---
 sound/soc/soc-io.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/sound/soc/soc-io.c b/sound/soc/soc-io.c
index add99e2..18353f1 100644
--- a/sound/soc/soc-io.c
+++ b/sound/soc/soc-io.c
@@ -88,16 +88,11 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
 			       int addr_bits, int data_bits,
 			       enum snd_soc_control_type control)
 {
-	struct regmap_config config;
 	int ret;
 
-	memset(&config, 0, sizeof(config));
 	codec->write = hw_write;
 	codec->read = hw_read;
 
-	config.reg_bits = addr_bits;
-	config.val_bits = data_bits;
-
 	switch (control) {
 	case SND_SOC_REGMAP:
 		/* Device has made its own regmap arrangements */
-- 
1.8.4



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

* [PATCH 1/3] ASoC: io: Clean up snd_soc_codec_set_cache_io()
@ 2014-02-27  9:49   ` Xiubo Li
  0 siblings, 0 replies; 24+ messages in thread
From: Xiubo Li @ 2014-02-27  9:49 UTC (permalink / raw)
  To: broonie; +Cc: Xiubo Li, alsa-devel, shawn.guo, linux-kernel

Now that all users have been converted to regmap and the config.reg_bits
and config.val_bits can be setted by each user through regmap core API.
So these two params are redundant here.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
---
 sound/soc/soc-io.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/sound/soc/soc-io.c b/sound/soc/soc-io.c
index add99e2..18353f1 100644
--- a/sound/soc/soc-io.c
+++ b/sound/soc/soc-io.c
@@ -88,16 +88,11 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
 			       int addr_bits, int data_bits,
 			       enum snd_soc_control_type control)
 {
-	struct regmap_config config;
 	int ret;
 
-	memset(&config, 0, sizeof(config));
 	codec->write = hw_write;
 	codec->read = hw_read;
 
-	config.reg_bits = addr_bits;
-	config.val_bits = data_bits;
-
 	switch (control) {
 	case SND_SOC_REGMAP:
 		/* Device has made its own regmap arrangements */
-- 
1.8.4

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

* [PATCH 2/3] ASoC: core: Set the default I/O up try regmap.
  2014-02-27  9:49 ` Xiubo Li
@ 2014-02-27  9:49   ` Xiubo Li
  -1 siblings, 0 replies; 24+ messages in thread
From: Xiubo Li @ 2014-02-27  9:49 UTC (permalink / raw)
  To: broonie; +Cc: alsa-devel, linux-kernel, shawn.guo, Xiubo Li

For most CODEC drivers which the REGMAP is used, the soc_probe_codec()
will do the stuff work of snd_soc_codec_set_cache_io(), which the CODEC
drivers' ASoC probe will do too, and almost at the same time.

This patch set the default I/O up try regmap, and then the CODEC drivers'
stuff work of snd_soc_codec_set_cache_io() will be redundant, while if one
CODEC driver needed to set it's own I/O, then it can rewrite the default ones.
Then could we just discard the snd_soc_codec_set_cache_io() from the CODEC
drivers' ASoC probe to simplify the code.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
---
 sound/soc/soc-core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index e5a535b..c159a34 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1137,6 +1137,10 @@ static int soc_probe_codec(struct snd_soc_card *card,
 
 	codec->dapm.idle_bias_off = driver->idle_bias_off;
 
+	/* Set the default I/O up try regmap */
+	if (dev_get_regmap(codec->dev, NULL))
+		snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP);
+
 	if (driver->probe) {
 		ret = driver->probe(codec);
 		if (ret < 0) {
@@ -1150,10 +1154,6 @@ static int soc_probe_codec(struct snd_soc_card *card,
 			codec->name);
 	}
 
-	/* If the driver didn't set I/O up try regmap */
-	if (!codec->write && dev_get_regmap(codec->dev, NULL))
-		snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP);
-
 	if (driver->controls)
 		snd_soc_add_codec_controls(codec, driver->controls,
 				     driver->num_controls);
-- 
1.8.4



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

* [PATCH 2/3] ASoC: core: Set the default I/O up try regmap.
@ 2014-02-27  9:49   ` Xiubo Li
  0 siblings, 0 replies; 24+ messages in thread
From: Xiubo Li @ 2014-02-27  9:49 UTC (permalink / raw)
  To: broonie; +Cc: alsa-devel, linux-kernel, shawn.guo, Xiubo Li

For most CODEC drivers which the REGMAP is used, the soc_probe_codec()
will do the stuff work of snd_soc_codec_set_cache_io(), which the CODEC
drivers' ASoC probe will do too, and almost at the same time.

This patch set the default I/O up try regmap, and then the CODEC drivers'
stuff work of snd_soc_codec_set_cache_io() will be redundant, while if one
CODEC driver needed to set it's own I/O, then it can rewrite the default ones.
Then could we just discard the snd_soc_codec_set_cache_io() from the CODEC
drivers' ASoC probe to simplify the code.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
---
 sound/soc/soc-core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index e5a535b..c159a34 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1137,6 +1137,10 @@ static int soc_probe_codec(struct snd_soc_card *card,
 
 	codec->dapm.idle_bias_off = driver->idle_bias_off;
 
+	/* Set the default I/O up try regmap */
+	if (dev_get_regmap(codec->dev, NULL))
+		snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP);
+
 	if (driver->probe) {
 		ret = driver->probe(codec);
 		if (ret < 0) {
@@ -1150,10 +1154,6 @@ static int soc_probe_codec(struct snd_soc_card *card,
 			codec->name);
 	}
 
-	/* If the driver didn't set I/O up try regmap */
-	if (!codec->write && dev_get_regmap(codec->dev, NULL))
-		snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP);
-
 	if (driver->controls)
 		snd_soc_add_codec_controls(codec, driver->controls,
 				     driver->num_controls);
-- 
1.8.4

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

* [PATCH 3/3] ASoC: SGTL5000: Simplify ASoC probe code.
  2014-02-27  9:49 ` Xiubo Li
@ 2014-02-27  9:49   ` Xiubo Li
  -1 siblings, 0 replies; 24+ messages in thread
From: Xiubo Li @ 2014-02-27  9:49 UTC (permalink / raw)
  To: broonie; +Cc: alsa-devel, linux-kernel, shawn.guo, Xiubo Li

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
---
 sound/soc/codecs/sgtl5000.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index ab4754a..d3ed1be 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -1352,14 +1352,6 @@ static int sgtl5000_probe(struct snd_soc_codec *codec)
 	int ret;
 	struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec);
 
-	/* setup i2c data ops */
-	codec->control_data = sgtl5000->regmap;
-	ret = snd_soc_codec_set_cache_io(codec, 16, 16, SND_SOC_REGMAP);
-	if (ret < 0) {
-		dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
-		return ret;
-	}
-
 	ret = sgtl5000_enable_regulators(codec);
 	if (ret)
 		return ret;
-- 
1.8.4



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

* [PATCH 3/3] ASoC: SGTL5000: Simplify ASoC probe code.
@ 2014-02-27  9:49   ` Xiubo Li
  0 siblings, 0 replies; 24+ messages in thread
From: Xiubo Li @ 2014-02-27  9:49 UTC (permalink / raw)
  To: broonie; +Cc: alsa-devel, linux-kernel, shawn.guo, Xiubo Li

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
---
 sound/soc/codecs/sgtl5000.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index ab4754a..d3ed1be 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -1352,14 +1352,6 @@ static int sgtl5000_probe(struct snd_soc_codec *codec)
 	int ret;
 	struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec);
 
-	/* setup i2c data ops */
-	codec->control_data = sgtl5000->regmap;
-	ret = snd_soc_codec_set_cache_io(codec, 16, 16, SND_SOC_REGMAP);
-	if (ret < 0) {
-		dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
-		return ret;
-	}
-
 	ret = sgtl5000_enable_regulators(codec);
 	if (ret)
 		return ret;
-- 
1.8.4

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

* Re: [PATCH 1/3] ASoC: io: Clean up snd_soc_codec_set_cache_io()
  2014-02-27  9:49   ` Xiubo Li
  (?)
@ 2014-02-28  3:47   ` Mark Brown
  -1 siblings, 0 replies; 24+ messages in thread
From: Mark Brown @ 2014-02-28  3:47 UTC (permalink / raw)
  To: Xiubo Li; +Cc: alsa-devel, linux-kernel, shawn.guo

[-- Attachment #1: Type: text/plain, Size: 267 bytes --]

On Thu, Feb 27, 2014 at 05:49:51PM +0800, Xiubo Li wrote:
> Now that all users have been converted to regmap and the config.reg_bits
> and config.val_bits can be setted by each user through regmap core API.
> So these two params are redundant here.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 2/3] ASoC: core: Set the default I/O up try regmap.
  2014-02-27  9:49   ` Xiubo Li
  (?)
@ 2014-02-28  3:52   ` Mark Brown
  2014-02-28  4:00     ` Li.Xiubo
  -1 siblings, 1 reply; 24+ messages in thread
From: Mark Brown @ 2014-02-28  3:52 UTC (permalink / raw)
  To: Xiubo Li; +Cc: alsa-devel, linux-kernel, shawn.guo

[-- Attachment #1: Type: text/plain, Size: 366 bytes --]

On Thu, Feb 27, 2014 at 05:49:52PM +0800, Xiubo Li wrote:
> For most CODEC drivers which the REGMAP is used, the soc_probe_codec()
> will do the stuff work of snd_soc_codec_set_cache_io(), which the CODEC
> drivers' ASoC probe will do too, and almost at the same time.

Applied, thanks.  I did a check of the drivers and it looks like they'll
all be fine with this.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 3/3] ASoC: SGTL5000: Simplify ASoC probe code.
  2014-02-27  9:49   ` Xiubo Li
  (?)
@ 2014-02-28  3:53   ` Mark Brown
  -1 siblings, 0 replies; 24+ messages in thread
From: Mark Brown @ 2014-02-28  3:53 UTC (permalink / raw)
  To: Xiubo Li; +Cc: alsa-devel, linux-kernel, shawn.guo

[-- Attachment #1: Type: text/plain, Size: 127 bytes --]

On Thu, Feb 27, 2014 at 05:49:53PM +0800, Xiubo Li wrote:
> Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* RE: [PATCH 2/3] ASoC: core: Set the default I/O up try regmap.
  2014-02-28  3:52   ` Mark Brown
@ 2014-02-28  4:00     ` Li.Xiubo
  2014-02-28  5:29         ` Mark Brown
  0 siblings, 1 reply; 24+ messages in thread
From: Li.Xiubo @ 2014-02-28  4:00 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, linux-kernel, shawn.guo


> Subject: Re: [PATCH 2/3] ASoC: core: Set the default I/O up try regmap.
> 
> On Thu, Feb 27, 2014 at 05:49:52PM +0800, Xiubo Li wrote:
> > For most CODEC drivers which the REGMAP is used, the soc_probe_codec()
> > will do the stuff work of snd_soc_codec_set_cache_io(), which the CODEC
> > drivers' ASoC probe will do too, and almost at the same time.
> 
> Applied, thanks.  I did a check of the drivers and it looks like they'll
> all be fine with this.

Yes.

I'll send another patches to applied to use this for another CODEC drivers.
And there almost 80 files, Should I send them in one patch or split them into
individual patch for each CODEC driver ?

Thanks,

--
Best Regards,
Xiubo


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

* Re: [PATCH 2/3] ASoC: core: Set the default I/O up try regmap.
  2014-02-28  4:00     ` Li.Xiubo
@ 2014-02-28  5:29         ` Mark Brown
  0 siblings, 0 replies; 24+ messages in thread
From: Mark Brown @ 2014-02-28  5:29 UTC (permalink / raw)
  To: Li.Xiubo; +Cc: alsa-devel, linux-kernel, shawn.guo

[-- Attachment #1: Type: text/plain, Size: 471 bytes --]

On Fri, Feb 28, 2014 at 04:00:38AM +0000, Li.Xiubo@freescale.com wrote:

> I'll send another patches to applied to use this for another CODEC drivers.
> And there almost 80 files, Should I send them in one patch or split them into
> individual patch for each CODEC driver ?

I'd suggest doing one patch that covers the boring drivers where the
first thing they do is call set_cache_io() but split out the others into
one patch per driver since the need more examination.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 2/3] ASoC: core: Set the default I/O up try regmap.
@ 2014-02-28  5:29         ` Mark Brown
  0 siblings, 0 replies; 24+ messages in thread
From: Mark Brown @ 2014-02-28  5:29 UTC (permalink / raw)
  To: Li.Xiubo; +Cc: alsa-devel, shawn.guo, linux-kernel


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

On Fri, Feb 28, 2014 at 04:00:38AM +0000, Li.Xiubo@freescale.com wrote:

> I'll send another patches to applied to use this for another CODEC drivers.
> And there almost 80 files, Should I send them in one patch or split them into
> individual patch for each CODEC driver ?

I'd suggest doing one patch that covers the boring drivers where the
first thing they do is call set_cache_io() but split out the others into
one patch per driver since the need more examination.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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



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

* RE: [PATCH 2/3] ASoC: core: Set the default I/O up try regmap.
  2014-02-28  5:29         ` Mark Brown
  (?)
@ 2014-02-28  5:56         ` Li.Xiubo
  2014-02-28  6:38           ` [alsa-devel] " Lars-Peter Clausen
  -1 siblings, 1 reply; 24+ messages in thread
From: Li.Xiubo @ 2014-02-28  5:56 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, linux-kernel, shawn.guo

> Subject: Re: [PATCH 2/3] ASoC: core: Set the default I/O up try regmap.
> 
> On Fri, Feb 28, 2014 at 04:00:38AM +0000, Li.Xiubo@freescale.com wrote:
> 
> > I'll send another patches to applied to use this for another CODEC drivers.
> > And there almost 80 files, Should I send them in one patch or split them
> into
> > individual patch for each CODEC driver ?
> 
> I'd suggest doing one patch that covers the boring drivers where the
> first thing they do is call set_cache_io() but split out the others into
> one patch per driver since the need more examination.

Got it.

Thanks,

--
Best Regards,
Xiubo

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

* Re: [alsa-devel] [PATCH 2/3] ASoC: core: Set the default I/O up try regmap.
  2014-02-28  5:56         ` Li.Xiubo
@ 2014-02-28  6:38           ` Lars-Peter Clausen
  2014-02-28  6:40             ` Li.Xiubo
  0 siblings, 1 reply; 24+ messages in thread
From: Lars-Peter Clausen @ 2014-02-28  6:38 UTC (permalink / raw)
  To: Li.Xiubo; +Cc: Mark Brown, alsa-devel, shawn.guo, linux-kernel

On 02/28/2014 06:56 AM, Li.Xiubo@freescale.com wrote:
>> Subject: Re: [PATCH 2/3] ASoC: core: Set the default I/O up try regmap.
>>
>> On Fri, Feb 28, 2014 at 04:00:38AM +0000, Li.Xiubo@freescale.com wrote:
>>
>>> I'll send another patches to applied to use this for another CODEC drivers.
>>> And there almost 80 files, Should I send them in one patch or split them
>> into
>>> individual patch for each CODEC driver ?
>>
>> I'd suggest doing one patch that covers the boring drivers where the
>> first thing they do is call set_cache_io() but split out the others into
>> one patch per driver since the need more examination.
>
> Got it.

Btw. be careful, just removing the set_cache_io() call will not work for all 
drivers. There are some MFD child devices which use regmap from the parent 
device. So dev_get_regmap() will return NULL for those.

- Lars


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

* RE: [alsa-devel] [PATCH 2/3] ASoC: core: Set the default I/O up try regmap.
  2014-02-28  6:38           ` [alsa-devel] " Lars-Peter Clausen
@ 2014-02-28  6:40             ` Li.Xiubo
  2014-02-28  6:46               ` Lars-Peter Clausen
  0 siblings, 1 reply; 24+ messages in thread
From: Li.Xiubo @ 2014-02-28  6:40 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: Mark Brown, alsa-devel, shawn.guo, linux-kernel


> Subject: Re: [alsa-devel] [PATCH 2/3] ASoC: core: Set the default I/O up try
> regmap.
> 
> On 02/28/2014 06:56 AM, Li.Xiubo@freescale.com wrote:
> >> Subject: Re: [PATCH 2/3] ASoC: core: Set the default I/O up try regmap.
> >>
> >> On Fri, Feb 28, 2014 at 04:00:38AM +0000, Li.Xiubo@freescale.com wrote:
> >>
> >>> I'll send another patches to applied to use this for another CODEC drivers.
> >>> And there almost 80 files, Should I send them in one patch or split them
> >> into
> >>> individual patch for each CODEC driver ?
> >>
> >> I'd suggest doing one patch that covers the boring drivers where the
> >> first thing they do is call set_cache_io() but split out the others into
> >> one patch per driver since the need more examination.
> >
> > Got it.
> 
> Btw. be careful, just removing the set_cache_io() call will not work for all
> drivers. There are some MFD child devices which use regmap from the parent
> device. So dev_get_regmap() will return NULL for those.
> 

@Lars,

Do you mean the CODEC drivers like wm5110 and wm8997 ?

Thanks,

--
Best Regards,
Xiubo
 


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

* Re: [alsa-devel] [PATCH 2/3] ASoC: core: Set the default I/O up try regmap.
  2014-02-28  6:40             ` Li.Xiubo
@ 2014-02-28  6:46               ` Lars-Peter Clausen
  2014-02-28  7:08                 ` Li.Xiubo
  0 siblings, 1 reply; 24+ messages in thread
From: Lars-Peter Clausen @ 2014-02-28  6:46 UTC (permalink / raw)
  To: Li.Xiubo; +Cc: Mark Brown, alsa-devel, shawn.guo, linux-kernel

On 02/28/2014 07:40 AM, Li.Xiubo@freescale.com wrote:
>
>> Subject: Re: [alsa-devel] [PATCH 2/3] ASoC: core: Set the default I/O up try
>> regmap.
>>
>> On 02/28/2014 06:56 AM, Li.Xiubo@freescale.com wrote:
>>>> Subject: Re: [PATCH 2/3] ASoC: core: Set the default I/O up try regmap.
>>>>
>>>> On Fri, Feb 28, 2014 at 04:00:38AM +0000, Li.Xiubo@freescale.com wrote:
>>>>
>>>>> I'll send another patches to applied to use this for another CODEC drivers.
>>>>> And there almost 80 files, Should I send them in one patch or split them
>>>> into
>>>>> individual patch for each CODEC driver ?
>>>>
>>>> I'd suggest doing one patch that covers the boring drivers where the
>>>> first thing they do is call set_cache_io() but split out the others into
>>>> one patch per driver since the need more examination.
>>>
>>> Got it.
>>
>> Btw. be careful, just removing the set_cache_io() call will not work for all
>> drivers. There are some MFD child devices which use regmap from the parent
>> device. So dev_get_regmap() will return NULL for those.
>>
>
> @Lars,
>
> Do you mean the CODEC drivers like wm5110 and wm8997 ?
>


Yes.


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

* RE: [alsa-devel] [PATCH 2/3] ASoC: core: Set the default I/O up try regmap.
  2014-02-28  6:46               ` Lars-Peter Clausen
@ 2014-02-28  7:08                 ` Li.Xiubo
  2014-02-28  7:15                   ` Lars-Peter Clausen
  0 siblings, 1 reply; 24+ messages in thread
From: Li.Xiubo @ 2014-02-28  7:08 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: Mark Brown, alsa-devel, shawn.guo, linux-kernel

> >>>> Subject: Re: [PATCH 2/3] ASoC: core: Set the default I/O up try regmap.
> >>>>
> >>>> On Fri, Feb 28, 2014 at 04:00:38AM +0000, Li.Xiubo@freescale.com wrote:
> >>>>
> >>>>> I'll send another patches to applied to use this for another CODEC
> drivers.
> >>>>> And there almost 80 files, Should I send them in one patch or split them
> >>>> into
> >>>>> individual patch for each CODEC driver ?
> >>>>
> >>>> I'd suggest doing one patch that covers the boring drivers where the
> >>>> first thing they do is call set_cache_io() but split out the others into
> >>>> one patch per driver since the need more examination.
> >>>
> >>> Got it.
> >>
> >> Btw. be careful, just removing the set_cache_io() call will not work for
> all
> >> drivers. There are some MFD child devices which use regmap from the parent
> >> device. So dev_get_regmap() will return NULL for those.
> >>
> >
> > @Lars,
> >
> > Do you mean the CODEC drivers like wm5110 and wm8997 ?
> >
> 
> 
> Yes.
> 

I only found these two CODEC drivers using MFD who would get its parent's regmap.

Has I missed some ?

Thanks,

Best Regards,
Xiubo

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

* Re: [alsa-devel] [PATCH 2/3] ASoC: core: Set the default I/O up try regmap.
  2014-02-28  7:08                 ` Li.Xiubo
@ 2014-02-28  7:15                   ` Lars-Peter Clausen
  2014-02-28  7:18                     ` Li.Xiubo
  2014-02-28  7:50                     ` Li.Xiubo
  0 siblings, 2 replies; 24+ messages in thread
From: Lars-Peter Clausen @ 2014-02-28  7:15 UTC (permalink / raw)
  To: Li.Xiubo; +Cc: Mark Brown, alsa-devel, shawn.guo, linux-kernel

On 02/28/2014 08:08 AM, Li.Xiubo@freescale.com wrote:
>>>>>> Subject: Re: [PATCH 2/3] ASoC: core: Set the default I/O up try regmap.
>>>>>>
>>>>>> On Fri, Feb 28, 2014 at 04:00:38AM +0000, Li.Xiubo@freescale.com wrote:
>>>>>>
>>>>>>> I'll send another patches to applied to use this for another CODEC
>> drivers.
>>>>>>> And there almost 80 files, Should I send them in one patch or split them
>>>>>> into
>>>>>>> individual patch for each CODEC driver ?
>>>>>>
>>>>>> I'd suggest doing one patch that covers the boring drivers where the
>>>>>> first thing they do is call set_cache_io() but split out the others into
>>>>>> one patch per driver since the need more examination.
>>>>>
>>>>> Got it.
>>>>
>>>> Btw. be careful, just removing the set_cache_io() call will not work for
>> all
>>>> drivers. There are some MFD child devices which use regmap from the parent
>>>> device. So dev_get_regmap() will return NULL for those.
>>>>
>>>
>>> @Lars,
>>>
>>> Do you mean the CODEC drivers like wm5110 and wm8997 ?
>>>
>>
>>
>> Yes.
>>
>
> I only found these two CODEC drivers using MFD who would get its parent's regmap.
>
> Has I missed some ?

A quick grep reveals:
mc13783.c:	codec->control_data = dev_get_regmap(codec->dev->parent, NULL);
si476x.c:	codec->control_data = dev_get_regmap(codec->dev->parent, NULL);
wm5102.c:	codec->control_data = priv->core.arizona->regmap;
wm5110.c:	codec->control_data = priv->core.arizona->regmap;
wm8997.c:	codec->control_data = priv->core.arizona->regmap;

But there might be more.

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

* RE: [alsa-devel] [PATCH 2/3] ASoC: core: Set the default I/O up try regmap.
  2014-02-28  7:15                   ` Lars-Peter Clausen
@ 2014-02-28  7:18                     ` Li.Xiubo
  2014-02-28  7:50                     ` Li.Xiubo
  1 sibling, 0 replies; 24+ messages in thread
From: Li.Xiubo @ 2014-02-28  7:18 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: Mark Brown, alsa-devel, shawn.guo, linux-kernel


> 
> A quick grep reveals:
> mc13783.c:	codec->control_data = dev_get_regmap(codec->dev->parent, NULL);
> si476x.c:	codec->control_data = dev_get_regmap(codec->dev->parent, NULL);
> wm5102.c:	codec->control_data = priv->core.arizona->regmap;
> wm5110.c:	codec->control_data = priv->core.arizona->regmap;
> wm8997.c:	codec->control_data = priv->core.arizona->regmap;
> 
> But there might be more.
>

Yes, I'll check it more carefully...

Thanks very much.


Best Regards,
Xiubo
 


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

* RE: [alsa-devel] [PATCH 2/3] ASoC: core: Set the default I/O up try regmap.
  2014-02-28  7:15                   ` Lars-Peter Clausen
  2014-02-28  7:18                     ` Li.Xiubo
@ 2014-02-28  7:50                     ` Li.Xiubo
  2014-02-28  8:15                       ` Lars-Peter Clausen
  1 sibling, 1 reply; 24+ messages in thread
From: Li.Xiubo @ 2014-02-28  7:50 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: Mark Brown, alsa-devel, shawn.guo, linux-kernel


> 
> A quick grep reveals:
> mc13783.c:	codec->control_data = dev_get_regmap(codec->dev->parent, NULL);
> si476x.c:	codec->control_data = dev_get_regmap(codec->dev->parent, NULL);
> wm5102.c:	codec->control_data = priv->core.arizona->regmap;
> wm5110.c:	codec->control_data = priv->core.arizona->regmap;
> wm8997.c:	codec->control_data = priv->core.arizona->regmap;
> 
> But there might be more.
> 

I have found the following ones, who are using MFD & set_cache_io.

   1    143  sound/soc/codecs/cq93vc.c <<cq93vc_probe>>
             snd_soc_codec_set_cache_io(codec, 32, 32, SND_SOC_REGMAP);
   2    618  sound/soc/codecs/mc13783.c <<mc13783_probe>>
             ret = snd_soc_codec_set_cache_io(codec, 8, 24, SND_SOC_REGMAP);
   3   1765  sound/soc/codecs/wm5102.c <<wm5102_codec_probe>>
             ret = snd_soc_codec_set_cache_io(codec, 32, 16, SND_SOC_REGMAP);
   4   1593  sound/soc/codecs/wm5110.c <<wm5110_codec_probe>>
             ret = snd_soc_codec_set_cache_io(codec, 32, 16, SND_SOC_REGMAP);
   5   1510  sound/soc/codecs/wm8350.c <<wm8350_codec_probe>>
             snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_REGMAP);
   6   1322  sound/soc/codecs/wm8400.c <<wm8400_codec_probe>>
             snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_REGMAP);
   7   4004  sound/soc/codecs/wm8994.c <<wm8994_codec_probe>>
             snd_soc_codec_set_cache_io(codec, 16, 16, SND_SOC_REGMAP);
   8   1058  sound/soc/codecs/wm8997.c <<wm8997_codec_probe>>
             ret = snd_soc_codec_set_cache_io(codec, 32, 16, SND_SOC_REGMAP);


Thanks,

--
Best regards,
Xiubo

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

* Re: [alsa-devel] [PATCH 2/3] ASoC: core: Set the default I/O up try regmap.
  2014-02-28  7:50                     ` Li.Xiubo
@ 2014-02-28  8:15                       ` Lars-Peter Clausen
  2014-03-01  4:07                         ` Mark Brown
  0 siblings, 1 reply; 24+ messages in thread
From: Lars-Peter Clausen @ 2014-02-28  8:15 UTC (permalink / raw)
  To: Li.Xiubo; +Cc: Mark Brown, alsa-devel, shawn.guo, linux-kernel

On 02/28/2014 08:50 AM, Li.Xiubo@freescale.com wrote:
>
>>
>> A quick grep reveals:
>> mc13783.c:	codec->control_data = dev_get_regmap(codec->dev->parent, NULL);
>> si476x.c:	codec->control_data = dev_get_regmap(codec->dev->parent, NULL);
>> wm5102.c:	codec->control_data = priv->core.arizona->regmap;
>> wm5110.c:	codec->control_data = priv->core.arizona->regmap;
>> wm8997.c:	codec->control_data = priv->core.arizona->regmap;
>>
>> But there might be more.
>>
>
> I have found the following ones, who are using MFD & set_cache_io.
>
>     1    143  sound/soc/codecs/cq93vc.c <<cq93vc_probe>>
>               snd_soc_codec_set_cache_io(codec, 32, 32, SND_SOC_REGMAP);
>     2    618  sound/soc/codecs/mc13783.c <<mc13783_probe>>
>               ret = snd_soc_codec_set_cache_io(codec, 8, 24, SND_SOC_REGMAP);
>     3   1765  sound/soc/codecs/wm5102.c <<wm5102_codec_probe>>
>               ret = snd_soc_codec_set_cache_io(codec, 32, 16, SND_SOC_REGMAP);
>     4   1593  sound/soc/codecs/wm5110.c <<wm5110_codec_probe>>
>               ret = snd_soc_codec_set_cache_io(codec, 32, 16, SND_SOC_REGMAP);
>     5   1510  sound/soc/codecs/wm8350.c <<wm8350_codec_probe>>
>               snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_REGMAP);
>     6   1322  sound/soc/codecs/wm8400.c <<wm8400_codec_probe>>
>               snd_soc_codec_set_cache_io(codec, 8, 16, SND_SOC_REGMAP);
>     7   4004  sound/soc/codecs/wm8994.c <<wm8994_codec_probe>>
>               snd_soc_codec_set_cache_io(codec, 16, 16, SND_SOC_REGMAP);
>     8   1058  sound/soc/codecs/wm8997.c <<wm8997_codec_probe>>
>               ret = snd_soc_codec_set_cache_io(codec, 32, 16, SND_SOC_REGMAP);

Yes, I think that's almost all of them. si476x is missing, but I think that 
one is currently broken, as it doesn't call snd_soc_codec_set_cache_io() at all.

As to how to handle those, I think there was a plan to add the possibility 
to assign a regmap to a device, so that dev_get_regmap() returns the regmap 
struct that should be used, even though the device itself did not allocate 
the regmap. But I can't find the details. Mark may know more about this.

- Lars

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

* Re: [alsa-devel] [PATCH 2/3] ASoC: core: Set the default I/O up try regmap.
  2014-02-28  8:15                       ` Lars-Peter Clausen
@ 2014-03-01  4:07                         ` Mark Brown
  0 siblings, 0 replies; 24+ messages in thread
From: Mark Brown @ 2014-03-01  4:07 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: Li.Xiubo, alsa-devel, shawn.guo, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1130 bytes --]

On Fri, Feb 28, 2014 at 09:15:37AM +0100, Lars-Peter Clausen wrote:

> Yes, I think that's almost all of them. si476x is missing, but I
> think that one is currently broken, as it doesn't call
> snd_soc_codec_set_cache_io() at all.

Probably, yeah - there were other problems with that driver that make me
question if it ever worked properly IIRC.  There is a default call to
set cache I/O already but it relies on dev_get_regmap().

> As to how to handle those, I think there was a plan to add the
> possibility to assign a regmap to a device, so that dev_get_regmap()
> returns the regmap struct that should be used, even though the
> device itself did not allocate the regmap. But I can't find the
> details. Mark may know more about this.

That's not for this and is likely to create confusion - that's for
handling early init with syscon type devices, allowing the regmap to be
created with no device and then have the device attached later.  I'd
need to look through and see what happens if two devices share a regmap,
perhaps it'd actually be OK, but we can always just allow the regmap to
be overridden at the ASoC level.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2014-03-01  4:07 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-27  9:49 [PATCH 0/3] To simplify the code for ASoC probe Xiubo Li
2014-02-27  9:49 ` Xiubo Li
2014-02-27  9:49 ` [PATCH 1/3] ASoC: io: Clean up snd_soc_codec_set_cache_io() Xiubo Li
2014-02-27  9:49   ` Xiubo Li
2014-02-28  3:47   ` Mark Brown
2014-02-27  9:49 ` [PATCH 2/3] ASoC: core: Set the default I/O up try regmap Xiubo Li
2014-02-27  9:49   ` Xiubo Li
2014-02-28  3:52   ` Mark Brown
2014-02-28  4:00     ` Li.Xiubo
2014-02-28  5:29       ` Mark Brown
2014-02-28  5:29         ` Mark Brown
2014-02-28  5:56         ` Li.Xiubo
2014-02-28  6:38           ` [alsa-devel] " Lars-Peter Clausen
2014-02-28  6:40             ` Li.Xiubo
2014-02-28  6:46               ` Lars-Peter Clausen
2014-02-28  7:08                 ` Li.Xiubo
2014-02-28  7:15                   ` Lars-Peter Clausen
2014-02-28  7:18                     ` Li.Xiubo
2014-02-28  7:50                     ` Li.Xiubo
2014-02-28  8:15                       ` Lars-Peter Clausen
2014-03-01  4:07                         ` Mark Brown
2014-02-27  9:49 ` [PATCH 3/3] ASoC: SGTL5000: Simplify ASoC probe code Xiubo Li
2014-02-27  9:49   ` Xiubo Li
2014-02-28  3:53   ` 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.