On Tue, May 30, 2023 at 1:28 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote: > On 5/29/23 23:48, Andy Shevchenko wrote: > > On Mon, May 29, 2023 at 1:39 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote: ... > >> + ret = clk_prepare_enable(clk); > >> + if (!ret) > >> + clk_disable_unprepare(clk); > > > > I'm wondering if _enable / _disable required. > > As the comment says the BIOS may have the clock enabled > at boot, the hw won't allow changing the rate while > the clk is enabled and the clk-framework won't > allow calling clk_disable_unprepare(clk) without > first calling clk_prepare_enable(). > > All the sound/soc/intel/boards/*.c files which are > used on BYT / CHT do the same thing before setting > the codec clk speed. Interesting... It might be that x86 (under drivers/clk/x86 or somewhere there) can gain a common helper to do this trick, so we won't repeat this over and over again. -- With Best Regards, Andy Shevchenko