aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/omap_device.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@linaro.org>2015-06-11 19:36:32 -0400
committerKevin Hilman <khilman@linaro.org>2015-06-11 19:36:32 -0400
commit2879e43f09122f8b3ef5456e3d7e48716b086e60 (patch)
tree0399726ae8acb415504a8b4878f341b643ad3bf4 /arch/arm/mach-omap2/omap_device.c
parent4d48614ec45aa20d6a2cb7d2eb1368d7641c747d (diff)
parent436bbc12452c23b9e7385f3fcabc82fdd387a55a (diff)
Merge tag 'omap-for-v4.2/soc-pt1-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/soc
Omap hwmod changes for v4.2 via Paul Walmsley <paul@pwsan.com>: Several OMAP2+ hwmod changes for v4.2. One patch cleans up a nasty interaction between the OMAP GPMC and the hwmod code when debugging is enabled. IP block integration data has been added for the AM43xx EMIF RAM controller. There's also a fix for the omap-aes driver when used in QEMU. And finally, some changes to the OMAP3 hwmod code to support the use of the security IP blocks (AES and SHA) on GP devices, or when they've specifically been enabled in the DT data. Basic build, boot, and power management test results are here: http://www.pwsan.com/omap/testlogs/omap-hwmod-a-for-v4.2/20150601192349/ * tag 'omap-for-v4.2/soc-pt1-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: OMAP3: Fix crypto support for HS devices ARM: OMAP2+: Return correct error values from device and hwmod ARM: OMAP: AM43xx hwmod: Add data for am43xx emif hwmod memory: omap-gpmc: Add Kconfig option for debug
Diffstat (limited to 'arch/arm/mach-omap2/omap_device.c')
-rw-r--r--arch/arm/mach-omap2/omap_device.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
index 166b18f515a2..4a7303cf563e 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -224,13 +224,13 @@ static int _omap_device_notifier_call(struct notifier_block *nb,
224 */ 224 */
225static int _omap_device_enable_hwmods(struct omap_device *od) 225static int _omap_device_enable_hwmods(struct omap_device *od)
226{ 226{
227 int ret = 0;
227 int i; 228 int i;
228 229
229 for (i = 0; i < od->hwmods_cnt; i++) 230 for (i = 0; i < od->hwmods_cnt; i++)
230 omap_hwmod_enable(od->hwmods[i]); 231 ret |= omap_hwmod_enable(od->hwmods[i]);
231 232
232 /* XXX pass along return value here? */ 233 return ret;
233 return 0;
234} 234}
235 235
236/** 236/**
@@ -241,13 +241,13 @@ static int _omap_device_enable_hwmods(struct omap_device *od)
241 */ 241 */
242static int _omap_device_idle_hwmods(struct omap_device *od) 242static int _omap_device_idle_hwmods(struct omap_device *od)
243{ 243{
244 int ret = 0;
244 int i; 245 int i;
245 246
246 for (i = 0; i < od->hwmods_cnt; i++) 247 for (i = 0; i < od->hwmods_cnt; i++)
247 omap_hwmod_idle(od->hwmods[i]); 248 ret |= omap_hwmod_idle(od->hwmods[i]);
248 249
249 /* XXX pass along return value here? */ 250 return ret;
250 return 0;
251} 251}
252 252
253/* Public functions for use by core code */ 253/* Public functions for use by core code */
@@ -595,18 +595,20 @@ static int _od_runtime_suspend(struct device *dev)
595 int ret; 595 int ret;
596 596
597 ret = pm_generic_runtime_suspend(dev); 597 ret = pm_generic_runtime_suspend(dev);
598 if (ret)
599 return ret;
598 600
599 if (!ret) 601 return omap_device_idle(pdev);
600 omap_device_idle(pdev);
601
602 return ret;
603} 602}
604 603
605static int _od_runtime_resume(struct device *dev) 604static int _od_runtime_resume(struct device *dev)
606{ 605{
607 struct platform_device *pdev = to_platform_device(dev); 606 struct platform_device *pdev = to_platform_device(dev);
607 int ret;
608 608
609 omap_device_enable(pdev); 609 ret = omap_device_enable(pdev);
610 if (ret)
611 return ret;
610 612
611 return pm_generic_runtime_resume(dev); 613 return pm_generic_runtime_resume(dev);
612} 614}
@@ -743,7 +745,8 @@ int omap_device_enable(struct platform_device *pdev)
743 745
744 ret = _omap_device_enable_hwmods(od); 746 ret = _omap_device_enable_hwmods(od);
745 747
746 od->_state = OMAP_DEVICE_STATE_ENABLED; 748 if (ret == 0)
749 od->_state = OMAP_DEVICE_STATE_ENABLED;
747 750
748 return ret; 751 return ret;
749} 752}
@@ -773,7 +776,8 @@ int omap_device_idle(struct platform_device *pdev)
773 776
774 ret = _omap_device_idle_hwmods(od); 777 ret = _omap_device_idle_hwmods(od);
775 778
776 od->_state = OMAP_DEVICE_STATE_IDLE; 779 if (ret == 0)
780 od->_state = OMAP_DEVICE_STATE_IDLE;
777 781
778 return ret; 782 return ret;
779} 783}