diff options
Diffstat (limited to 'arch/arm/mach-omap2/omap_hwmod.c')
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod.c | 45 |
1 files changed, 36 insertions, 9 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 7d843cd3b33d..5c8c5e0449b6 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -679,16 +679,25 @@ static int _init_main_clk(struct omap_hwmod *oh) | |||
679 | if (!oh->main_clk) | 679 | if (!oh->main_clk) |
680 | return 0; | 680 | return 0; |
681 | 681 | ||
682 | oh->_clk = omap_clk_get_by_name(oh->main_clk); | 682 | oh->_clk = clk_get(NULL, oh->main_clk); |
683 | if (!oh->_clk) { | 683 | if (IS_ERR(oh->_clk)) { |
684 | pr_warning("omap_hwmod: %s: cannot clk_get main_clk %s\n", | 684 | pr_warning("omap_hwmod: %s: cannot clk_get main_clk %s\n", |
685 | oh->name, oh->main_clk); | 685 | oh->name, oh->main_clk); |
686 | return -EINVAL; | 686 | return -EINVAL; |
687 | } | 687 | } |
688 | /* | ||
689 | * HACK: This needs a re-visit once clk_prepare() is implemented | ||
690 | * to do something meaningful. Today its just a no-op. | ||
691 | * If clk_prepare() is used at some point to do things like | ||
692 | * voltage scaling etc, then this would have to be moved to | ||
693 | * some point where subsystems like i2c and pmic become | ||
694 | * available. | ||
695 | */ | ||
696 | clk_prepare(oh->_clk); | ||
688 | 697 | ||
689 | if (!oh->_clk->clkdm) | 698 | if (!oh->_clk->clkdm) |
690 | pr_warning("omap_hwmod: %s: missing clockdomain for %s.\n", | 699 | pr_warning("omap_hwmod: %s: missing clockdomain for %s.\n", |
691 | oh->main_clk, oh->_clk->name); | 700 | oh->name, oh->main_clk); |
692 | 701 | ||
693 | return ret; | 702 | return ret; |
694 | } | 703 | } |
@@ -715,13 +724,22 @@ static int _init_interface_clks(struct omap_hwmod *oh) | |||
715 | if (!os->clk) | 724 | if (!os->clk) |
716 | continue; | 725 | continue; |
717 | 726 | ||
718 | c = omap_clk_get_by_name(os->clk); | 727 | c = clk_get(NULL, os->clk); |
719 | if (!c) { | 728 | if (IS_ERR(c)) { |
720 | pr_warning("omap_hwmod: %s: cannot clk_get interface_clk %s\n", | 729 | pr_warning("omap_hwmod: %s: cannot clk_get interface_clk %s\n", |
721 | oh->name, os->clk); | 730 | oh->name, os->clk); |
722 | ret = -EINVAL; | 731 | ret = -EINVAL; |
723 | } | 732 | } |
724 | os->_clk = c; | 733 | os->_clk = c; |
734 | /* | ||
735 | * HACK: This needs a re-visit once clk_prepare() is implemented | ||
736 | * to do something meaningful. Today its just a no-op. | ||
737 | * If clk_prepare() is used at some point to do things like | ||
738 | * voltage scaling etc, then this would have to be moved to | ||
739 | * some point where subsystems like i2c and pmic become | ||
740 | * available. | ||
741 | */ | ||
742 | clk_prepare(os->_clk); | ||
725 | } | 743 | } |
726 | 744 | ||
727 | return ret; | 745 | return ret; |
@@ -742,13 +760,22 @@ static int _init_opt_clks(struct omap_hwmod *oh) | |||
742 | int ret = 0; | 760 | int ret = 0; |
743 | 761 | ||
744 | for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) { | 762 | for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) { |
745 | c = omap_clk_get_by_name(oc->clk); | 763 | c = clk_get(NULL, oc->clk); |
746 | if (!c) { | 764 | if (IS_ERR(c)) { |
747 | pr_warning("omap_hwmod: %s: cannot clk_get opt_clk %s\n", | 765 | pr_warning("omap_hwmod: %s: cannot clk_get opt_clk %s\n", |
748 | oh->name, oc->clk); | 766 | oh->name, oc->clk); |
749 | ret = -EINVAL; | 767 | ret = -EINVAL; |
750 | } | 768 | } |
751 | oc->_clk = c; | 769 | oc->_clk = c; |
770 | /* | ||
771 | * HACK: This needs a re-visit once clk_prepare() is implemented | ||
772 | * to do something meaningful. Today its just a no-op. | ||
773 | * If clk_prepare() is used at some point to do things like | ||
774 | * voltage scaling etc, then this would have to be moved to | ||
775 | * some point where subsystems like i2c and pmic become | ||
776 | * available. | ||
777 | */ | ||
778 | clk_prepare(oc->_clk); | ||
752 | } | 779 | } |
753 | 780 | ||
754 | return ret; | 781 | return ret; |
@@ -827,7 +854,7 @@ static void _enable_optional_clocks(struct omap_hwmod *oh) | |||
827 | for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) | 854 | for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) |
828 | if (oc->_clk) { | 855 | if (oc->_clk) { |
829 | pr_debug("omap_hwmod: enable %s:%s\n", oc->role, | 856 | pr_debug("omap_hwmod: enable %s:%s\n", oc->role, |
830 | oc->_clk->name); | 857 | __clk_get_name(oc->_clk)); |
831 | clk_enable(oc->_clk); | 858 | clk_enable(oc->_clk); |
832 | } | 859 | } |
833 | } | 860 | } |
@@ -842,7 +869,7 @@ static void _disable_optional_clocks(struct omap_hwmod *oh) | |||
842 | for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) | 869 | for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) |
843 | if (oc->_clk) { | 870 | if (oc->_clk) { |
844 | pr_debug("omap_hwmod: disable %s:%s\n", oc->role, | 871 | pr_debug("omap_hwmod: disable %s:%s\n", oc->role, |
845 | oc->_clk->name); | 872 | __clk_get_name(oc->_clk)); |
846 | clk_disable(oc->_clk); | 873 | clk_disable(oc->_clk); |
847 | } | 874 | } |
848 | } | 875 | } |