• Janusz Krzysztofik's avatar
    ARM: OMAP1: clock: Convert to CCF · c73b9099
    Janusz Krzysztofik authored
    OMAP1 still uses its own implementation of standard clock API defined in
    include/linux/clk.h.  Internals of that implementation are not visible
    outside OMAP1 directory.  As a consequence, device drivers are not able to
    register clocks potentially provided by peripheral devices.
    
    Drop OMAP1 implementation of the clock API and enable common clock
    framework.  Modify the remaining low level code to be compatible with
    clock provider API and register the clocks with CCF.
    
    Move initialisation of clocks to omap1_timer_init() to avoid memory
    allocation issues at early setup phase from where omap1_init_early() is
    called.  Register the clocks after initialization of clock I/O registers,
    local clock pointers used by OMAP1 clock ops, and local .rate fields of
    clocks with no local implementation of .recalc ops, so CCF structures are
    populated with correct data during clock registration.  Instead of
    enabling some of the registered clocks, flag them for CCF as critical.
    Introduce .is_enabled op using code that verifies hardware status of clock
    enablement, split out from implementation of .disable_unused op, so the
    latter is actually called by CCF for not requested but hardware enabled
    clocks.  Add .round_rate ops where missing so .set_rate ops are called by
    CCF as expected.  Since CCF allows parallel execution of .enable/.disable
    and .set_rate ops, protect registers shared among those groups of ops from
    concurrent access with spinlocks.  Drop local debugfs support in favor of
    that provided by CCF.
    
    v2: flag tc2_ck as CLK_IS_CRITICAL (Aaro)
    v3: rebase on top of soc/omap1-multiplatform-5.18,
      - drop no longer needed includes from arch/arm/mach-omap1/io.c
    Signed-off-by: default avatarJanusz Krzysztofik <jmkrzyszt@gmail.com>
    Acked-by: default avatarTony Lindgren <tony@atomide.com>
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    c73b9099
clock.h 6.59 KB