Skip to content

Commit 3f03916

Browse files
John-Hsubroonie
authored andcommitted
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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent eeef16a commit 3f03916

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

sound/soc/codecs/nau8825.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -946,6 +946,11 @@ static void nau8825_init_regs(struct nau8825 *nau8825)
946946
NAU8825_RDAC_CLK_DELAY_MASK | NAU8825_RDAC_VREF_MASK,
947947
(0x2 << NAU8825_RDAC_CLK_DELAY_SFT) |
948948
(0x3 << NAU8825_RDAC_VREF_SFT));
949+
/* Config L/R channel */
950+
regmap_update_bits(nau8825->regmap, NAU8825_REG_DACL_CTRL,
951+
NAU8825_DACL_CH_SEL_MASK, NAU8825_DACL_CH_SEL_L);
952+
regmap_update_bits(nau8825->regmap, NAU8825_REG_DACR_CTRL,
953+
NAU8825_DACL_CH_SEL_MASK, NAU8825_DACL_CH_SEL_R);
949954
}
950955

951956
static const struct regmap_config nau8825_regmap_config = {

sound/soc/codecs/nau8825.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,15 @@
257257

258258
/* DACL_CTRL (0x33) */
259259
#define NAU8825_DACL_CH_SEL_SFT 9
260+
#define NAU8825_DACL_CH_SEL_MASK (0x1 << NAU8825_DACL_CH_SEL_SFT)
261+
#define NAU8825_DACL_CH_SEL_L (0x0 << NAU8825_DACL_CH_SEL_SFT)
262+
#define NAU8825_DACL_CH_SEL_R (0x1 << NAU8825_DACL_CH_SEL_SFT)
260263

261264
/* DACR_CTRL (0x34) */
262265
#define NAU8825_DACR_CH_SEL_SFT 9
266+
#define NAU8825_DACR_CH_SEL_MASK (0x1 << NAU8825_DACR_CH_SEL_SFT)
267+
#define NAU8825_DACR_CH_SEL_L (0x0 << NAU8825_DACR_CH_SEL_SFT)
268+
#define NAU8825_DACR_CH_SEL_R (0x1 << NAU8825_DACR_CH_SEL_SFT)
263269

264270
/* CLASSG_CTRL (0x50) */
265271
#define NAU8825_CLASSG_TIMER_SFT 8

0 commit comments

Comments
 (0)