aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Hilman <khilman@deeprootsystems.com>2010-01-11 11:22:23 -0500
committerKevin Hilman <khilman@deeprootsystems.com>2010-02-04 16:30:09 -0500
commit08aca087f263e8089420b2723fe0c1a0cbe5de0c (patch)
treee63f7d29d5f06e3eb4c1cc29f790b174105b8afb
parente89861e9b44fcd606cdade6230eb0037ad5911bf (diff)
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: Kevin Hilman <khilman@deeprootsystems.com>
-rw-r--r--arch/arm/mach-davinci/clock.c13
-rw-r--r--arch/arm/mach-davinci/clock.h22
-rw-r--r--arch/arm/mach-davinci/da830.c2
-rw-r--r--arch/arm/mach-davinci/da850.c8
-rw-r--r--arch/arm/mach-davinci/dm355.c2
-rw-r--r--arch/arm/mach-davinci/dm365.c2
-rw-r--r--arch/arm/mach-davinci/dm644x.c2
-rw-r--r--arch/arm/mach-davinci/dm646x.c2
-rw-r--r--arch/arm/mach-davinci/include/mach/common.h2
9 files changed, 26 insertions, 29 deletions
diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c
index 0fc63f93a222..bf6218ee94e1 100644
--- a/arch/arm/mach-davinci/clock.c
+++ b/arch/arm/mach-davinci/clock.c
@@ -427,13 +427,14 @@ int davinci_set_pllrate(struct pll_data *pll, unsigned int prediv,
427} 427}
428EXPORT_SYMBOL(davinci_set_pllrate); 428EXPORT_SYMBOL(davinci_set_pllrate);
429 429
430int __init davinci_clk_init(struct davinci_clk *clocks) 430int __init davinci_clk_init(struct clk_lookup *clocks)
431 { 431 {
432 struct davinci_clk *c; 432 struct clk_lookup *c;
433 struct clk *clk; 433 struct clk *clk;
434 size_t num_clocks = 0;
434 435
435 for (c = clocks; c->lk.clk; c++) { 436 for (c = clocks; c->clk; c++) {
436 clk = c->lk.clk; 437 clk = c->clk;
437 438
438 if (!clk->recalc) { 439 if (!clk->recalc) {
439 440
@@ -456,14 +457,16 @@ int __init davinci_clk_init(struct davinci_clk *clocks)
456 if (clk->lpsc) 457 if (clk->lpsc)
457 clk->flags |= CLK_PSC; 458 clk->flags |= CLK_PSC;
458 459
459 clkdev_add(&c->lk);
460 clk_register(clk); 460 clk_register(clk);
461 num_clocks++;
461 462
462 /* Turn on clocks that Linux doesn't otherwise manage */ 463 /* Turn on clocks that Linux doesn't otherwise manage */
463 if (clk->flags & ALWAYS_ENABLED) 464 if (clk->flags & ALWAYS_ENABLED)
464 clk_enable(clk); 465 clk_enable(clk);
465 } 466 }
466 467
468 clkdev_add_table(clocks, num_clocks);
469
467 return 0; 470 return 0;
468} 471}
469 472
diff --git a/arch/arm/mach-davinci/clock.h b/arch/arm/mach-davinci/clock.h
index 31fb6eac712c..aa0a61150325 100644
--- a/arch/arm/mach-davinci/clock.h
+++ b/arch/arm/mach-davinci/clock.h
@@ -106,20 +106,14 @@ struct clk {
106#define CLK_PLL BIT(4) /* PLL-derived clock */ 106#define CLK_PLL BIT(4) /* PLL-derived clock */
107#define PRE_PLL BIT(5) /* source is before PLL mult/div */ 107#define PRE_PLL BIT(5) /* source is before PLL mult/div */
108 108
109struct davinci_clk { 109#define CLK(dev, con, ck) \
110 struct clk_lookup lk; 110 { \
111}; 111 .dev_id = dev, \
112 112 .con_id = con, \
113#define CLK(dev, con, ck) \ 113 .clk = ck, \
114 { \ 114 } \
115 .lk = { \ 115
116 .dev_id = dev, \ 116int davinci_clk_init(struct clk_lookup *clocks);
117 .con_id = con, \
118 .clk = ck, \
119 }, \
120 }
121
122int davinci_clk_init(struct davinci_clk *clocks);
123int davinci_set_pllrate(struct pll_data *pll, unsigned int prediv, 117int davinci_set_pllrate(struct pll_data *pll, unsigned int prediv,
124 unsigned int mult, unsigned int postdiv); 118 unsigned int mult, unsigned int postdiv);
125 119
diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c
index 54796050a2ff..122e61a9f505 100644
--- a/arch/arm/mach-davinci/da830.c
+++ b/arch/arm/mach-davinci/da830.c
@@ -371,7 +371,7 @@ static struct clk rmii_clk = {
371 .parent = &pll0_sysclk7, 371 .parent = &pll0_sysclk7,
372}; 372};
373 373
374static struct davinci_clk da830_clks[] = { 374static struct clk_lookup da830_clks[] = {
375 CLK(NULL, "ref", &ref_clk), 375 CLK(NULL, "ref", &ref_clk),
376 CLK(NULL, "pll0", &pll0_clk), 376 CLK(NULL, "pll0", &pll0_clk),
377 CLK(NULL, "pll0_aux", &pll0_aux_clk), 377 CLK(NULL, "pll0_aux", &pll0_aux_clk),
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index b9a7b3bc36b2..d0fd7566712a 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -335,7 +335,7 @@ static struct clk aemif_clk = {
335 .flags = ALWAYS_ENABLED, 335 .flags = ALWAYS_ENABLED,
336}; 336};
337 337
338static struct davinci_clk da850_clks[] = { 338static struct clk_lookup da850_clks[] = {
339 CLK(NULL, "ref", &ref_clk), 339 CLK(NULL, "ref", &ref_clk),
340 CLK(NULL, "pll0", &pll0_clk), 340 CLK(NULL, "pll0", &pll0_clk),
341 CLK(NULL, "pll0_aux", &pll0_aux_clk), 341 CLK(NULL, "pll0_aux", &pll0_aux_clk),
@@ -834,12 +834,12 @@ static struct davinci_timer_info da850_timer_info = {
834static void da850_set_async3_src(int pllnum) 834static void da850_set_async3_src(int pllnum)
835{ 835{
836 struct clk *clk, *newparent = pllnum ? &pll1_sysclk2 : &pll0_sysclk2; 836 struct clk *clk, *newparent = pllnum ? &pll1_sysclk2 : &pll0_sysclk2;
837 struct davinci_clk *c; 837 struct clk_lookup *c;
838 unsigned int v; 838 unsigned int v;
839 int ret; 839 int ret;
840 840
841 for (c = da850_clks; c->lk.clk; c++) { 841 for (c = da850_clks; c->clk; c++) {
842 clk = c->lk.clk; 842 clk = c->clk;
843 if (clk->flags & DA850_CLK_ASYNC3) { 843 if (clk->flags & DA850_CLK_ASYNC3) {
844 ret = clk_set_parent(clk, newparent); 844 ret = clk_set_parent(clk, newparent);
845 WARN(ret, "DA850: unable to re-parent clock %s", 845 WARN(ret, "DA850: unable to re-parent clock %s",
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index b1185f82ffb3..2cdd8740aad9 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -335,7 +335,7 @@ static struct clk usb_clk = {
335 .lpsc = DAVINCI_LPSC_USB, 335 .lpsc = DAVINCI_LPSC_USB,
336}; 336};
337 337
338static struct davinci_clk dm355_clks[] = { 338static struct clk_lookup dm355_clks[] = {
339 CLK(NULL, "ref", &ref_clk), 339 CLK(NULL, "ref", &ref_clk),
340 CLK(NULL, "pll1", &pll1_clk), 340 CLK(NULL, "pll1", &pll1_clk),
341 CLK(NULL, "pll1_sysclk1", &pll1_sysclk1), 341 CLK(NULL, "pll1_sysclk1", &pll1_sysclk1),
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index d5010567b496..e88f2624df68 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -403,7 +403,7 @@ static struct clk mjcp_clk = {
403 .lpsc = DM365_LPSC_MJCP, 403 .lpsc = DM365_LPSC_MJCP,
404}; 404};
405 405
406static struct davinci_clk dm365_clks[] = { 406static struct clk_lookup dm365_clks[] = {
407 CLK(NULL, "ref", &ref_clk), 407 CLK(NULL, "ref", &ref_clk),
408 CLK(NULL, "pll1", &pll1_clk), 408 CLK(NULL, "pll1", &pll1_clk),
409 CLK(NULL, "pll1_aux", &pll1_aux_clk), 409 CLK(NULL, "pll1_aux", &pll1_aux_clk),
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index fc060e7aefdf..a7b57237461a 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -277,7 +277,7 @@ static struct clk timer2_clk = {
277 .usecount = 1, /* REVISIT: why cant' this be disabled? */ 277 .usecount = 1, /* REVISIT: why cant' this be disabled? */
278}; 278};
279 279
280struct davinci_clk dm644x_clks[] = { 280struct clk_lookup dm644x_clks[] = {
281 CLK(NULL, "ref", &ref_clk), 281 CLK(NULL, "ref", &ref_clk),
282 CLK(NULL, "pll1", &pll1_clk), 282 CLK(NULL, "pll1", &pll1_clk),
283 CLK(NULL, "pll1_sysclk1", &pll1_sysclk1), 283 CLK(NULL, "pll1_sysclk1", &pll1_sysclk1),
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index 7eb34e9253c6..893baf4ad37d 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -311,7 +311,7 @@ static struct clk vpif1_clk = {
311 .flags = ALWAYS_ENABLED, 311 .flags = ALWAYS_ENABLED,
312}; 312};
313 313
314struct davinci_clk dm646x_clks[] = { 314struct clk_lookup dm646x_clks[] = {
315 CLK(NULL, "ref", &ref_clk), 315 CLK(NULL, "ref", &ref_clk),
316 CLK(NULL, "aux", &aux_clkin), 316 CLK(NULL, "aux", &aux_clkin),
317 CLK(NULL, "pll1", &pll1_clk), 317 CLK(NULL, "pll1", &pll1_clk),
diff --git a/arch/arm/mach-davinci/include/mach/common.h b/arch/arm/mach-davinci/include/mach/common.h
index 6ca2c9a0a482..50a955f05ef9 100644
--- a/arch/arm/mach-davinci/include/mach/common.h
+++ b/arch/arm/mach-davinci/include/mach/common.h
@@ -43,7 +43,7 @@ struct davinci_soc_info {
43 void __iomem *jtag_id_base; 43 void __iomem *jtag_id_base;
44 struct davinci_id *ids; 44 struct davinci_id *ids;
45 unsigned long ids_num; 45 unsigned long ids_num;
46 struct davinci_clk *cpu_clks; 46 struct clk_lookup *cpu_clks;
47 void __iomem **psc_bases; 47 void __iomem **psc_bases;
48 unsigned long psc_bases_num; 48 unsigned long psc_bases_num;
49 void __iomem *pinmux_base; 49 void __iomem *pinmux_base;