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

Commit 08aca087 authored by Kevin Hilman's avatar Kevin Hilman
Browse files

davinci: clkdev cleanup: remove clk_lookup wrapper, use clkdev_add_table()



Remove unneeded 'struct davinci_clk' wrapper around 'struct clk_lookup'
and use clkdev_add_table() to add the list of clocks in one go.

Signed-off-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
parent e89861e9
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -427,13 +427,14 @@ int davinci_set_pllrate(struct pll_data *pll, unsigned int prediv,
}
EXPORT_SYMBOL(davinci_set_pllrate);

int __init davinci_clk_init(struct davinci_clk *clocks)
int __init davinci_clk_init(struct clk_lookup *clocks)
  {
	struct davinci_clk *c;
	struct clk_lookup *c;
	struct clk *clk;
	size_t num_clocks = 0;

	for (c = clocks; c->lk.clk; c++) {
		clk = c->lk.clk;
	for (c = clocks; c->clk; c++) {
		clk = c->clk;

		if (!clk->recalc) {

@@ -456,14 +457,16 @@ int __init davinci_clk_init(struct davinci_clk *clocks)
		if (clk->lpsc)
			clk->flags |= CLK_PSC;

		clkdev_add(&c->lk);
		clk_register(clk);
		num_clocks++;

		/* Turn on clocks that Linux doesn't otherwise manage */
		if (clk->flags & ALWAYS_ENABLED)
			clk_enable(clk);
	}

	clkdev_add_table(clocks, num_clocks);

	return 0;
}

+8 −14
Original line number Diff line number Diff line
@@ -106,20 +106,14 @@ struct clk {
#define CLK_PLL			BIT(4) /* PLL-derived clock */
#define PRE_PLL                 BIT(5) /* source is before PLL mult/div */

struct davinci_clk {
	struct clk_lookup lk;
};

#define CLK(dev, con, ck) 	\
	{			\
		.lk = {			\
		.dev_id = dev,	\
		.con_id = con,	\
		.clk = ck,	\
		},			\
	}
	}			\

int davinci_clk_init(struct davinci_clk *clocks);
int davinci_clk_init(struct clk_lookup *clocks);
int davinci_set_pllrate(struct pll_data *pll, unsigned int prediv,
				unsigned int mult, unsigned int postdiv);

+1 −1
Original line number Diff line number Diff line
@@ -371,7 +371,7 @@ static struct clk rmii_clk = {
	.parent		= &pll0_sysclk7,
};

static struct davinci_clk da830_clks[] = {
static struct clk_lookup da830_clks[] = {
	CLK(NULL,		"ref",		&ref_clk),
	CLK(NULL,		"pll0",		&pll0_clk),
	CLK(NULL,		"pll0_aux",	&pll0_aux_clk),
+4 −4
Original line number Diff line number Diff line
@@ -335,7 +335,7 @@ static struct clk aemif_clk = {
	.flags		= ALWAYS_ENABLED,
};

static struct davinci_clk da850_clks[] = {
static struct clk_lookup da850_clks[] = {
	CLK(NULL,		"ref",		&ref_clk),
	CLK(NULL,		"pll0",		&pll0_clk),
	CLK(NULL,		"pll0_aux",	&pll0_aux_clk),
@@ -834,12 +834,12 @@ static struct davinci_timer_info da850_timer_info = {
static void da850_set_async3_src(int pllnum)
{
	struct clk *clk, *newparent = pllnum ? &pll1_sysclk2 : &pll0_sysclk2;
	struct davinci_clk *c;
	struct clk_lookup *c;
	unsigned int v;
	int ret;

	for (c = da850_clks; c->lk.clk; c++) {
		clk = c->lk.clk;
	for (c = da850_clks; c->clk; c++) {
		clk = c->clk;
		if (clk->flags & DA850_CLK_ASYNC3) {
			ret = clk_set_parent(clk, newparent);
			WARN(ret, "DA850: unable to re-parent clock %s",
+1 −1
Original line number Diff line number Diff line
@@ -335,7 +335,7 @@ static struct clk usb_clk = {
	.lpsc = DAVINCI_LPSC_USB,
};

static struct davinci_clk dm355_clks[] = {
static struct clk_lookup dm355_clks[] = {
	CLK(NULL, "ref", &ref_clk),
	CLK(NULL, "pll1", &pll1_clk),
	CLK(NULL, "pll1_sysclk1", &pll1_sysclk1),
Loading