Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: tas5086: fix TAS5086_CLOCK_CONTROL register size
@ 2013-06-27 19:59 Daniel Mack
  2013-06-27 19:59 ` [PATCH 2/2] ASoC: tas5086: fix Mid-Z implementation Daniel Mack
  2013-06-28 11:16 ` [PATCH 1/2] ASoC: tas5086: fix TAS5086_CLOCK_CONTROL register size Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Mack @ 2013-06-27 19:59 UTC (permalink / raw)
  To: alsa-devel; +Cc: broonie, Daniel Mack

The TAS5086_CLOCK_CONTROL also has a size of 1 byte.

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 sound/soc/codecs/tas5086.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/tas5086.c b/sound/soc/codecs/tas5086.c
index fec9a28..84c3f27 100644
--- a/sound/soc/codecs/tas5086.c
+++ b/sound/soc/codecs/tas5086.c
@@ -130,7 +130,7 @@ static const struct reg_default tas5086_reg_defaults[] = {
 static int tas5086_register_size(struct device *dev, unsigned int reg)
 {
 	switch (reg) {
-	case TAS5086_DEV_ID ... TAS5086_BKNDERR:
+	case TAS5086_CLOCK_CONTROL ... TAS5086_BKNDERR:
 		return 1;
 	case TAS5086_INPUT_MUX:
 	case TAS5086_PWM_OUTPUT_MUX:
-- 
1.8.1.4

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

* [PATCH 2/2] ASoC: tas5086: fix Mid-Z implementation
  2013-06-27 19:59 [PATCH 1/2] ASoC: tas5086: fix TAS5086_CLOCK_CONTROL register size Daniel Mack
@ 2013-06-27 19:59 ` Daniel Mack
  2013-06-28 11:16 ` [PATCH 1/2] ASoC: tas5086: fix TAS5086_CLOCK_CONTROL register size Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Mack @ 2013-06-27 19:59 UTC (permalink / raw)
  To: alsa-devel; +Cc: broonie, Daniel Mack

It turns out that the TAS5086 doesn't like channel start parts to be
empty, and if all channels are configured to Mid-Z, part 1 has to be
used.

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 sound/soc/codecs/tas5086.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/sound/soc/codecs/tas5086.c b/sound/soc/codecs/tas5086.c
index 84c3f27..3a22741 100644
--- a/sound/soc/codecs/tas5086.c
+++ b/sound/soc/codecs/tas5086.c
@@ -721,7 +721,7 @@ static int tas5086_probe(struct snd_soc_codec *codec)
 {
 	struct tas5086_private *priv = snd_soc_codec_get_drvdata(codec);
 	int charge_period = 1300000; /* hardware default is 1300 ms */
-	u8 pwm_start = TAS5086_PWM_START_CHANNEL_MASK;
+	u8 pwm_start_mid_z = 0;
 	int i, ret;
 
 	if (of_match_device(of_match_ptr(tas5086_dt_ids), codec->dev)) {
@@ -735,16 +735,19 @@ static int tas5086_probe(struct snd_soc_codec *codec)
 				 "ti,mid-z-channel-%d", i + 1);
 
 			if (of_get_property(of_node, name, NULL) != NULL)
-				pwm_start &= ~(1 << i);
+				pwm_start_mid_z |= 1 << i;
 		}
 	}
 
 	/*
-	 * Configure 'part 2' of the PWM starts to always use MID-Z, and tell
-	 * all configured mid-z channels to start start under 'part 2'.
+	 * If any of the channels is configured to start in Mid-Z mode,
+	 * configure 'part 1' of the PWM starts to use Mid-Z, and tell
+	 * all configured mid-z channels to start start under 'part 1'.
 	 */
-	regmap_write(priv->regmap, TAS5086_PWM_START,
-		     TAS5086_PWM_START_MIDZ_FOR_START_2 | pwm_start);
+	if (pwm_start_mid_z)
+		regmap_write(priv->regmap, TAS5086_PWM_START,
+			     TAS5086_PWM_START_MIDZ_FOR_START_1 |
+				pwm_start_mid_z);
 
 	/* lookup and set split-capacitor charge period */
 	if (charge_period == 0) {
-- 
1.8.1.4

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

* Re: [PATCH 1/2] ASoC: tas5086: fix TAS5086_CLOCK_CONTROL register size
  2013-06-27 19:59 [PATCH 1/2] ASoC: tas5086: fix TAS5086_CLOCK_CONTROL register size Daniel Mack
  2013-06-27 19:59 ` [PATCH 2/2] ASoC: tas5086: fix Mid-Z implementation Daniel Mack
@ 2013-06-28 11:16 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2013-06-28 11:16 UTC (permalink / raw)
  To: Daniel Mack; +Cc: alsa-devel


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

On Thu, Jun 27, 2013 at 09:59:10PM +0200, Daniel Mack wrote:
> The TAS5086_CLOCK_CONTROL also has a size of 1 byte.

Applied both, 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] 3+ messages in thread

end of thread, other threads:[~2013-06-28 11:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-27 19:59 [PATCH 1/2] ASoC: tas5086: fix TAS5086_CLOCK_CONTROL register size Daniel Mack
2013-06-27 19:59 ` [PATCH 2/2] ASoC: tas5086: fix Mid-Z implementation Daniel Mack
2013-06-28 11:16 ` [PATCH 1/2] ASoC: tas5086: fix TAS5086_CLOCK_CONTROL register size Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox