<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/hwmon/tmp102.c, branch v4.4.171</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.4.171</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.4.171'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2015-12-10T16:14:22+00:00</updated>
<entry>
<title>hwmon: (tmp102) Force wait for conversion time for the first valid data</title>
<updated>2015-12-10T16:14:22+00:00</updated>
<author>
<name>Nishanth Menon</name>
<email>nm@ti.com</email>
</author>
<published>2015-12-01T16:10:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=00917b5c55aeb01322d5ab51af8c025b82959224'/>
<id>urn:sha1:00917b5c55aeb01322d5ab51af8c025b82959224</id>
<content type='text'>
TMP102 works based on conversions done periodically. However, as per
the TMP102 data sheet[1] the first conversion is triggered immediately
after we program the configuration register. The temperature data
registers do not reflect proper data until the first conversion is
complete (in our case HZ/4).

The driver currently sets the last_update to be jiffies - HZ, just
after the configuration is complete. When TMP102 driver registers
with the thermal framework, it immediately tries to read the sensor
temperature data. This takes place even before the conversion on the
TMP102 is complete and results in an invalid temperature read.

Depending on the value read, this may cause thermal framework to
assume that a critical temperature event has occurred and attempts to
shutdown the system.

Instead of causing an invalid mid-conversion value to be read
erroneously, we mark the last_update to be in-line with the current
jiffies. This allows the tmp102_update_device function to skip update
until the required conversion time is complete. Further, we ensure to
return -EAGAIN result instead of returning spurious temperature (such
as 0C) values to the caller to prevent any wrong decisions made with
such values. NOTE: this allows the read functions not to be blocking
and allows the callers to make the decision if they would like to
block or try again later. At least the current user(thermal) seems to
handle this by retrying later.

A simpler alternative approach could be to sleep in the probe for the
duration required, but that will result in latency that is undesirable
and delay boot sequence un-necessarily.

[1] http://www.ti.com/lit/ds/symlink/tmp102.pdf

Cc: Eduardo Valentin &lt;edubezval@gmail.com&gt;
Reported-by: Aparna Balasubramanian &lt;aparnab@ti.com&gt;
Reported-by: Elvita Lobo &lt;elvita@ti.com&gt;
Reported-by: Yan Liu &lt;yan-liu@ti.com&gt;
Signed-off-by: Nishanth Menon &lt;nm@ti.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>thermal: consistently use int for temperatures</title>
<updated>2015-08-03T15:15:50+00:00</updated>
<author>
<name>Sascha Hauer</name>
<email>s.hauer@pengutronix.de</email>
</author>
<published>2015-07-24T06:12:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=17e8351a77397e8a83727eb17e3a3e9b8ab5257a'/>
<id>urn:sha1:17e8351a77397e8a83727eb17e3a3e9b8ab5257a</id>
<content type='text'>
The thermal code uses int, long and unsigned long for temperatures
in different places.

Using an unsigned type limits the thermal framework to positive
temperatures without need. Also several drivers currently will report
temperatures near UINT_MAX for temperatures below 0°C. This will probably
immediately shut the machine down due to overtemperature if started below
0°C.

'long' is 64bit on several architectures. This is not needed since INT_MAX °mC
is above the melting point of all known materials.

Consistently use a plain 'int' for temperatures throughout the thermal code and
the drivers. This only changes the places in the drivers where the temperature
is passed around as pointer, when drivers internally use another type this is
not changed.

