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

Commit e1482a17 authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

Merge branch 'mxs/clk-prepare' of git://git.linaro.org/people/shawnguo/linux-2.6 into imx/clk

parents 5f0a6e2d 6abda3e1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -442,6 +442,7 @@ config ARCH_MXS
	select ARCH_REQUIRE_GPIOLIB
	select CLKDEV_LOOKUP
	select CLKSRC_MMIO
	select HAVE_CLK_PREPARE
	help
	  Support for Freescale MXS-based family of processors

+5 −5
Original line number Diff line number Diff line
@@ -545,11 +545,11 @@ int __init mx23_clocks_init(void)
	 */
	clk_set_parent(&ssp_clk, &ref_io_clk);

	clk_enable(&cpu_clk);
	clk_enable(&hbus_clk);
	clk_enable(&xbus_clk);
	clk_enable(&emi_clk);
	clk_enable(&uart_clk);
	clk_prepare_enable(&cpu_clk);
	clk_prepare_enable(&hbus_clk);
	clk_prepare_enable(&xbus_clk);
	clk_prepare_enable(&emi_clk);
	clk_prepare_enable(&uart_clk);

	clkdev_add_table(lookups, ARRAY_SIZE(lookups));

+5 −5
Original line number Diff line number Diff line
@@ -775,11 +775,11 @@ int __init mx28_clocks_init(void)
	clk_set_parent(&ssp0_clk, &ref_io0_clk);
	clk_set_parent(&ssp1_clk, &ref_io0_clk);

	clk_enable(&cpu_clk);
	clk_enable(&hbus_clk);
	clk_enable(&xbus_clk);
	clk_enable(&emi_clk);
	clk_enable(&uart_clk);
	clk_prepare_enable(&cpu_clk);
	clk_prepare_enable(&hbus_clk);
	clk_prepare_enable(&xbus_clk);
	clk_prepare_enable(&emi_clk);
	clk_prepare_enable(&uart_clk);

	clk_set_parent(&lcdif_clk, &ref_pix_clk);
	clk_set_parent(&saif0_clk, &pll0_clk);
+23 −10
Original line number Diff line number Diff line
@@ -74,10 +74,15 @@ static int __clk_enable(struct clk *clk)
	return 0;
}

/* This function increments the reference count on the clock and enables the
 * clock if not already enabled. The parent clock tree is recursively enabled
/*
 * The clk_enable/clk_disable could be called by drivers in atomic context,
 * so they should not really hold mutex.  Instead, clk_prepare/clk_unprepare
 * can hold a mutex, as the pair will only be called in non-atomic context.
 * Before migrating to common clk framework, we can have __clk_enable and
 * __clk_disable called in clk_prepare/clk_unprepare with mutex held and
 * leave clk_enable/clk_disable as the dummy functions.
 */
int clk_enable(struct clk *clk)
int clk_prepare(struct clk *clk)
{
	int ret = 0;

@@ -90,13 +95,9 @@ int clk_enable(struct clk *clk)

	return ret;
}
EXPORT_SYMBOL(clk_enable);
EXPORT_SYMBOL(clk_prepare);

/* This function decrements the reference count on the clock and disables
 * the clock when reference count is 0. The parent clock tree is
 * recursively disabled
 */
void clk_disable(struct clk *clk)
void clk_unprepare(struct clk *clk)
{
	if (clk == NULL || IS_ERR(clk))
		return;
@@ -105,6 +106,18 @@ void clk_disable(struct clk *clk)
	__clk_disable(clk);
	mutex_unlock(&clocks_mutex);
}
EXPORT_SYMBOL(clk_unprepare);

int clk_enable(struct clk *clk)
{
	return 0;
}
EXPORT_SYMBOL(clk_enable);

void clk_disable(struct clk *clk)
{
	/* nothing to do */
}
EXPORT_SYMBOL(clk_disable);

/* Retrieve the *current* clock rate. If the clock itself
@@ -166,7 +179,7 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
		return ret;

	if (clk->usecount)
		clk_enable(parent);
		clk_prepare_enable(parent);

	mutex_lock(&clocks_mutex);
	ret = clk->set_parent(clk, parent);
+1 −1
Original line number Diff line number Diff line
@@ -228,7 +228,7 @@ static void __init mx28evk_fec_reset(void)
	/* Enable fec phy clock */
	clk = clk_get_sys("pll2", NULL);
	if (!IS_ERR(clk))
		clk_enable(clk);
		clk_prepare_enable(clk);

	/* Power up fec phy */
	ret = gpio_request(MX28EVK_FEC_PHY_POWER, "fec-phy-power");
Loading