aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c22
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2420.h3
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2430.h3
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_34xx.h3
-rw-r--r--arch/arm/plat-omap/include/plat/omap_hwmod.h26
5 files changed, 23 insertions, 34 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index fb11ec176d55..501660aae962 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -416,18 +416,18 @@ static int _init_main_clk(struct omap_hwmod *oh)
416 struct clk *c; 416 struct clk *c;
417 int ret = 0; 417 int ret = 0;
418 418
419 if (!oh->clkdev_con_id) 419 if (!oh->main_clk)
420 return 0; 420 return 0;
421 421
422 c = clk_get_sys(oh->clkdev_dev_id, oh->clkdev_con_id); 422 c = omap_clk_get_by_name(oh->main_clk);
423 WARN(IS_ERR(c), "omap_hwmod: %s: cannot clk_get main_clk %s.%s\n", 423 WARN(IS_ERR(c), "omap_hwmod: %s: cannot clk_get main_clk %s\n",
424 oh->name, oh->clkdev_dev_id, oh->clkdev_con_id); 424 oh->name, oh->main_clk);
425 if (IS_ERR(c)) 425 if (IS_ERR(c))
426 ret = -EINVAL; 426 ret = -EINVAL;
427 oh->_clk = c; 427 oh->_clk = c;
428 428
429 WARN(!c->clkdm, "omap_hwmod: %s: missing clockdomain for %s.\n", 429 WARN(!c->clkdm, "omap_hwmod: %s: missing clockdomain for %s.\n",
430 oh->clkdev_con_id, c->name); 430 oh->main_clk, c->name);
431 431
432 return ret; 432 return ret;
433} 433}
@@ -450,13 +450,12 @@ static int _init_interface_clks(struct omap_hwmod *oh)
450 return 0; 450 return 0;
451 451
452 for (i = 0, os = *oh->slaves; i < oh->slaves_cnt; i++, os++) { 452 for (i = 0, os = *oh->slaves; i < oh->slaves_cnt; i++, os++) {
453 if (!os->clkdev_con_id) 453 if (!os->clk)
454 continue; 454 continue;
455 455
456 c = clk_get_sys(os->clkdev_dev_id, os->clkdev_con_id); 456 c = omap_clk_get_by_name(os->clk);
457 WARN(IS_ERR(c), "omap_hwmod: %s: cannot clk_get " 457 WARN(IS_ERR(c), "omap_hwmod: %s: cannot clk_get "
458 "interface_clk %s.%s\n", oh->name, 458 "interface_clk %s\n", oh->name, os->clk);
459 os->clkdev_dev_id, os->clkdev_con_id);
460 if (IS_ERR(c)) 459 if (IS_ERR(c))
461 ret = -EINVAL; 460 ret = -EINVAL;
462 os->_clk = c; 461 os->_clk = c;
@@ -480,10 +479,9 @@ static int _init_opt_clks(struct omap_hwmod *oh)
480 int ret = 0; 479 int ret = 0;
481 480
482 for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) { 481 for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) {
483 c = clk_get_sys(oc->clkdev_dev_id, oc->clkdev_con_id); 482 c = omap_clk_get_by_name(oc->clk);
484 WARN(IS_ERR(c), "omap_hwmod: %s: cannot clk_get opt_clk " 483 WARN(IS_ERR(c), "omap_hwmod: %s: cannot clk_get opt_clk "
485 "%s.%s\n", oh->name, oc->clkdev_dev_id, 484 "%s\n", oh->name, oc->clk);
486 oc->clkdev_con_id);
487 if (IS_ERR(c)) 485 if (IS_ERR(c))
488 ret = -EINVAL; 486 ret = -EINVAL;
489 oc->_clk = c; 487 oc->_clk = c;
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420.h b/arch/arm/mach-omap2/omap_hwmod_2420.h
index a9ca1b99a301..5932c1d3e07b 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420.h
+++ b/arch/arm/mach-omap2/omap_hwmod_2420.h
@@ -117,8 +117,7 @@ static struct omap_hwmod_ocp_if *omap2420_mpu_masters[] = {
117/* MPU */ 117/* MPU */
118static struct omap_hwmod omap2420_mpu_hwmod = { 118static struct omap_hwmod omap2420_mpu_hwmod = {
119 .name = "mpu_hwmod", 119 .name = "mpu_hwmod",
120 .clkdev_dev_id = NULL, 120 .main_clk = "mpu_ck",
121 .clkdev_con_id = "mpu_ck",
122 .masters = omap2420_mpu_masters, 121 .masters = omap2420_mpu_masters,
123 .masters_cnt = ARRAY_SIZE(omap2420_mpu_masters), 122 .masters_cnt = ARRAY_SIZE(omap2420_mpu_masters),
124 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 123 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430.h b/arch/arm/mach-omap2/omap_hwmod_2430.h
index 59a208bea6c2..91f79c05a98c 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430.h
+++ b/arch/arm/mach-omap2/omap_hwmod_2430.h
@@ -119,8 +119,7 @@ static struct omap_hwmod_ocp_if *omap2430_mpu_masters[] = {
119/* MPU */ 119/* MPU */
120static struct omap_hwmod omap2430_mpu_hwmod = { 120static struct omap_hwmod omap2430_mpu_hwmod = {
121 .name = "mpu_hwmod", 121 .name = "mpu_hwmod",
122 .clkdev_dev_id = NULL, 122 .main_clk = "mpu_ck",
123 .clkdev_con_id = "mpu_ck",
124 .masters = omap2430_mpu_masters, 123 .masters = omap2430_mpu_masters,
125 .masters_cnt = ARRAY_SIZE(omap2430_mpu_masters), 124 .masters_cnt = ARRAY_SIZE(omap2430_mpu_masters),
126 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 125 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
diff --git a/arch/arm/mach-omap2/omap_hwmod_34xx.h b/arch/arm/mach-omap2/omap_hwmod_34xx.h
index 2e629dcb2fb1..26991147d5ee 100644
--- a/arch/arm/mach-omap2/omap_hwmod_34xx.h
+++ b/arch/arm/mach-omap2/omap_hwmod_34xx.h
@@ -143,8 +143,7 @@ static struct omap_hwmod_ocp_if *omap34xx_mpu_masters[] = {
143/* MPU */ 143/* MPU */
144static struct omap_hwmod omap34xx_mpu_hwmod = { 144static struct omap_hwmod omap34xx_mpu_hwmod = {
145 .name = "mpu_hwmod", 145 .name = "mpu_hwmod",
146 .clkdev_dev_id = NULL, 146 .main_clk = "arm_fck",
147 .clkdev_con_id = "arm_fck",
148 .masters = omap34xx_mpu_masters, 147 .masters = omap34xx_mpu_masters,
149 .masters_cnt = ARRAY_SIZE(omap34xx_mpu_masters), 148 .masters_cnt = ARRAY_SIZE(omap34xx_mpu_masters),
150 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 149 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 665420e89c21..de4d0422cd2a 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -110,8 +110,7 @@ struct omap_hwmod_dma_info {
110/** 110/**
111 * struct omap_hwmod_opt_clk - optional clocks used by this hwmod 111 * struct omap_hwmod_opt_clk - optional clocks used by this hwmod
112 * @role: "sys", "32k", "tv", etc -- for use in clk_get() 112 * @role: "sys", "32k", "tv", etc -- for use in clk_get()
113 * @clkdev_dev_id: opt clock: clkdev dev_id string 113 * @clk: opt clock: OMAP clock name
114 * @clkdev_con_id: opt clock: clkdev con_id string
115 * @_clk: pointer to the struct clk (filled in at runtime) 114 * @_clk: pointer to the struct clk (filled in at runtime)
116 * 115 *
117 * The module's interface clock and main functional clock should not 116 * The module's interface clock and main functional clock should not
@@ -119,8 +118,7 @@ struct omap_hwmod_dma_info {
119 */ 118 */
120struct omap_hwmod_opt_clk { 119struct omap_hwmod_opt_clk {
121 const char *role; 120 const char *role;
122 const char *clkdev_dev_id; 121 const char *clk;
123 const char *clkdev_con_id;
124 struct clk *_clk; 122 struct clk *_clk;
125}; 123};
126 124
@@ -187,8 +185,7 @@ struct omap_hwmod_addr_space {
187 * @master: struct omap_hwmod that initiates OCP transactions on this link 185 * @master: struct omap_hwmod that initiates OCP transactions on this link
188 * @slave: struct omap_hwmod that responds to OCP transactions on this link 186 * @slave: struct omap_hwmod that responds to OCP transactions on this link
189 * @addr: address space associated with this link 187 * @addr: address space associated with this link
190 * @clkdev_dev_id: interface clock: clkdev dev_id string 188 * @clk: interface clock: OMAP clock name
191 * @clkdev_con_id: interface clock: clkdev con_id string
192 * @_clk: pointer to the interface struct clk (filled in at runtime) 189 * @_clk: pointer to the interface struct clk (filled in at runtime)
193 * @fw: interface firewall data 190 * @fw: interface firewall data
194 * @addr_cnt: ARRAY_SIZE(@addr) 191 * @addr_cnt: ARRAY_SIZE(@addr)
@@ -207,8 +204,7 @@ struct omap_hwmod_ocp_if {
207 struct omap_hwmod *master; 204 struct omap_hwmod *master;
208 struct omap_hwmod *slave; 205 struct omap_hwmod *slave;
209 struct omap_hwmod_addr_space *addr; 206 struct omap_hwmod_addr_space *addr;
210 const char *clkdev_dev_id; 207 const char *clk;
211 const char *clkdev_con_id;
212 struct clk *_clk; 208 struct clk *_clk;
213 union { 209 union {
214 struct omap_hwmod_omap2_firewall omap2; 210 struct omap_hwmod_omap2_firewall omap2;
@@ -401,8 +397,7 @@ struct omap_hwmod_omap4_prcm {
401 * @mpu_irqs: ptr to an array of MPU IRQs (see also mpu_irqs_cnt) 397 * @mpu_irqs: ptr to an array of MPU IRQs (see also mpu_irqs_cnt)
402 * @sdma_chs: ptr to an array of SDMA channel IDs (see also sdma_chs_cnt) 398 * @sdma_chs: ptr to an array of SDMA channel IDs (see also sdma_chs_cnt)
403 * @prcm: PRCM data pertaining to this hwmod 399 * @prcm: PRCM data pertaining to this hwmod
404 * @clkdev_dev_id: main clock: clkdev dev_id string 400 * @main_clk: main clock: OMAP clock name
405 * @clkdev_con_id: main clock: clkdev con_id string
406 * @_clk: pointer to the main struct clk (filled in at runtime) 401 * @_clk: pointer to the main struct clk (filled in at runtime)
407 * @opt_clks: other device clocks that drivers can request (0..*) 402 * @opt_clks: other device clocks that drivers can request (0..*)
408 * @masters: ptr to array of OCP ifs that this hwmod can initiate on 403 * @masters: ptr to array of OCP ifs that this hwmod can initiate on
@@ -426,10 +421,10 @@ struct omap_hwmod_omap4_prcm {
426 * @omap_chip: OMAP chips this hwmod is present on 421 * @omap_chip: OMAP chips this hwmod is present on
427 * @node: list node for hwmod list (internal use) 422 * @node: list node for hwmod list (internal use)
428 * 423 *
429 * @clkdev_dev_id, @clkdev_con_id, and @clk all refer to this module's "main 424 * @main_clk refers to this module's "main clock," which for our
430 * clock," which for our purposes is defined as "the functional clock needed 425 * purposes is defined as "the functional clock needed for register
431 * for register accesses to complete." Modules may not have a main clock if 426 * accesses to complete." Modules may not have a main clock if the
432 * the interface clock also serves as a main clock. 427 * interface clock also serves as a main clock.
433 * 428 *
434 * Parameter names beginning with an underscore are managed internally by 429 * Parameter names beginning with an underscore are managed internally by
435 * the omap_hwmod code and should not be set during initialization. 430 * the omap_hwmod code and should not be set during initialization.
@@ -443,8 +438,7 @@ struct omap_hwmod {
443 struct omap_hwmod_omap2_prcm omap2; 438 struct omap_hwmod_omap2_prcm omap2;
444 struct omap_hwmod_omap4_prcm omap4; 439 struct omap_hwmod_omap4_prcm omap4;
445 } prcm; 440 } prcm;
446 const char *clkdev_dev_id; 441 const char *main_clk;
447 const char *clkdev_con_id;
448 struct clk *_clk; 442 struct clk *_clk;
449 struct omap_hwmod_opt_clk *opt_clks; 443 struct omap_hwmod_opt_clk *opt_clks;
450 struct omap_hwmod_ocp_if **masters; /* connect to *_IA */ 444 struct omap_hwmod_ocp_if **masters; /* connect to *_IA */