ARM: OMAP1: clock: Remove noop code
authorJanusz Krzysztofik <jmkrzyszt@gmail.com>
Sun, 10 Apr 2022 13:07:56 +0000 (15:07 +0200)
committerArnd Bergmann <arnd@arndb.de>
Fri, 22 Apr 2022 09:08:56 +0000 (11:08 +0200)
There are some OMAP1 clock code bits that have no effect:
- crystal_type variable is set to 0 but never changed, then
  crystal_type == 2 condition is never true and ck_ref.rate never set to
  19200000,
- clk->ops->allow_idle() is called from omap_clk_enable_autoidle_all() but
  that op is not configured for any clock, then the function does nothing
  and the op field is not needed,
- ENABLE_ON_INIT flag is set for some clocks but is never checked by any
  code, then not needed.
Drop that code.

Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
arch/arm/mach-omap1/clock.c
arch/arm/mach-omap1/clock.h
arch/arm/mach-omap1/clock_data.c

index 5ea8ec026a85429d22a49973beb2183b970b595f..e5bd4d3b742df52e6901483e336c7ba6933b38b1 100644 (file)
@@ -798,22 +798,6 @@ void clk_unregister(struct clk *clk)
 }
 EXPORT_SYMBOL(clk_unregister);
 
-int omap_clk_enable_autoidle_all(void)
-{
-       struct clk *c;
-       unsigned long flags;
-
-       spin_lock_irqsave(&clockfw_lock, flags);
-
-       list_for_each_entry(c, &clocks, node)
-               if (c->ops->allow_idle)
-                       c->ops->allow_idle(c);
-
-       spin_unlock_irqrestore(&clockfw_lock, flags);
-
-       return 0;
-}
-
 /*
  * Low level helpers
  */
@@ -871,7 +855,6 @@ static int __init clk_disable_unused(void)
        return 0;
 }
 late_initcall(clk_disable_unused);
-late_initcall(omap_clk_enable_autoidle_all);
 #endif
 
 #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
index 7bebd488f1bebe79eb875a5d3737458d2db091a8..8025e4a22469f810da8d3ccfcb3cb343a69f3966 100644 (file)
@@ -53,7 +53,6 @@ struct omap_clk {
 struct clkops {
        int                     (*enable)(struct clk *);
        void                    (*disable)(struct clk *);
-       void                    (*allow_idle)(struct clk *);
 };
 
 /*
@@ -64,7 +63,6 @@ struct clkops {
 #define ENABLE_REG_32BIT       (1 << 0)        /* Use 32-bit access */
 #define CLOCK_IDLE_CONTROL     (1 << 1)
 #define CLOCK_NO_IDLE_PARENT   (1 << 2)
-#define ENABLE_ON_INIT         (1 << 3)        /* Enable upon framework init */
 
 /**
  * struct clk - OMAP struct clk
@@ -135,7 +133,6 @@ extern void clk_unregister(struct clk *clk);
 extern void propagate_rate(struct clk *clk);
 extern unsigned long followparent_recalc(struct clk *clk);
 unsigned long omap_fixed_divisor_recalc(struct clk *clk);
-extern int omap_clk_enable_autoidle_all(void);
 
 extern const struct clkops clkops_null;
 
index 57d3752babf883e235490bd77ce581c29935835f..9b9c9fcc61c282d3f67e6367219843c272a025d5 100644 (file)
@@ -92,8 +92,7 @@ static struct arm_idlect1_clk ck_dpll1out = {
                .name           = "ck_dpll1out",
                .ops            = &clkops_generic,
                .parent         = &ck_dpll1,
-               .flags          = CLOCK_IDLE_CONTROL | ENABLE_REG_32BIT |
-                                 ENABLE_ON_INIT,
+               .flags          = CLOCK_IDLE_CONTROL | ENABLE_REG_32BIT,
                .enable_reg     = OMAP1_IO_ADDRESS(ARM_IDLECT2),
                .enable_bit     = EN_CKOUT_ARM,
                .recalc         = &followparent_recalc,
@@ -146,7 +145,6 @@ static struct clk arm_gpio_ck = {
        .name           = "ick",
        .ops            = &clkops_generic,
        .parent         = &ck_dpll1,
-       .flags          = ENABLE_ON_INIT,
        .enable_reg     = OMAP1_IO_ADDRESS(ARM_IDLECT2),
        .enable_bit     = EN_GPIOCK,
        .recalc         = &followparent_recalc,
@@ -316,7 +314,6 @@ static struct clk tc2_ck = {
        .name           = "tc2_ck",
        .ops            = &clkops_generic,
        .parent         = &tc_ck.clk,
-       .flags          = ENABLE_ON_INIT,
        .enable_reg     = OMAP1_IO_ADDRESS(ARM_IDLECT3),
        .enable_bit     = EN_TC2_CK,
        .recalc         = &followparent_recalc,
@@ -762,7 +759,6 @@ u32 cpu_mask;
 int __init omap1_clk_init(void)
 {
        struct omap_clk *c;
-       int crystal_type = 0; /* Default 12 MHz */
        u32 reg;
 
 #ifdef CONFIG_DEBUG_LL
@@ -810,8 +806,6 @@ int __init omap1_clk_init(void)
 
        if (cpu_is_omap7xx())
                ck_ref.rate = 13000000;
-       if (cpu_is_omap16xx() && crystal_type == 2)
-               ck_ref.rate = 19200000;
 
        pr_info("Clocks: ARM_SYSST: 0x%04x DPLL_CTL: 0x%04x ARM_CKCTL: 0x%04x\n",
                omap_readw(ARM_SYSST), omap_readw(DPLL_CTL),