OSDN Git Service

ASoC: mediatek: mt8195: support etdm in platform driver
authorTrevor Wu <trevor.wu@mediatek.com>
Thu, 19 Aug 2021 08:41:36 +0000 (16:41 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 24 Aug 2021 18:13:53 +0000 (19:13 +0100)
commit1de9a54acafba2f0e3ea2856ad0b22556d59ec45
tree728a2c957e8a3502b5f3a39e34cc580fd55e1a24
parentd62ad762f67585acfb5e03f71b28a52dc4604cf2
ASoC: mediatek: mt8195: support etdm in platform driver

This patch adds mt8195 tdm/i2s dai driver.

MCLK clock tree is as follows.
PLL -> MUX -> DIVIDER -> MCLK

For PLL source of MCLK, driver only supports APLL1 and APLL2 now.
APLL3 and APLL4 are used to track external clock source, so they are
only used when slave input is connected.

For example,
case 1: (HDMI RX connected)
DL memif (a1sys) -> etdm out2 (clk from apll1/apll2) -> codec
case 2: (HDMI RX disconnected)
HDMI RX -> a3sys -> UL memif (a3sys) -> DL memif (a3sys) -> .... ->
etdm out2 (clk from apll3) -> codec

We keep all modules in the pipeline working on the same clock domain.
MCLK is expected to output the clock generated from the same clock
source as the pipeline, so dynamic reparenting is required for MCLK
configuration.

As a result, clk_set_parent() is used to select PLL source,
and clk_set_rate() is used to configure divider to get MCLK output rate.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20210819084144.18483-4-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/mediatek/mt8195/mt8195-dai-etdm.c [new file with mode: 0644]