<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/hwmon/tmp401.c, branch v6.6.132</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-01-11T14:21:48+00:00</updated>
<entry>
<title>hwmon: (tmp401) fix overflow caused by default conversion rate value</title>
<updated>2026-01-11T14:21:48+00:00</updated>
<author>
<name>Alexey Simakov</name>
<email>bigalex934@gmail.com</email>
</author>
<published>2025-12-11T16:43:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=11dddaed697896d8c38767f0f39b556b543df5c0'/>
<id>urn:sha1:11dddaed697896d8c38767f0f39b556b543df5c0</id>
<content type='text'>
[ Upstream commit 82f2aab35a1ab2e1460de06ef04c726460aed51c ]

The driver computes conversion intervals using the formula:

    interval = (1 &lt;&lt; (7 - rate)) * 125ms

where 'rate' is the sensor's conversion rate register value. According to
the datasheet, the power-on reset value of this register is 0x8, which
could be assigned to the register, after handling i2c general call.
Using this default value causes a result greater than the bit width of
left operand and an undefined behaviour in the calculation above, since
shifting by values larger than the bit width is undefined behaviour as
per C language standard.

Limit the maximum usable 'rate' value to 7 to prevent undefined
behaviour in calculations.

Found by Linux Verification Center (linuxtesting.org) with Svace.

Note (groeck):
    This does not matter in practice unless someone overwrites the chip
    configuration from outside the driver while the driver is loaded.
    The conversion time register is initialized with a value of 5 (500ms)
    when the driver is loaded, and the driver never writes a bad value.

Fixes: ca53e7640de7 ("hwmon: (tmp401) Convert to _info API")
Signed-off-by: Alexey Simakov &lt;bigalex934@gmail.com&gt;
Link: https://lore.kernel.org/r/20251211164342.6291-1-bigalex934@gmail.com
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>hwmon: Switch i2c drivers back to use .probe()</title>
<updated>2023-06-08T13:41:17+00:00</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2023-05-05T13:17:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1975d167869ef03102771d6267582623d6e07058'/>
<id>urn:sha1:1975d167869ef03102771d6267582623d6e07058</id>
<content type='text'>
After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new()
call-back type"), all drivers being converted to .probe_new() and then
03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert
back to (the new) .probe() to be able to eventually drop .probe_new() from
struct i2c_driver.

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Link: https://lore.kernel.org/r/20230505131718.1210071-1-u.kleine-koenig@pengutronix.de
[groeck: Added missing change in pmbus/acbel-fsg032.c]
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: move from strlcpy with unused retval to strscpy</title>
<updated>2022-09-19T13:17:05+00:00</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa+renesas@sang-engineering.com</email>
</author>
<published>2022-08-18T21:00:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f2f394db4b5eb1d3e609c93ad85bb4d2d0490121'/>
<id>urn:sha1:f2f394db4b5eb1d3e609c93ad85bb4d2d0490121</id>
<content type='text'>
Follow the advice of the below link and prefer 'strscpy' in this
subsystem. Conversion is 1:1 because the return value is not used.
Generated by a coccinelle script.

Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/
Signed-off-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
Link: https://lore.kernel.org/r/20220818210014.6769-1-wsa+renesas@sang-engineering.com
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (tmp401) Fix incorrect return value of tmp401_init_client</title>
<updated>2022-05-20T17:57:05+00:00</updated>
<author>
<name>Camel Guo</name>
<email>camel.guo@axis.com</email>
</author>
<published>2022-04-25T10:00:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8c099cd381aa36373593d4efc92493c1345c73da'/>
<id>urn:sha1:8c099cd381aa36373593d4efc92493c1345c73da</id>
<content type='text'>
When ti,n-factor, ti,beta-compentation are not defined in devicetree,
of_property_read_u32|s32 returns -EINVAL. In this case,
tmp401_init_client should return 0 instead of simply pass ret to its
caller.

Signed-off-by: Camel Guo &lt;camel.guo@axis.com&gt;
Link: https://lore.kernel.org/r/20220425100019.562781-1-camel.guo@axis.com
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (tmp401) Add support of three advanced features</title>
<updated>2022-05-20T17:57:05+00:00</updated>
<author>
<name>Camel Guo</name>
<email>camel.guo@axis.com</email>
</author>
<published>2022-04-14T07:58:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bd79021072ac841e73ec5300a4dbfbdeff431582'/>
<id>urn:sha1:bd79021072ac841e73ec5300a4dbfbdeff431582</id>
<content type='text'>
tmp401 driver supports TMP401, TMP411 and TMP43X temperature sensors.
According to their datasheet:
- all of them support extended temperature range feature;
- TMP411 and TPM43X support n-factor correction feature;
- TMP43X support beta compensation feature.

