alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: nau8825: assign DAC Ch to match headset L/R
@ 2016-03-30  6:57 John Hsu
  2016-03-30 17:39 ` Mark Brown
  2016-03-31 17:20 ` Applied "ASoC: nau8825: assign DAC Ch to match headset L/R" to the asoc tree Mark Brown
  0 siblings, 2 replies; 5+ messages in thread
From: John Hsu @ 2016-03-30  6:57 UTC (permalink / raw)
  To: broonie
  Cc: alsa-devel, anatol.pomozov, YHCHuang, John Hsu, lgirdwood, benzh,
	CTLIN0, mhkuo, yong.zhi

The default value of DAC channel select is reverse in codec.
For normal usage, switch the channel select when codec bootup.

Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
---
 sound/soc/codecs/nau8825.c | 5 +++++
 sound/soc/codecs/nau8825.h | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c
index 3e7bee2..1a99a25 100644
--- a/sound/soc/codecs/nau8825.c
+++ b/sound/soc/codecs/nau8825.c
@@ -905,6 +905,11 @@ static void nau8825_init_regs(struct nau8825 *nau8825)
 		NAU8825_RDAC_CLK_DELAY_MASK | NAU8825_RDAC_VREF_MASK,
 		(0x2 << NAU8825_RDAC_CLK_DELAY_SFT) |
 		(0x3 << NAU8825_RDAC_VREF_SFT));
+	/* Config L/R channel */
+	regmap_update_bits(nau8825->regmap, NAU8825_REG_DACL_CTRL,
+		NAU8825_DACL_CH_SEL_MASK, NAU8825_DACL_CH_SEL_L);
+	regmap_update_bits(nau8825->regmap, NAU8825_REG_DACR_CTRL,
+		NAU8825_DACL_CH_SEL_MASK, NAU8825_DACL_CH_SEL_R);
 }
 
 static const struct regmap_config nau8825_regmap_config = {
diff --git a/sound/soc/codecs/nau8825.h b/sound/soc/codecs/nau8825.h
index 5fe009d..fcf0d0a 100644
--- a/sound/soc/codecs/nau8825.h
+++ b/sound/soc/codecs/nau8825.h
@@ -256,9 +256,15 @@
 
 /* DACL_CTRL (0x33) */
 #define NAU8825_DACL_CH_SEL_SFT	9
+#define NAU8825_DACL_CH_SEL_MASK (0x1 << NAU8825_DACL_CH_SEL_SFT)
+#define NAU8825_DACL_CH_SEL_L    (0x0 << NAU8825_DACL_CH_SEL_SFT)
+#define NAU8825_DACL_CH_SEL_R    (0x1 << NAU8825_DACL_CH_SEL_SFT)
 
 /* DACR_CTRL (0x34) */
 #define NAU8825_DACR_CH_SEL_SFT	9
+#define NAU8825_DACR_CH_SEL_MASK (0x1 << NAU8825_DACR_CH_SEL_SFT)
+#define NAU8825_DACR_CH_SEL_L    (0x0 << NAU8825_DACR_CH_SEL_SFT)
+#define NAU8825_DACR_CH_SEL_R    (0x1 << NAU8825_DACR_CH_SEL_SFT)
 
 /* CLASSG_CTRL (0x50) */
 #define NAU8825_CLASSG_TIMER_SFT	8
-- 
2.6.4

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

* Re: [PATCH] ASoC: nau8825: assign DAC Ch to match headset L/R
  2016-03-30  6:57 [PATCH] ASoC: nau8825: assign DAC Ch to match headset L/R John Hsu
@ 2016-03-30 17:39 ` Mark Brown
  2016-03-30 22:55   ` Ben Zhang
  2016-03-31 17:20 ` Applied "ASoC: nau8825: assign DAC Ch to match headset L/R" to the asoc tree Mark Brown
  1 sibling, 1 reply; 5+ messages in thread
From: Mark Brown @ 2016-03-30 17:39 UTC (permalink / raw)
  To: John Hsu
  Cc: alsa-devel, anatol.pomozov, YHCHuang, lgirdwood, benzh, CTLIN0,
	mhkuo, yong.zhi


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

On Wed, Mar 30, 2016 at 02:57:11PM +0800, John Hsu wrote:
> The default value of DAC channel select is reverse in codec.
> For normal usage, switch the channel select when codec bootup.

I would expect this to be exposed as DAPM routing?

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

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



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

* Re: [PATCH] ASoC: nau8825: assign DAC Ch to match headset L/R
  2016-03-30 17:39 ` Mark Brown
@ 2016-03-30 22:55   ` Ben Zhang
  2016-03-30 23:32     ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Ben Zhang @ 2016-03-30 22:55 UTC (permalink / raw)
  To: Mark Brown
  Cc: alsa-devel, Anatol Pomozov, John Hsu, Liam Girdwood, YHCHuang,
	CTLIN0, mhkuo, yong.zhi

On Wed, Mar 30, 2016 at 10:39 AM, Mark Brown <broonie@kernel.org> wrote:
> On Wed, Mar 30, 2016 at 02:57:11PM +0800, John Hsu wrote:
>> The default value of DAC channel select is reverse in codec.
>> For normal usage, switch the channel select when codec bootup.
>
> I would expect this to be exposed as DAPM routing?

The channel selection is already exposed by DAPM widget "DACL Mux" and
"DACR Mux". The issue is that hardware default register values after
reset have the channels reversed as R/L. This patch is for
initializing to the normal L/R channels after boot. The default should
be normal L/R from userspace point of view. If userspace wants some
other settings later, it can set the muxes to get R/L, L/L, or R/R.

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

* Re: [PATCH] ASoC: nau8825: assign DAC Ch to match headset L/R
  2016-03-30 22:55   ` Ben Zhang
@ 2016-03-30 23:32     ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2016-03-30 23:32 UTC (permalink / raw)
  To: Ben Zhang
  Cc: alsa-devel, Anatol Pomozov, John Hsu, Liam Girdwood, YHCHuang,
	CTLIN0, mhkuo, yong.zhi


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

On Wed, Mar 30, 2016 at 03:55:49PM -0700, Ben Zhang wrote:

> The channel selection is already exposed by DAPM widget "DACL Mux" and
> "DACR Mux". The issue is that hardware default register values after
> reset have the channels reversed as R/L. This patch is for

And nobody managed to notice that this might be a problem before the
part was released and relabel things?  Yay.

> initializing to the normal L/R channels after boot. The default should
> be normal L/R from userspace point of view. If userspace wants some
> other settings later, it can set the muxes to get R/L, L/L, or R/R.

This is yet another case where clearer changelogs would really help.
It is a lot easier to review changes if they are clearly described.

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

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



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

* Applied "ASoC: nau8825: assign DAC Ch to match headset L/R" to the asoc tree
  2016-03-30  6:57 [PATCH] ASoC: nau8825: assign DAC Ch to match headset L/R John Hsu
  2016-03-30 17:39 ` Mark Brown
@ 2016-03-31 17:20 ` Mark Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2016-03-31 17:20 UTC (permalink / raw)
  To: John Hsu, Mark Brown; +Cc: alsa-devel

The patch

   ASoC: nau8825: assign DAC Ch to match headset L/R

has been applied to the asoc tree at

   git://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 c5a85d8a61a91c13278e3c4ca32fecbc86dc2ede Mon Sep 17 00:00:00 2001
From: John Hsu <KCHSU0@nuvoton.com>
Date: Wed, 30 Mar 2016 14:57:11 +0800
Subject: [PATCH] ASoC: nau8825: assign DAC Ch to match headset L/R

The default value of DAC channel select is reverse in codec.
For normal usage, switch the channel select when codec bootup.

Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/nau8825.c | 5 +++++
 sound/soc/codecs/nau8825.h | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c
index 106c391f9ec3..f35019a0db1d 100644
--- a/sound/soc/codecs/nau8825.c
+++ b/sound/soc/codecs/nau8825.c
@@ -930,6 +930,11 @@ static void nau8825_init_regs(struct nau8825 *nau8825)
 		NAU8825_RDAC_CLK_DELAY_MASK | NAU8825_RDAC_VREF_MASK,
 		(0x2 << NAU8825_RDAC_CLK_DELAY_SFT) |
 		(0x3 << NAU8825_RDAC_VREF_SFT));
