From patchwork Tue Nov 19 14:07:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: JuenKit Yip X-Patchwork-Id: 13879952 Received: from m16.mail.126.com (m16.mail.126.com [117.135.210.9]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B6D781CCECF; Tue, 19 Nov 2024 14:08:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732025329; cv=none; b=DYQLpT7pK/F+8NlrHCSf28eML7cfhakhGbtlnAkXPysxrty+uMKogdA59q6dBE3kniuSyg99rb4rgPw/KDKhHXLy7wnjlrX7F+6Lc2HNuPvA2/rgaK2OMyLE5bTuhwEAAVlWv31UNwtzM4K9IvxEpLPc48VA78yJjRtaogK11Rs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732025329; c=relaxed/simple; bh=VddMon7KGsoAO+8uNG9DoNYGSEVrl+SvzfCAy5RVITw=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=e/oeo4vA3VE8fq3Un8mJ5TMTU54L/n+yfZOshPMxoE2qXqseSK0LVYuFTbQgsXE/faj0CZ0ypRgHeCcrEMEmSjT8gqIw+p+/IbahtTv3DAnJEa4JtQpeGZw8A4EQpBVIgqXx8ibe7BQGs5ty/fx9xgjgp75QdzRSFY8iltj0PpM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=126.com; spf=pass smtp.mailfrom=126.com; dkim=pass (1024-bit key) header.d=126.com header.i=@126.com header.b=hor3vsRc; arc=none smtp.client-ip=117.135.210.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=126.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=126.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=126.com header.i=@126.com header.b="hor3vsRc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=cHi0m zq8NWBijK4Ly2A3LsdTUocLcPH7MQG+4r3jEMc=; b=hor3vsRcMEtHz0EMzcO3D iAtoByyRGpOAj4qWMNopKgYfcBCHEkIyAzzk+1fMnNcnmgfwSzy5+OqGRHWkQCIK hALnDJxF6vD0fAE4pqZ2f3PYIJlTR8JgI3upySrmqkffxcFd5FZoMNR3MyBtlcGF b/R4+FKgCEtC9g733isXCM= Received: from localhost.localdomain (unknown [122.225.16.198]) by gzga-smtp-mtada-g1-4 (Coremail) with SMTP id _____wD3H6a0mzxn+SwgBw--.35577S2; Tue, 19 Nov 2024 22:08:00 +0800 (CST) From: JuenKit Yip To: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, jdelvare@suse.com, linux@roeck-us.net, peteryin.openbmc@gmail.com, noahwang.wang@outlook.com, festevam@gmail.com, marex@denx.de, lukas@wunner.de, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org Cc: JuenKit Yip Subject: [PATCH 1/2] hwmon: (sht3x) add devicetree support Date: Tue, 19 Nov 2024 09:07:24 -0500 Message-Id: <20241119140725.75297-1-hunterteaegg@126.com> X-Mailer: git-send-email 2.39.5 Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: _____wD3H6a0mzxn+SwgBw--.35577S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7uFy8Xw1rurW5Ar17CF4kWFg_yoW8Gw48p3 Wrur9aqF15WF4fX39Iqay09Fy5Cwn3A3yIkr9rGas09FWDJ34jqa1ftFyDA3Z8Zry5Xr12 gFykt34fGF48AFDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0zuXd78UUUUU= X-CM-SenderInfo: xkxq3v5uwhtvljj6ij2wof0z/1tbiWQWc7Gc8V-HN-AACsi add "compatible" property for supporting devicetree Signed-off-by: JuenKit Yip --- drivers/hwmon/sht3x.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/hwmon/sht3x.c b/drivers/hwmon/sht3x.c index 650b0bcc2359..2ac1537b3e3e 100644 --- a/drivers/hwmon/sht3x.c +++ b/drivers/hwmon/sht3x.c @@ -954,6 +954,19 @@ static int sht3x_probe(struct i2c_client *client) return PTR_ERR_OR_ZERO(hwmon_dev); } +/* devicetree ID table */ +static const struct of_device_id sht3x_of_match[] = { + { .compatible = "sensirion,sht30", .data = (void *)sht3x }, + { .compatible = "sensirion,sht31", .data = (void *)sht3x }, + { .compatible = "sensirion,sht35", .data = (void *)sht3x }, + { .compatible = "sensirion,sts30", .data = (void *)sts3x }, + { .compatible = "sensirion,sts31", .data = (void *)sts3x }, + { .compatible = "sensirion,sts35", .data = (void *)sts3x }, + {}, +}; + +MODULE_DEVICE_TABLE(of, sht3x_of_match); + /* device ID table */ static const struct i2c_device_id sht3x_ids[] = { {"sht3x", sht3x}, @@ -964,7 +977,10 @@ static const struct i2c_device_id sht3x_ids[] = { MODULE_DEVICE_TABLE(i2c, sht3x_ids); static struct i2c_driver sht3x_i2c_driver = { - .driver.name = "sht3x", + .driver = { + .name = "sht3x", + .of_match_table = sht3x_of_match, + }, .probe = sht3x_probe, .id_table = sht3x_ids, }; From patchwork Tue Nov 19 14:07:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: JuenKit Yip X-Patchwork-Id: 13879995 Received: from m16.mail.126.com (m16.mail.126.com [220.197.31.7]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D1BAD2AE74; Tue, 19 Nov 2024 14:24:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732026283; cv=none; b=j5Ropcgbu4WNtPkPvBnxHPg2ISOmrjnpCjT9mSlYU4t08HlzaNwSyBhhTVCCjAkw3kgL70lzPkPBMfZDx57lnXVb8IQ/geiaKZ8Q7GjiUzI1zpAaE8xvHkhkej4bSgdk8E1ADcgh7D1TS0vckRMoKkDuQ6q025jONnx5dV2Ec/M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732026283; c=relaxed/simple; bh=cr80setFQkb+HicAmRHKidwGqzhdJSMoba5ZQwQOueQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=eIdWsl0ujoA1VlHYE5EPvX1PGyahMK7wc8Kx5TSkGYxrD4T7Q8TPu+xjAPNXZXjLh1mrHkGGGobhazwZw+SjGdQ+IcW3GCy/X0f1oaQAUm/zcWCK1E9VFbL1QnnT/3nizSz1khM6wu8W3lIbLePr+3O1lOOd+pdrII9/QNaPgsU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=126.com; spf=pass smtp.mailfrom=126.com; dkim=pass (1024-bit key) header.d=126.com header.i=@126.com header.b=T1WUS4l0; arc=none smtp.client-ip=220.197.31.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=126.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=126.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=126.com header.i=@126.com header.b="T1WUS4l0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=Y2Rlk M23+q/RmSNnamSnu5n9SxZAH/rknzHQi6Lbzeo=; b=T1WUS4l0qLl2g6xPZL+2B H+3BQe0gOGyTA3LoH+OsTkxnhZPT0Ay/KkAkBK76H9eJzw7kl/Qv6duSzbDMXCDL OOKQauYMeaZKl+IjyhClr+IZqeBS/wW/cIoraZkTpMl/Ji2dxioUd2zFDtuYtzdL zlw2TqJDTiumwlZCyKXadw= Received: from localhost.localdomain (unknown [122.225.16.198]) by gzga-smtp-mtada-g1-4 (Coremail) with SMTP id _____wD3H6a0mzxn+SwgBw--.35577S3; Tue, 19 Nov 2024 22:08:03 +0800 (CST) From: JuenKit Yip To: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, jdelvare@suse.com, linux@roeck-us.net, peteryin.openbmc@gmail.com, noahwang.wang@outlook.com, festevam@gmail.com, marex@denx.de, lukas@wunner.de, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org Cc: JuenKit Yip Subject: [PATCH 2/2] dt-bindings: trivial-devices: add sensirion,sht3x Date: Tue, 19 Nov 2024 09:07:25 -0500 Message-Id: <20241119140725.75297-2-hunterteaegg@126.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241119140725.75297-1-hunterteaegg@126.com> References: <20241119140725.75297-1-hunterteaegg@126.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: _____wD3H6a0mzxn+SwgBw--.35577S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7Wr1DZFyrGry5Kw1UuFy7GFg_yoWfZrc_A3 Wxuw1kAr48JF95t39Ikr1xJr1Yk3yIkFn7Cw1Uta97uw1xu39xKFyvqa4av3y7GrWUu3Wr urn7KrZFqwnrGjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRZMa0DUUUUU== X-CM-SenderInfo: xkxq3v5uwhtvljj6ij2wof0z/1tbifhuc7Gc8lqAyUQAAsb add sensirion,sht3x as trivial device for devicetree support Signed-off-by: JuenKit Yip --- 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 9bf0fb17a05e..be006b21b1ea 100644 --- a/Documentation/devicetree/bindings/trivial-devices.yaml +++ b/Documentation/devicetree/bindings/trivial-devices.yaml @@ -333,6 +333,8 @@ properties: - sensirion,sgp40 # Sensirion low power multi-pixel gas sensor with I2C interface - sensirion,sgpc3 + # Sensirion SHT3x-DIS humidity and temperature sensor with I2C interface + - sensirion,sht3x # Sensirion temperature & humidity sensor with I2C interface - sensirion,sht4x # Sensortek 3 axis accelerometer