[alsa-devel] [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 --- 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
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?
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.
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.
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
participants (3)
-
Ben Zhang
-
John Hsu
-
Mark Brown