All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: core: Fix check before defaulting to regmap
@ 2012-08-01 19:06 Mark Brown
  2012-08-02  7:44 ` Peter Ujfalusi
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2012-08-01 19:06 UTC (permalink / raw)
  To: Peter Ujfalusi, Liam Girdwood; +Cc: alsa-devel, Mark Brown

Check if the chip has provided a write operation (which is mandatory for
I/O) rather than looking for control data as some of the MFDs use a global
for this. Also skip the attempt if there's no regmap available by device
in case things get confused by the attempt to default.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 sound/soc/soc-core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index b1fd043..5359623 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1096,7 +1096,7 @@ static int soc_probe_codec(struct snd_soc_card *card,
 	}
 
 	/* If the driver didn't set I/O up try regmap */
-	if (!codec->control_data)
+	if (!codec->write && dev_get_regmap(codec->dev, NULL))
 		snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP);
 
 	if (driver->controls)
-- 
1.7.10.4

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

* Re: [PATCH] ASoC: core: Fix check before defaulting to regmap
  2012-08-01 19:06 [PATCH] ASoC: core: Fix check before defaulting to regmap Mark Brown
@ 2012-08-02  7:44 ` Peter Ujfalusi
  2012-08-02  7:47   ` Takashi Iwai
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Ujfalusi @ 2012-08-02  7:44 UTC (permalink / raw)
  To: Mark Brown; +Cc: Takashi Iwai, alsa-devel, Liam Girdwood

Hi Mark,

On 08/01/2012 10:06 PM, Mark Brown wrote:
> Check if the chip has provided a write operation (which is mandatory for
> I/O) rather than looking for control data as some of the MFDs use a global
> for this. Also skip the attempt if there's no regmap available by device
> in case things get confused by the attempt to default.
> 
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
>  sound/soc/soc-core.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> index b1fd043..5359623 100644
> --- a/sound/soc/soc-core.c
> +++ b/sound/soc/soc-core.c
> @@ -1096,7 +1096,7 @@ static int soc_probe_codec(struct snd_soc_card *card,
>  	}
>  
>  	/* If the driver didn't set I/O up try regmap */
> -	if (!codec->control_data)
> +	if (!codec->write && dev_get_regmap(codec->dev, NULL))
>  		snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP);
>  
>  	if (driver->controls)

I have a slightly different implementation of this, but this looks better.

Boards using the following machine drivers are affected by this issue:
zoom2, overo, omap3pandora, omap3beagle, sdp3430, omap-abe-twl6040, omap3evm,
igep0020.

All boards using these machine drivers will have kernel crash at the first
time we try to write a register in the codec.

Could you send this patch (if the patch OK with you) to be included in 3.6-rc1
to avoid boards booting to kernel crash (if they restore the mixers at boot
time).

Thank you.

Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

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

* Re: [PATCH] ASoC: core: Fix check before defaulting to regmap
  2012-08-02  7:44 ` Peter Ujfalusi
@ 2012-08-02  7:47   ` Takashi Iwai
  0 siblings, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2012-08-02  7:47 UTC (permalink / raw)
  To: Peter Ujfalusi; +Cc: alsa-devel, Mark Brown, Liam Girdwood

At Thu, 02 Aug 2012 10:44:41 +0300,
Peter Ujfalusi wrote:
> 
> Hi Mark,
> 
> On 08/01/2012 10:06 PM, Mark Brown wrote:
> > Check if the chip has provided a write operation (which is mandatory for
> > I/O) rather than looking for control data as some of the MFDs use a global
> > for this. Also skip the attempt if there's no regmap available by device
> > in case things get confused by the attempt to default.
> > 
> > Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> > ---
> >  sound/soc/soc-core.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> > index b1fd043..5359623 100644
> > --- a/sound/soc/soc-core.c
> > +++ b/sound/soc/soc-core.c
> > @@ -1096,7 +1096,7 @@ static int soc_probe_codec(struct snd_soc_card *card,
> >  	}
> >  
> >  	/* If the driver didn't set I/O up try regmap */
> > -	if (!codec->control_data)
> > +	if (!codec->write && dev_get_regmap(codec->dev, NULL))
> >  		snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP);
> >  
> >  	if (driver->controls)
> 
> I have a slightly different implementation of this, but this looks better.
> 
> Boards using the following machine drivers are affected by this issue:
> zoom2, overo, omap3pandora, omap3beagle, sdp3430, omap-abe-twl6040, omap3evm,
> igep0020.
> 
> All boards using these machine drivers will have kernel crash at the first
> time we try to write a register in the codec.
> 
> Could you send this patch (if the patch OK with you) to be included in 3.6-rc1
> to avoid boards booting to kernel crash (if they restore the mixers at boot
> time).
> 
> Thank you.
> 
> Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

Mark, if this fix (and other for-3.6 patches) are to be included in
3.6-rc1, give a pull request in today or tomorrow, so that I can merge
and pass to Linus in time.


thanks,

Takashi

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

end of thread, other threads:[~2012-08-02  7:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-01 19:06 [PATCH] ASoC: core: Fix check before defaulting to regmap Mark Brown
2012-08-02  7:44 ` Peter Ujfalusi
2012-08-02  7:47   ` Takashi Iwai

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.