summaryrefslogtreecommitdiff
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorHao Yu <haoyufine@gmail.com>2026-02-23 01:03:31 +0800
committerSasha Levin <sashal@kernel.org>2026-03-12 07:09:46 -0400
commit9833ed224aad8c305aec9ce4a94d2ec6d498bc14 (patch)
tree29a75e71b73b4c38c0a9a7dfb4b4059eef7706e1 /drivers/hwmon
parent9c1984180260b81650e075ab30d57e800f6a6fd2 (diff)
downloadlinux-9833ed224aad8c305aec9ce4a94d2ec6d498bc14.tar.gz
linux-9833ed224aad8c305aec9ce4a94d2ec6d498bc14.tar.bz2
linux-9833ed224aad8c305aec9ce4a94d2ec6d498bc14.zip
hwmon: (aht10) Fix initialization commands for AHT20
[ Upstream commit b7497b5a99f54ab8dcda5b14a308385b2fb03d8d ] According to the AHT20 datasheet (updated to V1.0 after the 2023.09 version), the initialization command for AHT20 is 0b10111110 (0xBE). The previous sequence (0xE1) used in earlier versions is no longer compatible with newer AHT20 sensors. Update the initialization command to ensure the sensor is properly initialized. While at it, use binary notation for DHT20_CMD_INIT to match the notation used in the datasheet. Fixes: d2abcb5cc885 ("hwmon: (aht10) Add support for compatible aht20") Signed-off-by: Hao Yu <haoyufine@gmail.com> Link: https://lore.kernel.org/r/20260222170332.1616-3-haoyufine@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/aht10.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/hwmon/aht10.c b/drivers/hwmon/aht10.c
index a153282eef6a..7ba00bafb57d 100644
--- a/drivers/hwmon/aht10.c
+++ b/drivers/hwmon/aht10.c
@@ -37,7 +37,9 @@
#define AHT10_CMD_MEAS 0b10101100
#define AHT10_CMD_RST 0b10111010
-#define DHT20_CMD_INIT 0x71
+#define AHT20_CMD_INIT 0b10111110
+
+#define DHT20_CMD_INIT 0b01110001
/*
* Flags in the answer byte/command
@@ -357,7 +359,7 @@ static int aht10_probe(struct i2c_client *client)
data->meas_size = AHT20_MEAS_SIZE;
data->crc8 = true;
crc8_populate_msb(crc8_table, AHT20_CRC8_POLY);
- data->init_cmd = AHT10_CMD_INIT;
+ data->init_cmd = AHT20_CMD_INIT;
break;
case dht20:
data->meas_size = AHT20_MEAS_SIZE;