Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e9b98f60 authored by Paul Walmsley's avatar Paul Walmsley
Browse files

OMAP clock: make the fixed divisor clock code available for all OMAPs



One of the OMAP1 clocks can use the fixed divisor recalculation code
introduced in the OMAP2 clock code, so rename the
omap2_fixed_divisor_recalc() function to omap_fixed_divisor_recalc()
and make it available to all OMAPs.  A followup patch converts the OMAP1
clock.

Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
parent ced82529
Loading
Loading
Loading
Loading
+0 −11
Original line number Original line Diff line number Diff line
@@ -300,17 +300,6 @@ u32 omap2_get_dpll_rate(struct clk *clk)
	return dpll_clk;
	return dpll_clk;
}
}


/*
 * Used for clocks that have the same value as the parent clock,
 * divided by some factor
 */
unsigned long omap2_fixed_divisor_recalc(struct clk *clk)
{
	WARN_ON(!clk->fixed_div);

	return clk->parent->rate / clk->fixed_div;
}

/**
/**
 * omap2_clk_dflt_find_companion - find companion clock to @clk
 * omap2_clk_dflt_find_companion - find companion clock to @clk
 * @clk: struct clk * to find the companion clock of
 * @clk: struct clk * to find the companion clock of
+0 −1
Original line number Original line Diff line number Diff line
@@ -78,7 +78,6 @@ u32 omap2_clksel_round_rate_div(struct clk *clk, unsigned long target_rate,
				u32 *new_div);
				u32 *new_div);
u32 omap2_clksel_to_divisor(struct clk *clk, u32 field_val);
u32 omap2_clksel_to_divisor(struct clk *clk, u32 field_val);
u32 omap2_divisor_to_clksel(struct clk *clk, u32 div);
u32 omap2_divisor_to_clksel(struct clk *clk, u32 div);
unsigned long omap2_fixed_divisor_recalc(struct clk *clk);
long omap2_clksel_round_rate(struct clk *clk, unsigned long target_rate);
long omap2_clksel_round_rate(struct clk *clk, unsigned long target_rate);
int omap2_clksel_set_rate(struct clk *clk, unsigned long rate);
int omap2_clksel_set_rate(struct clk *clk, unsigned long rate);
u32 omap2_get_dpll_rate(struct clk *clk);
u32 omap2_get_dpll_rate(struct clk *clk);
+2 −2
Original line number Original line Diff line number Diff line
@@ -261,7 +261,7 @@ static struct clk func_12m_ck = {
	.parent		= &func_48m_ck,
	.parent		= &func_48m_ck,
	.fixed_div	= 4,
	.fixed_div	= 4,
	.clkdm_name	= "wkup_clkdm",
	.clkdm_name	= "wkup_clkdm",
	.recalc		= &omap2_fixed_divisor_recalc,
	.recalc		= &omap_fixed_divisor_recalc,
};
};


/* Secure timer, only available in secure mode */
/* Secure timer, only available in secure mode */
@@ -557,7 +557,7 @@ static struct clk iva1_mpu_int_ifck = {
	.enable_reg	= OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
	.enable_reg	= OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP2420_EN_IVA_MPU_SHIFT,
	.enable_bit	= OMAP2420_EN_IVA_MPU_SHIFT,
	.fixed_div	= 2,
	.fixed_div	= 2,
	.recalc		= &omap2_fixed_divisor_recalc,
	.recalc		= &omap_fixed_divisor_recalc,
};
};


/*
/*
+3 −3
Original line number Original line Diff line number Diff line
@@ -735,7 +735,7 @@ static struct clk omap_12m_fck = {
	.ops		= &clkops_null,
	.ops		= &clkops_null,
	.parent		= &omap_48m_fck,
	.parent		= &omap_48m_fck,
	.fixed_div	= 4,
	.fixed_div	= 4,
	.recalc		= &omap2_fixed_divisor_recalc,
	.recalc		= &omap_fixed_divisor_recalc,
};
};


/* This virstual clock is the source for dpll4_m4x2_ck */
/* This virstual clock is the source for dpll4_m4x2_ck */
@@ -1588,7 +1588,7 @@ static struct clk ssi_sst_fck_3430es1 = {
	.ops		= &clkops_null,
	.ops		= &clkops_null,
	.parent		= &ssi_ssr_fck_3430es1,
	.parent		= &ssi_ssr_fck_3430es1,
	.fixed_div	= 2,
	.fixed_div	= 2,
	.recalc		= &omap2_fixed_divisor_recalc,
	.recalc		= &omap_fixed_divisor_recalc,
};
};


static struct clk ssi_sst_fck_3430es2 = {
static struct clk ssi_sst_fck_3430es2 = {
@@ -1596,7 +1596,7 @@ static struct clk ssi_sst_fck_3430es2 = {
	.ops		= &clkops_null,
	.ops		= &clkops_null,
	.parent		= &ssi_ssr_fck_3430es2,
	.parent		= &ssi_ssr_fck_3430es2,
	.fixed_div	= 2,
	.fixed_div	= 2,
	.recalc		= &omap2_fixed_divisor_recalc,
	.recalc		= &omap_fixed_divisor_recalc,
};
};




+11 −0
Original line number Original line Diff line number Diff line
@@ -199,6 +199,17 @@ unsigned long followparent_recalc(struct clk *clk)
	return clk->parent->rate;
	return clk->parent->rate;
}
}


/*
 * Used for clocks that have the same value as the parent clock,
 * divided by some factor
 */
unsigned long omap_fixed_divisor_recalc(struct clk *clk)
{
	WARN_ON(!clk->fixed_div);

	return clk->parent->rate / clk->fixed_div;
}

void clk_reparent(struct clk *child, struct clk *parent)
void clk_reparent(struct clk *child, struct clk *parent)
{
{
	list_del_init(&child->sibling);
	list_del_init(&child->sibling);
Loading