* [PATCH] ASoC: adau17x1: Avoid overwriting CHPF
@ 2021-04-22 13:02 Niklas Carlsson
2021-04-22 16:48 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Niklas Carlsson @ 2021-04-22 13:02 UTC (permalink / raw)
To: Lars-Peter Clausen, Nuno Sá,
Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai
Cc: kernel, Niklas Carlsson, alsa-devel, linux-kernel
From: Niklas Carlsson <niklasc@axis.com>
Configuring number of channels per LRCLK frame by using e.g.
snd_soc_dai_set_tdm_slot before configuring DAI format was being
overwritten by the latter due to a regmap_write which would write over
the whole register.
Signed-off-by: Niklas Carlsson <niklasc@axis.com>
---
sound/soc/codecs/adau17x1.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/adau17x1.c b/sound/soc/codecs/adau17x1.c
index 546ee8178038..8aae7ab74091 100644
--- a/sound/soc/codecs/adau17x1.c
+++ b/sound/soc/codecs/adau17x1.c
@@ -553,6 +553,7 @@ static int adau17x1_set_dai_fmt(struct snd_soc_dai *dai,
{
struct adau *adau = snd_soc_component_get_drvdata(dai->component);
unsigned int ctrl0, ctrl1;
+ unsigned int ctrl0_mask;
int lrclk_pol;
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
@@ -612,8 +613,16 @@ static int adau17x1_set_dai_fmt(struct snd_soc_dai *dai,
if (lrclk_pol)
ctrl0 |= ADAU17X1_SERIAL_PORT0_LRCLK_POL;
- regmap_write(adau->regmap, ADAU17X1_SERIAL_PORT0, ctrl0);
- regmap_write(adau->regmap, ADAU17X1_SERIAL_PORT1, ctrl1);
+ /* Set the mask to update all relevant bits in ADAU17X1_SERIAL_PORT0 */
+ ctrl0_mask = ADAU17X1_SERIAL_PORT0_MASTER |
+ ADAU17X1_SERIAL_PORT0_LRCLK_POL |
+ ADAU17X1_SERIAL_PORT0_BCLK_POL |
+ ADAU17X1_SERIAL_PORT0_PULSE_MODE;
+
+ regmap_update_bits(adau->regmap, ADAU17X1_SERIAL_PORT0, ctrl0_mask,
+ ctrl0);
+ regmap_update_bits(adau->regmap, ADAU17X1_SERIAL_PORT1,
+ ADAU17X1_SERIAL_PORT1_DELAY_MASK, ctrl1);
adau->dai_fmt = fmt & SND_SOC_DAIFMT_FORMAT_MASK;
--
2.20.1
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] ASoC: adau17x1: Avoid overwriting CHPF
2021-04-22 13:02 [PATCH] ASoC: adau17x1: Avoid overwriting CHPF Niklas Carlsson
@ 2021-04-22 16:48 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2021-04-22 16:48 UTC (permalink / raw)
To: Takashi Iwai, Liam Girdwood, Niklas Carlsson, Jaroslav Kysela,
Nuno Sá,
Lars-Peter Clausen
Cc: Mark Brown, linux-kernel, Niklas Carlsson, alsa-devel, kernel
On Thu, 22 Apr 2021 15:02:26 +0200, Niklas Carlsson wrote:
> Configuring number of channels per LRCLK frame by using e.g.
> snd_soc_dai_set_tdm_slot before configuring DAI format was being
> overwritten by the latter due to a regmap_write which would write over
> the whole register.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: adau17x1: Avoid overwriting CHPF
commit: a89f3a93cd20f77ac1f84089297258d4b409e280
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-04-22 16:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-22 13:02 [PATCH] ASoC: adau17x1: Avoid overwriting CHPF Niklas Carlsson
2021-04-22 16:48 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®