clk: samsung: exynos-clkout: convert to module driver
authorKrzysztof Kozlowski <krzk@kernel.org>
Thu, 1 Oct 2020 16:56:46 +0000 (18:56 +0200)
committerKrzysztof Kozlowski <krzk@kernel.org>
Wed, 28 Oct 2020 22:04:46 +0000 (23:04 +0100)
commit9484f2cb83327c4197c0809cdf3156d4213c44e5
treeda63107aea0af49eebcac0f0d0ad0dbc20dbc31a
parent93618e344a5ee995249ab6af813092d08313ea83
clk: samsung: exynos-clkout: convert to module driver

The Exynos clkout driver depends on board input clock (typically XXTI or
XUSBXTI), however on Exynos4 boards these clocks were modeled as part of
SoC clocks (Exynos4 clocks driver).  Obviously this is not proper, but
correcting it would break DT backward compatibility.

Both drivers - clkout and Exynos4 clocks - register the clock providers
with CLK_OF_DECLARE/OF_DECLARE_1 so their order is fragile (in the
Makefile clkout is behind Exynos4 clock).  It will work only if the
Exynos4 clock driver comes up before clkout.

A change in DTS adding input clock reference to Exynos4 clocks input
PLL, see reverted commit eaf2d2f6895d ("ARM: dts: exynos: add input
clock to CMU in Exynos4412 Odroid"), caused probe reorder: the clkout
appeared before Exynos4 clock provider.  Since clkout depends on Exynos4
clocks and does not support deferred probe, this did not work and caused
later failure of usb3503 USB hub probe which needs clkout:

    [    5.007442] usb3503 0-0008: unable to request refclk (-517)

The Exynos clkout driver is not a critical/core clock so there is
actually no problem in instantiating it later, as a regular module.
This removes specific probe ordering and adds support for probe
deferral.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Tested-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Link: https://lore.kernel.org/r/20201001165646.32279-3-krzk@kernel.org
drivers/clk/samsung/clk-exynos-clkout.c