+	/* Config L/R channel */
+	regmap_update_bits(nau8825->regmap, NAU8825_REG_DACL_CTRL,
+		NAU8825_DACL_CH_SEL_MASK, NAU8825_DACL_CH_SEL_L);
+	regmap_update_bits(nau8825->regmap, NAU8825_REG_DACR_CTRL,
+		NAU8825_DACL_CH_SEL_MASK, NAU8825_DACL_CH_SEL_R);
 }
 
 static const struct regmap_config nau8825_regmap_config = {
diff --git a/sound/soc/codecs/nau8825.h b/sound/soc/codecs/nau8825.h
index 4427df99de24..9e6cb6262bf2 100644
--- a/sound/soc/codecs/nau8825.h
+++ b/sound/soc/codecs/nau8825.h
@@ -257,9 +257,15 @@
 
 /* DACL_CTRL (0x33) */
 #define NAU8825_DACL_CH_SEL_SFT	9
+#define NAU8825_DACL_CH_SEL_MASK (0x1 << NAU8825_DACL_CH_SEL_SFT)
+#define NAU8825_DACL_CH_SEL_L    (0x0 << NAU8825_DACL_CH_SEL_SFT)
+#define NAU8825_DACL_CH_SEL_R    (0x1 << NAU8825_DACL_CH_SEL_SFT)
 
 /* DACR_CTRL (0x34) */
 #define NAU8825_DACR_CH_SEL_SFT	9
+#define NAU8825_DACR_CH_SEL_MASK (0x1 << NAU8825_DACR_CH_SEL_SFT)
+#define NAU8825_DACR_CH_SEL_L    (0x0 << NAU8825_DACR_CH_SEL_SFT)
+#define NAU8825_DACR_CH_SEL_R    (0x1 << NAU8825_DACR_CH_SEL_SFT)
 
 /* CLASSG_CTRL (0x50) */
 #define NAU8825_CLASSG_TIMER_SFT	8
-- 
2.8.0.rc3

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

end of thread, other threads:[~2016-03-31 17:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-30  6:57 [PATCH] ASoC: nau8825: assign DAC Ch to match headset L/R John Hsu
2016-03-30 17:39 ` Mark Brown
2016-03-30 22:55   ` Ben Zhang
2016-03-30 23:32     ` Mark Brown
2016-03-31 17:20 ` Applied "ASoC: nau8825: assign DAC Ch to match headset L/R" to the asoc tree Mark Brown

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