On Wed, Oct 26, 2022 at 03:42:31PM +0100, Aidan MacDonald wrote:
Mark Brown broonie@kernel.org writes:
There is a strong case for saying that all the clocking in CODECs might fit into the clock API, especially given the whole DT thing.
The ASoC APIs don't speak "struct clk", which seems (to me) like a prerequisite before we can think about doing anything with clocks.
Right, they probably should.
Even if ASoC began to use the clock API for codec clocking, it's not clear how you maintain backward compatibility with the existing simple-card bindings. You'd have to go over all DAIs and mimic the effects of "snd_soc_dai_set_sysclk(dai, 0, freq, dir)" because there could be a device tree relying on it somewhere.
Of course, you'd need to define bindings for devices with multiple clocks such that things continue to work out compatibly.
So... given you're already stuck maintaining .set_sysclk() behavior forever, is there much harm in exposing the sysclock ID to the DT?
Yes, it's ABI and the more baked in this stuff gets the more issues we have when trying to integrate with the wider clock tree in the system - for example when devices are able to output their system clock to be used as a master clock for a device which can use the clock API as an input. It's fine in kernel but we should be trying to keep it out of ABI.