All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 7/8 v2] OMAP: Hwmod api changes
@ 2010-08-18 14:10 Hema HK
  2010-08-25 23:42 ` Kevin Hilman
  0 siblings, 1 reply; 3+ messages in thread
From: Hema HK @ 2010-08-18 14:10 UTC (permalink / raw)
  To: linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA
  Cc: Hema HK, Basak, Partha, Felipe Balbi, Tony Lindgren, Kevin Hilman,
	Cousson, Benoit, Paul Walmsley

OMAP USBOTG modules has a requirement to set the auto idle bit only after
setting smart idle bit. Modified the _sys_enable api to set the smart idle
first and then the autoidle bit. Setting this will not have any impact on the
other modules.

Added 2 wrapper APIs in the omap device layer for wakeup enable/disable
and sidle/mstandby settings.

Signed-off-by: Hema HK <hemahk-l0cyMroinI0@public.gmane.org>
Signed-off-by: Basak, Partha <p-basak2-l0cyMroinI0@public.gmane.org>

Cc: Felipe Balbi <felipe.balbi-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
Cc: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
Cc: Kevin Hilman <khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
Cc: Cousson, Benoit <b-cousson-l0cyMroinI0@public.gmane.org>
Cc: Paul Walmsley <paul-DWxLp4Yu+b8AvxtiuMwx3w@public.gmane.org>
---
 arch/arm/mach-omap2/omap_hwmod.c              |   18 +++++++---
 arch/arm/plat-omap/include/plat/omap_device.h |    2 +
 arch/arm/plat-omap/omap_device.c              |   43 +++++++++++++++++++++++++
 3 files changed, 57 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 9bd99ad..55507a6 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -654,12 +654,6 @@ static void _sysc_enable(struct omap_hwmod *oh)
 		_set_master_standbymode(oh, idlemode, &v);
 	}
 
-	if (sf & SYSC_HAS_AUTOIDLE) {
-		idlemode = (oh->flags & HWMOD_NO_OCP_AUTOIDLE) ?
-			0 : 1;
-		_set_module_autoidle(oh, idlemode, &v);
-	}
-
 	/* XXX OCP ENAWAKEUP bit? */
 
 	/*
@@ -672,6 +666,18 @@ static void _sysc_enable(struct omap_hwmod *oh)
 		_set_clockactivity(oh, oh->class->sysc->clockact, &v);
 
 	_write_sysconfig(v, oh);
+
+	/* Set the auto idle bit only after setting the smartidle bit
+	 * as this is requirement for some modules like USBOTG
+	 * setting this will not have any impact on the other modues.
+	 */
+
+	if (sf & SYSC_HAS_AUTOIDLE) {
+		idlemode = (oh->flags & HWMOD_NO_OCP_AUTOIDLE) ?
+			0 : 1;
+		_set_module_autoidle(oh, idlemode, &v);
+	}
+	_write_sysconfig(v, oh);
 }
 
 /**
diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h
index 25cd9ac..c3eb07e 100644
--- a/arch/arm/plat-omap/include/plat/omap_device.h
+++ b/arch/arm/plat-omap/include/plat/omap_device.h
@@ -116,6 +116,8 @@ int omap_device_enable_hwmods(struct omap_device *od);
 int omap_device_disable_clocks(struct omap_device *od);
 int omap_device_enable_clocks(struct omap_device *od);
 
+int omap_device_enable_wakeup(struct platform_device *pdev);
+int omap_device_disable_wakeup(struct platform_device *pdev);
 
 /*
  * Entries should be kept in latency order ascending
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index d2b1609..10182b1 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -757,3 +757,46 @@ int omap_device_enable_clocks(struct omap_device *od)
 	/* XXX pass along return value here? */
 	return 0;
 }
+
+/**
+ * omap_device_enable_wakeup - Enable the wakeup bit
+ * @od: struct omap_device *od
+ *
+ * Enable the wakup bit for omap_hwmods associated
+ * with the omap_device.  Returns 0.
+ */
+int omap_device_enable_wakeup(struct platform_device *pdev)
+{
+	struct omap_hwmod *oh;
+	struct omap_device *od = _find_by_pdev(pdev);
+	int i;
+
+	for (i = 0, oh = *od->hwmods; i < od->hwmods_cnt; i++, oh++)
+		omap_hwmod_enable_wakeup(oh);
+
+	/* XXX pass along return value here? */
+	return 0;
+}
+
+/**
+ * omap_device_disable_wakeup -Disable the wakeup bit
+ * @od: struct omap_device *od
+ *
+ * Disable the wakup bit for omap_hwmods associated
+ * with the omap_device.  Returns 0.
+ */
+
+
+int omap_device_disable_wakeup(struct platform_device *pdev)
+{
+	struct omap_hwmod *oh;
+	struct omap_device *od = _find_by_pdev(pdev);
+	int i;
+
+	for (i = 0, oh = *od->hwmods; i < od->hwmods_cnt; i++, oh++)
+		omap_hwmod_disable_wakeup(oh);
+
+	/* XXX pass along return value here? */
+	return 0;
+}
+
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 7/8 v2] OMAP: Hwmod api changes
  2010-08-18 14:10 [PATCH 7/8 v2] OMAP: Hwmod api changes Hema HK
@ 2010-08-25 23:42 ` Kevin Hilman
       [not found]   ` <877hje8dki.fsf-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Hilman @ 2010-08-25 23:42 UTC (permalink / raw)
  To: Hema HK
  Cc: linux-omap, linux-usb, Basak, Partha, Felipe Balbi, Tony Lindgren,
	Cousson, Benoit, Paul Walmsley

Hema HK <hemahk@ti.com> writes:

> OMAP USBOTG modules has a requirement to set the auto idle bit only after
> setting smart idle bit. Modified the _sys_enable api to set the smart idle
> first and then the autoidle bit. Setting this will not have any impact on the
> other modules.
>
> Added 2 wrapper APIs in the omap device layer for wakeup enable/disable
> and sidle/mstandby settings.

This should be a separate patch, with an description of who the users of
this API would be and why.

> Signed-off-by: Hema HK <hemahk@ti.com>
> Signed-off-by: Basak, Partha <p-basak2@ti.com>
>
> Cc: Felipe Balbi <felipe.balbi@nokia.com>
> Cc: Tony Lindgren <tony@atomide.com>
> Cc: Kevin Hilman <khilman@deeprootsystems.com>
> Cc: Cousson, Benoit <b-cousson@ti.com>
> Cc: Paul Walmsley <paul@pwsan.com>
> ---
>  arch/arm/mach-omap2/omap_hwmod.c              |   18 +++++++---
>  arch/arm/plat-omap/include/plat/omap_device.h |    2 +
>  arch/arm/plat-omap/omap_device.c              |   43 +++++++++++++++++++++++++
>  3 files changed, 57 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
> index 9bd99ad..55507a6 100644
> --- a/arch/arm/mach-omap2/omap_hwmod.c
> +++ b/arch/arm/mach-omap2/omap_hwmod.c
> @@ -654,12 +654,6 @@ static void _sysc_enable(struct omap_hwmod *oh)
>  		_set_master_standbymode(oh, idlemode, &v);
>  	}
>  
> -	if (sf & SYSC_HAS_AUTOIDLE) {
> -		idlemode = (oh->flags & HWMOD_NO_OCP_AUTOIDLE) ?
> -			0 : 1;
> -		_set_module_autoidle(oh, idlemode, &v);
> -	}
> -
>  	/* XXX OCP ENAWAKEUP bit? */
>  
>  	/*
> @@ -672,6 +666,18 @@ static void _sysc_enable(struct omap_hwmod *oh)
>  		_set_clockactivity(oh, oh->class->sysc->clockact, &v);
>  
>  	_write_sysconfig(v, oh);
> +
> +	/* Set the auto idle bit only after setting the smartidle bit
> +	 * as this is requirement for some modules like USBOTG
> +	 * setting this will not have any impact on the other modues.
> +	 */

Please fix multi-line comment style.  (search for multi-line in
Documentation/CodingStyle)

Kevin

> +	if (sf & SYSC_HAS_AUTOIDLE) {
> +		idlemode = (oh->flags & HWMOD_NO_OCP_AUTOIDLE) ?
> +			0 : 1;
> +		_set_module_autoidle(oh, idlemode, &v);
> +	}
> +	_write_sysconfig(v, oh);
>  }
>  
>  /**
> diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h
> index 25cd9ac..c3eb07e 100644
> --- a/arch/arm/plat-omap/include/plat/omap_device.h
> +++ b/arch/arm/plat-omap/include/plat/omap_device.h
> @@ -116,6 +116,8 @@ int omap_device_enable_hwmods(struct omap_device *od);
>  int omap_device_disable_clocks(struct omap_device *od);
>  int omap_device_enable_clocks(struct omap_device *od);
>  
> +int omap_device_enable_wakeup(struct platform_device *pdev);
> +int omap_device_disable_wakeup(struct platform_device *pdev);
>  
>  /*
>   * Entries should be kept in latency order ascending
> diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
> index d2b1609..10182b1 100644
> --- a/arch/arm/plat-omap/omap_device.c
> +++ b/arch/arm/plat-omap/omap_device.c
> @@ -757,3 +757,46 @@ int omap_device_enable_clocks(struct omap_device *od)
>  	/* XXX pass along return value here? */
>  	return 0;
>  }
> +
> +/**
> + * omap_device_enable_wakeup - Enable the wakeup bit
> + * @od: struct omap_device *od
> + *
> + * Enable the wakup bit for omap_hwmods associated
> + * with the omap_device.  Returns 0.
> + */
> +int omap_device_enable_wakeup(struct platform_device *pdev)
> +{
> +	struct omap_hwmod *oh;
> +	struct omap_device *od = _find_by_pdev(pdev);
> +	int i;
> +
> +	for (i = 0, oh = *od->hwmods; i < od->hwmods_cnt; i++, oh++)
> +		omap_hwmod_enable_wakeup(oh);
> +
> +	/* XXX pass along return value here? */
> +	return 0;
> +}
> +
> +/**
> + * omap_device_disable_wakeup -Disable the wakeup bit
> + * @od: struct omap_device *od
> + *
> + * Disable the wakup bit for omap_hwmods associated
> + * with the omap_device.  Returns 0.
> + */
> +
> +
> +int omap_device_disable_wakeup(struct platform_device *pdev)
> +{
> +	struct omap_hwmod *oh;
> +	struct omap_device *od = _find_by_pdev(pdev);
> +	int i;
> +
> +	for (i = 0, oh = *od->hwmods; i < od->hwmods_cnt; i++, oh++)
> +		omap_hwmod_disable_wakeup(oh);
> +
> +	/* XXX pass along return value here? */
> +	return 0;
> +}
> +

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH 7/8 v2] OMAP: Hwmod api changes
       [not found]   ` <877hje8dki.fsf-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
