Skip to content

Commit e9bdc3d

Browse files
jkrzysztarndb
authored andcommitted
ARM: OMAP1: clock: Remove noop code
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>
1 parent 6bdfc9b commit e9bdc3d

3 files changed

Lines changed: 1 addition & 27 deletions

File tree

arch/arm/mach-omap1/clock.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -798,22 +798,6 @@ void clk_unregister(struct clk *clk)
798798
}
799799
EXPORT_SYMBOL(clk_unregister);
800800

801-
int omap_clk_enable_autoidle_all(void)
802-
{
803-
struct clk *c;
804-
unsigned long flags;
805-
806-
spin_lock_irqsave(&clockfw_lock, flags);
807-
808-
list_for_each_entry(c, &clocks, node)
809-
if (c->ops->allow_idle)
810-
c->ops->allow_idle(c);
811-
812-
spin_unlock_irqrestore(&clockfw_lock, flags);
813-
814-
return 0;
815-
}
816-
817801
/*
818802
* Low level helpers
819803
*/
@@ -871,7 +855,6 @@ static int __init clk_disable_unused(void)
871855
return 0;
872856
}
873857
late_initcall(clk_disable_unused);
874-
late_initcall(omap_clk_enable_autoidle_all);
875858
#endif
876859

877860
#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)

arch/arm/mach-omap1/clock.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ struct omap_clk {
5353
struct clkops {
5454
int (*enable)(struct clk *);
5555
void (*disable)(struct clk *);
56-
void (*allow_idle)(struct clk *);
5756
};
5857

5958
/*
@@ -64,7 +63,6 @@ struct clkops {
6463
#define ENABLE_REG_32BIT (1 << 0) /* Use 32-bit access */
6564
#define CLOCK_IDLE_CONTROL (1 << 1)
6665
#define CLOCK_NO_IDLE_PARENT (1 << 2)
67-
#define ENABLE_ON_INIT (1 << 3) /* Enable upon framework init */
6866

6967
/**
7068
* struct clk - OMAP struct clk
@@ -135,7 +133,6 @@ extern void clk_unregister(struct clk *clk);
135133
extern void propagate_rate(struct clk *clk);
136134
extern unsigned long followparent_recalc(struct clk *clk);
137135
unsigned long omap_fixed_divisor_recalc(struct clk *clk);
138-
extern int omap_clk_enable_autoidle_all(void);
139136

140137
extern const struct clkops clkops_null;
141138

arch/arm/mach-omap1/clock_data.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ static struct arm_idlect1_clk ck_dpll1out = {
9292
.name = "ck_dpll1out",
9393
.ops = &clkops_generic,
9494
.parent = &ck_dpll1,
95-
.flags = CLOCK_IDLE_CONTROL | ENABLE_REG_32BIT |
96-
ENABLE_ON_INIT,
95+
.flags = CLOCK_IDLE_CONTROL | ENABLE_REG_32BIT,
9796
.enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
9897
.enable_bit = EN_CKOUT_ARM,
9998
.recalc = &followparent_recalc,
@@ -146,7 +145,6 @@ static struct clk arm_gpio_ck = {
146145
.name = "ick",
147146
.ops = &clkops_generic,
148147
.parent = &ck_dpll1,
149-
.flags = ENABLE_ON_INIT,
150148
.enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
151149
.enable_bit = EN_GPIOCK,
152150
.recalc = &followparent_recalc,
@@ -316,7 +314,6 @@ static struct clk tc2_ck = {
316314
.name = "tc2_ck",
317315
.ops = &clkops_generic,
318316
.parent = &tc_ck.clk,
319-
.flags = ENABLE_ON_INIT,
320317
.enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT3),
321318
.enable_bit = EN_TC2_CK,
322319
.recalc = &followparent_recalc,
@@ -762,7 +759,6 @@ u32 cpu_mask;
762759
int __init omap1_clk_init(void)
763760
{
764761
struct omap_clk *c;
765-
int crystal_type = 0; /* Default 12 MHz */
766762
u32 reg;
767763

768764
#ifdef CONFIG_DEBUG_LL
@@ -810,8 +806,6 @@ int __init omap1_clk_init(void)
810806

811807
if (cpu_is_omap7xx())
812808
ck_ref.rate = 13000000;
813-
if (cpu_is_omap16xx() && crystal_type == 2)
814-
ck_ref.rate = 19200000;
815809

816810
pr_info("Clocks: ARM_SYSST: 0x%04x DPLL_CTL: 0x%04x ARM_CKCTL: 0x%04x\n",
817811
omap_readw(ARM_SYSST), omap_readw(DPLL_CTL),

0 commit comments

Comments
 (0)