aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2010-09-27 13:18:00 -0400
committerTony Lindgren <tony@atomide.com>2010-09-27 13:18:00 -0400
commitd58cc92bda765e62f28b12a8f4627ddee32978f0 (patch)
tree3609fc3ae4a17106e83e18d9fb6fe54c08170316 /arch
parentb245f26f5e45a6513a318835d83eea895d3ab54b (diff)
parent78f26e872f77b6312273216de1a8f836c6f2e143 (diff)
Merge branch 'misc_2.6.37' of git://git.pwsan.com/linux-2.6 into omap-for-linus
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/cm4xxx.c9
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c17
-rw-r--r--arch/arm/plat-omap/omap_device.c35
3 files changed, 30 insertions, 31 deletions
diff --git a/arch/arm/mach-omap2/cm4xxx.c b/arch/arm/mach-omap2/cm4xxx.c
index b101091e95d6..f8a660a1a4a6 100644
--- a/arch/arm/mach-omap2/cm4xxx.c
+++ b/arch/arm/mach-omap2/cm4xxx.c
@@ -43,7 +43,6 @@
43 * using separate functional clock 43 * using separate functional clock
44 * 0x3 disabled: Module is disabled and cannot be accessed 44 * 0x3 disabled: Module is disabled and cannot be accessed
45 * 45 *
46 * TODO: Need to handle module accessible in idle state
47 */ 46 */
48int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg) 47int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg)
49{ 48{
@@ -52,9 +51,11 @@ int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg)
52 if (!clkctrl_reg) 51 if (!clkctrl_reg)
53 return 0; 52 return 0;
54 53
55 omap_test_timeout(((__raw_readl(clkctrl_reg) & 54 omap_test_timeout((
56 OMAP4430_IDLEST_MASK) == 0), 55 ((__raw_readl(clkctrl_reg) & OMAP4430_IDLEST_MASK) == 0) ||
57 MAX_MODULE_READY_TIME, i); 56 (((__raw_readl(clkctrl_reg) & OMAP4430_IDLEST_MASK) >>
57 OMAP4430_IDLEST_SHIFT) == 0x2)),
58 MAX_MODULE_READY_TIME, i);
58 59
59 return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY; 60 return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY;
60} 61}
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index c3a5889d8add..955861acc0c4 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -777,12 +777,6 @@ static void _enable_sysc(struct omap_hwmod *oh)
777 _set_master_standbymode(oh, idlemode, &v); 777 _set_master_standbymode(oh, idlemode, &v);
778 } 778 }
779 779
780 if (sf & SYSC_HAS_AUTOIDLE) {
781 idlemode = (oh->flags & HWMOD_NO_OCP_AUTOIDLE) ?
782 0 : 1;
783 _set_module_autoidle(oh, idlemode, &v);
784 }
785
786 /* 780 /*
787 * XXX The clock framework should handle this, by 781 * XXX The clock framework should handle this, by
788 * calling into this code. But this must wait until the 782 * calling into this code. But this must wait until the
@@ -797,6 +791,17 @@ static void _enable_sysc(struct omap_hwmod *oh)
797 /* If slave is in SMARTIDLE, also enable wakeup */ 791 /* If slave is in SMARTIDLE, also enable wakeup */
798 if ((sf & SYSC_HAS_SIDLEMODE) && !(oh->flags & HWMOD_SWSUP_SIDLE)) 792 if ((sf & SYSC_HAS_SIDLEMODE) && !(oh->flags & HWMOD_SWSUP_SIDLE))
799 _enable_wakeup(oh); 793 _enable_wakeup(oh);
794
795 /*
796 * Set the autoidle bit only after setting the smartidle bit
797 * Setting this will not have any impact on the other modules.
798 */
799 if (sf & SYSC_HAS_AUTOIDLE) {
800 idlemode = (oh->flags & HWMOD_NO_OCP_AUTOIDLE) ?
801 0 : 1;
802 _set_module_autoidle(oh, idlemode, &v);
803 _write_sysconfig(v, oh);
804 }
800} 805}
801 806
802/** 807/**
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index b5e5f6074b0b..abe933cd8f09 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -290,12 +290,11 @@ static void _add_optional_clock_alias(struct omap_device *od,
290 */ 290 */
291int omap_device_count_resources(struct omap_device *od) 291int omap_device_count_resources(struct omap_device *od)
292{ 292{
293 struct omap_hwmod *oh;
294 int c = 0; 293 int c = 0;
295 int i; 294 int i;
296 295
297 for (i = 0, oh = *od->hwmods; i < od->hwmods_cnt; i++, oh++) 296 for (i = 0; i < od->hwmods_cnt; i++)
298 c += omap_hwmod_count_resources(oh); 297 c += omap_hwmod_count_resources(od->hwmods[i]);
299 298
300 pr_debug("omap_device: %s: counted %d total resources across %d " 299 pr_debug("omap_device: %s: counted %d total resources across %d "
301 "hwmods\n", od->pdev.name, c, od->hwmods_cnt); 300 "hwmods\n", od->pdev.name, c, od->hwmods_cnt);
@@ -322,12 +321,11 @@ int omap_device_count_resources(struct omap_device *od)
322 */ 321 */
323int omap_device_fill_resources(struct omap_device *od, struct resource *res) 322int omap_device_fill_resources(struct omap_device *od, struct resource *res)
324{ 323{
325 struct omap_hwmod *oh;
326 int c = 0; 324 int c = 0;
327 int i, r; 325 int i, r;
328 326
329 for (i = 0, oh = *od->hwmods; i < od->hwmods_cnt; i++, oh++) { 327 for (i = 0; i < od->hwmods_cnt; i++) {
330 r = omap_hwmod_fill_resources(oh, res); 328 r = omap_hwmod_fill_resources(od->hwmods[i], res);
331 res += r; 329 res += r;
332 c += r; 330 c += r;
333 } 331 }
@@ -600,7 +598,6 @@ int omap_device_shutdown(struct platform_device *pdev)
600{ 598{
601 int ret, i; 599 int ret, i;
602 struct omap_device *od; 600 struct omap_device *od;
603 struct omap_hwmod *oh;
604 601
605 od = _find_by_pdev(pdev); 602 od = _find_by_pdev(pdev);
606 603
@@ -613,8 +610,8 @@ int omap_device_shutdown(struct platform_device *pdev)
613 610
614 ret = _omap_device_deactivate(od, IGNORE_WAKEUP_LAT); 611 ret = _omap_device_deactivate(od, IGNORE_WAKEUP_LAT);
615 612
616 for (i = 0, oh = *od->hwmods; i < od->hwmods_cnt; i++, oh++) 613 for (i = 0; i < od->hwmods_cnt; i++)
617 omap_hwmod_shutdown(oh); 614 omap_hwmod_shutdown(od->hwmods[i]);
618 615
619 od->_state = OMAP_DEVICE_STATE_SHUTDOWN; 616 od->_state = OMAP_DEVICE_STATE_SHUTDOWN;
620 617
@@ -714,11 +711,10 @@ void __iomem *omap_device_get_rt_va(struct omap_device *od)
714 */ 711 */
715int omap_device_enable_hwmods(struct omap_device *od) 712int omap_device_enable_hwmods(struct omap_device *od)
716{ 713{
717 struct omap_hwmod *oh;
718 int i; 714 int i;
719 715
720 for (i = 0, oh = *od->hwmods; i < od->hwmods_cnt; i++, oh++) 716 for (i = 0; i < od->hwmods_cnt; i++)
721 omap_hwmod_enable(oh); 717 omap_hwmod_enable(od->hwmods[i]);
722 718
723 /* XXX pass along return value here? */ 719 /* XXX pass along return value here? */
724 return 0; 720 return 0;
@@ -732,11 +728,10 @@ int omap_device_enable_hwmods(struct omap_device *od)
732 */ 728 */
733int omap_device_idle_hwmods(struct omap_device *od) 729int omap_device_idle_hwmods(struct omap_device *od)
734{ 730{
735 struct omap_hwmod *oh;
736 int i; 731 int i;
737 732
738 for (i = 0, oh = *od->hwmods; i < od->hwmods_cnt; i++, oh++) 733 for (i = 0; i < od->hwmods_cnt; i++)
739 omap_hwmod_idle(oh); 734 omap_hwmod_idle(od->hwmods[i]);
740 735
741 /* XXX pass along return value here? */ 736 /* XXX pass along return value here? */
742 return 0; 737 return 0;
@@ -751,11 +746,10 @@ int omap_device_idle_hwmods(struct omap_device *od)
751 */ 746 */
752int omap_device_disable_clocks(struct omap_device *od) 747int omap_device_disable_clocks(struct omap_device *od)
753{ 748{
754 struct omap_hwmod *oh;
755 int i; 749 int i;
756 750
757 for (i = 0, oh = *od->hwmods; i < od->hwmods_cnt; i++, oh++) 751 for (i = 0; i < od->hwmods_cnt; i++)
758 omap_hwmod_disable_clocks(oh); 752 omap_hwmod_disable_clocks(od->hwmods[i]);
759 753
760 /* XXX pass along return value here? */ 754 /* XXX pass along return value here? */
761 return 0; 755 return 0;
@@ -770,11 +764,10 @@ int omap_device_disable_clocks(struct omap_device *od)
770 */ 764 */
771int omap_device_enable_clocks(struct omap_device *od) 765int omap_device_enable_clocks(struct omap_device *od)
772{ 766{
773 struct omap_hwmod *oh;
774 int i; 767 int i;
775 768
776 for (i = 0, oh = *od->hwmods; i < od->hwmods_cnt; i++, oh++) 769 for (i = 0; i < od->hwmods_cnt; i++)
777 omap_hwmod_enable_clocks(oh); 770 omap_hwmod_enable_clocks(od->hwmods[i]);
778 771
779 /* XXX pass along return value here? */ 772 /* XXX pass along return value here? */
780 return 0; 773 return 0;