diff options
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap_device.h | 4 | ||||
-rw-r--r-- | arch/arm/plat-omap/omap_device.c | 55 |
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 | ||
121 | int omap_device_assert_hardreset(struct platform_device *pdev, | ||
122 | const char *name); | ||
123 | int omap_device_deassert_hardreset(struct platform_device *pdev, | ||
124 | const char *name); | ||
121 | int omap_device_idle_hwmods(struct omap_device *od); | 125 | int omap_device_idle_hwmods(struct omap_device *od); |
122 | int omap_device_enable_hwmods(struct omap_device *od); | 126 | int 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 | */ | ||
934 | int 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 | */ | ||
961 | int 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 | * |