From patchwork Wed Jun 21 03:59:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: JuenKit Yip X-Patchwork-Id: 13286637 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A7F1EB64D7 for ; Wed, 21 Jun 2023 04:00:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229899AbjFUEAU (ORCPT ); Wed, 21 Jun 2023 00:00:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229709AbjFUEAT (ORCPT ); Wed, 21 Jun 2023 00:00:19 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04olkn2079.outbound.protection.outlook.com [40.92.74.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FFFA10F0; Tue, 20 Jun 2023 21:00:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kl4zF0Bibv7oR2hoo5X4PADVwAIdAkBr/ZVrzBhj8E7BdSUVgMgyqpCiqBdpWiewg58oRNvHU4qscP42+hRFfaZQggv3KmaD7DjDL/8xCLbq5ZS8WXcm7f3eBAX7NotSd9BBYdhe11oxdECRVWONNFDMMrOfSx7U3V1nl0fqrhNI6XbNirV9uRHyYhh7K4U26MHo8C1xshFkMaO4yJgrbUY4sYCGvVgpM0KCXdLmMobHQ+xR6I+05WEy40INlH3YRifV7L00Nld0QxQcnw7EMystYCsOiWHnq3I6OgTPrBpTgAqR2Lhq/2tIeqQgiMDHO5jE0BGbHTYb0nkDx/w15A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cItG1AFjXtrdojmWbMUoT879VHkL7SL6rqYrgl34xdg=; b=EyxFemMYAzR/RSL0Ey9dCvyFbE8Pkx0R62S8vmn3ySo0mxGgJ0SH8p2aoWwTWTiV5fXArNU3yvHKO9we0I+SmrjdmL1Ore+P+Xkno49KXmIrmGSN8MF3D8avWS4KsdlG2D1To169E3VdfijETzascfBpea71m3dG3EnQR91cCype5q2MdsLJZJUUpriwekXy5NgH+fo5Q4VnffPtk/rqFaRfqV3KDm98eAPbFNiQdPT6JaKJ5ZaOK4tCpIHwfs4NVRLt+l8gIej6cq3ZAA/hxvr98Uq/jXQFdKZbbxZ2LN83YdKi6mcxZ/Ojo9l1gNfvFkX7qxypO1P+BmQZK/RfPA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cItG1AFjXtrdojmWbMUoT879VHkL7SL6rqYrgl34xdg=; b=J97nUboySRcBYAp3Vowh3Q+KavYBBsc0i3d76QdSXNNfm98vraa6/Yk+Y1ygquxkpnB9HGJLlIsxDPGNTTnqJRRtjkMo7ztjNl2r0CjG41Yu6Wv6duyxK5rgwKyCXM8xVDcdkJ2lk/ZdvwJKFkairL6zgdYWsfuygf87j/wtPsmS/fN3MwL5sE+VdmIlTBHVBtGfSOhXvFgvxqQD6gx0cOw8H7w3euINsshsUF7IN98xWTRYP0UR+lYsvIfxCHC0ulySpMUld9wnsAHhgUUs8fjk7cGD6Kbh1mGcSiue4fQ0m/oE4pnybhAQMpphhqReIDjKacvyi3dc3DPQX23ZCg== Received: from DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:383::21) by AS1PR10MB5652.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:47b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Wed, 21 Jun 2023 04:00:16 +0000 Received: from DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM ([fe80::628a:d617:46f:2a88]) by DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM ([fe80::628a:d617:46f:2a88%7]) with mapi id 15.20.6500.036; Wed, 21 Jun 2023 04:00:16 +0000 From: JuenKit Yip To: linux@roeck-us.net, jdelvare@suse.com Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, JuenKit Yip Subject: [RFC PATCH 2/2] hwmon: (sht3x) add device-tree support Date: Wed, 21 Jun 2023 11:59:37 +0800 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230621035937.58721-1-JuenKit_Yip@hotmail.com> References: <20230621035937.58721-1-JuenKit_Yip@hotmail.com> X-TMN: [1X9BksokKZ03cF5ejWD9xVDlZWoP4EkM] X-ClientProxiedBy: TY2PR02CA0068.apcprd02.prod.outlook.com (2603:1096:404:e2::32) To DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:383::21) X-Microsoft-Original-Message-ID: <20230621035937.58721-2-JuenKit_Yip@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB4PR10MB6261:EE_|AS1PR10MB5652:EE_ X-MS-Office365-Filtering-Correlation-Id: dd79e4f6-4613-4970-c387-08db720c0576 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmpXYlgiiriwpiw8n8pZtYyvhHaZ+ikyytccZrudNB8sPMgiTaOEzXL0zRgllRSAXVOhUXXPpiH5c3gaGrW+MHbyO7fgLiylR8+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ppLDqiTOJ54nBfz8pj03R0QjXartlOXuO0H5eGf5GjHxyoPNJPgmLpZQYnGIUYHvKuA2OaBjUsJf+T/tFdIvHKLOaFug/wvwEXPkVbhHnQLPCtOlm60pKzeJglFLBmXuM9oWt+Yxte7AyeH2uOPqwwM7aAt0Qn34ufbSquhWr7gKFmN0OjadnTQQa3d+dHJb7I0DRvVwnwRjzjUbIVH1OINpEPJN40Y/E/udoEaDTK2NnZxktG7pdJRC12UWCuBf1zz9/JtnrSZb41SJpXKlBoHABUeX+ig783bMFvGhGB02oh18sSI19LJHlmB8WLH5471q8oOpRpZ5rtXXjvDj9WXspvvqLsWCx+Bh/zElivOS0wDhrifRT5pKMYx7ytCyWUsH/6l5VcpPKgtIupuFWt+NEcxZHAem1yIH9aHr/bi2pcGlohANWdQzCQBQHfvcRzcFDy6wKUT0zxxLyP0BoZRR821v394Ak5ZA5V96V9brq91eTGqOhAY= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-6b909.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: dd79e4f6-4613-4970-c387-08db720c0576 X-MS-Exchange-CrossTenant-AuthSource: DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2023 04:00:16.4384 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR10MB5652 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org add "compatible" property for supporting device-tree Signed-off-by: JuenKit Yip --- drivers/hwmon/sht3x.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/hwmon/sht3x.c b/drivers/hwmon/sht3x.c index 31013b5b6..edcf6820c 100644 --- a/drivers/hwmon/sht3x.c +++ b/drivers/hwmon/sht3x.c @@ -923,8 +923,18 @@ static const struct i2c_device_id sht3x_ids[] = { MODULE_DEVICE_TABLE(i2c, sht3x_ids); +/* devicetree ID table */ +static const struct of_device_id sht3x_of_match[] = { + { .compatible = "sensirion,sht3x" }, + { .compatible = "sensirion,sts3x" }, + {}, +}; + static struct i2c_driver sht3x_i2c_driver = { - .driver.name = "sht3x", + .driver = { + .name = "sht3x", + .of_match_table = of_match_ptr(sht3x_of_match), + }, .probe = sht3x_probe, .id_table = sht3x_ids, };