]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
clk: fsl-sai: Add MCLK generation support
authorMarek Vasut <marex@nabladev.com>
Thu, 9 Apr 2026 00:29:06 +0000 (02:29 +0200)
committerStephen Boyd <sboyd@kernel.org>
Sun, 12 Apr 2026 00:32:40 +0000 (17:32 -0700)
commit6358c883179e3f89085bf2de625e1bbf15dfe8b0
tree444f35b78f6899565f5c2188da1023fc515fabc2
parent32b0c7aac1a2d17373b38fcfd4d5f352281892f7
clk: fsl-sai: Add MCLK generation support

The driver currently supports generating BCLK. There are systems which
require generation of MCLK instead. Register new MCLK clock and handle
clock-cells = <1> to differentiate between BCLK and MCLK. In case of a
legacy system with clock-cells = <0>, the driver behaves as before, i.e.
always returns BCLK.

Note that it is not possible re-use the current SAI audio driver to
generate MCLK and correctly enable and disable the MCLK.

If SAI (audio driver) is used to control the MCLK enablement, then MCLK
clock is not always enabled, and it is not necessarily enabled when the
codec may need the clock to be enabled. There is also no way for the
codec node to specify phandle to clock provider in DT, because the SAI
(audio driver) is not clock provider.

If SAI (clock driver) is used to control the MCLK enablement, then MCLK
clock is enabled when the codec needs the clock enabled, because the
codec is the clock consumer and the SAI (clock driver) is the clock
provider, and the codec driver can request the clock to be enabled when
needed. There is also the usual phandle to clock provider in DT, because
the SAI (clock driver) is clock provider.

Acked-by: Michael Walle <mwalle@kernel.org>
Signed-off-by: Marek Vasut <marex@nabladev.com>
Reviewed-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/clk-fsl-sai.c