From patchwork Tue Jun 13 11:49:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 13278639 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 38E72C88CB4 for ; Tue, 13 Jun 2023 11:51:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kjWP6uoAER7NJKe0z6FL7rokl9kA13QgGvmnLFUHzEY=; b=SgmMbV4Hbbt0vj ntHWKNBcCPxhkEmGGF6iZX6e0xTUvfYjxTyPnPEmxm4upjGSw+4Mrn4rhEzQJwHtKoqNlLPXcCjqL mxOZFDL6uI2ufw8dEIwiAKT/HibqSv/XVxLJpxPteWo0OF6TPl8sBFtXXeQvWEW8S4lrf0/Gtg8VH zgQ2HR7RaATz5uMGA8LNhnt+Mj1oqyj3hJDcQj5MDsE1HNqUP/6A21frcrfrFVyxLhw3XMQX9v6VA 88R3FmAZBUooEGFQ8hUUqPRL1FMIBcER8VRyLQ7YtHjGk5gW65ApQFeiXtOf7fHeNsMH7hKRWGmCW 6oHQSne7R9lVNCvGVevg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q92Xo-007yUC-37; Tue, 13 Jun 2023 11:50:40 +0000 Received: from mail-psaapc01on20708.outbound.protection.outlook.com ([2a01:111:f400:feae::708] helo=APC01-PSA-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q92Xb-007yEs-3D; Tue, 13 Jun 2023 11:50:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DPGnaglkTyMb9ANyv9A+jPzN2jX0vhkkTwUjosuf+aH1Sm9PR0kMaY1L7z7gI9SyLs+zWkZu23LpT7+q8j+kYshMjDdHlfWe9VJ1l7kajM6kPdKs0Kyu5MYJ4rdcKf6VFDBIJqx1RvjG40lb6VZxhtzN7RlvnTfJs2pVk40lTjxJBOYyTKAqPtze5r6aioWyFofU7cbr3ohF4juZdT4WTO1u/oM1htDvEmij/kDx88lrQddJ2Zxrjk5X8Lx5LFbYoN4sRuHR16tuSuJjs7aXZmaHs+5/S7FmHHWD3mga24Y2j0Is2yzH+02Iyg77FN60/A8jCotohZ6vjfu3hjPVPw== 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=1MIJeHIAZZfXJqZUnLCI8QVcKNIxIIiXPANVgZtGEcM=; b=gPZYZz7D13plYdX7dttMjk3PgjVlG+YH4J6OOwH9wyj+J3UfmJ8Mh+F9ZdcHS/5SDFGk39wvhwF/mBaUbADLga4/LJPOTJhzZVV+A/vg8/wiWDvYOop75lQ2QO4AJBR2h9wabU0YkAnlOwyk0u9QOzn+eqXDNchEoLA/V38jyX37WRDXBivJ0J31epxq1I8lORoBICrcEBSVtdWx13TJBROFJrtSkgfS5l3vUzikgK5c/B7rzi/n5UmNCvKxGIy1a02Ba0B33/oRZy+S3a0fffhwuEpMNIQ4OEf7kuyiSM0d0ro3AfzMDPifKIPrlpw1WhKmdFzCmMyPNN2odpmWwA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1MIJeHIAZZfXJqZUnLCI8QVcKNIxIIiXPANVgZtGEcM=; b=OcfbgD7zyTUo68FyCLO+HiiFsA6O1CearxYd+4yZhr0hXmQ2mqNpIkiM/HgDFwFabvoT8O7/6jShmSp2nL47PuWhHqzKnpoYLx3cFomD9l7H6tN7MG3dnLxJQcEfbQ+8Lkrxv94iHL16r7f9jiqxOgaOZ5p/Gc8cc+W1UIr+FzwIPepaUYVCUikwN0IS6s3SnEldaVHoLNMoQC/wspyeZhPJh5YhNSyj+CBWYRLK1Q6lEZQmPgXs2lxHyQWQE2K0kvIkWWy+yMf/iDDBrcqU1jcVTrB+o0CgxcHKW4CU6PX2spX9IGEs0eUzEKTcw6IfhaWL7TTYRYYu6OekkjOCsw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by JH0PR06MB6416.apcprd06.prod.outlook.com (2603:1096:990:d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33; Tue, 13 Jun 2023 11:50:18 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::76d6:4828:7e80:2965]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::76d6:4828:7e80:2965%3]) with mapi id 15.20.6455.039; Tue, 13 Jun 2023 11:50:17 +0000 From: Yangtao Li To: glaroque@baylibre.com, rafael@kernel.org, daniel.lezcano@linaro.org, amitk@kernel.org, rui.zhang@intel.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, thara.gopinath@gmail.com, agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, anarsoul@gmail.com, tiny.windzz@gmail.com, wens@csie.org, jernej.skrabec@gmail.com, samuel@sholland.org, thierry.reding@gmail.com, jonathanh@nvidia.com, edubezval@gmail.com, j-keerthy@ti.com, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, bchihi@baylibre.com, niklas.soderlund+renesas@ragnatech.se, wenst@chromium.org Cc: linux-pm@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-omap@vger.kernel.org, linux-mediatek@lists.infradead.org, Yangtao Li Subject: [PATCH v3 11/12] thermal/drivers/generic-adc: Register thermal zones as hwmon sensors Date: Tue, 13 Jun 2023 19:49:03 +0800 Message-Id: <20230613114904.15749-11-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230613114904.15749-1-frank.li@vivo.com> References: <20230613114904.15749-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR01CA0038.apcprd01.prod.exchangelabs.com (2603:1096:4:193::20) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|JH0PR06MB6416:EE_ X-MS-Office365-Filtering-Correlation-Id: 5f8d20f0-8476-4135-51de-08db6c045b3d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nZaQ4oDwCEe3OIlaHOOfj2WTXT9UZkSK/IOx4DXZKYLtH2nBVUAPwtjCLnDntWFOlRFcPHPO1Po5n2Fdk9Y8UvWu50maEY7bGwm77ZFhKyFX4mSQZgbtNN8+IqlwkyzEUFgj12e/RP9vyiGPJcZlvTDV/SLcoDBCl5Sd0hXh9YdcwlTXVR6ZHr35QgN8Owy89pbBMHa+/w3ow8tUZaTU1SvLDS/uXnQaWdn1nTJ/4qny7Qhf0zMD6vlH4S3Qx/7SRZj9Z3yltPirVSiLICfhZypjBlc7GITckKMfkH/J9qjgH0KKjY0qQSi6y6hHYVefl3CIrxAaQc5D5tsiqp262xTB+uZDX/t98cMjN6bftfwipldVh1j2IbZHMYRHgQ3YTYNtvNEEMQqz+wMdco4UnPSQDXKJBzAjtPEWoOD2kSZmSKxffEKvzpaez4YQEjnbWJXGExzbUmdVcEc2uAQ+UdXM88qIe8aEGDv5dl1F6XQFlAitiN+F8nw2wClsWs4USsFBM655AxIn8vzO5iEBIE7L8N/MrAHzMNaWJB5YtT5vhrsKI6S+swHisoJmxexllHGimlj+XQxxWdAHoyl03kY75ZkUR3OljkO8EbZfiE1+8Etj92elpY/uHRIq+MTGJbPzs1z8BHzOjripByzOyuKrZVzJfTTuQNYwsj6y/jE= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(366004)(376002)(346002)(451199021)(36756003)(2906002)(5660300002)(86362001)(7406005)(7416002)(38100700002)(52116002)(6666004)(6486002)(1076003)(6506007)(186003)(6512007)(26005)(107886003)(478600001)(921005)(316002)(41300700001)(66556008)(66476007)(66946007)(4326008)(8936002)(8676002)(38350700002)(2616005)(41533002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: a5V34HLvUWEVeM/gkYrV+RzQhBgEqt+aKtEaGr6iPcRb3gwmQ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kBjYAj3+XKfu9xKwMp7EZu6E5gg3R7c46+La2vSr1rkuIi+QO9fXPAh54OxOObxCAFVXN6osHFcuz8o+6kL2Vm4U3pudJfrDxvWcvaARbcbIDyc3M+QE3t+vE1WGmDc64ovYU97ixUDxuWLRYK4kSl2sdORCuGWhq6IY66zfpOBIFeQNaHccgCWn0oejkdEm4tKzoBW3UwHr/DG0hlK396cbhoZ67h1AgWyTpkAMmDP9Jx8jq8NF8A5GvvinWUia1FpuFUNiAjOIFhyIhGiSAz/G/aMoM21eepGY3/G5rCoq24CmMrsjNaI2EKXi3dwdLLmfp/hzcvWhMRf0639pwimYg0VUY0hJDUbjBRDkzgGGivEg2fZaHLFiwHrUXHRne+sKVzvaESW+vQkdwKmDzmXFwoNztudPwvoXTX4IV+Sa7ypTGr75thtBudTDeDe1R6DFUyrebCxrpSB1nWlT4xPUaAxJhdbIN268 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5f8d20f0-8476-4135-51de-08db6c045b3d X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2023 11:50:17.1148 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lxtVkAGwvuJ44knJxC+rT/WrwUQQ+3NbYiqUF4hnf4/L/yNpskODuVVbm/o04MS6xGLU9xGawBEDPpnPoaIi7Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: JH0PR06MB6416 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230613_045028_073400_90F90A91 X-CRM114-Status: GOOD ( 10.02 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org From: Chen-Yu Tsai Register thermal zones as hwmon sensors to let userspace read temperatures using standard hwmon interface. Signed-off-by: Chen-Yu Tsai [Yangtao change to use dev_warn and remove return] Signed-off-by: Yangtao Li --- drivers/thermal/thermal-generic-adc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/thermal/thermal-generic-adc.c b/drivers/thermal/thermal-generic-adc.c index 017b0ce52122..9531bc2f2ce7 100644 --- a/drivers/thermal/thermal-generic-adc.c +++ b/drivers/thermal/thermal-generic-adc.c @@ -13,6 +13,8 @@ #include #include +#include "thermal_hwmon.h" + struct gadc_thermal_info { struct device *dev; struct thermal_zone_device *tz_dev; @@ -153,6 +155,9 @@ static int gadc_thermal_probe(struct platform_device *pdev) return ret; } + if (devm_thermal_add_hwmon_sysfs(&pdev->dev, gti->tz_dev)) + dev_warn(&pdev->dev, "Failed to add hwmon sysfs attributes\n"); + return 0; }