From patchwork Mon Jul 3 14:08:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: JuenKit Yip X-Patchwork-Id: 13300181 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 0DCC6C001DB for ; Mon, 3 Jul 2023 14:09:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230429AbjGCOJB (ORCPT ); Mon, 3 Jul 2023 10:09:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230513AbjGCOI6 (ORCPT ); Mon, 3 Jul 2023 10:08:58 -0400 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01olkn2106.outbound.protection.outlook.com [40.92.65.106]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D67D106; Mon, 3 Jul 2023 07:08:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QuBNbXDTkqDNaQcsC64Z4OKFsov+QoHbu4CDvYoUUqHv+ovEzMqNII4mZmIjChEZcuCIYj1n2S0kcnRjHdmDX+2w6VSBu7gKqrBMTa+2zN5ER7Tqhkydv83pyLim8mtRw8AsD0JY/CVaErrzdeKThHO/r618do9CFoGZh4sZFceYZa1csHqoTWKegS1CWY2NlklIP/7+QVW35vtKvqfdfMh/htTY/Mj5KqmxFb3HNSAlIKWjRQkeMvqzRTcHhLpla31cyl7NviNysuZQ+Rs1369wXJhlYGDB+B6Nd/3AY5G2aHQXVDm0KjTqeN3rljtWIl2b00ECRQkuvG6rqxP5TQ== 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=3o4vrPZZxBA3YbyvZ2e6l7Nv6AYaTFI9R/bVHAHCW90=; b=aQztKHbzUAkm/X9Tl2Ae3z2voarwFNfea8KVUhXxA9sWAiqqNUdQzQA0RvuxlYA3/yegnijWqusP3qW98WQF0QbLyHl0poM50qvmmazQNvzGPWIDSdCLsk106m+LZaWIT9V0v7g5HAwOliDx/fw9MacOT77d7NXY8bKyp2WYEXIsIhsqWKdC+HEV7e3OOW7KCw09+4dcv4wjeVrJ5seohHzspet5pvhxU7CZ3sWKzTBGiSI1FHn5yk3pbsjSq0V/Im8puKtdm40JPzbafuzZAAF08uof5CDTaB2FzfX7Q8KFER2zKn5+lVtENypiymPX0kq1xAr4Pl2W2lkCkDhkwA== 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=3o4vrPZZxBA3YbyvZ2e6l7Nv6AYaTFI9R/bVHAHCW90=; b=gSnhYl2RQta5Pg8JJrca5RwKgzFUnYOX5UbYUbpy5pQg+Dad/74O/d0SZSAVSZnQVRF7Dkx3DZvdOjCTtBQCXBNsqqsIJOpJH5qSL0u0vQyHIpVlGO33SgjRY2+WzigEF3MIlRacqPHYg0aqkriUrapnTQnf9LZUxgSSouFJSN4+R7JyjK26Cmim9dVMitTPt+6V8d3grVrWs+rGkr+uu9U4k+rBD/JJx15JWMynlp+Do1AP261uLhBQ9COCHD8AM+GqPOai1pZCdEwVIU+iPy7QXLX7iHyreq3h27PxWqNn44aEq2CygGEdxl9T8Gf9zFB1026Xu+XAlykdlNao5Q== Received: from DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:383::21) by AM7PR10MB3891.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:178::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul 2023 14:08:55 +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.6544.024; Mon, 3 Jul 2023 14:08:55 +0000 From: JuenKit Yip To: jdelvare@suse.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, linux@roeck-us.net Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, JuenKit Yip Subject: [PATCH v3 2/3] hwmon: (sht3x) add devicetree support Date: Mon, 3 Jul 2023 22:08:17 +0800 Message-ID: X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230703140818.427403-1-JuenKit_Yip@hotmail.com> References: <20230703140818.427403-1-JuenKit_Yip@hotmail.com> X-TMN: [i+9QzgfcsI/Ia8JV328O+M9WodjiKC0G5px+Ko3RhAkveJgS3sbLoNRH0Q6cgMyo] X-ClientProxiedBy: TYCP286CA0023.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:263::10) To DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:383::21) X-Microsoft-Original-Message-ID: <20230703140818.427403-2-JuenKit_Yip@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB4PR10MB6261:EE_|AM7PR10MB3891:EE_ X-MS-Office365-Filtering-Correlation-Id: 1f960fe6-1086-4d95-c8db-08db7bcf093a X-MS-Exchange-SLBlob-MailProps: AZnQBsB9Xmqqp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RN/OUtCjFsxfM/6XWvkSpSmRkS9VuYJ5LvvFULfwL+njMpKWPYQO/90BGOGNavnx2HWBGSbQAYHL1fWOcgnf5moIuwDHvR/NZYngOrqJ8Yi67KApHMux9gnzYNV8qjdgllzrOEK6zedPxYQ8VYwtLhWpBcvMvJVWq79NeYzw6GPeZtIJWTpsMCJpfkBpYl6GhwL0mHyfGefhirDLPNq8PV3ENZtVRxR3n9YBZQptp7bGHMpF/QZk53WMqRbwsSgh2/ET1CMeLoXmhoy97Z7PratlDCmDSifG7DDeHs8HOeKd8zG7hcNJDZdzteC70WeW0keKveDwor5QGg45XHYB3Y/Biemk35vjC/jLWtcVzseye2Wvnh/3/aJZk8pM+sKZgDIDedMNYuA+FOl/6cJ/LxCddReD7OMiRmI8ZEB7H1gxtH4PdGO9rynYFaSRBt772VauQpMWwEml2gvI1oWZXCmOJsG23yPRVBYZc/Mr9dkzP5NKtU3tljDsbA3Ti88siz5ufleqT2Z6WdTjrXbWDqdd26L7nKndY1hyv0S7KNrrWqPP64BbkBzdA9UP2DN7jwTHFKcNszX9Je/u+zkQx6BWrq4HK5QfG92G8Ny9rNGPn41APibz21q79SFpCdJ0L04CAOJDPe7wINDWMBuYb9XDU= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-6b909.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 1f960fe6-1086-4d95-c8db-08db7bcf093a X-MS-Exchange-CrossTenant-AuthSource: DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2023 14:08:55.0823 (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: AM7PR10MB3891 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org add "compatible" property for supporting devicetree Signed-off-by: JuenKit Yip --- v3: - fix wildcards problem drivers/hwmon/sht3x.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/hwmon/sht3x.c b/drivers/hwmon/sht3x.c index 79657910b79e..bb8586233adc 100644 --- a/drivers/hwmon/sht3x.c +++ b/drivers/hwmon/sht3x.c @@ -911,8 +911,23 @@ 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" }, + { .compatible = "sensirion,sht31" }, + { .compatible = "sensirion,sht35" }, + { .compatible = "sensirion,sts30" }, + { .compatible = "sensirion,sts31" }, + { .compatible = "sensirion,sts35" }, + {}, +}; +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, };