|  | @@ -2843,3 +2843,177 @@ static int _omap4_wait_target_ready(struct omap_hwmod *oh)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	return omap4_cminst_wait_module_ready(oh->clkdm->prcm_partition,
 | 
	
		
			
				|  |  |  					      oh->clkdm->cm_inst,
 | 
	
		
			
				|  |  | +					      oh->clkdm->clkdm_offs,
 | 
	
		
			
				|  |  | +					      oh->prcm.omap4.clkctrl_offs);
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/**
 | 
	
		
			
				|  |  | + * _am33xx_wait_target_ready - wait for a module to leave slave idle
 | 
	
		
			
				|  |  | + * @oh: struct omap_hwmod *
 | 
	
		
			
				|  |  | + *
 | 
	
		
			
				|  |  | + * Wait for a module @oh to leave slave idle.  Returns 0 if the module
 | 
	
		
			
				|  |  | + * does not have an IDLEST bit or if the module successfully leaves
 | 
	
		
			
				|  |  | + * slave idle; otherwise, pass along the return value of the
 | 
	
		
			
				|  |  | + * appropriate *_cm*_wait_module_ready() function.
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +static int _am33xx_wait_target_ready(struct omap_hwmod *oh)
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +	if (!oh || !oh->clkdm)
 | 
	
		
			
				|  |  | +		return -EINVAL;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	if (oh->flags & HWMOD_NO_IDLEST)
 | 
	
		
			
				|  |  | +		return 0;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	if (!_find_mpu_rt_port(oh))
 | 
	
		
			
				|  |  | +		return 0;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	/* XXX check module SIDLEMODE, hardreset status */
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	return am33xx_cm_wait_module_ready(oh->clkdm->cm_inst,
 | 
	
		
			
				|  |  | +					      oh->clkdm->clkdm_offs,
 | 
	
		
			
				|  |  | +					      oh->prcm.omap4.clkctrl_offs);
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/**
 | 
	
		
			
				|  |  | + * _omap2_assert_hardreset - call OMAP2 PRM hardreset fn with hwmod args
 | 
	
		
			
				|  |  | + * @oh: struct omap_hwmod * to assert hardreset
 | 
	
		
			
				|  |  | + * @ohri: hardreset line data
 | 
	
		
			
				|  |  | + *
 | 
	
		
			
				|  |  | + * Call omap2_prm_assert_hardreset() with parameters extracted from
 | 
	
		
			
				|  |  | + * the hwmod @oh and the hardreset line data @ohri.  Only intended for
 | 
	
		
			
				|  |  | + * use as an soc_ops function pointer.  Passes along the return value
 | 
	
		
			
				|  |  | + * from omap2_prm_assert_hardreset().  XXX This function is scheduled
 | 
	
		
			
				|  |  | + * for removal when the PRM code is moved into drivers/.
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +static int _omap2_assert_hardreset(struct omap_hwmod *oh,
 | 
	
		
			
				|  |  | +				   struct omap_hwmod_rst_info *ohri)
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +	return omap2_prm_assert_hardreset(oh->prcm.omap2.module_offs,
 | 
	
		
			
				|  |  | +					  ohri->rst_shift);
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/**
 | 
	
		
			
				|  |  | + * _omap2_deassert_hardreset - call OMAP2 PRM hardreset fn with hwmod args
 | 
	
		
			
				|  |  | + * @oh: struct omap_hwmod * to deassert hardreset
 | 
	
		
			
				|  |  | + * @ohri: hardreset line data
 | 
	
		
			
				|  |  | + *
 | 
	
		
			
				|  |  | + * Call omap2_prm_deassert_hardreset() with parameters extracted from
 | 
	
		
			
				|  |  | + * the hwmod @oh and the hardreset line data @ohri.  Only intended for
 | 
	
		
			
				|  |  | + * use as an soc_ops function pointer.  Passes along the return value
 | 
	
		
			
				|  |  | + * from omap2_prm_deassert_hardreset().  XXX This function is
 | 
	
		
			
				|  |  | + * scheduled for removal when the PRM code is moved into drivers/.
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +static int _omap2_deassert_hardreset(struct omap_hwmod *oh,
 | 
	
		
			
				|  |  | +				     struct omap_hwmod_rst_info *ohri)
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +	return omap2_prm_deassert_hardreset(oh->prcm.omap2.module_offs,
 | 
	
		
			
				|  |  | +					    ohri->rst_shift,
 | 
	
		
			
				|  |  | +					    ohri->st_shift);
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/**
 | 
	
		
			
				|  |  | + * _omap2_is_hardreset_asserted - call OMAP2 PRM hardreset fn with hwmod args
 | 
	
		
			
				|  |  | + * @oh: struct omap_hwmod * to test hardreset
 | 
	
		
			
				|  |  | + * @ohri: hardreset line data
 | 
	
		
			
				|  |  | + *
 | 
	
		
			
				|  |  | + * Call omap2_prm_is_hardreset_asserted() with parameters extracted
 | 
	
		
			
				|  |  | + * from the hwmod @oh and the hardreset line data @ohri.  Only
 | 
	
		
			
				|  |  | + * intended for use as an soc_ops function pointer.  Passes along the
 | 
	
		
			
				|  |  | + * return value from omap2_prm_is_hardreset_asserted().  XXX This
 | 
	
		
			
				|  |  | + * function is scheduled for removal when the PRM code is moved into
 | 
	
		
			
				|  |  | + * drivers/.
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +static int _omap2_is_hardreset_asserted(struct omap_hwmod *oh,
 | 
	
		
			
				|  |  | +					struct omap_hwmod_rst_info *ohri)
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +	return omap2_prm_is_hardreset_asserted(oh->prcm.omap2.module_offs,
 | 
	
		
			
				|  |  | +					       ohri->st_shift);
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/**
 | 
	
		
			
				|  |  | + * _omap4_assert_hardreset - call OMAP4 PRM hardreset fn with hwmod args
 | 
	
		
			
				|  |  | + * @oh: struct omap_hwmod * to assert hardreset
 | 
	
		
			
				|  |  | + * @ohri: hardreset line data
 | 
	
		
			
				|  |  | + *
 | 
	
		
			
				|  |  | + * Call omap4_prminst_assert_hardreset() with parameters extracted
 | 
	
		
			
				|  |  | + * from the hwmod @oh and the hardreset line data @ohri.  Only
 | 
	
		
			
				|  |  | + * intended for use as an soc_ops function pointer.  Passes along the
 | 
	
		
			
				|  |  | + * return value from omap4_prminst_assert_hardreset().  XXX This
 | 
	
		
			
				|  |  | + * function is scheduled for removal when the PRM code is moved into
 | 
	
		
			
				|  |  | + * drivers/.
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +static int _omap4_assert_hardreset(struct omap_hwmod *oh,
 | 
	
		
			
				|  |  | +				   struct omap_hwmod_rst_info *ohri)
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +	if (!oh->clkdm)
 | 
	
		
			
				|  |  | +		return -EINVAL;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	return omap4_prminst_assert_hardreset(ohri->rst_shift,
 | 
	
		
			
				|  |  | +				oh->clkdm->pwrdm.ptr->prcm_partition,
 | 
	
		
			
				|  |  | +				oh->clkdm->pwrdm.ptr->prcm_offs,
 | 
	
		
			
				|  |  | +				oh->prcm.omap4.rstctrl_offs);
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/**
 | 
	
		
			
				|  |  | + * _omap4_deassert_hardreset - call OMAP4 PRM hardreset fn with hwmod args
 | 
	
		
			
				|  |  | + * @oh: struct omap_hwmod * to deassert hardreset
 | 
	
		
			
				|  |  | + * @ohri: hardreset line data
 | 
	
		
			
				|  |  | + *
 | 
	
		
			
				|  |  | + * Call omap4_prminst_deassert_hardreset() with parameters extracted
 | 
	
		
			
				|  |  | + * from the hwmod @oh and the hardreset line data @ohri.  Only
 | 
	
		
			
				|  |  | + * intended for use as an soc_ops function pointer.  Passes along the
 | 
	
		
			
				|  |  | + * return value from omap4_prminst_deassert_hardreset().  XXX This
 | 
	
		
			
				|  |  | + * function is scheduled for removal when the PRM code is moved into
 | 
	
		
			
				|  |  | + * drivers/.
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +static int _omap4_deassert_hardreset(struct omap_hwmod *oh,
 | 
	
		
			
				|  |  | +				     struct omap_hwmod_rst_info *ohri)
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +	if (!oh->clkdm)
 | 
	
		
			
				|  |  | +		return -EINVAL;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	if (ohri->st_shift)
 | 
	
		
			
				|  |  | +		pr_err("omap_hwmod: %s: %s: hwmod data error: OMAP4 does not support st_shift\n",
 | 
	
		
			
				|  |  | +		       oh->name, ohri->name);
 | 
	
		
			
				|  |  | +	return omap4_prminst_deassert_hardreset(ohri->rst_shift,
 | 
	
		
			
				|  |  | +				oh->clkdm->pwrdm.ptr->prcm_partition,
 | 
	
		
			
				|  |  | +				oh->clkdm->pwrdm.ptr->prcm_offs,
 | 
	
		
			
				|  |  | +				oh->prcm.omap4.rstctrl_offs);
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/**
 | 
	
		
			
				|  |  | + * _omap4_is_hardreset_asserted - call OMAP4 PRM hardreset fn with hwmod args
 | 
	
		
			
				|  |  | + * @oh: struct omap_hwmod * to test hardreset
 | 
	
		
			
				|  |  | + * @ohri: hardreset line data
 | 
	
		
			
				|  |  | + *
 | 
	
		
			
				|  |  | + * Call omap4_prminst_is_hardreset_asserted() with parameters
 | 
	
		
			
				|  |  | + * extracted from the hwmod @oh and the hardreset line data @ohri.
 | 
	
		
			
				|  |  | + * Only intended for use as an soc_ops function pointer.  Passes along
 | 
	
		
			
				|  |  | + * the return value from omap4_prminst_is_hardreset_asserted().  XXX
 | 
	
		
			
				|  |  | + * This function is scheduled for removal when the PRM code is moved
 | 
	
		
			
				|  |  | + * into drivers/.
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +static int _omap4_is_hardreset_asserted(struct omap_hwmod *oh,
 | 
	
		
			
				|  |  | +					struct omap_hwmod_rst_info *ohri)
 | 
	
		
			
				|  |  | +{
 | 
	
		
			
				|  |  | +	if (!oh->clkdm)
 | 
	
		
			
				|  |  | +		return -EINVAL;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	return omap4_prminst_is_hardreset_asserted(ohri->rst_shift,
 | 
	
		
			
				|  |  | +				oh->clkdm->pwrdm.ptr->prcm_partition,
 | 
	
		
			
				|  |  | +				oh->clkdm->pwrdm.ptr->prcm_offs,
 | 
	
		
			
				|  |  | +				oh->prcm.omap4.rstctrl_offs);
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/**
 | 
	
		
			
				|  |  | + * _am33xx_assert_hardreset - call AM33XX PRM hardreset fn with hwmod args
 | 
	
		
			
				|  |  | + * @oh: struct omap_hwmod * to assert hardreset
 | 
	
		
			
				|  |  | + * @ohri: hardreset line data
 | 
	
		
			
				|  |  | + *
 | 
	
		
			
				|  |  | + * Call am33xx_prminst_assert_hardreset() with parameters extracted
 | 
	
		
			
				|  |  | + * from the hwmod @oh and the hardreset line data @ohri.  Only
 | 
	
		
			
				|  |  | + * intended for use as an soc_ops function pointer.  Passes along the
 | 
	
		
			
				|  |  | + * return value from am33xx_prminst_assert_hardreset().  XXX This
 | 
	
		
			
				|  |  | + * function is scheduled for removal when the PRM code is moved into
 | 
	
		
			
				|  |  | + * drivers/.
 | 
	
		
			
				|  |  | + */
 |