aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap
diff options
context:
space:
mode:
authorOmar Ramirez Luna <omar.luna@linaro.org>2012-09-23 19:28:18 -0400
committerPaul Walmsley <paul@pwsan.com>2012-09-23 19:28:18 -0400
commit8bb9fde2396b6cd205f404ef6d2aa46eb5b0af26 (patch)
tree9a37e501469a889b262fafae0f0db0b5d49a2ab0 /arch/arm/plat-omap
parentc9e49024edba46463479d2830b3f36bcceb60ea9 (diff)
ARM: OMAP2+: omap_device: expose hwmod assert/deassert to omap devices
This API is meant to be an interface to hwmod assert/deassert function, omap devices can call them through their platform data to control their reset lines, they are expected to know the name of the reset line they are trying to control. Signed-off-by: Omar Ramirez Luna <omar.luna@linaro.org> [paul@pwsan.com: tweaked some documentation; fixed CodingStyle issue] Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r--arch/arm/plat-omap/include/plat/omap_device.h4
-rw-r--r--arch/arm/plat-omap/omap_device.c55
2 files changed, 59 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h
index 4327b2c90c3d..27bcc2441195 100644
--- a/arch/arm/plat-omap/include/plat/omap_device.h
+++ b/arch/arm/plat-omap/include/plat/omap_device.h
@@ -118,6 +118,10 @@ int omap_device_get_context_loss_count(struct platform_device *pdev);
118 118
119/* Other */ 119/* Other */
120 120
121int omap_device_assert_hardreset(struct platform_device *pdev,
122 const char *name);
123int omap_device_deassert_hardreset(struct platform_device *pdev,
124 const char *name);
121int omap_device_idle_hwmods(struct omap_device *od); 125int omap_device_idle_hwmods(struct omap_device *od);
122int omap_device_enable_hwmods(struct omap_device *od); 126int omap_device_enable_hwmods(struct omap_device *od);
123 127
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index 6056a622a5f9..5b6974269107 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -920,6 +920,61 @@ int omap_device_shutdown(struct platform_device *pdev)
920} 920}
921 921
922/** 922/**
923 * omap_device_assert_hardreset - set a device's hardreset line
924 * @pdev: struct platform_device * to reset
925 * @name: const char * name of the reset line
926 *
927 * Set the hardreset line identified by @name on the IP blocks
928 * associated with the hwmods backing the platform_device @pdev. All
929 * of the hwmods associated with @pdev must have the same hardreset
930 * line linked to them for this to work. Passes along the return value
931 * of omap_hwmod_assert_hardreset() in the event of any failure, or
932 * returns 0 upon success.
933 */
934int omap_device_assert_hardreset(struct platform_device *pdev, const char *name)
935{
936 struct omap_device *od = to_omap_device(pdev);
937 int ret = 0;
938 int i;
939
940 for (i = 0; i < od->hwmods_cnt; i++) {
941 ret = omap_hwmod_assert_hardreset(od->hwmods[i], name);
942 if (ret)
943 break;
944 }
945
946 return ret;
947}
948
949/**
950 * omap_device_deassert_hardreset - release a device's hardreset line
951 * @pdev: struct platform_device * to reset
952 * @name: const char * name of the reset line
953 *
954 * Release the hardreset line identified by @name on the IP blocks
955 * associated with the hwmods backing the platform_device @pdev. All
956 * of the hwmods associated with @pdev must have the same hardreset
957 * line linked to them for this to work. Passes along the return
958 * value of omap_hwmod_deassert_hardreset() in the event of any
959 * failure, or returns 0 upon success.
960 */
961int omap_device_deassert_hardreset(struct platform_device *pdev,
962 const char *name)
963{
964 struct omap_device *od = to_omap_device(pdev);
965 int ret = 0;
966 int i;
967
968 for (i = 0; i < od->hwmods_cnt; i++) {
969 ret = omap_hwmod_deassert_hardreset(od->hwmods[i], name);
970 if (ret)
971 break;
972 }
973
974 return ret;
975}
976
977/**
923 * omap_device_align_pm_lat - activate/deactivate device to match wakeup lat lim 978 * omap_device_align_pm_lat - activate/deactivate device to match wakeup lat lim
924 * @od: struct omap_device * 979 * @od: struct omap_device *
925 * 980 *