Prechádzať zdrojové kódy

arm: mach-omap2: omap_hwmod: Introduce omap_hwmod_rst save/restore

With the introduction of ti,sysc driver we no longer need to
save/restore the actual module context but the rst lines context
needs to be saved/restored. Hence add the omap_hwmod_rst save/restore
functions.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Keerthy 6 rokov pred
rodič
commit
cf19938d0f

+ 11 - 20
arch/arm/mach-omap2/omap_hwmod.c

@@ -4150,13 +4150,13 @@ const char *omap_hwmod_get_main_clk(struct omap_hwmod *oh)
 }
 
 /**
- * omap_hwmod_save_context - Saves the HW reset line state of submodules
+ * omap_hwmod_rst_save_context - Saves the HW reset line state of submodules
  * @oh: struct omap_hwmod *
  * @unused: (unused, caller should pass NULL)
  *
  * Saves the HW reset line state of all the submodules in the hwmod
  */
-static int omap_hwmod_save_context(struct omap_hwmod *oh, void *unused)
+static int omap_hwmod_rst_save_context(struct omap_hwmod *oh, void *unused)
 {
 	int i;
 
@@ -4167,13 +4167,14 @@ static int omap_hwmod_save_context(struct omap_hwmod *oh, void *unused)
 }
 
 /**
- * omap_hwmod_restore_context - Restores the HW reset line state of submodules
+ * omap_hwmod_rst_restore_context - Restores the HW reset line state of
+ *					submodules
  * @oh: struct omap_hwmod *
  * @unused: (unused, caller should pass NULL)
  *
  * Restores the HW reset line state of all the submodules in the hwmod
  */
-static int omap_hwmod_restore_context(struct omap_hwmod *oh, void *unused)
+static int omap_hwmod_rst_restore_context(struct omap_hwmod *oh, void *unused)
 {
 	int i;
 
@@ -4183,35 +4184,25 @@ static int omap_hwmod_restore_context(struct omap_hwmod *oh, void *unused)
 		else
 			_deassert_hardreset(oh, oh->rst_lines[i].name);
 
-	if (oh->_state == _HWMOD_STATE_ENABLED) {
-		if (soc_ops.enable_module)
-			soc_ops.enable_module(oh);
-	} else {
-		if (oh->flags & HWMOD_NEEDS_REIDLE)
-			_reidle(oh);
-		else if (soc_ops.disable_module)
-			soc_ops.disable_module(oh);
-	}
-
 	return 0;
 }
 
 /**
- * omap_hwmods_save_context - Saves the HW reset line state for all hwmods
+ * omap_hwmods_rst_save_context - Saves the HW reset line state for all hwmods
  *
  * Saves the HW reset line state of all the registered hwmods
  */
-void omap_hwmods_save_context(void)
+void omap_hwmods_rst_save_context(void)
 {
-	omap_hwmod_for_each(omap_hwmod_save_context, NULL);
+	omap_hwmod_for_each(omap_hwmod_rst_save_context, NULL);
 }
 
 /**
- * omap_hwmods_restore_context - Restores the HW reset line state for all hwmods
+ * omap_hwmods_rst_restore_context - Restores the HW reset line state for all hwmods
  *
  * Restores the HW reset line state of all the registered hwmods
  */
-void omap_hwmods_restore_context(void)
+void omap_hwmods_rst_restore_context(void)
 {
-	omap_hwmod_for_each(omap_hwmod_restore_context, NULL);
+	omap_hwmod_for_each(omap_hwmod_rst_restore_context, NULL);
 }

+ 2 - 2
arch/arm/mach-omap2/omap_hwmod.h

@@ -679,8 +679,8 @@ extern void __init omap_hwmod_init(void);
 
 const char *omap_hwmod_get_main_clk(struct omap_hwmod *oh);
 
-void omap_hwmods_save_context(void);
-void omap_hwmods_restore_context(void);
+void omap_hwmods_rst_save_context(void);
+void omap_hwmods_rst_restore_context(void);
 
 /*
  *