From patchwork Sat Jun 24 16:01:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: JuenKit Yip X-Patchwork-Id: 13291679 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 D2568EB64DA for ; Sat, 24 Jun 2023 16:02:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233212AbjFXQC1 (ORCPT ); Sat, 24 Jun 2023 12:02:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbjFXQCX (ORCPT ); Sat, 24 Jun 2023 12:02:23 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2034.outbound.protection.outlook.com [40.92.89.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E69A0E5F; Sat, 24 Jun 2023 09:02:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fbABwz8SXG3WN7XqNBGENLH1pj0/bkb6zdqhly7N77teCuZJVAWuWyWeD0tnAw8ZmYQWG1DcWoJB8289hxRJBKGJKA4vdQKOAk85JUnX30hkBAjwRE5V452hmwYqSF4YlbuEI3aoqO3VO2mbzZgrSE/Pext/tw/HFJzYoHs9VYSuSmQJ8FxSbRoG2quCtrQNLwdl7HVXkrcVpTWVAPFhRk8n8dinAD/R/sQmEU4rKihqHJ/cakZvUAIatH7V/2IZohLVl3ExeQV2fkjJUyc80nWOlPL7IgWiOBu6XynQlJjMzBcsrODz9OenM6CtvR+R3DrYMyltuwMUef3ml73vaQ== 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=/h7pafd5UrjLQONNEg0P/Pj78wXpnRORgZc854zpH2Q=; b=eMO+aiZ3IO3kw5cP4lcK3UGyT8Uu0aDb0nC52t7YPIzFRUN3X9t52grWZxqunAK/leejpEynqZJOpuqsk3JmdFTGaGKB2uXkWMBePY0xQKMNVrv+vklmreq6IA3CIR5FUgWHcH/QqSE2Eu9YI3Qs12x4GEjkR6veVR5dJJRgYQroGz2DuwpKlUKVDiuJEPN5P/jBU9Gco/Hw76rsEjC6JOF0TojvJr1FgVoMCQaelvxXDGeezXNyFzG7MzVTA5tzamymqY0n1W5j2JMJ0iScqweyWQffFK6rIgNGhFtZTFoGN22CSiLd6A3Z6RGNjCIiyGxJjxS7XIjR/arJ71NVxQ== 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=/h7pafd5UrjLQONNEg0P/Pj78wXpnRORgZc854zpH2Q=; b=aWTwDhgvuSoS7KlppLDuhplyibENyEADF+yeIrvYK3LJI6r/+rc+UzY87qk+9V1lPOFrcaeVw1e5+kC2sO4rrJ5Tt/A8pSvLyzRa4iJuyLXeJszKqGtpkKeR98Z5SHekNSMCye/uv88iDX9f1KKgmUNw5Sh25MLN7tSnNBkuLTDiWibNtmvT1vp2o6LwxcVrkKEwDt+5xo6gVmUY97GeGoEhCsxGFHn1l+OsvKBLZ4j3K6T/5wMHI5HRrHpgC765ut/pqmBfLmCz43yA+kytK2zqTVJoSU3cEcSXlEbhH96eEy3WvPEsoCbbLAOnmpBCHN5Mjt8mDWYAUkRnXXoKXA== Received: from DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:383::21) by AS8PR10MB6102.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:570::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.26; Sat, 24 Jun 2023 16:02:21 +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.6521.024; Sat, 24 Jun 2023 16:02:21 +0000 From: JuenKit_Yip@hotmail.com To: jdelvare@suse.com, linux@roeck-us.net, krzysztof.kozlowki+dt@linaro.org, conor+dt@kernel.org, broonie@kernel.org, vincent@vtremblay.dev, michal.simek@amd.com, geert+renesas@glider.be Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, JuenKit Yip Subject: [PATCH 2/3] hwmon: (sht3x) add device-tree support Date: Sun, 25 Jun 2023 00:01:47 +0800 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230624160148.218786-1-JuenKit_Yip@hotmail.com> References: <20230624160148.218786-1-JuenKit_Yip@hotmail.com> X-TMN: [JrKxpSX0kTrz7X1sw6tVWGcXZnPhKkgm] X-ClientProxiedBy: TYCPR01CA0136.jpnprd01.prod.outlook.com (2603:1096:400:2b7::6) To DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:383::21) X-Microsoft-Original-Message-ID: <20230624160148.218786-2-JuenKit_Yip@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB4PR10MB6261:EE_|AS8PR10MB6102:EE_ X-MS-Office365-Filtering-Correlation-Id: 3e765205-61ca-4ae2-2a09-08db74cc641f X-MS-Exchange-SLBlob-MailProps: quCBM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myQKIAFgHGM//OlFXuzggdrZOUf6OWOznhlXwd7XOzSwq1gVLdHpgQNvR4u1Qn8GHDeWffUUqoReAiqqFvu8EUk+3OC4h2eB/hRgEfBpKOLlOkkjDu4rZTSK9RprNaRNP73+KPdUg5iqHdTTs8V5ejrfpddFGkZ+wjWIuiiGQBacIW09OLNEuz2AFIKLt8SfigASKJeFu+AYGWWRi+F8ZbwUW0xVESnYzptEBOl943VHyws+dfPnAdxIZiqIdykNkpG8u+YHlM9MVipl2nAdP/TQ1zouShdYC7QNkqm2LEFI2OFqZblwNjJNQpsby9tNopQxJoBBmJiBn+ua9xqrT761GELanYqsVCiXxkfusnXHL3jjuW8aHAPZbQsU6jyqeOOYsFvK8Hzoa/7jCS/xk4Xpfewgkh/eL5q3Ypsm4OFh+HuUpZb4r7dxhVxxq8Atp5KtMkCG1Ha0HM2gbs5tw0z1oBm2RZ0cP6XHJWOy3ATcN7n9Z+01c+QLqxWQyiQDou63/Ff/YXPcA45JMZNu25P0DqNOjG++tLcFE= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-6b909.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 3e765205-61ca-4ae2-2a09-08db74cc641f X-MS-Exchange-CrossTenant-AuthSource: DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jun 2023 16:02:20.9622 (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: AS8PR10MB6102 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org From: JuenKit Yip 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 9b2dadd11eeb..e7648c011e5f 100644 --- a/drivers/hwmon/sht3x.c +++ b/drivers/hwmon/sht3x.c @@ -925,8 +925,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, };