Re: [PATCH v4 2/2] hwmon: Add driver for Texas Instruments TMP464 and TMP468

From: Agathe Porte
Date: Fri Feb 18 2022 - 04:50:52 EST


Hi Guenter,

Le 18/02/2022 à 07:58, Guenter Roeck a écrit :
Add support for Texas Instruments TMP464 and TMP468 temperature sensor
ICs.

TI's TMP464 is an I2C temperature sensor chip. This chip is similar
to TI's TMP421 chip, but with 16bit-wide registers (instead of
8bit-wide registers). The chip has one local sensor and four remote
sensors. TMP468 is similar to TMP464 but has one local and eight
remote sensors.

Originally-from: Agathe Porte <agathe.porte@xxxxxxxxx>
Cc: Agathe Porte <agathe.porte@xxxxxxxxx>
Cc: Krzysztof Adamski <krzysztof.adamski@xxxxxxxxx>
Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
---
v4:
- Fixed reading n-factor information from devicetree
[Use of_property_read_u8 instead of of_property_read_s32 to read the
property value, and write n-factor value into the upper 8 bit of the
n-factor register]

Changing n-factor with DT seems to work:

temp2_input=38500 (nfactor=10)
temp2_input=35500 (nfactor=-10)

Driver probes just fine with this attribute set.

+static int tmp464_probe_child_from_dt(struct device *dev,
+ struct device_node *child,
+ struct tmp464_data *data)
+
+{
+ struct regmap *regmap = data->regmap;
+ u32 channel;
+ u8 nfactor;
+ s32 val;

val is not used according to the compiler, and thus should be removed (module does not compile with -Werror)

PS: TMP464 samples will be sent by DHL today and should arrive to you on Feb, 23rd.

Best regards,

Agathe.