ASoC: nau8822: Add operation for internal PLL off and on
authorHui Wang <hui.wang@canonical.com>
Mon, 30 May 2022 04:01:50 +0000 (12:01 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Jun 2022 12:21:55 +0000 (14:21 +0200)
commit96c22385c25b559595e6e1ac4e713945c695700e
treee758f0543e16fdfaee3d7886bfde0adc2df6ac04
parent70d6d6874db3cdead1ea31eb4656f01a0b40bd6a
ASoC: nau8822: Add operation for internal PLL off and on

[ Upstream commit aeca8a3295022bcec46697f16e098140423d8463 ]

We tried to enable the audio on an imx6sx EVB with the codec nau8822,
after setting the internal PLL fractional parameters, the audio still
couldn't work and the there was no sdma irq at all.

After checking with the section "8.1.1 Phase Locked Loop (PLL) Design
Example" of "NAU88C22 Datasheet Rev 0.6", we found we need to
turn off the PLL before programming fractional parameters and turn on
the PLL after programming.

After this change, the audio driver could record and play sound and
the sdma's irq is triggered when playing or recording.

Cc: David Lin <ctlin0@nuvoton.com>
Cc: John Hsu <kchsu0@nuvoton.com>
Cc: Seven Li <wtli@nuvoton.com>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Link: https://lore.kernel.org/r/20220530040151.95221-2-hui.wang@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/codecs/nau8822.c
sound/soc/codecs/nau8822.h