[PATCH 4/8] OMAP2+: omap_hwmod: manage the wake-up latency constraints

2011-10-12 Thread jean . pihet
From: Jean Pihet j-pi...@ti.com

Hwmod is queried from the OMAP_PM layer to manage the power domains
wake-up latency constraints. Hwmod retrieves the correct power domain
and if it exists it calls the corresponding power domain function.

Tested on OMAP3 Beagleboard and OMAP4 Pandaboard in RET/OFF using wake-up
latency constraints on MPU, CORE and PER.

Signed-off-by: Jean Pihet j-pi...@ti.com
---
 arch/arm/mach-omap2/omap_hwmod.c |   27 +-
 arch/arm/plat-omap/include/plat/omap_hwmod.h |2 +
 2 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 84cc0bd..023f3e7 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -143,6 +143,7 @@
 #include powerdomain.h
 #include plat/clock.h
 #include plat/omap_hwmod.h
+#include plat/omap_device.h
 #include plat/prcm.h
 
 #include cm2xxx_3xxx.h
@@ -2619,10 +2620,34 @@ ohsps_unlock:
 }
 
 /**
+ * omap_hwmod_set_wkup_constraint- set/release a wake-up latency constraint
+ *
+ * @oh: struct omap_hwmod* to which the target device belongs to.
+ * @cookie: identifier of the constraints list for @oh.
+ * @min_latency: the minimum allowed wake-up latency for @oh.
+ *
+ * Returns 0 upon success, -EINVAL in case of invalid parameters, or
+ * the return value from pwrdm_set_wkup_lat_constraint.
+ */
+int omap_hwmod_set_wkup_lat_constraint(struct omap_hwmod *oh,
+  void *cookie, long min_latency)
+{
+   struct powerdomain *pwrdm = omap_hwmod_get_pwrdm(oh);
+
+   if (!pwrdm) {
+   pr_err(%s: Error: could not find powerdomain 
+  for %s\n, __func__, oh-name);
+   return -EINVAL;
+   }
+
+   return pwrdm_set_wkup_lat_constraint(pwrdm, cookie, min_latency);
+}
+
+/**
  * omap_hwmod_get_context_loss_count - get lost context count
  * @oh: struct omap_hwmod *
  *
- * Query the powerdomain of of @oh to get the context loss
+ * Query the powerdomain of @oh to get the context loss
  * count for this device.
  *
  * Returns the context loss count of the powerdomain assocated with @oh
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h 
b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 0e329ca..75e0e7a 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -603,6 +603,8 @@ int omap_hwmod_for_each_by_class(const char *classname,
 void *user);
 
 int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state);
+int omap_hwmod_set_wkup_lat_constraint(struct omap_hwmod *oh, void *cookie,
+  long min_latency);
 u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh);
 
 int omap_hwmod_no_setup_reset(struct omap_hwmod *oh);
-- 
1.7.4.1

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


Re: [PATCH 4/8] OMAP2+: omap_hwmod: manage the wake-up latency constraints

2011-10-12 Thread Jean Pihet
Hi Paul,

The series has been updated with the kerneldoc and error path rework,
then re-submitted as v3.
Can you please look at it and possibly pull it?

Please let me know.

Regards,
Jean

On Mon, Oct 10, 2011 at 10:08 AM, Jean Pihet jean.pi...@newoldbits.com wrote:
 Hi Paull,

 On Fri, Oct 7, 2011 at 4:53 AM, Paul Walmsley p...@pwsan.com wrote:
 Hi

 a comment:

 On Wed, 21 Sep 2011, jean.pi...@newoldbits.com wrote:

 From: Jean Pihet j-pi...@ti.com

 Hwmod is queried from the OMAP_PM layer to manage the power domains
 wake-up latency constraints. Hwmod retrieves the correct power domain
 and if it exists it calls the corresponding power domain function.

 Tested on OMAP3 Beagleboard and OMAP4 Pandaboard in RET/OFF using wake-up
 latency constraints on MPU, CORE and PER.

 Signed-off-by: Jean Pihet j-pi...@ti.com
 ---
  arch/arm/mach-omap2/omap_hwmod.c             |   26 
 +-
  arch/arm/plat-omap/include/plat/omap_hwmod.h |    2 ++
  2 files changed, 27 insertions(+), 1 deletions(-)

 diff --git a/arch/arm/mach-omap2/omap_hwmod.c 
 b/arch/arm/mach-omap2/omap_hwmod.c
 index 84cc0bd..c6b1cc9 100644
 --- a/arch/arm/mach-omap2/omap_hwmod.c
 +++ b/arch/arm/mach-omap2/omap_hwmod.c
 @@ -2618,11 +2619,34 @@ ohsps_unlock:
       return ret;
  }

 +/*
 + * omap_hwmod_set_wkup_constraint- set/release a wake-up latency constraint
 + *
 + * @oh: struct omap_hwmod* to which the target device belongs to.
 + * @cookie: identifier of the constraints list for @oh.
 + * @min_latency: the minimum allowed wake-up latency for @oh.
 + *
 + * Returns 0 upon success.
 + */

 It's good that there is some documentation here, but it would be better if
 it were kerneldoc-style documentation.  Please see
 Documentation/kernel-doc-nano-HOWTO.txt.
 Also it would be good to have a bit more documentation here beyond simply
 Returns 0 upon success.  For example, how should a caller remove a
 wakeup latency constraint?  Also, this function can return -EINVAL, not
 counting whatever pwrdm_set_wkup_lat_constraint() can return, so that
 should be documented above also.

 This applies to the function comments in the rest of the patches too.
 Some of them have quite good kerneldoc comments, such as
 pwrdm_wakeuplat_update_pwrst(); others need some work, like
 pwrdm_set_wkup_lat_constraint().

 Not all functions have kernel doc comments, i.e. this one does not (no
 /** at the start of the header).
 The intention is to document the functions from the API and the ones
 that implement the core service (pwrdm_set_wkup_lat_constraint()), and
 not the pure pass-through functions (omap_hwmod_set_wkup_constraint).

 In any case I will review the comments and resubmit.

 Thanks,
 Jean


 - Paul


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


Re: [PATCH 4/8] OMAP2+: omap_hwmod: manage the wake-up latency constraints

2011-10-10 Thread Jean Pihet
Hi Paull,

On Fri, Oct 7, 2011 at 4:53 AM, Paul Walmsley p...@pwsan.com wrote:
 Hi

 a comment:

 On Wed, 21 Sep 2011, jean.pi...@newoldbits.com wrote:

 From: Jean Pihet j-pi...@ti.com

 Hwmod is queried from the OMAP_PM layer to manage the power domains
 wake-up latency constraints. Hwmod retrieves the correct power domain
 and if it exists it calls the corresponding power domain function.

 Tested on OMAP3 Beagleboard and OMAP4 Pandaboard in RET/OFF using wake-up
 latency constraints on MPU, CORE and PER.

 Signed-off-by: Jean Pihet j-pi...@ti.com
 ---
  arch/arm/mach-omap2/omap_hwmod.c             |   26 
 +-
  arch/arm/plat-omap/include/plat/omap_hwmod.h |    2 ++
  2 files changed, 27 insertions(+), 1 deletions(-)

 diff --git a/arch/arm/mach-omap2/omap_hwmod.c 
 b/arch/arm/mach-omap2/omap_hwmod.c
 index 84cc0bd..c6b1cc9 100644
 --- a/arch/arm/mach-omap2/omap_hwmod.c
 +++ b/arch/arm/mach-omap2/omap_hwmod.c
 @@ -2618,11 +2619,34 @@ ohsps_unlock:
       return ret;
  }

 +/*
 + * omap_hwmod_set_wkup_constraint- set/release a wake-up latency constraint
 + *
 + * @oh: struct omap_hwmod* to which the target device belongs to.
 + * @cookie: identifier of the constraints list for @oh.
 + * @min_latency: the minimum allowed wake-up latency for @oh.
 + *
 + * Returns 0 upon success.
 + */

 It's good that there is some documentation here, but it would be better if
 it were kerneldoc-style documentation.  Please see
 Documentation/kernel-doc-nano-HOWTO.txt.
 Also it would be good to have a bit more documentation here beyond simply
 Returns 0 upon success.  For example, how should a caller remove a
 wakeup latency constraint?  Also, this function can return -EINVAL, not
 counting whatever pwrdm_set_wkup_lat_constraint() can return, so that
 should be documented above also.

 This applies to the function comments in the rest of the patches too.
 Some of them have quite good kerneldoc comments, such as
 pwrdm_wakeuplat_update_pwrst(); others need some work, like
 pwrdm_set_wkup_lat_constraint().

Not all functions have kernel doc comments, i.e. this one does not (no
/** at the start of the header).
The intention is to document the functions from the API and the ones
that implement the core service (pwrdm_set_wkup_lat_constraint()), and
not the pure pass-through functions (omap_hwmod_set_wkup_constraint).

In any case I will review the comments and resubmit.

Thanks,
Jean


 - Paul

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


Re: [PATCH 4/8] OMAP2+: omap_hwmod: manage the wake-up latency constraints

2011-10-06 Thread Paul Walmsley
Hi

a comment:

On Wed, 21 Sep 2011, jean.pi...@newoldbits.com wrote:

 From: Jean Pihet j-pi...@ti.com
 
 Hwmod is queried from the OMAP_PM layer to manage the power domains
 wake-up latency constraints. Hwmod retrieves the correct power domain
 and if it exists it calls the corresponding power domain function.
 
 Tested on OMAP3 Beagleboard and OMAP4 Pandaboard in RET/OFF using wake-up
 latency constraints on MPU, CORE and PER.
 
 Signed-off-by: Jean Pihet j-pi...@ti.com
 ---
  arch/arm/mach-omap2/omap_hwmod.c |   26 
 +-
  arch/arm/plat-omap/include/plat/omap_hwmod.h |2 ++
  2 files changed, 27 insertions(+), 1 deletions(-)
 
 diff --git a/arch/arm/mach-omap2/omap_hwmod.c 
 b/arch/arm/mach-omap2/omap_hwmod.c
 index 84cc0bd..c6b1cc9 100644
 --- a/arch/arm/mach-omap2/omap_hwmod.c
 +++ b/arch/arm/mach-omap2/omap_hwmod.c
 @@ -2618,11 +2619,34 @@ ohsps_unlock:
   return ret;
  }
  
 +/*
 + * omap_hwmod_set_wkup_constraint- set/release a wake-up latency constraint
 + *
 + * @oh: struct omap_hwmod* to which the target device belongs to.
 + * @cookie: identifier of the constraints list for @oh.
 + * @min_latency: the minimum allowed wake-up latency for @oh.
 + *
 + * Returns 0 upon success.
 + */

It's good that there is some documentation here, but it would be better if 
it were kerneldoc-style documentation.  Please see 
Documentation/kernel-doc-nano-HOWTO.txt.

Also it would be good to have a bit more documentation here beyond simply 
Returns 0 upon success.  For example, how should a caller remove a 
wakeup latency constraint?  Also, this function can return -EINVAL, not 
counting whatever pwrdm_set_wkup_lat_constraint() can return, so that 
should be documented above also.

This applies to the function comments in the rest of the patches too.  
Some of them have quite good kerneldoc comments, such as 
pwrdm_wakeuplat_update_pwrst(); others need some work, like 
pwrdm_set_wkup_lat_constraint().

 +int omap_hwmod_set_wkup_lat_constraint(struct omap_hwmod *oh,
 +void *cookie, long min_latency)
 +{
 + struct powerdomain *pwrdm = omap_hwmod_get_pwrdm(oh);
 +
 + if (!pwrdm) {
 + pr_err(%s: Error: could not find powerdomain 
 +for %s\n, __func__, oh-name);
 + return -EINVAL;
 + }
 +
 + return pwrdm_set_wkup_lat_constraint(pwrdm, cookie, min_latency);
 +}
 +
  /**
   * omap_hwmod_get_context_loss_count - get lost context count
   * @oh: struct omap_hwmod *
   *
 - * Query the powerdomain of of @oh to get the context loss
 + * Query the powerdomain of @oh to get the context loss
   * count for this device.
   *
   * Returns the context loss count of the powerdomain assocated with @oh
 diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h 
 b/arch/arm/plat-omap/include/plat/omap_hwmod.h
 index 0e329ca..75e0e7a 100644
 --- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
 +++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
 @@ -603,6 +603,8 @@ int omap_hwmod_for_each_by_class(const char *classname,
void *user);
  
  int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state);
 +int omap_hwmod_set_wkup_lat_constraint(struct omap_hwmod *oh, void *cookie,
 +long min_latency);
  u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh);
  
  int omap_hwmod_no_setup_reset(struct omap_hwmod *oh);
 -- 
 1.7.4.1
 


- Paul
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/8] OMAP2+: omap_hwmod: manage the wake-up latency constraints

2011-09-21 Thread Jean Pihet
Hwmod is queried from the OMAP_PM layer to manage the power domains
wake-up latency constraints. Hwmod retrieves the correct power domain
and if it exists it calls the corresponding power domain function.

Tested on OMAP3 Beagleboard and OMAP4 Pandaboard in RET/OFF using wake-up
latency constraints on MPU, CORE and PER.

Signed-off-by: Jean Pihet j-pi...@ti.com
---
 arch/arm/mach-omap2/omap_hwmod.c |   26 +-
 arch/arm/plat-omap/include/plat/omap_hwmod.h |2 ++
 2 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 84cc0bd..c6b1cc9 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -143,6 +143,7 @@
 #include powerdomain.h
 #include plat/clock.h
 #include plat/omap_hwmod.h
+#include plat/omap_device.h
 #include plat/prcm.h
 
 #include cm2xxx_3xxx.h
@@ -2618,11 +2619,34 @@ ohsps_unlock:
return ret;
 }
 
+/*
+ * omap_hwmod_set_wkup_constraint- set/release a wake-up latency constraint
+ *
+ * @oh: struct omap_hwmod* to which the target device belongs to.
+ * @cookie: identifier of the constraints list for @oh.
+ * @min_latency: the minimum allowed wake-up latency for @oh.
+ *
+ * Returns 0 upon success.
+ */
+int omap_hwmod_set_wkup_lat_constraint(struct omap_hwmod *oh,
+  void *cookie, long min_latency)
+{
+   struct powerdomain *pwrdm = omap_hwmod_get_pwrdm(oh);
+
+   if (!pwrdm) {
+   pr_err(%s: Error: could not find powerdomain 
+  for %s\n, __func__, oh-name);
+   return -EINVAL;
+   }
+
+   return pwrdm_set_wkup_lat_constraint(pwrdm, cookie, min_latency);
+}
+
 /**
  * omap_hwmod_get_context_loss_count - get lost context count
  * @oh: struct omap_hwmod *
  *
- * Query the powerdomain of of @oh to get the context loss
+ * Query the powerdomain of @oh to get the context loss
  * count for this device.
  *
  * Returns the context loss count of the powerdomain assocated with @oh
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h 
b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 0e329ca..75e0e7a 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -603,6 +603,8 @@ int omap_hwmod_for_each_by_class(const char *classname,
 void *user);
 
 int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state);
+int omap_hwmod_set_wkup_lat_constraint(struct omap_hwmod *oh, void *cookie,
+  long min_latency);
 u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh);
 
 int omap_hwmod_no_setup_reset(struct omap_hwmod *oh);
-- 
1.7.4.1

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


[PATCH 4/8] OMAP2+: omap_hwmod: manage the wake-up latency constraints

2011-09-21 Thread jean . pihet
From: Jean Pihet j-pi...@ti.com

Hwmod is queried from the OMAP_PM layer to manage the power domains
wake-up latency constraints. Hwmod retrieves the correct power domain
and if it exists it calls the corresponding power domain function.

Tested on OMAP3 Beagleboard and OMAP4 Pandaboard in RET/OFF using wake-up
latency constraints on MPU, CORE and PER.

Signed-off-by: Jean Pihet j-pi...@ti.com
---
 arch/arm/mach-omap2/omap_hwmod.c |   26 +-
 arch/arm/plat-omap/include/plat/omap_hwmod.h |2 ++
 2 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 84cc0bd..c6b1cc9 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -143,6 +143,7 @@
 #include powerdomain.h
 #include plat/clock.h
 #include plat/omap_hwmod.h
+#include plat/omap_device.h
 #include plat/prcm.h
 
 #include cm2xxx_3xxx.h
@@ -2618,11 +2619,34 @@ ohsps_unlock:
return ret;
 }
 
+/*
+ * omap_hwmod_set_wkup_constraint- set/release a wake-up latency constraint
+ *
+ * @oh: struct omap_hwmod* to which the target device belongs to.
+ * @cookie: identifier of the constraints list for @oh.
+ * @min_latency: the minimum allowed wake-up latency for @oh.
+ *
+ * Returns 0 upon success.
+ */
+int omap_hwmod_set_wkup_lat_constraint(struct omap_hwmod *oh,
+  void *cookie, long min_latency)
+{
+   struct powerdomain *pwrdm = omap_hwmod_get_pwrdm(oh);
+
+   if (!pwrdm) {
+   pr_err(%s: Error: could not find powerdomain 
+  for %s\n, __func__, oh-name);
+   return -EINVAL;
+   }
+
+   return pwrdm_set_wkup_lat_constraint(pwrdm, cookie, min_latency);
+}
+
 /**
  * omap_hwmod_get_context_loss_count - get lost context count
  * @oh: struct omap_hwmod *
  *
- * Query the powerdomain of of @oh to get the context loss
+ * Query the powerdomain of @oh to get the context loss
  * count for this device.
  *
  * Returns the context loss count of the powerdomain assocated with @oh
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h 
b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 0e329ca..75e0e7a 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -603,6 +603,8 @@ int omap_hwmod_for_each_by_class(const char *classname,
 void *user);
 
 int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state);
+int omap_hwmod_set_wkup_lat_constraint(struct omap_hwmod *oh, void *cookie,
+  long min_latency);
 u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh);
 
 int omap_hwmod_no_setup_reset(struct omap_hwmod *oh);
-- 
1.7.4.1

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