Signed-off-by: Sascha Hauer &lt;s.hauer@pengutronix.de&gt;
Acked-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Reviewed-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Reviewed-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
Reviewed-by: Darren Hart &lt;dvhart@linux.intel.com&gt;
Reviewed-by: Heiko Stuebner &lt;heiko@sntech.de&gt;
Reviewed-by: Peter Feuerer &lt;peter@piie.net&gt;
Cc: Punit Agrawal &lt;punit.agrawal@arm.com&gt;
Cc: Zhang Rui &lt;rui.zhang@intel.com&gt;
Cc: Eduardo Valentin &lt;edubezval@gmail.com&gt;
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: Jean Delvare &lt;jdelvare@suse.de&gt;
Cc: Peter Feuerer &lt;peter@piie.net&gt;
Cc: Heiko Stuebner &lt;heiko@sntech.de&gt;
Cc: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
Cc: Stephen Warren &lt;swarren@wwwdotorg.org&gt;
Cc: Thierry Reding &lt;thierry.reding@gmail.com&gt;
Cc: linux-acpi@vger.kernel.org
Cc: platform-driver-x86@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-omap@vger.kernel.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: Guenter Roeck &lt;linux@roeck-us.net&gt;
Cc: Rafael J. Wysocki &lt;rjw@rjwysocki.net&gt;
Cc: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Cc: Darren Hart &lt;dvhart@infradead.org&gt;
Cc: lm-sensors@lm-sensors.org
Signed-off-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
</content>
</entry>
<entry>
<title>hwmon: (tmp102) add hibernation callbacks</title>
<updated>2015-02-03T20:17:12+00:00</updated>
<author>
<name>Grygorii Strashko</name>
<email>Grygorii.Strashko@linaro.org</email>
</author>
<published>2015-02-03T15:01:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dd378b1bcaa0ef5b14cca1e52b58ef9a3279fd8b'/>
<id>urn:sha1:dd378b1bcaa0ef5b14cca1e52b58ef9a3279fd8b</id>
<content type='text'>
Setting a dev_pm_ops suspend/resume pair but not a set of
hibernation functions means those pm functions will not be
called upon hibernation.
Fix this by using SIMPLE_DEV_PM_OPS, which appropriately
assigns the suspend and hibernation handlers and move
mp102_suspend/tmp102_resume under CONFIG_PM_SLEEP to avoid
build warnings.

Signed-off-by: Grygorii Strashko &lt;Grygorii.Strashko@linaro.org&gt;
[groeck: Declare tmp102_dev_pm_ops as static variable]
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>thermal: of: improve of-thermal sensor registration API</title>
<updated>2014-11-20T14:44:54+00:00</updated>
<author>
<name>Eduardo Valentin</name>
<email>edubezval@gmail.com</email>
</author>
<published>2014-11-08T01:24:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2251aef64a38db60f4ae7a4a83f9203c6791f196'/>
<id>urn:sha1:2251aef64a38db60f4ae7a4a83f9203c6791f196</id>
<content type='text'>
Different drivers request API extensions in of-thermal. For this reason,
additional callbacks are required to fit the new drivers needs.

The current API implementation expects the registering sensor driver
to provide a get_temp and get_trend callbacks as function parameters.
As the amount of callbacks is growing, this patch changes the existing
implementation to use a .ops field to hold all the of thermal callbacks
to sensor drivers.

This patch also changes the existing of-thermal users to fit the new
API design. No functional change is introduced in this patch.

Cc: Alexandre Courbot &lt;gnurou@gmail.com&gt;
Cc: devicetree@vger.kernel.org
Cc: Grant Likely &lt;grant.likely@linaro.org&gt;
Cc: Guenter Roeck &lt;linux@roeck-us.net&gt;
Cc: Jean Delvare &lt;jdelvare@suse.de&gt;
Cc: linux-kernel@vger.kernel.org
Cc: linux-pm@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
Cc: lm-sensors@lm-sensors.org
Cc: Rob Herring &lt;robh+dt@kernel.org&gt;
Cc: Stephen Warren &lt;swarren@wwwdotorg.org&gt;
Cc: Thierry Reding &lt;thierry.reding@gmail.com&gt;
Cc: Zhang Rui &lt;rui.zhang@intel.com&gt;
Acked-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Tested-by: Mikko Perttunen &lt;mikko.perttunen@kapsi.fi&gt;
Reviewed-by: Mikko Perttunen &lt;mikko.perttunen@kapsi.fi&gt;
Reviewed-by: Alexandre Courbot &lt;acourbot@nvidia.com&gt;
Reviewed-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
Signed-off-by: Eduardo Valentin &lt;edubezval@gmail.com&gt;
</content>
</entry>
<entry>
<title>hwmon: (tmp102) Convert to use hwmon_device_register_with_groups</title>
<updated>2014-05-21T23:02:20+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2014-02-02T18:08:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ad9beea43f22f80217ac1850b0373718adce5fbc'/>
<id>urn:sha1:ad9beea43f22f80217ac1850b0373718adce5fbc</id>
<content type='text'>
Simplify code, reduce code size, and attach sysfs attributes to hwmon device.

Reviewed-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (tmp102) Introduce dev variable in probe function</title>
<updated>2014-05-21T23:02:20+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2014-02-02T22:22:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fbd9af164c4a70e6f37b6985de8d481a6958cc2c'/>
<id>urn:sha1:fbd9af164c4a70e6f37b6985de8d481a6958cc2c</id>
<content type='text'>
The pointer to client-&gt;dev is used several times in the probe function.
Simplify code by introducing a separate variable for it.

