From patchwork Mon Jun 26 07:29:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: JuenKit Yip X-Patchwork-Id: 13292433 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 B36BDEB64DA for ; Mon, 26 Jun 2023 07:30:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229816AbjFZHaK (ORCPT ); Mon, 26 Jun 2023 03:30:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbjFZHaI (ORCPT ); Mon, 26 Jun 2023 03:30:08 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03olkn2060.outbound.protection.outlook.com [40.92.58.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD8E5E0; Mon, 26 Jun 2023 00:30:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nHEjHg2GHrFb8t6VJx5Zt6HSWn6bWYmH5SdgLdVVZulx6e6YLMgxdE/uGFqT0DjBXRBWzHYPZtlJtlIN4J9cVVETbvMCwZG+v6Kir5JVRfxXi/R6FRiLOg2392MFpWpVel6rivFvawrxGAZ2LWXa/3j3ojaDVYvlBtvkWpSns6TQID1biZec7fC3tM/63vuWN0QUzxJT+ywaTCMjqbXe3y9eyVkDgJ63hJakbEuhIS5QPjGi7giAETL/sooZyvRIxZDBtHpZfuVxNlz2AllBdpfJxja/AAljxttlPdlaMSk2nFc9AGVSzEM8VFLPhS0v60KzFpt6S4q25aEzNYASUw== 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=2TIMv/J22r6cNoRW8Aee8JzK9G9u0MewxudOg21/GlU=; b=SIJnNmsNLqPvma03UL8/W1WMNiavZ3nvCyzUfviT4mDoYoE9TyjLrWrXXXhGEdB1AyuElP8AWwHCIIOH6BfF3H8VNOAwLRaU6mD/4aI5dZlthfx52HLVq+Bhp0w4PSFq8VEp+29+6OeVVAeQ6zIfqYGJ6FArQGjuA18Hid9VMWwOXy6Bcoz2vLJKy+vQ6YMgLb4UPor/qjyn++M/SOhroZbX0EdOr1X5zNWATjfzpAF8yzrjRNowq9GrIiwcKld7G6meJ7rQiYLvBo8fjf3u5dap6QzAWUegttGAUXCWU+6zj4apHGUOLTQIwGOAMp5NxGKeQ6iJ52+sb6rbzVYI9Q== 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=2TIMv/J22r6cNoRW8Aee8JzK9G9u0MewxudOg21/GlU=; b=KQPdd0f5C/K2vhXcaEhRDaZTaJPsLmZfmqFhO99vwNdF60dZRggo32+ELafopsgf5GmbFDGdeud9W3oSLRAMwzEIb+jVeeMaFVFXTK6JhqQq+71k3we4MHxdGqz23YqPrysjImIVZWLKjB5LNn8BSTLZynQVCieKLpFpal6qEjLERRtk4BGoLaxjXLe1sifgs7Fl81FTKt5FbHtfKWQQ9kwCAMzUMzjKJM+OxpGMgFeck8ipW2skl7/r+z9vT+3A3bQbe0ZvOyEOhErdyX1Y0ecN0dmJhvKU1CKvTPN0YfubijT3b75XOYlOG+9JO6/Nhfz6a1vLfixrsLwMYlHXnQ== Received: from DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:383::21) by AS8PR10MB7858.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:631::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.26; Mon, 26 Jun 2023 07:30:05 +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; Mon, 26 Jun 2023 07:30:05 +0000 From: JuenKit_Yip@hotmail.com To: jdelvare@suse.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, corbet@lwn.net Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, JuenKit Yip Subject: [PATCH v1 2/3] hwmon: (sht3x) add devicetree support Date: Mon, 26 Jun 2023 15:29:22 +0800 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230626072923.340544-1-JuenKit_Yip@hotmail.com> References: <20230626072923.340544-1-JuenKit_Yip@hotmail.com> X-TMN: [QQ/NGHhaxWXKSr0HyQDcEAt8euCQwfEi] X-ClientProxiedBy: TYCPR01CA0167.jpnprd01.prod.outlook.com (2603:1096:400:2b2::7) To DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:383::21) X-Microsoft-Original-Message-ID: <20230626072923.340544-2-JuenKit_Yip@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB4PR10MB6261:EE_|AS8PR10MB7858:EE_ X-MS-Office365-Filtering-Correlation-Id: 78214b27-2787-421f-ba01-08db76172965 X-MS-Exchange-SLBlob-MailProps: EgT5Wr3QDKzYk8yevgJIT5SRqgxOIeQcAffxd68fClywQns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r9mC6nBSDHV547oembBOCQBx/iXou+8wQHlI8ER4i5ImugVUBcaqKLypH+7SyhZMrnNPCSOwfeEYKKBe7il3kQTTwa9pvGRiIt7O6oUAsB+nG8d4f/8M+UKoSs3VhAPdwoR1wSM3wkYF5KZdT48GMcgkM9oW+7bjvFAEZhEgt5UmjyJAwrWZ+5W2gu+38I/2e9HpwspYxLzk6DzLnKl4HLylSfEKEQ9wtpPwBJNUrZ6+faRAAfVtb1hfTeH0FZhk+wxW3X0GlOlJI4CzlVfvSK1JooiHJmXmjjZMMahK2/ylyJyhSkrW65rZGt53XMOjvdOBpYodRIKJLTL15PO3fU3X0zb3sZYA57RRmAA8jCYJ4hzOfCyMDpWFiVsKHGjTajLlJZp7s+1m8N5a6b7DSdFGrCJLqNDQPKXB9IosZ5PGou7kemQ6nbeEe6ruO936BJLKNmg8ILtqvTK7NuYSP98p0+CpEiWGNJUcYcHLjm/D4ccOTESd0JOnjGEYKtysPI= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-6b909.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 78214b27-2787-421f-ba01-08db76172965 X-MS-Exchange-CrossTenant-AuthSource: DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2023 07:30:05.8662 (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: AS8PR10MB7858 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org From: JuenKit Yip add "compatible" property for supporting devicetree Signed-off-by: JuenKit Yip --- v1: - add MODULE_DEVICE_TABLE(of, sht3x_of_match) - drop of_match_ptr drivers/hwmon/sht3x.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/hwmon/sht3x.c b/drivers/hwmon/sht3x.c index bd483af1c5ab..46b0a0231b06 100644 --- a/drivers/hwmon/sht3x.c +++ b/drivers/hwmon/sht3x.c @@ -911,8 +911,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,sht3x" }, + { .compatible = "sensirion,sts3x" }, + {}, +}; +MODULE_DEVICE_TABLE(of, sht3x_of_match); + 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, };