diff options
author | Paul Walmsley <paul@pwsan.com> | 2010-02-23 00:09:31 -0500 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2010-02-24 14:29:44 -0500 |
commit | 50ebdac2ec9fb2de9c271cb2e0e13aae3b454166 (patch) | |
tree | 0d3787446804696a8f048925bce19e3147bd8691 /arch/arm/mach-omap2/omap_hwmod.c | |
parent | 74be8427431b4bbff4a6506f64fb30bb61e781a7 (diff) |
OMAP hwmod: convert hwmod to use hardware clock names rather than clkdev dev+con
The OMAP hwmod core code is intended to use SoC IP block description
structures that are autogenerated from TI's OMAP hardware database.
Currently the hwmod code uses clkdev device + connection addressing to
identify clocks. This causes problems in the hwmod autogeneration
process, since the TI hardware database doesn't use platform_device or
clkdev addressing; it uses a single clock signal name string, which
tends to bear some resemblance to what is used in the OMAP TRMs. This
patch converts the hwmod code and existing data to use omap_clk_get_by_name(),
introduced in the previous patch.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: BenoƮt Cousson <b-cousson@ti.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-omap2/omap_hwmod.c')
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod.c | 22 |
1 files changed, 10 insertions, 12 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; |