@ 2010-08-31  8:55     ` Kalliguddi, Hema
  0 siblings, 0 replies; 3+ messages in thread
From: Kalliguddi, Hema @ 2010-08-31  8:55 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Basak, Partha,
	Felipe Balbi, Tony Lindgren, Cousson, Benoit, Paul Walmsley

Hi, 

>-----Original Message-----
>From: Kevin Hilman [mailto:khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org] 
>Sent: Thursday, August 26, 2010 5:12 AM
>To: Kalliguddi, Hema
>Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; 
>Basak, Partha; Felipe Balbi; Tony Lindgren; Cousson, Benoit; 
>Paul Walmsley
>Subject: Re: [PATCH 7/8 v2] OMAP: Hwmod api changes
>
>Hema HK <hemahk-l0cyMroinI0@public.gmane.org> writes:
>
>> OMAP USBOTG modules has a requirement to set the auto idle 
>bit only after
>> setting smart idle bit. Modified the _sys_enable api to set 
>the smart idle
>> first and then the autoidle bit. Setting this will not have 
>any impact on the
>> other modules.
>>
>> Added 2 wrapper APIs in the omap device layer for wakeup 
>enable/disable
>> and sidle/mstandby settings.
>
>This should be a separate patch, with an description of who 
>the users of
>this API would be and why.
>
Ok. I can post it as separate patch also.  But I think there was plan from Rajendra to
Enable the wakeup as part of the sysc_enable() if smart idle/standby is configured.
If that implementation is done then there is no need of this patch.


>> Signed-off-by: Hema HK <hemahk-l0cyMroinI0@public.gmane.org>
>> Signed-off-by: Basak, Partha <p-basak2-l0cyMroinI0@public.gmane.org>
>>
>> Cc: Felipe Balbi <felipe.balbi-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
>> Cc: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
>> Cc: Kevin Hilman <khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
>> Cc: Cousson, Benoit <b-cousson-l0cyMroinI0@public.gmane.org>
>> Cc: Paul Walmsley <paul-DWxLp4Yu+b8AvxtiuMwx3w@public.gmane.org>
>> ---
>>  arch/arm/mach-omap2/omap_hwmod.c              |   18 +++++++---
>>  arch/arm/plat-omap/include/plat/omap_device.h |    2 +
>>  arch/arm/plat-omap/omap_device.c              |   43 
>+++++++++++++++++++++++++
>>  3 files changed, 57 insertions(+), 6 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/omap_hwmod.c 
>b/arch/arm/mach-omap2/omap_hwmod.c
>> index 9bd99ad..55507a6 100644
>> --- a/arch/arm/mach-omap2/omap_hwmod.c
>> +++ b/arch/arm/mach-omap2/omap_hwmod.c
>> @@ -654,12 +654,6 @@ static void _sysc_enable(struct omap_hwmod *oh)
>>  		_set_master_standbymode(oh, idlemode, &v);
>>  	}
>>  
>> -	if (sf & SYSC_HAS_AUTOIDLE) {
>> -		idlemode = (oh->flags & HWMOD_NO_OCP_AUTOIDLE) ?
>> -			0 : 1;
>> -		_set_module_autoidle(oh, idlemode, &v);
>> -	}
>> -
>>  	/* XXX OCP ENAWAKEUP bit? */
>>  
>>  	/*
>> @@ -672,6 +666,18 @@ static void _sysc_enable(struct omap_hwmod *oh)
>>  		_set_clockactivity(oh, oh->class->sysc->clockact, &v);
>>  
>>  	_write_sysconfig(v, oh);
>> +
>> +	/* Set the auto idle bit only after setting the smartidle bit
>> +	 * as this is requirement for some modules like USBOTG
>> +	 * setting this will not have any impact on the other modues.
>> +	 */
>
>Please fix multi-line comment style.  (search for multi-line in
>Documentation/CodingStyle)
>
Sure I will fix it.

>Kevin
>
>> +	if (sf & SYSC_HAS_AUTOIDLE) {
>> +		idlemode = (oh->flags & HWMOD_NO_OCP_AUTOIDLE) ?
>> +			0 : 1;
>> +		_set_module_autoidle(oh, idlemode, &v);
>> +	}
>> +	_write_sysconfig(v, oh);
>>  }
>>  
>>  /**
>> diff --git a/arch/arm/plat-omap/include/plat/omap_device.h 
>b/arch/arm/plat-omap/include/plat/omap_device.h
>> index 25cd9ac..c3eb07e 100644
>> --- a/arch/arm/plat-omap/include/plat/omap_device.h
>> +++ b/arch/arm/plat-omap/include/plat/omap_device.h
>> @@ -116,6 +116,8 @@ int omap_device_enable_hwmods(struct 
>omap_device *od);
>>  int omap_device_disable_clocks(struct omap_device *od);
>>  int omap_device_enable_clocks(struct omap_device *od);
>>  
>> +int omap_device_enable_wakeup(struct platform_device *pdev);
>> +int omap_device_disable_wakeup(struct platform_device *pdev);
>>  
>>  /*
>>   * Entries should be kept in latency order ascending
>> diff --git a/arch/arm/plat-omap/omap_device.c 
>b/arch/arm/plat-omap/omap_device.c
>> index d2b1609..10182b1 100644
>> --- a/arch/arm/plat-omap/omap_device.c
>> +++ b/arch/arm/plat-omap/omap_device.c
>> @@ -757,3 +757,46 @@ int omap_device_enable_clocks(struct 
>omap_device *od)
>>  	/* XXX pass along return value here? */
>>  	return 0;
>>  }
>> +
>> +/**
>> + * omap_device_enable_wakeup - Enable the wakeup bit
>> + * @od: struct omap_device *od
>> + *
>> + * Enable the wakup bit for omap_hwmods associated
>> + * with the omap_device.  Returns 0.
>> + */
>> +int omap_device_enable_wakeup(struct platform_device *pdev)
>> +{
>> +	struct omap_hwmod *oh;
>> +	struct omap_device *od = _find_by_pdev(pdev);
>> +	int i;
>> +
>> +	for (i = 0, oh = *od->hwmods; i < od->hwmods_cnt; i++, oh++)
>> +		omap_hwmod_enable_wakeup(oh);
>> +
>> +	/* XXX pass along return value here? */
>> +	return 0;
>> +}
>> +
>> +/**
>> + * omap_device_disable_wakeup -Disable the wakeup bit
>> + * @od: struct omap_device *od
>> + *
>> + * Disable the wakup bit for omap_hwmods associated
>> + * with the omap_device.  Returns 0.
>> + */
>> +
>> +
>> +int omap_device_disable_wakeup(struct platform_device *pdev)
>> +{
>> +	struct omap_hwmod *oh;
>> +	struct omap_device *od = _find_by_pdev(pdev);
>> +	int i;
>> +
>> +	for (i = 0, oh = *od->hwmods; i < od->hwmods_cnt; i++, oh++)
>> +		omap_hwmod_disable_wakeup(oh);
>> +
>> +	/* XXX pass along return value here? */
>> +	return 0;
>> +}
>> +
>--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-08-31  8:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-18 14:10 [PATCH 7/8 v2] OMAP: Hwmod api changes Hema HK
2010-08-25 23:42 ` Kevin Hilman
     [not found]   ` <877hje8dki.fsf-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
2010-08-31  8:55     ` Kalliguddi, Hema

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.