From patchwork Thu Feb 16 12:23:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marco Franchi X-Patchwork-Id: 9576999 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1803760244 for ; Thu, 16 Feb 2017 12:23:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04C40284F2 for ; Thu, 16 Feb 2017 12:23:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC3F92856A; Thu, 16 Feb 2017 12:23:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CD1F284F2 for ; Thu, 16 Feb 2017 12:23:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754521AbdBPMXZ (ORCPT ); Thu, 16 Feb 2017 07:23:25 -0500 Received: from mail-sn1nam01on0046.outbound.protection.outlook.com ([104.47.32.46]:24747 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754386AbdBPMXX (ORCPT ); Thu, 16 Feb 2017 07:23:23 -0500 Received: from BN6PR03CA0027.namprd03.prod.outlook.com (10.175.124.13) by DM5PR03MB2953.namprd03.prod.outlook.com (10.175.106.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.919.13; Thu, 16 Feb 2017 12:23:21 +0000 Received: from BY2FFO11FD014.protection.gbl (2a01:111:f400:7c0c::156) by BN6PR03CA0027.outlook.office365.com (2603:10b6:404:10c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.919.13 via Frontend Transport; Thu, 16 Feb 2017 12:23:21 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none; nxp.com; dmarc=fail action=none header.from=nxp.com; nxp.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD014.mail.protection.outlook.com (10.1.14.76) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.904.16 via Frontend Transport; Thu, 16 Feb 2017 12:23:20 +0000 Received: from b58965-3.am.freescale.net (b58965-3.am.freescale.net [10.29.244.100]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v1GCNHV0007316; Thu, 16 Feb 2017 05:23:18 -0700 From: Marco Franchi To: CC: , , , , , Marco Franchi Subject: [PATCH v4 2/2] hwmon: (sht15) Add device tree support Date: Thu, 16 Feb 2017 10:23:43 -0200 Message-ID: <1487247824-10005-1-git-send-email-marco.franchi@nxp.com> X-Mailer: git-send-email 2.7.4 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131317214008283483; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(336005)(39840400002)(39450400003)(39860400002)(39380400002)(39850400002)(39400400002)(39410400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(6916009)(85426001)(8656002)(6666003)(50226002)(305945005)(81156014)(8676002)(33646002)(77096006)(81166006)(54906002)(5660300001)(92566002)(47776003)(97736004)(626004)(48376002)(106466001)(86362001)(8936002)(104016004)(105606002)(2906002)(5003940100001)(2351001)(4326007)(50986999)(189998001)(36756003)(53936002)(38730400002)(68736007)(39060400002)(50466002)(110136004)(389900003)(356003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2953; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD014; 1:K5O2OjPpJxLS1sOFCW6Wyqu3Dy3uhDVOXtyhTnak6/2+ggjuJL70gY9HQdRhlumuct/EqEVkE8Jk3jGIA8WbQQ/nWjbJWwHvNJbAkDgA9/N8zvECp5A6ds75PXGl18SPnNuHRUXS1HBr9u+5JDaQUOAUr+rDlhycQyuIm24F5d3AnadEwFZL4GvBC2BDtiKIKuGmXCArkOMlaKigUl+XlJlO1BHha/LMxYHatff+UJnl3nSjQ6vuEOaKOt3qcBifeLl++eeD+EAqA76I1pse16BJZVF9X5E3IQ5oVjtmLB6y5ugx0XdVjVYchR0dIHOIj3AM0Nz0h7D8Q21Kk9zD9T9xz6cIc894oYaPvvFH4CWONHzThiVVMcSlR6BiECVp3J/OIH3/63kFDfcPU33zhUku9NALC+HI74Y1C++GjgC52tWRO5MO1f9PtibisiTE3xmyOLsBbgcXA7F+iVdms+Z4na4vvVf52p2ZkRXQ/+kObVrBMmTg3RGZoRQ4B+izXa3GG4jcimhfS9oi9T7x7LbYcdvzijzDJB1IonbQwr56LUOilrWj1U0HkWM7ti6Lea1iSAv97i+hBxgAdX3ag8dotMGdclKEZ9xe+JxKZsgcVjGFutUrDVh5KfGdgnnLUI2gkZ+WKGzZtpmGizEdQDiLu7NOUEHlwU1MxWyTkJzGnZFjRGVpOjnWNlDcHLS80sv6o7XfpPtjbxkvtl+h2Q== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 887c25f7-de21-486d-2ffa-08d456669850 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DM5PR03MB2953; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2953; 3:K2Lvl+uaWOOhk1U3AMoQmcRGlDzCD2Hm0Bhze/tOqKG9tPhAzB37uTjDcePxYkkqN0EkfH7vEqwRjA2gDzBLxv9GuHAFtOzyuFrXTCT5bciUuscuDYtVbZaytolA3yJzVb5S3T1tTXxWwMMYnXWXsS71FOl8vv+nGfl6XMhq7IGIBnMyJM2jv1byCD1SKql+2kWNgDNrafFI3zZGVaYrVJkSFXyfDNJOGTezI5AgzMT09pVzDZxgTFm6YRV9Z3FCZ7+iyoBAcoGDCtdPGLtTebW3l8Ee8GM+/1opzvoYck38VHj6UFv+ewa8H2xHSZGqp+pA4kCD3jkiKRJcaiDm0kTUkCbH2NftYbIe/tnpThCSuMW3V6aZK5HHNmgxeR7j; 25:L6VpWhqyvh1xzgJwFFK8XZjTTvR9d0rXo4TeEeOma51ogrV0dkuXE3h4KvOtz8ZmdgU/KQHmF8Uxz0LpfKhHeWP+uSuh4Tfap2v0DKXg9Zz2I3ToXjbE5IKZkxTiv3pSNCqDtyJdQbzzfaN0QwNo1j57p1cY36VUyiYD60M1uSqnQ4FWoWrYe9LN13TBB4rSV0ttnOpBuhUy6wiV3AJ7lJgZ+1MULJksQs3Pkb+zsGeb02VAH+gPm2hEiU8DVD8kCyHAkiFLEt5n4/uRgYlgMQnKBnh9pRrBq500Hk5UWa2N9z8xwwJ+kesAfDflpcHG8wNUHL9BY6HLKJew79OIZn0axeAdVGQZqOH2oO9kopB585VqiHC3m71MiKse8pf4pPQKKDmHi0uQ9y3cvp2qi/FxZmbtHPO2LwD/DQE2stN71aSV2IiUVUz7XQmShyQNSdZmaEi0jt0Pk4wpHxoMlA== X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2953; 31:pjhgkIrf5bdVuh5hwbKoWqqQ6fltOLKiHjb589TfppaEPLxe9mnE798n9I9yFEyC34NbbPdq6Dohn808qXC3q/mODwGPxek8szkD3Iyv5gT/4h6VbrUYMK68dBA0ifgufK9rWzSwWjyv97khxnC144bVO/8ifzN2TlpPnBbgD1S/aNE/Mln+50KwMS0LMOqXp2kAGD1xgDxQcNgku7GMrpMWDuY79Bse/0o9pXwThfQUGcIgWJNgWGhA0Fa7MmC4O+QmTgEBkIz8n/KyYZ/CyA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13017025)(13023025)(13018025)(13015025)(8121501046)(13024025)(5005006)(10201501046)(3002001)(6055026)(6096035)(20161123565025)(20161123556025)(20161123563025)(20161123561025)(20161123559025); SRVR:DM5PR03MB2953; BCL:0; PCL:0; RULEID:(400006); SRVR:DM5PR03MB2953; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2953; 4:PS7AXB2t5382UFRF57sE4D405Zga7zNC4iGyacfApJUsOEjT4t/grGoj7slpnEE2Mlh4gytwCcnSq2473y/39H3VPQy9mv/ZWRTY3uWWrzDVQCjerjk9IU2c+BnqXHNRWfnNESSsLS/xL8fAcxQlqDliGGYbD0vmOFKQRB+NQrawh0c8GoWmTkz5dMf7kL8la2wS2l49Mgd70iKcMWz7DPwGKRlNQ3LT4tC8U6fH7ZCURce9hTAilEnvZQw4KzYLCqfchS4KkzngYueEpXQKfjeotKNZki8gXPZLs9yp/QKKHDVhwR83i8WNMnglOvS424FqpwNJO4/gRIYZkg00CdqaGkd1gzPCBvSvjsiUdiVGfnPhZlAkZ4BdEUh9Lf4+73LN56TT5HXAlWyH5AUysYIboo9o9GDR/ySs0J3jw2Rwbd0yLS7iq4uoEy3X2OZDCrtLQHiZEIjobWVIje9aDd3AIXHagIse8PR0FLo5ZtXA1fLXw2Vb6PaWxMkjuRorw7wjF+2RNq8ctj2RPpHNCiF378WdAsvUEJoklqK0BeppJY5kKrVFM3v9v41oAesV6eTWaxKtW8TiQGvps/d7VvFlnqUEtTAAkvAE28GhuyEzHzCcQPLjYV2WVInXqfUWTaTLcJUC2ujUVyHez1iIM/3ICnBtGh1KisM1gAuFLfEyWxdjHciZbbhC1VmhoMmKn4tz/AMY/ue1x0bfDk6+jWIcCRpwl0X04ydJlGJRJ8yMtBYR7RcupMxFI6NC2P2U X-Forefront-PRVS: 0220D4B98D X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB2953; 23:2bStTK1knbD8dhvC/Kn1ypY8DFGbkjpP+cPshu99m?= =?us-ascii?Q?uwvXQsqP5W4FEjyQAXfM4tOiRWUo3PPHOMtQX7yDqdc46IJHP1xAz29Gyn8z?= =?us-ascii?Q?dkT0qA9NGoPZ8eurSXLjSch7SiGoZ09FeG0Xf0sTAvxXZK3pWWAFdtflG0D2?= =?us-ascii?Q?dfwbRnXB4IonGkJujLcaBzRHYMfLYMgnd/6rdwD3UxcM+xF6VI0PqMTkmTtp?= =?us-ascii?Q?Fue6s9wj0fRM5sqGNXNAwj5W5bQHLZb/Er2J4jPCJ9i98P7RowgPWCp5HyJg?= =?us-ascii?Q?tm/zIVQiszeBBB1EDYLJjM4DYgPt09axn5YcNSWZUTmYt00p+wPk8Hokkb7X?= =?us-ascii?Q?80cSQLgF+eybxTsrP7bzlFFGXyp58p50uaDM2+j6qymTfJn7tWEVBz1XrFiy?= =?us-ascii?Q?S5APGZsQmtfBgcym0Dm0KEig1DkH65hNewJgiNKsvfGWKIDUDqyUiASOk1Ca?= =?us-ascii?Q?VTD8ijh/By2gEkHH2d9WcFrM6XbLjvwRM+6d2eWkwRHQ1XjTrmGxPpppaJ3T?= =?us-ascii?Q?Nzi+IcggHgf/4B/xM1UTO09BK3gaN71DN1MiPh/RwowDutKdk/Vi89cpn8G6?= =?us-ascii?Q?vMzFyUtwM6ZgQ0RhmMonlKv25Cy5hWyVNXn+M8vgCYtb89QbgQIAXwKBwicb?= =?us-ascii?Q?yEjdaONdwMX3RPAVgB2facjMLprR7xsAtCNO8aoYOsaECz3yCBRIyscfkAe5?= =?us-ascii?Q?xEgnG74upAQN266t4Z+4REhiOt35214QEbbJubdkAlTkf1pMqWDBynXloIEf?= =?us-ascii?Q?V00erHhTNgMcKvj/WA9NAZuOr2p946IKiw4IAA8+NPLmrSpRHZQmWjcX9JER?= =?us-ascii?Q?mrL/03E70GF3FxAYOe7oko8AXgZ/MO5YVTbfUo8p7C5V3lKqdq39SFCWYk7V?= =?us-ascii?Q?7DKRYrTgey0M2Hjyia/03KUJtN6Xnl/bIZ66ICeD8Pp7dfyPAb0zZaihmn+5?= =?us-ascii?Q?yCv+4kyRCP8Ilex6SB3kLcYlhz3ehx4jLt8+rXTAGFyK8/XdBBQqiQQByCXs?= =?us-ascii?Q?WNAiR+CraFTmCgCB/7IzfwPyK4W9bbh2tMxKrwGBMV28gHP9yu0ANjMuCaCQ?= =?us-ascii?Q?XS9LeJV7eYM2GGzbHhdwNQKwhzYdD5AXayhZsbVJU31N5rs0N3qy6e7cYPUY?= =?us-ascii?Q?YdVQyZtttpCoe3HHYjikXZwM2Nye9B7LLMlFuUhFIlnB2hp2gk6UVyrdoS7c?= =?us-ascii?Q?yM17VLcXKpA6WQ5kFOjE/XEkr+AW04du62z3htUIjPcIEgLYxXEeJbDmHi7d?= =?us-ascii?Q?/mGaEd9ibOVqY38hO02lUOw3ODxkVzj47ZBiwOb9c2TL/HbU5PWbPds+ifn6?= =?us-ascii?Q?n4TYvvXC7b5fh5th50agAA=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2953; 6:P60UHaYwomKbQrKi0ann2az/CxD/cpUjfwSVIKg6HtI+IhF3euyIFPYY5bDXkQyodbQRF5WhwZa88uYRm+qIVi1aBevQTrsrJ20/IAwtyvJcUJ1IpUrH6dJX580zvnD7KjdE2XbHlNeMslCHQF5VYGou+Kcg9SlNf70BCOOpeL6/l4wX/4PcsBPFS04QwIdiIkpIrPHvVtA2eiWCZCnZ6t0PdIlTcOTxieArdenpLL75ZlzkZbfJzf6hZb9Yxxrmo51EbdDoDRieJnjNdrgfpJesBk0WVnR8dfV+5fDN2EwJ49+pcyXtMCdlInjgJyZXVWnu2l9vcWywKTiX3tiAJwyXYqLiyxyOWCI8z2Gd8yMbfP9Kq9O856KmI2p+BcdRayKshir86RUyEpJvIVwzL47affSqnoUM/gfroVvjYR8=; 5:oWST2BTnN9A7GYZ69jXOpOEtqdskqxrogQys42TI2fNReQZbKKYn3ZuwPc/TqNt+UJrWv0vh2rn1a7+XWElFPahtyFUmtumXyzwvBIcAhZ4mRQmva/J1Gu4jzUa2vH9s+vOtlrnYz5vqPBhoi/QkEVcJ65hkl+iiAQtBSHtp1PpZJCWmqHhNNl/k1J3w9tEA; 24:XH+Z59Kfreh4aIjENYfGag6EWAq/0N/FpILr6nPADWWjshgKacKGxP42VN4vMyoXRjn2NhIIwzsOK7SbBSgQocusKN7y0sjMdSnJVpoh3QY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2953; 7:pptptEi/Bw3dyPX/eIPdEBpVYTvDDSbC3G3j622q91XGgooJNxNdPtEivl/nFMNKSATYUkUwUP5zXx7mK7LJx1L+GnSKIdOKM/Huh5HWMxrBFDE8D3DmaGIfqiBK+nIUGHVEdG5y41fjVbBm48PTJfsc/wWSmsEO0/nUG3QlEwdzAMIWDrN6Y2P6vfdAOcpkKDmJFyUG1WGAoqt/Gc7NNon2T4+MoINts7n/8AJB45kKa1fCydlYs9FgpFtwElcLVuLQjiIvIfNTlNx8nXIs39CWUSju/ToQyavFydmZ+cPxK8tf2v39yDZabK9aH+NSesYsNoxDYYDGRfacZuseMg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2017 12:23:20.5943 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2953 Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Allow the driver to work with device tree support. Based on initial patch submission from Peter Fox. Tested on a imx7d-sdb board connected to a SHT15 board via Mikro Bus. Signed-off-by: Marco Franchi Reviewed-by: Fabio Estevam Acked-by: Rob Herring --- Changes since v3: -Remove the optional properties because they are not hardware description -Change the sensor node name Documentation/devicetree/bindings/hwmon/sht15.txt | 19 +++++++ drivers/hwmon/sht15.c | 64 +++++++++++++++++++++-- 2 files changed, 79 insertions(+), 4 deletions(-) create mode 100644 Documentation/devicetree/bindings/hwmon/sht15.txt diff --git a/Documentation/devicetree/bindings/hwmon/sht15.txt b/Documentation/devicetree/bindings/hwmon/sht15.txt new file mode 100644 index 0000000..6a80277 --- /dev/null +++ b/Documentation/devicetree/bindings/hwmon/sht15.txt @@ -0,0 +1,19 @@ +Sensirion SHT15 Humidity and Temperature Sensor + +Required properties: + + - "compatible": must be "sensirion,sht15". + - "data-gpios": GPIO connected to the data line. + - "clk-gpios": GPIO connected to the clock line. + - "vcc-supply": regulator that drives the VCC pin. + +Example: + + sensor { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_sensor>; + compatible = "sensirion,sht15"; + clk-gpios = <&gpio4 12 0>; + data-gpios = <&gpio4 13 0>; + vcc-supply = <®_sht15>; + }; diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c index f16687c..69141b2 100644 --- a/drivers/hwmon/sht15.c +++ b/drivers/hwmon/sht15.c @@ -34,6 +34,7 @@ #include #include #include +#include /* Commands */ #define SHT15_MEASURE_TEMP 0x03 @@ -911,6 +912,54 @@ static int sht15_invalidate_voltage(struct notifier_block *nb, return NOTIFY_OK; } +#ifdef CONFIG_OF +static const struct of_device_id sht15_dt_match[] = { + { .compatible = "sensirion,sht15" }, + { }, +}; +MODULE_DEVICE_TABLE(of, sht15_dt_match); + +/* + * This function returns NULL if pdev isn't a device instatiated by dt, + * a pointer to pdata if it could successfully get all information + * from dt or a negative ERR_PTR() on error. + */ +static struct sht15_platform_data *sht15_probe_dt(struct device *dev) +{ + struct device_node *np = dev->of_node; + struct sht15_platform_data *pdata; + + /* no device tree device */ + if (!np) + return NULL; + + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) + return ERR_PTR(-ENOMEM); + + pdata->gpio_data = of_get_named_gpio(np, "data-gpios", 0); + if (pdata->gpio_data < 0) { + if (pdata->gpio_data != -EPROBE_DEFER) + dev_err(dev, "data-gpios not found\n"); + return ERR_PTR(pdata->gpio_data); + } + + pdata->gpio_sck = of_get_named_gpio(np, "clk-gpios", 0); + if (pdata->gpio_sck < 0) { + if (pdata->gpio_sck != -EPROBE_DEFER) + dev_err(dev, "clk-gpios not found\n"); + return ERR_PTR(pdata->gpio_sck); + } + + return pdata; +} +#else +static inline struct sht15_platform_data *sht15_probe_dt(struct device *dev) +{ + return NULL; +} +#endif + static int sht15_probe(struct platform_device *pdev) { int ret; @@ -928,11 +977,17 @@ static int sht15_probe(struct platform_device *pdev) data->dev = &pdev->dev; init_waitqueue_head(&data->wait_queue); - if (dev_get_platdata(&pdev->dev) == NULL) { - dev_err(&pdev->dev, "no platform data supplied\n"); - return -EINVAL; + data->pdata = sht15_probe_dt(&pdev->dev); + if (IS_ERR(data->pdata)) + return PTR_ERR(data->pdata); + if (data->pdata == NULL) { + data->pdata = dev_get_platdata(&pdev->dev); + if (data->pdata == NULL) { + dev_err(&pdev->dev, "no platform data supplied\n"); + return -EINVAL; + } } - data->pdata = dev_get_platdata(&pdev->dev); + data->supply_uv = data->pdata->supply_mv * 1000; if (data->pdata->checksum) data->checksumming = true; @@ -1075,6 +1130,7 @@ MODULE_DEVICE_TABLE(platform, sht15_device_ids); static struct platform_driver sht15_driver = { .driver = { .name = "sht15", + .of_match_table = of_match_ptr(sht15_dt_match), }, .probe = sht15_probe, .remove = sht15_remove,