From: Guenter Roeck <linux@roeck-us.net>
To: Eduardo Valentin <eduardo.valentin@ti.com>
Cc: devicetree-discuss@lists.ozlabs.org, wni@nvidia.com,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
lm-sensors@lm-sensors.org, l.stach@pengutronix.de
Subject: Re: [lm-sensors] [RESEND PATCH V1 0/9] thermal: introduce DT thermal zone build
Date: Wed, 17 Jul 2013 15:09:42 -0700 [thread overview]
Message-ID: <20130717220942.GB990@roeck-us.net> (raw)
In-Reply-To: <1374074248-31690-1-git-send-email-eduardo.valentin@ti.com>
On Wed, Jul 17, 2013 at 11:17:19AM -0400, Eduardo Valentin wrote:
> Hello all,
>
> As you noticed, I am working in a way to represent thermal data
> using device tree [1]. Essentially, this should be a way to say
> what to do with a sensor and how to associate (cooling) actions
> with it.
>
Seems to me that goes way beyond the supposed scope of devicetree data.
Devicetree data is supposed to describe hardware, not its configuration or use.
This is clearly a use case.
Guenter
> The motivation to create such infrastructure is:
> (i) - to reuse the existing temperature sensor code base;
> (ii) - have a way to easily describe thermal data across different
> boards for the same sensor. Say you have an i2c temp sensor,
> which is placed close to your battery on board A but on
> board B, another instance of this same senor is placed
> close to your display, for instance.
>
> This series introduces then a DT parser. The data expected in
> DT must contain the needed properties to build a thermal zone
> out of the desired sensor. All properties are documented and
> they are derived from the existing requirements of current
> thermal API.
>
> In order to perform a binding with cooling devices,
> the new thermal zone built using DT nodes will use
> the existing thermal API that uses binding parameters. This is
> the current proposed way to register thermal zones with platform
> information, written by Durga.
>
> There are some virtual concepts that are pushed to device tree,
> I know. But I believe using device tree to do this makes sense
> because we are still describing the HW and how they are related
> to each other. Things like cooling devices are not represented
> in device tree though, as I believe that will cause a lot of
> confusion with real devices (as already does).
>
> So the series is short but I think it makes sense to describe
> how it is organized, as it touches several places. First four
> patches are a preparation for this parser. There is a change
> on cpufreq-cpu0, so that it knows now how to load its
> corresponding cooling device. There is a change on thermal_core
> to split its hwmon code, because I think we may need to improve
> this code base when we start to integrate better with hwmon
> temperature sensors. Then, another needed preparation is to
> improve the bind_params, so that we are able to bind with
> upper and lower limits. The remaining patches are the changes
> with the proposed DT parser. A part from the DT thermal zone
> builder itself (patch 05), I also changed the ti-soc-thermal
> driver to use this new API and the omap4430 bandgap DT node,
> as an example (this has been tested on panda omap4430); and also changed
> the hwmon drivers lm75 and tmp102 to have the option to build
> a thermal zone using DT. I haven't touched any dts file using
> lm75 or tmp102 because this should come on a need basis.
>
> I believe this code is pretty usable the way it is, but might
> need to be revisited, in case the enhancement proposed by Durga
> get in. This is because representing virtual thermal zones
> built out of several sensors may need a different representation
> in DT.
>
> [1] - RFC of this work:
> http://comments.gmane.org/gmane.linux.power-management.general/35874
>
> Changes from RFC:
> - Added a way to load cpufreq cooling device out of DT
> - Added a way to bind with upper and lower limits using bind_params
> - Added a way to specify upper and lower binding limits on DT
> - Added DT thermal builder support to lm75 and tmp102 hwmon drivers
> - Changed ERANGE to EDOM
> - Added thermal constants for zone type and bind limit, so that
> dts file could be more readable
>
> Tested on panda omap4430 (3.11-rc1 with minor changes for getting cpufreq working)
>
> BR,
>
> Eduardo Valentin (9):
> cpufreq: cpufreq-cpu0: add dt node parsing for 'needs-cooling'
> thermal: hwmon: move hwmon support to single file
> thermal: thermal_core: allow binding with limits on bind_params
> arm: dts: flag omap4430 with needs-cooling for cpu node
> thermal: introduce device tree parser
> thermal: ti-soc-thermal: use thermal DT infrastructure
> arm: dts: add omap4430 thermal data
> hwmon: lm75: expose to thermal fw via DT nodes
> hwmon: tmp102: expose to thermal fw via DT nodes
>
> .../devicetree/bindings/cpufreq/cpufreq-cpu0.txt | 3 +
> .../devicetree/bindings/thermal/thermal.txt | 133 ++++++
> Documentation/thermal/sysfs-api.txt | 7 +
> arch/arm/boot/dts/omap443x.dtsi | 32 +-
> drivers/cpufreq/cpufreq-cpu0.c | 8 +
> drivers/hwmon/lm75.c | 29 ++
> drivers/hwmon/tmp102.c | 25 ++
> drivers/thermal/Kconfig | 22 +
> drivers/thermal/Makefile | 4 +
> drivers/thermal/thermal_core.c | 274 +-----------
> drivers/thermal/thermal_dt.c | 458 +++++++++++++++++++++
> drivers/thermal/thermal_hwmon.c | 269 ++++++++++++
> drivers/thermal/thermal_hwmon.h | 49 +++
> drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 46 ++-
> include/dt-bindings/thermal/thermal.h | 27 ++
> include/linux/thermal.h | 13 +
> 16 files changed, 1129 insertions(+), 270 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/thermal/thermal.txt
> create mode 100644 drivers/thermal/thermal_dt.c
> create mode 100644 drivers/thermal/thermal_hwmon.c
> create mode 100644 drivers/thermal/thermal_hwmon.h
> create mode 100644 include/dt-bindings/thermal/thermal.h
>
> --
> 1.8.2.1.342.gfa7285d
>
>
> _______________________________________________
> lm-sensors mailing list
> lm-sensors@lm-sensors.org
> http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
>
next prev parent reply other threads:[~2013-07-17 22:09 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-17 15:17 Eduardo Valentin
2013-07-17 15:17 ` [RESEND PATCH V1 1/9] cpufreq: cpufreq-cpu0: add dt node parsing for 'needs-cooling' Eduardo Valentin
2013-07-25 23:28 ` Rafael J. Wysocki
2013-07-26 13:27 ` Eduardo Valentin
2013-07-17 15:17 ` [RESEND PATCH V1 2/9] thermal: hwmon: move hwmon support to single file Eduardo Valentin
2013-07-17 16:29 ` [lm-sensors] " R, Durgadoss
2013-07-17 15:17 ` [RESEND PATCH V1 3/9] thermal: thermal_core: allow binding with limits on bind_params Eduardo Valentin
2013-07-17 16:25 ` [lm-sensors] " R, Durgadoss
2013-07-17 15:17 ` [RESEND PATCH V1 4/9] arm: dts: flag omap4430 with needs-cooling for cpu node Eduardo Valentin
2013-07-17 15:17 ` [RESEND PATCH V1 5/9] thermal: introduce device tree parser Eduardo Valentin
2013-07-17 15:17 ` [RESEND PATCH V1 6/9] thermal: ti-soc-thermal: use thermal DT infrastructure Eduardo Valentin
2013-07-17 15:17 ` [RESEND PATCH V1 7/9] arm: dts: add omap4430 thermal data Eduardo Valentin
2013-07-17 15:17 ` [RESEND PATCH V1 8/9] hwmon: lm75: expose to thermal fw via DT nodes Eduardo Valentin
2013-07-18 5:33 ` Wei Ni
2013-07-18 13:12 ` Eduardo Valentin
2013-07-19 7:43 ` Wei Ni
2013-07-18 7:22 ` Guenter Roeck
2013-07-17 15:17 ` [RESEND PATCH V1 9/9] hwmon: tmp102: " Eduardo Valentin
2013-07-18 7:23 ` Guenter Roeck
2013-07-17 22:09 ` Guenter Roeck [this message]
2013-07-18 13:53 ` [lm-sensors] [RESEND PATCH V1 0/9] thermal: introduce DT thermal zone build Eduardo Valentin
2013-07-18 17:18 ` Stephen Warren
2013-07-18 21:21 ` Guenter Roeck
2013-07-19 13:03 ` Eduardo Valentin
2013-07-19 18:48 ` Stephen Warren
2013-07-21 11:08 ` Guenter Roeck
2013-07-22 19:43 ` Stephen Warren
2013-07-22 21:46 ` Guenter Roeck
2013-07-18 21:11 ` Guenter Roeck
2013-07-19 13:38 ` Eduardo Valentin
2013-07-19 18:45 ` Stephen Warren
2013-07-19 18:56 ` Eduardo Valentin
2013-07-21 10:14 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130717220942.GB990@roeck-us.net \
--to=linux@roeck-us.net \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=eduardo.valentin@ti.com \
--cc=l.stach@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lm-sensors@lm-sensors.org \
--cc=wni@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®