From patchwork Tue Jan 28 19:16:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Lalaev X-Patchwork-Id: 13953051 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 40C561DED6A; Tue, 28 Jan 2025 19:17:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738091863; cv=none; b=ZsTOIHHa3JIX3+XyaTbdbRW3/lhdmbtlHCfIoezzdj5vqWpUfPJKR0zSlq7Kz+BkOyvU1rHJsbRg19FfO4GQgJQEz49eh7Jn6NB4oqUffeVNSvZoxk0iZlBztwbeBvoX11KhK3PxjP55wjA11OLyjF/OxTM5aw5ZehlmwIDL0u8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738091863; c=relaxed/simple; bh=DWZDyA7Vh1sZo70VcP5FEczLVQG7VuzdzMwKgz8+UfU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=msLhbjlLuRsQ4UsJCfatCVz06gUig1d/X+hAFf+4LT7h6CR8BfuecmwhO2/cZvXinjNemsMHwpISK+BHZTNig8tbDcCCH0laHPV+rbzdoy1uXDm/aWmHljXoT8BZ+lovacyQ8S+iDjo0k02WbymkIdiszG+5vmZrXyaBEge/1CY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eliZtTJQ; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eliZtTJQ" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-43634b570c1so43005845e9.0; Tue, 28 Jan 2025 11:17:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738091859; x=1738696659; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GaTsMNAsN5DKWCWC5o+nLJL+4cZULpJH+Ep2kGiFF/o=; b=eliZtTJQx3LMuZymkFF+i8T8Y8NrFXETM6IZBi789voFGqd3TJD9EzFsg9EFnKlXJA Ytz1uHEqmzwZISwZy6UJ6nnmKcwYrBWaisY5FXqjJKRqc24jWVhwoLz2vmHKK0DUB5LM 6S/8Bv0zympP+Y5Um5t35oEGyU0f9D26IaLs9cpNg1zziur8FKxR6ERf9p6mGwv+EGls pCqaKuYNk4fG4xAhWvWJcis+SVJUGrwvOcAKtrk1A969HsftGUirrrfIRM7LD+fPQDBK YBJLz7DpkXRhV2RVsfk6B3XeQcgrLFNm08s9ehmVwFhidwWvCx+uLgcBDn5rF5AA80JC nFXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738091859; x=1738696659; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GaTsMNAsN5DKWCWC5o+nLJL+4cZULpJH+Ep2kGiFF/o=; b=Ock0mbdM0EvVGvzVRGNoQhRX9mkw5c+3Kx2ykFNXnvGHH8OZLAmUH0iDKbczol62jD 5fAM82G2Lu+Y2TDb34M3vySKAjXvWuc9n/jOjiPT5fo/NswAN1J3IybamZ1eXzpJsQgy YBr6hT5xox1Q7pCoK6+nDvwghSGM/6Tn8DFdXn/aHXaGafW0NK2kVxY04o0z4wae6WfC 6fgSh91WZeMrFRUk3zpvunQFofGumYYw2LnqNBdilnAVHbju03Eqr0/y6WDt7rJ3gbem KB5LhiYNKD5s8HP+w2tfFoJVYd1o983sQuwRz1TQC17pSJqm76SlMxnfOJSNNaaZCbKL JuRg== X-Forwarded-Encrypted: i=1; AJvYcCUQ/XEPvMx3carnr8pkY4m8WnToMqJk5Jep5hlIug2zL9fXMv0W0F+kExBjHRZmQqOxJjLH8dN3ojVa@vger.kernel.org, AJvYcCVXrkKicSYPMigxoPfGg2l4DbA5vsbqXgkrKZ8scd1+GUxcMCYxoK7n6oz919019nrFBM1PiNrbCmrU0jd5@vger.kernel.org X-Gm-Message-State: AOJu0Yy3Bebcnm/nYIRypT2otBVLQE2IJartWHm9KcbEKk04pZP4vmGo Gqzcj9JpNU+kuiGbVt6Y5vfp0cSmwZ7qLzpe3p9CczU+cX/NdGdg X-Gm-Gg: ASbGncuV7FvkabPw5sR+icruLRP9CAzA3UmKivF4AcnZPI7C0DoFhOrxft9YtqRVU5i DZdrv44GDtPr1WPgZysCfa6G4lFJpHD1jhU3Z0b/yzwRoPfxiIG2gFxqfYc6USel0Z+3fbvk7kG nuAzepK3QQ5xnV80tCb9g2xiU2vIP8Qp7vyu03q99jVDuRfky0eD5XwYPzjefR4oyRVAWWnpDxG STUO5buCZq8HDqSyY28MbJj6HCtEWFQDy8CmjLlGj4q//zkvshvxV2C2utqV8yXAgrVs94xeXlU mKNKlTZEh4bXDI8A/gWZALqn4y3nHvNV9peaFEEGd9znIFmtU7JCTn9He+mMUGWoLbTbVcXjygz PzxZq2kJNgR5HjTNsokCiKpptJ2QFdKzBSctcs7ghnfZR X-Google-Smtp-Source: AGHT+IFaI9vvoNT/YPOBby1jXkKR9UEZsJLJDs57l07o+y+L6KlU5Nl5/on6MNPM6rsEoUbepXwgcw== X-Received: by 2002:a05:600c:8706:b0:434:9fac:b158 with SMTP id 5b1f17b1804b1-438dc3a4020mr1137635e9.1.1738091859136; Tue, 28 Jan 2025 11:17:39 -0800 (PST) Received: from thinkpad-p52.telekom.ip (2a02-8388-e103-2700-a24c-4303-c631-1166.cable.dynamic.v6.surfer.at. [2a02:8388:e103:2700:a24c:4303:c631:1166]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd54c0ecsm181224365e9.30.2025.01.28.11.17.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2025 11:17:38 -0800 (PST) From: Andrei Lalaev To: linux@roeck-us.net, krzk@kernel.org, robh@kernel.org, christophe.jaillet@wanadoo.fr, jdelvare@suse.com Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org, andrey.lalaev@gmail.com Subject: [PATCH v3 1/2] hwmon: add driver for HTU31 Date: Tue, 28 Jan 2025 20:16:40 +0100 Message-ID: <20250128191730.739428-2-andrey.lalaev@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250128191730.739428-1-andrey.lalaev@gmail.com> References: <20250128191730.739428-1-andrey.lalaev@gmail.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add base support for HTU31 temperature and humidity sensor. Besides temperature and humidity values, the driver also exports a 24-bit heater control to sysfs and serial number to debugfs. Signed-off-by: Andrei Lalaev --- Documentation/hwmon/htu31.rst | 37 ++++ Documentation/hwmon/index.rst | 1 + MAINTAINERS | 6 + drivers/hwmon/Kconfig | 11 ++ drivers/hwmon/Makefile | 1 + drivers/hwmon/htu31.c | 351 ++++++++++++++++++++++++++++++++++ 6 files changed, 407 insertions(+) create mode 100644 Documentation/hwmon/htu31.rst create mode 100644 drivers/hwmon/htu31.c diff --git a/Documentation/hwmon/htu31.rst b/Documentation/hwmon/htu31.rst new file mode 100644 index 000000000000..ccde84264643 --- /dev/null +++ b/Documentation/hwmon/htu31.rst @@ -0,0 +1,37 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +Kernel driver HTU31 +==================== + +Supported chips: + + * Measurement Specialties HTU31 + + Prefix: 'htu31' + + Addresses scanned: - + + Datasheet: Publicly available from https://www.te.com/en/product-CAT-HSC0007.html + +Author: + + - Andrei Lalaev + +Description +----------- + +HTU31 is a humidity and temperature sensor. + +Supported temperature range is from -40 to 125 degrees Celsius. + +Communication with the device is performed via I2C protocol. Sensor's default address +is 0x40. + +sysfs-Interface +--------------- + +=================== ================= +temp1_input: temperature input +humidity1_input: humidity input +heater_enable: heater control +=================== ================= diff --git a/Documentation/hwmon/index.rst b/Documentation/hwmon/index.rst index 874f8fd26325..86f6f5e46b59 100644 --- a/Documentation/hwmon/index.rst +++ b/Documentation/hwmon/index.rst @@ -85,6 +85,7 @@ Hardware Monitoring Kernel Drivers hih6130 hp-wmi-sensors hs3001 + htu31 ibmaem ibm-cffps ibmpowernv diff --git a/MAINTAINERS b/MAINTAINERS index d49306cc17e3..13dbb7fa4e73 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -10667,6 +10667,12 @@ W: http://www.st.com/ F: Documentation/devicetree/bindings/iio/humidity/st,hts221.yaml F: drivers/iio/humidity/hts221* +HTU31 Hardware Temperature and Humidity Sensor +M: Andrei Lalaev +L: linux-hwmon@vger.kernel.org +S: Maintained +F: drivers/hwmon/htu31.c + HUAWEI ETHERNET DRIVER M: Cai Huoqing L: netdev@vger.kernel.org diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index 4cbaba15d86e..e123e06ba352 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig @@ -789,6 +789,17 @@ config SENSORS_HS3001 This driver can also be built as a module. If so, the module will be called hs3001. +config SENSORS_HTU31 + tristate "Measurement Specialties HTU31 humidity and temperature sensor" + depends on I2C + select CRC8 + help + If you say yes here you get support for the HTU31 humidity + and temperature sensors. + + This driver can also be built as a module. If so, the module + will be called htu31. + config SENSORS_IBMAEM tristate "IBM Active Energy Manager temperature/power sensors and control" select IPMI_SI diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile index b7ef0f0562d3..55504e33c72d 100644 --- a/drivers/hwmon/Makefile +++ b/drivers/hwmon/Makefile @@ -91,6 +91,7 @@ obj-$(CONFIG_SENSORS_GPIO_FAN) += gpio-fan.o obj-$(CONFIG_SENSORS_GXP_FAN_CTRL) += gxp-fan-ctrl.o obj-$(CONFIG_SENSORS_HIH6130) += hih6130.o obj-$(CONFIG_SENSORS_HS3001) += hs3001.o +obj-$(CONFIG_SENSORS_HTU31) += htu31.o obj-$(CONFIG_SENSORS_ULTRA45) += ultra45_env.o obj-$(CONFIG_SENSORS_I5500) += i5500_temp.o obj-$(CONFIG_SENSORS_I5K_AMB) += i5k_amb.o diff --git a/drivers/hwmon/htu31.c b/drivers/hwmon/htu31.c new file mode 100644 index 000000000000..3860b7eba419 --- /dev/null +++ b/drivers/hwmon/htu31.c @@ -0,0 +1,351 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * The driver for Measurement Specialties HTU31 Temperature and Humidity sensor. + * + * Copyright (C) 2025 + * Author: Andrei Lalaev + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define HTU31_READ_TEMP_HUM_CMD 0x00 +#define HTU31_READ_SERIAL_CMD 0x0a +#define HTU31_CONVERSION_CMD 0x5e +#define HTU31_HEATER_OFF_CMD 0x02 +#define HTU31_HEATER_ON_CMD 0x04 + +#define HTU31_TEMP_HUM_LEN 6 + +/* Conversion time for the highest resolution */ +#define HTU31_HUMIDITY_CONV_TIME 10000 /* us */ +#define HTU31_TEMPERATURE_CONV_TIME 15000 /* us */ + +#define HTU31_SERIAL_NUMBER_LEN 3 +#define HTU31_SERIAL_NUMBER_CRC_LEN 1 +#define HTU31_SERIAL_NUMBER_CRC_OFFSET 3 + +#define HTU31_CRC8_INIT_VAL 0 +#define HTU31_CRC8_POLYNOMIAL 0x31 +DECLARE_CRC8_TABLE(htu31_crc8_table); + +/** + * struct htu31_data - all the data required to operate a HTU31 chip + * @client: the i2c client associated with the HTU31 + * @lock: a mutex to prevent parallel access to the data + * @wait_time: the time needed by sensor to convert values + * @temperature: the latest temperature value in millidegrees + * @humidity: the latest relative humidity value in millipercent + * @serial_number: the serial number of the sensor + * @heater_enable: the internal state of the heater + */ +struct htu31_data { + struct i2c_client *client; + struct mutex lock; /* Used to protect against parallel data updates */ + long wait_time; + long temperature; + long humidity; + u8 serial_number[HTU31_SERIAL_NUMBER_LEN]; + bool heater_enable; +}; + +static long htu31_temp_to_millicelsius(u16 val) +{ + return -40000 + DIV_ROUND_CLOSEST_ULL(165000ULL * val, 65535); +} + +static long htu31_relative_humidity(u16 val) +{ + return DIV_ROUND_CLOSEST_ULL(100000ULL * val, 65535); +} + +static int htu31_data_fetch_command(struct htu31_data *data) +{ + struct i2c_client *client = data->client; + u8 conversion_on = HTU31_CONVERSION_CMD; + u8 read_data_cmd = HTU31_READ_TEMP_HUM_CMD; + u8 t_h_buf[HTU31_TEMP_HUM_LEN] = {}; + struct i2c_msg msgs[] = { + { + .addr = client->addr, + .flags = 0, + .len = 1, + .buf = &read_data_cmd, + }, + { + .addr = client->addr, + .flags = I2C_M_RD, + .len = sizeof(t_h_buf), + .buf = t_h_buf, + }, + }; + int ret; + u8 crc; + + guard(mutex)(&data->lock); + + ret = i2c_master_send(client, &conversion_on, 1); + if (ret != 1) { + ret = ret < 0 ? ret : -EIO; + dev_err(&client->dev, + "Conversion command is failed. Error code: %d\n", ret); + return ret; + } + + fsleep(data->wait_time); + + ret = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs)); + if (ret != ARRAY_SIZE(msgs)) { + ret = ret < 0 ? ret : -EIO; + dev_err(&client->dev, + "T&H command is failed. Error code: %d\n", ret); + return ret; + } + + crc = crc8(htu31_crc8_table, &t_h_buf[0], 2, HTU31_CRC8_INIT_VAL); + if (crc != t_h_buf[2]) { + dev_err(&client->dev, "Temperature CRC mismatch\n"); + return -EIO; + } + + crc = crc8(htu31_crc8_table, &t_h_buf[3], 2, HTU31_CRC8_INIT_VAL); + if (crc != t_h_buf[5]) { + dev_err(&client->dev, "Humidity CRC mismatch\n"); + return -EIO; + } + + data->temperature = htu31_temp_to_millicelsius(be16_to_cpup((__be16 *)&t_h_buf[0])); + data->humidity = htu31_relative_humidity(be16_to_cpup((__be16 *)&t_h_buf[3])); + + return 0; +} + +static umode_t htu31_is_visible(const void *data, enum hwmon_sensor_types type, + u32 attr, int channel) +{ + switch (type) { + case hwmon_temp: + case hwmon_humidity: + return 0444; + default: + return 0; + } +} + +static int htu31_read(struct device *dev, enum hwmon_sensor_types type, + u32 attr, int channel, long *val) +{ + struct htu31_data *data = dev_get_drvdata(dev); + int ret; + + ret = htu31_data_fetch_command(data); + if (ret < 0) + return ret; + + switch (type) { + case hwmon_temp: + if (attr != hwmon_temp_input) + return -EINVAL; + + *val = data->temperature; + break; + case hwmon_humidity: + if (attr != hwmon_humidity_input) + return -EINVAL; + + *val = data->humidity; + break; + default: + return -EOPNOTSUPP; + } + + return 0; +} + +static int htu31_read_serial_number(struct htu31_data *data) +{ + struct i2c_client *client = data->client; + u8 read_sn_cmd = HTU31_READ_SERIAL_CMD; + u8 sn_buf[HTU31_SERIAL_NUMBER_LEN + HTU31_SERIAL_NUMBER_CRC_LEN]; + struct i2c_msg msgs[] = { + { + .addr = client->addr, + .flags = 0, + .len = 1, + .buf = &read_sn_cmd, + }, + { + .addr = client->addr, + .flags = I2C_M_RD, + .len = sizeof(sn_buf), + .buf = sn_buf, + }, + }; + int ret; + u8 crc; + + ret = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs)); + if (ret < 0) + return ret; + + crc = crc8(htu31_crc8_table, sn_buf, HTU31_SERIAL_NUMBER_LEN, HTU31_CRC8_INIT_VAL); + if (crc != sn_buf[HTU31_SERIAL_NUMBER_CRC_OFFSET]) { + dev_err(&client->dev, "Serial number CRC mismatch\n"); + return -EIO; + } + + memcpy(data->serial_number, sn_buf, HTU31_SERIAL_NUMBER_LEN); + + return 0; +} + +static ssize_t heater_enable_show(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + struct htu31_data *data = dev_get_drvdata(dev); + + return sysfs_emit(buf, "%d\n", data->heater_enable); +} + +static ssize_t heater_enable_store(struct device *dev, + struct device_attribute *attr, + const char *buf, + size_t count) +{ + struct htu31_data *data = dev_get_drvdata(dev); + u8 heater_cmd; + bool status; + int ret; + + ret = kstrtobool(buf, &status); + if (ret) + return ret; + + heater_cmd = status ? HTU31_HEATER_ON_CMD : HTU31_HEATER_OFF_CMD; + + guard(mutex)(&data->lock); + + ret = i2c_master_send(data->client, &heater_cmd, 1); + if (ret < 0) + return ret; + + data->heater_enable = status; + + return count; +} + +static DEVICE_ATTR_RW(heater_enable); + +static int serial_number_show(struct seq_file *seq_file, + void *unused) +{ + struct htu31_data *data = seq_file->private; + + seq_printf(seq_file, "%X%X%X\n", data->serial_number[0], + data->serial_number[1], + data->serial_number[2]); + return 0; +} + +DEFINE_SHOW_ATTRIBUTE(serial_number); + +static struct attribute *htu31_attrs[] = { + &dev_attr_heater_enable.attr, + NULL +}; + +ATTRIBUTE_GROUPS(htu31); + +static const struct hwmon_channel_info * const htu31_info[] = { + HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT), + HWMON_CHANNEL_INFO(humidity, HWMON_H_INPUT), + NULL +}; + +static const struct hwmon_ops htu31_hwmon_ops = { + .is_visible = htu31_is_visible, + .read = htu31_read, +}; + +static const struct hwmon_chip_info htu31_chip_info = { + .info = htu31_info, + .ops = &htu31_hwmon_ops, +}; + +static int htu31_probe(struct i2c_client *client) +{ + struct device *dev = &client->dev; + struct device *hwmon_dev; + struct htu31_data *data; + int ret; + + data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + data->client = client; + data->wait_time = HTU31_TEMPERATURE_CONV_TIME + HTU31_HUMIDITY_CONV_TIME; + + ret = devm_mutex_init(dev, &data->lock); + if (ret) + return ret; + + crc8_populate_msb(htu31_crc8_table, HTU31_CRC8_POLYNOMIAL); + + ret = htu31_read_serial_number(data); + if (ret) { + dev_err(dev, "Failed to read serial number\n"); + return ret; + } + + debugfs_create_file("serial_number", + 0444, + client->debugfs, + data, + &serial_number_fops); + + hwmon_dev = devm_hwmon_device_register_with_info(dev, + client->name, + data, + &htu31_chip_info, + htu31_groups); + + return PTR_ERR_OR_ZERO(hwmon_dev); +} + +static const struct i2c_device_id htu31_id[] = { + { "htu31" }, + { } +}; +MODULE_DEVICE_TABLE(i2c, htu31_id); + +#if IS_ENABLED(CONFIG_OF) +static const struct of_device_id htu31_of_match[] = { + { .compatible = "meas,htu31" }, + { } +}; +MODULE_DEVICE_TABLE(of, htu31_of_match); +#endif + +static struct i2c_driver htu31_driver = { + .driver = { + .name = "htu31", + .of_match_table = of_match_ptr(htu31_of_match), + }, + .probe = htu31_probe, + .id_table = htu31_id, +}; +module_i2c_driver(htu31_driver); + +MODULE_AUTHOR("Andrei Lalaev "); +MODULE_DESCRIPTION("HTU31 Temperature and Humidity sensor driver"); +MODULE_LICENSE("GPL"); From patchwork Tue Jan 28 19:16:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Lalaev X-Patchwork-Id: 13953052 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B0C61DFD89; Tue, 28 Jan 2025 19:17:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738091864; cv=none; b=S/HnJCmo/Icq8kCmcTIOH99dEuqoY8dhOuGSZBSP87gVkqS+DtWtLQuj135nf7zcdKJycbaaMPnd5cVzsIjSqn8QJC8PR7ytr4oGeUbLjfIQ/1Fofs7jlTfFsUjk7VnSoV4kaNH7Mq7vXU7v8FoHKYaWh+AHqZFabYN26HqI3lc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738091864; c=relaxed/simple; bh=bgnTcyfT5GS7CuKBUWPLESjyiP8WMrNY1oSZnqVtiXg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hOJfosjfT4V3HFRk/Rx9+Wa2USQM+pd/uSQ8Mq1nyWXeVEfr/Gwck2RFFZcV4gNgapAqckHnwAUgy0saIeo9GSEJL5zrv28it3qDhTm0GC1VKNEKv92wre//6Sl12LqfGhT4zZvBavIQrQW4iKghRghuA5VHBYivgX8V5XEEWs8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=U1k5w7b/; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="U1k5w7b/" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-43635796b48so38997455e9.0; Tue, 28 Jan 2025 11:17:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738091861; x=1738696661; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QtcHMHzsCPY8m2uh+Fm3smuT7g5v7qu+touota16XQU=; b=U1k5w7b/wNrMv9+7VtAdD1o7zzkKZEeTzBqw4gv2oVeMMJm8dbCSRt0AOqPhqSIXLl SpUWugIUZlhKUnlm94e7jG/1lzFRFzjZL8uI3jvJyMaOT90C4fNxx2dvJLkH3hoVOx0y 849Ydo5HaWUvnAj3gGAQus3CyaY9je1vodFPiv3Adman4y87WSN3poY5hZYYjJaH8wwr OBffA6u7htwhD1lt2ZsszPIc7OU+7MteLHdboKpSbRgjS2QET21N5BP0xsRfS9oflsJc +u9kd4jxcRD7pOWBtR7biq4QpM7xrJGRZ40Fh6ivQFTydc5Xhioqec0ExkeN0Id8OOYH kAeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738091861; x=1738696661; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QtcHMHzsCPY8m2uh+Fm3smuT7g5v7qu+touota16XQU=; b=JHMf2w978MIZGSLl+I5nUk6zBLe0g78ukFG35/wTJUUIiH6ZERRTry/mK635x0vY9/ ZjIXwss5jO/xasfhYEvFU+ElDUXbuiDFdTvRT64+EyT5xwhZOlduX+cp19+x56NuX1VV wIWWm2gDvSNR5O62GvALKxbH/S5jAkyqWEhAkOsHFF56L84y8QEdN8QihXcfPOpFzCVN NbzQB4zP9pBC9F7UJI9J658bgkey0hg41SlLMX7KhvkrBZutc676/z47a2KflG0+X2uZ mrLkfT3uSxZiXGHOZ7YubZndnK2eLuc8IMPvkKx3qwPnXE7V2+pODh7/uTowoZr475fS 5e1w== X-Forwarded-Encrypted: i=1; AJvYcCUIFWpTrlqFaj7dbgRMEju9kzl0aET0+20OOmLaDyh0AFy+apZlRqCgwM26ZJ/1x2SZ0/YOyJX0lxQG@vger.kernel.org, AJvYcCWOvOTAVFCsjN3bCVwW5WzwAoZMh8hFi/5FybU58FfCfDZn9a5KCwTmhki6aOtCRtLp/xXlmYpAnuv4Hw5m@vger.kernel.org X-Gm-Message-State: AOJu0YzCwQqwaRgIAixxmn9ho+PrcrrsozXUUVx/K2K9SK72iL/kX1Yv rn/c+wHFS+L0ZIglP2UmBabrn7pNhpuMY2hBKRIVKuqcUychc1RP8GazXi7JDVw= X-Gm-Gg: ASbGncu+RpfX4PAeF4dXS5lkMFgv8GwqyAKn7kum/oZ0pBMsM9Q1G++QduNUpuqw4Su nqWkfj4pHb5/VG+P5YCOf4yinSSW3YFb42UIZROzmHlF0MmCJsl+jUzUJn4iUUQIrPzdbdkg588 dCm9BMFauWhxvbOyu/M6oE2IYgqtzkk3Ni2rWSZkFQe2ntCNyyD6Xuc+hNncl8MBBLDMfb3Z2SY +nAt1BYGmF3YAHZQdIv/lpgHsbahWpg2r80aRFcjuorR9bc/+K4kHHWDnDimh9NtbCmZeMSkm13 PBMBp+YLacE7s2Z7ksW/a+M0DKKFph7xgzjoKM2KYCrnmD+RkyFBPh1amJ/P2CoKD3v/ZqE4h7F tmxckwnBtSSEh97mYYaeKy2JioysyUBcQBf9jJadFbbFa X-Google-Smtp-Source: AGHT+IFPt4i7RZlXb+LBvzZ/PTNGiA+ggdgrw7655oEDZ8N1b+ZKpuKJtBT54mmT/sLkmyE0Z9HWAg== X-Received: by 2002:a05:600c:1e09:b0:434:9e17:190c with SMTP id 5b1f17b1804b1-438dbdd3128mr4007595e9.0.1738091860764; Tue, 28 Jan 2025 11:17:40 -0800 (PST) Received: from thinkpad-p52.telekom.ip (2a02-8388-e103-2700-a24c-4303-c631-1166.cable.dynamic.v6.surfer.at. [2a02:8388:e103:2700:a24c:4303:c631:1166]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd54c0ecsm181224365e9.30.2025.01.28.11.17.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2025 11:17:40 -0800 (PST) From: Andrei Lalaev To: linux@roeck-us.net, krzk@kernel.org, robh@kernel.org, christophe.jaillet@wanadoo.fr, jdelvare@suse.com Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org, andrey.lalaev@gmail.com, Krzysztof Kozlowski Subject: [PATCH v3 2/2] dt-bindings: hwmon: Add description for sensor HTU31 Date: Tue, 28 Jan 2025 20:16:41 +0100 Message-ID: <20250128191730.739428-3-andrey.lalaev@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250128191730.739428-1-andrey.lalaev@gmail.com> References: <20250128191730.739428-1-andrey.lalaev@gmail.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add trivial binding for HTU31 Temperature and Humidity sensor. Signed-off-by: Andrei Lalaev Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml index fadbd3c041c8..30e8f89fa032 100644 --- a/Documentation/devicetree/bindings/trivial-devices.yaml +++ b/Documentation/devicetree/bindings/trivial-devices.yaml @@ -189,6 +189,8 @@ properties: - mcube,mc3230 # Measurement Specialities I2C temperature and humidity sensor - meas,htu21 + # Measurement Specialities I2C temperature and humidity sensor + - meas,htu31 # Measurement Specialities I2C pressure and temperature sensor - meas,ms5637 # Measurement Specialities I2C pressure and temperature sensor