diff mbox

[PATCHv4,04/15] Thermal: Add platform level information to thermal.h

Message ID 1347946506-18449-5-git-send-email-durgadoss.r@intel.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

durgadoss.r@intel.com Sept. 18, 2012, 5:34 a.m. UTC
This patch adds platform level information to thermal.h
by introducing two structures to hold:
 * bind parameters for a thermal zone,
 * zone level platform parameters

Signed-off-by: Durgadoss R <durgadoss.r@intel.com>
---
 include/linux/thermal.h |   29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

Comments

Zhang Rui Sept. 21, 2012, 7:12 a.m. UTC | #1
On ?, 2012-09-18 at 11:04 +0530, Durgadoss R wrote:
> This patch adds platform level information to thermal.h
> by introducing two structures to hold:
>  * bind parameters for a thermal zone,
>  * zone level platform parameters
> 
> Signed-off-by: Durgadoss R <durgadoss.r@intel.com>
> ---
>  include/linux/thermal.h |   29 +++++++++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
> 
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index 32af124..4caa32e 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -157,6 +157,7 @@ struct thermal_zone_device {
>  	int passive;
>  	unsigned int forced_passive;
>  	const struct thermal_zone_device_ops *ops;
> +	const struct thermal_zone_params *tzp;
>  	struct list_head thermal_instances;
>  	struct idr idr;
>  	struct mutex lock; /* protect thermal_instances list */
> @@ -164,6 +165,34 @@ struct thermal_zone_device {
>  	struct delayed_work poll_queue;
>  };
>  
> +/* Structure that holds binding parameters for a zone */
> +struct thermal_bind_params {
> +	struct thermal_cooling_device *cdev;
> +
> +	/*
> +	 * This is a measure of 'how effectively these devices can
> +	 * cool 'this' thermal zone. The shall be determined by platform
> +	 * characterization. This is on a 'percentage' scale.
> +	 * See Documentation/thermal/sysfs-api.txt for more information.
> +	 */
> +	int weight;
> +
> +	/*
> +	 * This is a bit mask that gives the binding relation between this
> +	 * thermal zone and cdev, for a particular trip point.
> +	 * See Documentation/thermal/sysfs-api.txt for more information.
> +	 */
> +	int trip_mask;
> +	int (*match) (struct thermal_zone_device *tz,
> +			struct thermal_cooling_device *cdev);
> +};

we do not have field to describe the upper and lower limit?

thanks.
rui
> +
> +/* Structure to define Thermal Zone parameters */
> +struct thermal_zone_params {
> +	int num_tbps;	/* Number of tbp entries */
> +	struct thermal_bind_params *tbp;
> +};
> +
>  struct thermal_genl_event {
>  	u32 orig;
>  	enum events event;


--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
durgadoss.r@intel.com Sept. 21, 2012, 8:07 a.m. UTC | #2
SGkgUnVpLA0KDQo+IC0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQo+IEZyb206IFpoYW5nLCBS
dWkNCj4gU2VudDogRnJpZGF5LCBTZXB0ZW1iZXIgMjEsIDIwMTIgMTI6NDMgUE0NCj4gVG86IFIs
IER1cmdhZG9zcw0KPiBDYzogbGVuYkBrZXJuZWwub3JnOyBsaW51eC1hY3BpQHZnZXIua2VybmVs
Lm9yZzsgZWR1YXJkby52YWxlbnRpbkB0aS5jb20NCj4gU3ViamVjdDogUmU6IFtQQVRDSHY0IDA0
LzE1XSBUaGVybWFsOiBBZGQgcGxhdGZvcm0gbGV2ZWwgaW5mb3JtYXRpb24gdG8NCj4gdGhlcm1h
bC5oDQo+IA0KPiBPbiDkuowsIDIwMTItMDktMTggYXQgMTE6MDQgKzA1MzAsIER1cmdhZG9zcyBS
IHdyb3RlOg0KPiA+IFRoaXMgcGF0Y2ggYWRkcyBwbGF0Zm9ybSBsZXZlbCBpbmZvcm1hdGlvbiB0
byB0aGVybWFsLmgNCj4gPiBieSBpbnRyb2R1Y2luZyB0d28gc3RydWN0dXJlcyB0byBob2xkOg0K
PiA+ICAqIGJpbmQgcGFyYW1ldGVycyBmb3IgYSB0aGVybWFsIHpvbmUsDQo+ID4gICogem9uZSBs
ZXZlbCBwbGF0Zm9ybSBwY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3pvbmVfZGV2aWNlICp0eiwNCj4g
PiArCQkJc3RydWN0IHRoZXJtYWxfY29vbGluZ19kZXZpY2UgKmNkZXYpOw0KPiA+ICt9Ow0KPiAN
Cj4gd2UgZG8gbm90IGhhdmUgZmllbGQgdG8gZGVzY3JpYmUgdGhlIHVwcGVyIGFuZCBsb3dlciBs
aW1pdD8NCg0KTG9va3MgbGlrZSBJIG1pc3NlZCBpdCBoZXJlIDotKA0KQnV0LCBJTU8sIHdlIG5l
ZWQgYW4gYXJyYXkgb2YgJ3VwcGVyJyBhbmQgJ2xvd2VyJyBsaW1pdHMgaGVyZSAuLiBjb3JyZWN0
ID8NCkxldCBtZSBrbm93IGhvdyB5b3Ugd291bGQgd2FudCB0byBhZGRyZXNzIGl0ID8NCmEgc2Vw
YXJhdGUgcGF0Y2ggb3IgZml4IGhlcmUgPw0KDQpUaGFua3MsDQpEdXJnYQ0K
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Zhang Rui Sept. 24, 2012, 5:43 a.m. UTC | #3
On ?, 2012-09-21 at 02:07 -0600, R, Durgadoss wrote:
> Hi Rui,
> 
> > -----Original Message-----
> > From: Zhang, Rui
> > Sent: Friday, September 21, 2012 12:43 PM
> > To: R, Durgadoss
> > Cc: lenb@kernel.org; linux-acpi@vger.kernel.org; eduardo.valentin@ti.com
> > Subject: Re: [PATCHv4 04/15] Thermal: Add platform level information to
> > thermal.h
> > 
> > On ?, 2012-09-18 at 11:04 +0530, Durgadoss R wrote:
> > > This patch adds platform level information to thermal.h
> > > by introducing two structures to hold:
> > >  * bind parameters for a thermal zone,
> > >  * zone level platform parameters
> > >
> > > Signed-off-by: Durgadoss R <durgadoss.r@intel.com>
> > > ---
> > >  include/linux/thermal.h |   29 +++++++++++++++++++++++++++++
> > >  1 file changed, 29 insertions(+)
> > >
> > > diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> > > index 32af124..4caa32e 100644
> > > --- a/include/linux/thermal.h
> > > +++ b/include/linux/thermal.h
> > > @@ -157,6 +157,7 @@ struct thermal_zone_device {
> > >  	int passive;
> > >  	unsigned int forced_passive;
> > >  	const struct thermal_zone_device_ops *ops;
> > > +	const struct thermal_zone_params *tzp;
> > >  	struct list_head thermal_instances;
> > >  	struct idr idr;
> > >  	struct mutex lock; /* protect thermal_instances list */
> > > @@ -164,6 +165,34 @@ struct thermal_zone_device {
> > >  	struct delayed_work poll_queue;
> > >  };
> > >
> > > +/* Structure that holds binding parameters for a zone */
> > > +struct thermal_bind_params {
> > > +	struct thermal_cooling_device *cdev;
> > > +
> > > +	/*
> > > +	 * This is a measure of 'how effectively these devices can
> > > +	 * cool 'this' thermal zone. The shall be determined by platform
> > > +	 * characterization. This is on a 'percentage' scale.
> > > +	 * See Documentation/thermal/sysfs-api.txt for more information.
> > > +	 */
> > > +	int weight;
> > > +
> > > +	/*
> > > +	 * This is a bit mask that gives the binding relation between this
> > > +	 * thermal zone and cdev, for a particular trip point.
> > > +	 * See Documentation/thermal/sysfs-api.txt for more information.
> > > +	 */
> > > +	int trip_mask;
> > > +	int (*match) (struct thermal_zone_device *tz,
> > > +			struct thermal_cooling_device *cdev);
> > > +};
> > 
> > we do not have field to describe the upper and lower limit?
> 
> Looks like I missed it here :-(
> But, IMO, we need an array of 'upper' and 'lower' limits here .. correct ?

either is ok.
if we are using two integers, we need different bind params for trip
points that have different upper and lower limit.
we can still use one bind params to describe multiple trip points if
they do not have any upper and lower limit.

> Let me know how you would want to address it ?
> a separate patch or fix here ?
> 
we can have an incremental patch for it.

thanks,
rui

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

Patch

diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 32af124..4caa32e 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -157,6 +157,7 @@  struct thermal_zone_device {
 	int passive;
 	unsigned int forced_passive;
 	const struct thermal_zone_device_ops *ops;
+	const struct thermal_zone_params *tzp;
 	struct list_head thermal_instances;
 	struct idr idr;
 	struct mutex lock; /* protect thermal_instances list */
@@ -164,6 +165,34 @@  struct thermal_zone_device {
 	struct delayed_work poll_queue;
 };
 
+/* Structure that holds binding parameters for a zone */
+struct thermal_bind_params {
+	struct thermal_cooling_device *cdev;
+
+	/*
+	 * This is a measure of 'how effectively these devices can
+	 * cool 'this' thermal zone. The shall be determined by platform
+	 * characterization. This is on a 'percentage' scale.
+	 * See Documentation/thermal/sysfs-api.txt for more information.
+	 */
+	int weight;
+
+	/*
+	 * This is a bit mask that gives the binding relation between this
+	 * thermal zone and cdev, for a particular trip point.
+	 * See Documentation/thermal/sysfs-api.txt for more information.
+	 */
+	int trip_mask;
+	int (*match) (struct thermal_zone_device *tz,
+			struct thermal_cooling_device *cdev);
+};
+
+/* Structure to define Thermal Zone parameters */
+struct thermal_zone_params {
+	int num_tbps;	/* Number of tbp entries */
+	struct thermal_bind_params *tbp;
+};
+
 struct thermal_genl_event {
 	u32 orig;
 	enum events event;