<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/hwmon/tmp102.c, branch v4.11.5</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.11.5</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.11.5'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2016-09-09T04:34:17+00:00</updated>
<entry>
<title>hwmon: (tmp102) Convert to use new hwmon registration API</title>
<updated>2016-09-09T04:34:17+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2016-06-20T17:50:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0208531d9090af3ca9d985dfdf66d1a71da0e58f'/>
<id>urn:sha1:0208531d9090af3ca9d985dfdf66d1a71da0e58f</id>
<content type='text'>
Simplify code and reduce code size by using the new hwmon
registration API.

Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (tmp102) Improve error handling</title>
<updated>2016-07-31T22:02:51+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2016-07-25T21:57:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1aa4f0289fd5554a9cd58e5b47a361b14256ea90'/>
<id>urn:sha1:1aa4f0289fd5554a9cd58e5b47a361b14256ea90</id>
<content type='text'>
Use devm_add_action_or_reset() instead of devm_add_action(), and
check its return code.

Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (tmp102) Convert to use regmap, and drop local cache</title>
<updated>2016-07-12T21:24:14+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2016-06-20T16:55:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=28a340db9043f11dfd092c1b8ea4043f59cc0ca1'/>
<id>urn:sha1:28a340db9043f11dfd092c1b8ea4043f59cc0ca1</id>
<content type='text'>
By converting the driver to regmap, we can use regmap to cache non-volatile
registers. Stop caching the temperature register; while potentially reading
it more often can result in reading it more often than necessary, this is
offset by the gain due to not re-reading the limit registers.

A positive side effect of this change is that limit registers can now be
read and updated before the first temperature conversion is complete.

Acked-by: Nishanth Menon &lt;nm@ti.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (tmp102) Rework chip configuration</title>
<updated>2016-07-12T21:24:09+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2016-06-22T17:01:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a9f92ccf334f7e15124193b1d7b89b7e6e6624e2'/>
<id>urn:sha1:a9f92ccf334f7e15124193b1d7b89b7e6e6624e2</id>
<content type='text'>
So far the chip was forced into polarity 0, even if it was preconfigured
differently. Do not touch the polarity when configuring the chip.

Also, the configuration register was read beack to check if the
configuration 'sticks'. Ultimately, that is similar to checking if the
chip is a tmp102 in the first place. Checking if a write into the
configuration register was successful is really not the way to do it,
and quite risky if the chip is not a tmp102, so drop that check.
Instead, verify if the configuration register has unexpected bits set
before writing into it.

Acked-by: Nishanth Menon &lt;nm@ti.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (tmp102) Improve handling of initial read delay</title>
<updated>2016-07-12T21:23:57+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2016-06-20T03:34:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3d8f7a89a1979be7f631cf06e02f882adf144885'/>
<id>urn:sha1:3d8f7a89a1979be7f631cf06e02f882adf144885</id>
<content type='text'>
If the chip was in shutdown mode when the driver was loaded, the first
conversion is ready no more than 35 milli-seconds after the chip was
taken out of shutdown. The driver delay was so far set to 333 ms (HZ / 3),
which is much higher than the maximum time needed by the chip.
Reduce the time to 35 milli-seconds.

Introduce a 'valid' flag to ensure that sensor data is actually read
even if requested less than 333 ms after the driver was loaded.

Acked-by: Nishanth Menon &lt;nm@ti.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (tmp102) Drop FSF address</title>
<updated>2016-06-28T01:58:31+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2016-06-22T17:40:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4e6163e859cd572acb4bc2525e00714f6c1905c8'/>
<id>urn:sha1:4e6163e859cd572acb4bc2525e00714f6c1905c8</id>
<content type='text'>
The FSF address can change, so drop it from the driver.

Acked-by: Nishanth Menon &lt;nm@ti.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (tmp102) Use devm_add_action to register cleanup function</title>
<updated>2016-06-28T01:58:31+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2016-06-20T03:09:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b17ea1ca1da115050959d24353e58ccae8aacb58'/>
<id>urn:sha1:b17ea1ca1da115050959d24353e58ccae8aacb58</id>
<content type='text'>
By registering a cleanup function with devm_add_action(), we can
simplify the error path in the probe function and drop the remove
function entirely.

Acked-by: Nishanth Menon &lt;nm@ti.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: convert tmp102 to use devm_thermal_zone_of_sensor_register</title>
<updated>2016-05-17T14:28:25+00:00</updated>
<author>
<name>Eduardo Valentin</name>
<email>edubezval@gmail.com</email>
</author>
<published>2016-03-09T21:02:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=51b77fd7b17f03114bb1809e35be0b434d89cb76'/>
<id>urn:sha1:51b77fd7b17f03114bb1809e35be0b434d89cb76</id>
<content type='text'>
This changes the driver to use the devm_ version
of thermal_zone_of_sensor_register and cleans
up the  local points and unregister calls.

Cc: Jean Delvare &lt;jdelvare@suse.com&gt;
Cc: Guenter Roeck &lt;linux@roeck-us.net&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;edubezval@gmail.com&gt;
</content>
</entry>
<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>
</feed>