In order to support setting them during bootup, this commit reads
ti,extended-range-enable, ti,n-factor and ti,beta-compensation and set
the corresponding registers during probing.

Signed-off-by: Camel Guo &lt;camel.guo@axis.com&gt;
Link: https://lore.kernel.org/r/20220414075824.2634839-3-camel.guo@axis.com
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (tmp401) Add OF device ID table</title>
<updated>2022-05-03T13:44:25+00:00</updated>
<author>
<name>Camel Guo</name>
<email>camel.guo@axis.com</email>
</author>
<published>2022-05-03T11:43:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3481551f035725fdc46885425eac3ef9b58ae7b7'/>
<id>urn:sha1:3481551f035725fdc46885425eac3ef9b58ae7b7</id>
<content type='text'>
This driver doesn't have of_match_table. This makes the kernel module
tmp401.ko lack alias patterns (e.g: of:N*T*Cti,tmp411) to match DT node
of the supported devices hence this kernel module will not be
automatically loaded.

After adding of_match_table to this driver, the folllowing alias will be
added into tmp401.ko.
$ modinfo drivers/hwmon/tmp401.ko
filename: drivers/hwmon/tmp401.ko
......
author:         Hans de Goede &lt;hdegoede@redhat.com&gt;
alias:          of:N*T*Cti,tmp435C*
alias:          of:N*T*Cti,tmp435
alias:          of:N*T*Cti,tmp432C*
alias:          of:N*T*Cti,tmp432
alias:          of:N*T*Cti,tmp431C*
alias:          of:N*T*Cti,tmp431
alias:          of:N*T*Cti,tmp411C*
alias:          of:N*T*Cti,tmp411
alias:          of:N*T*Cti,tmp401C*
alias:          of:N*T*Cti,tmp401
......

Fixes: af503716ac14 ("i2c: core: report OF style module alias for devices registered via OF")
Signed-off-by: Camel Guo &lt;camel.guo@axis.com&gt;
Link: https://lore.kernel.org/r/20220503114333.456476-1-camel.guo@axis.com
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (tmp401) Hide register write address differences in regmap code</title>
<updated>2021-12-26T23:02:05+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2021-11-09T21:18:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ff300b71ba3860d282f77774d2b02ec49ad0e9cf'/>
<id>urn:sha1:ff300b71ba3860d282f77774d2b02ec49ad0e9cf</id>
<content type='text'>
Since we are using regmap access functions to write into chip registers,
we can hide the difference in register write addresses within regmap
code. By doing this we do not need to clear the regmap cache on register
writes, and the high level code does not need to bother about different
read/write register addresses.

Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (tmp401) Use regmap</title>
<updated>2021-12-26T23:02:05+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2021-10-16T21:56:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=50152fb6c1a197271b8916b8225525a6ca71e9ee'/>
<id>urn:sha1:50152fb6c1a197271b8916b8225525a6ca71e9ee</id>
<content type='text'>
Use regmap for register accesses to be able to utilize its caching
functionality. This also lets us hide register access differences
in regmap code.

Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (tmp401) Convert to _info API</title>
<updated>2021-12-26T23:02:05+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2021-10-16T17:51:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ca53e7640de7579f7e3ee467c82618e1ad98857a'/>
<id>urn:sha1:ca53e7640de7579f7e3ee467c82618e1ad98857a</id>
<content type='text'>
The new API is cleaner and reduces code size significantly.
All chip accesses are 'hidden' in chip access to prepare for using
regmap. Local caching code is removed, to be replaced by regmap based
caching in a follow-up patch.

Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
<entry>
<title>hwmon: (tmp401) Simplify temperature register arrays</title>
<updated>2021-12-26T23:02:05+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2021-10-17T14:47:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bcb31e680837b71648158f2fedfc078cf6699207'/>
<id>urn:sha1:bcb31e680837b71648158f2fedfc078cf6699207</id>
<content type='text'>
The difference between TMP431 and other chips of this series is that the
TMP431 has an additional sensor. The register addresses for other sensors
are the same for all chips. It is therefore unnecessary to maintain two
different arrays for TMP431 and the other chips. Just use the same array
for all chips and add the TMP431 register addresses as third column.

Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
</content>
</entry>
</feed>
