alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] codecs: mc13783: add spi errate fix
@ 2013-09-09 14:12 Steffen Trumtrar
  2013-09-09 14:57 ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Steffen Trumtrar @ 2013-09-09 14:12 UTC (permalink / raw)
  To: alsa-devel; +Cc: Liam Girdwood, Mark Brown, kernel, Steffen Trumtrar, stable

The MC13783 Chip Errata, Rev. 4 says, that depending on SPI clock
and main audio clock speed, the Audio Codec or Stereo DAC do sometimes
not start when programmed to do so. This is due to an internal clock
timing issue related to the loading of the SPI bits into the audio block.

On an i.MX27 based system, this issue lead to switched audio channels under
certain circumstances: RTC + Touch + Audio are used and loaded at startup.

The mentioned workaround of writing registers 40 and 41 two times is implemented
here.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Cc: stable@vger.kernel.org
---
 sound/soc/codecs/mc13783.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/soc/codecs/mc13783.c b/sound/soc/codecs/mc13783.c
index 4d3c8fd..e78353d 100644
--- a/sound/soc/codecs/mc13783.c
+++ b/sound/soc/codecs/mc13783.c
@@ -125,6 +125,10 @@ static int mc13783_write(struct snd_soc_codec *codec,
 
 	ret = mc13xxx_reg_write(priv->mc13xxx, reg, value);
 
+	/* include errata fix for spi audio problems */
+	if (reg == PMIC_AUDIO_CODEC || reg == PMIC_AUDIO_DAC)
+		ret = mc13xxx_reg_write(priv->mc13xxx, reg, value);
+
 	mc13xxx_unlock(priv->mc13xxx);
 
 	return ret;
-- 
1.8.4.rc3

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

* Re: [PATCH] codecs: mc13783: add spi errate fix
  2013-09-09 14:12 [PATCH] codecs: mc13783: add spi errate fix Steffen Trumtrar
@ 2013-09-09 14:57 ` Mark Brown
  2013-09-09 15:33   ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2013-09-09 14:57 UTC (permalink / raw)
  To: Steffen Trumtrar; +Cc: stable, alsa-devel, Liam Girdwood, kernel


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

On Mon, Sep 09, 2013 at 04:12:36PM +0200, Steffen Trumtrar wrote:
> The MC13783 Chip Errata, Rev. 4 says, that depending on SPI clock
> and main audio clock speed, the Audio Codec or Stereo DAC do sometimes
> not start when programmed to do so. This is due to an internal clock
> timing issue related to the loading of the SPI bits into the audio block.

Applied, thanks.

[-- 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] 4+ messages in thread

* Re: [PATCH] codecs: mc13783: add spi errate fix
  2013-09-09 14:57 ` Mark Brown
@ 2013-09-09 15:33   ` Mark Brown
  2013-09-09 15:58     ` Steffen Trumtrar
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2013-09-09 15:33 UTC (permalink / raw)
  To: Steffen Trumtrar; +Cc: alsa-devel, Liam Girdwood, kernel, stable

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

On Mon, Sep 09, 2013 at 03:57:30PM +0100, Mark Brown wrote:
> On Mon, Sep 09, 2013 at 04:12:36PM +0200, Steffen Trumtrar wrote:
> > The MC13783 Chip Errata, Rev. 4 says, that depending on SPI clock
> > and main audio clock speed, the Audio Codec or Stereo DAC do sometimes
> > not start when programmed to do so. This is due to an internal clock
> > timing issue related to the loading of the SPI bits into the audio block.
> 
> Applied, thanks.

...and reverted since PMIC_AUDIO_CODEC isn't defined.  Please fix and
resend.

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

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

* Re: [PATCH] codecs: mc13783: add spi errate fix
  2013-09-09 15:33   ` Mark Brown
@ 2013-09-09 15:58     ` Steffen Trumtrar
  0 siblings, 0 replies; 4+ messages in thread
From: Steffen Trumtrar @ 2013-09-09 15:58 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, Liam Girdwood, kernel, stable

On Mon, Sep 09, 2013 at 04:33:28PM +0100, Mark Brown wrote:
> On Mon, Sep 09, 2013 at 03:57:30PM +0100, Mark Brown wrote:
> > On Mon, Sep 09, 2013 at 04:12:36PM +0200, Steffen Trumtrar wrote:
> > > The MC13783 Chip Errata, Rev. 4 says, that depending on SPI clock
> > > and main audio clock speed, the Audio Codec or Stereo DAC do sometimes
> > > not start when programmed to do so. This is due to an internal clock
> > > timing issue related to the loading of the SPI bits into the audio block.
> > 
> > Applied, thanks.
> 
> ...and reverted since PMIC_AUDIO_CODEC isn't defined.  Please fix and
> resend.

Ah, damn. Will resend ASAP. Sorry.

str

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

end of thread, other threads:[~2013-09-09 15:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-09 14:12 [PATCH] codecs: mc13783: add spi errate fix Steffen Trumtrar
2013-09-09 14:57 ` Mark Brown
2013-09-09 15:33   ` Mark Brown
2013-09-09 15:58     ` Steffen Trumtrar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).