Re: [PATCH v2 2/3] hwmon: (aht10) Fix initialization commands for AHT20
From: Guenter Roeck
Date: Sun Feb 22 2026 - 13:33:43 EST
On Mon, Feb 23, 2026 at 01:03:31AM +0800, Hao Yu wrote:
> 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.
>
> Fixes: d2abcb5cc885 ("hwmon: (aht10) Add support for compatible aht20")
> Signed-off-by: Hao Yu <haoyufine@xxxxxxxxx>
Applied, since htis is a fix which doewsn't depend on the devicetree patches.
Thanks,
Guenter
> ---
> drivers/hwmon/aht10.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/hwmon/aht10.c b/drivers/hwmon/aht10.c
> index 007befdba977..4ce019d2cc80 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
> @@ -341,7 +343,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;