Reviewed-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: tmp102: expose to thermal fw via DT nodes</title>
<updated>2013-12-04T13:34:25+00:00</updated>
<author>
<name>Eduardo Valentin</name>
<email>eduardo.valentin@ti.com</email>
</author>
<published>2013-07-16T18:57:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6a027523f30f1cc90037686e6a682d15c6a555d6'/>
<id>urn:sha1:6a027523f30f1cc90037686e6a682d15c6a555d6</id>
<content type='text'>
This patch adds to tmp102 temperature sensor the possibility
to expose itself as thermal zone device, registered on the
thermal framework.

The thermal zone is built only if a device tree node
describing a thermal zone for this sensor is present
inside the tmp102 DT node. Otherwise, the driver behavior
will be the same.

Note: This patch has also been reviewed by Jean D. He has
requested to perform a wider inspection of possible
users of thermal and hwmon interaction API. On the other
hand, the change on this patch is acceptable on first
step of overall code change.

Cc: Jean Delvare &lt;khali@linux-fr.org&gt;
Cc: lm-sensors@lm-sensors.org
Cc: linux-kernel@vger.kernel.org
Acked-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Eduardo Valentin &lt;eduardo.valentin@ti.com&gt;
</content>
</entry>
<entry>
<title>hwmon: Fix checkpatch warning 'quoted string split across lines'</title>
<updated>2013-04-08T04:16:40+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2013-01-10T18:01:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b55f375725ff85aada394da488802b0a3cc99e88'/>
<id>urn:sha1:b55f375725ff85aada394da488802b0a3cc99e88</id>
<content type='text'>
Cc: Corentin Labbe &lt;corentin.labbe@geomatys.fr&gt;
Cc: Mark M. Hoffman &lt;mhoffman@lightlink.com&gt;
Cc: Fenghua Yu &lt;fenghua.yu@intel.com&gt;
Cc: Juerg Haefliger &lt;juergh@gmail.com&gt;
Cc: Andreas Herrmann &lt;herrmann.der.user@googlemail.com&gt;
Cc: Rudolf Marek &lt;r.marek@assembler.cz&gt;
Cc: Jim Cromie &lt;jim.cromie@gmail.com&gt;
Cc: Roger Lucas &lt;vt8231@hiddenengine.co.uk&gt;
Cc: Marc Hulsman &lt;m.hulsman@tudelft.nl&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: Replace SENSORS_LIMIT with clamp_val</title>
<updated>2013-01-26T05:03:54+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2013-01-09T16:09:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2a844c148e1f714ebf42cb96e1b172ce394c36c9'/>
<id>urn:sha1:2a844c148e1f714ebf42cb96e1b172ce394c36c9</id>
<content type='text'>
SENSORS_LIMIT and the generic clamp_val have the same functionality,
and clamp_val is more efficient.

This patch reduces text size by 9052 bytes and bss size by 11624 bytes
for x86_64 builds.

Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Acked-by: George Joseph &lt;george.joseph@fairview5.com&gt;
Acked-by: Jean Delvare &lt;khali@linux-fr.org&gt;
</content>
</entry>
<entry>
<title>hwmon: remove use of __devexit</title>
<updated>2012-11-28T19:50:34+00:00</updated>
<author>
<name>Bill Pemberton</name>
<email>wfp5p@virginia.edu</email>
</author>
<published>2012-11-19T18:25:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=281dfd0b6ed5403f5b9b1669f2a37a4f8cfc11c1'/>
<id>urn:sha1:281dfd0b6ed5403f5b9b1669f2a37a4f8cfc11c1</id>
<content type='text'>
CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.

Signed-off-by: Bill Pemberton &lt;wfp5p@virginia.edu&gt;
Cc: Hans de Goede &lt;hdegoede@redhat.com&gt;
Cc: Jean Delvare &lt;khali@linux-fr.org&gt;
Cc: Alistair John Strachan &lt;alistair@devzero.co.uk&gt;
Cc: Fenghua Yu &lt;fenghua.yu@intel.com&gt;
Cc: Juerg Haefliger &lt;juergh@gmail.com&gt;
Cc: Andreas Herrmann &lt;herrmann.der.user@googlemail.com&gt;
Cc: Clemens Ladisch &lt;clemens@ladisch.de&gt;
Cc: Rudolf Marek &lt;r.marek@assembler.cz&gt;
Cc: Jim Cromie &lt;jim.cromie@gmail.com&gt;
Cc: "Mark M. Hoffman" &lt;mhoffman@lightlink.com&gt;
Cc: Roger Lucas &lt;vt8231@hiddenengine.co.uk&gt;
Acked-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Acked-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
