From patchwork Fri May 3 02:19:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13652273 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10olkn2048.outbound.protection.outlook.com [40.92.40.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 863F517984; Fri, 3 May 2024 02:18:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.92.40.48 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714702741; cv=fail; b=d9XLnmud8IpbGUrVGIqkANiQBhXd2KwMa+C73SkFxF7hg5esX+8aJCShTuh2QA8hemONs693RBEphQvzz0xXQb4ub70d8gKx35xo2PkcLXMlzVHzPv0YcAv6xlewOWtCQMmksklY+F/urSrff8hLZ/ssY2jWuqYM8T7k+Vhd8JM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714702741; c=relaxed/simple; bh=km3KtIM3pQOU3jzGjmpN8TTkfeZV6sMFIE9E80LQH3I=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=qBI/PVeDN9EqA4VA9WKgqBVLtjSzJPLDlG4UJWv6VkebvgUIYZn7ojpMe9cd6rl05jjw6B+MnRU/G6HyOqG9s9ap+OzZexFU6g+6Tj/eVLJswxMa8jEvBJxTYAQtcR2/FTBTTtME6HTfxSD0wotn7fL0FPC7peFnGGPntrd/ZB0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com; spf=pass smtp.mailfrom=outlook.com; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b=OXJnfOCv; arc=fail smtp.client-ip=40.92.40.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=outlook.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b="OXJnfOCv" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XTgwUyZVnMqr8DcybbRwzLyq2LYNf8WP+F5/YlUT94cgJM0obPBvAUNXrJ9KMzpBBImdJNiFPtf97i3fXkxfuPHX/3Xs+Pdki/h1o9Mg2p/7MD+ehVHm27vTx0Rq2dC09rSTjfY4F8/RdxB6wD0GhQ98H9fenIVGlQDoxa6in0P4X6kL4H5T9IvAw9ZwZ3lxIO2xQ1LfdnFzZj7bySwI6hoOJBEGxnpeWbKbZ1ch13/Ws9f7hwVZOtCWcZeAkhzrVOjmGbJTdft+d43e2BXATYWBRJ6c7m+UPdOnR9wBdehXuVQKCnWziIUse18v50dq2Q3YR6r78uM3axoUD5q3dQ== 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=2ud2EVsxx+GO5U1A4/zRqMFMJRVM1Ju+SCGZsxk+mtc=; b=Hj/YOTdvIo+TC9DIRgvhsnaedVJdcTNSEXDuCn19wuZY9YquV92MAVGTYQ2628jhxAqKMXS9DFsNuxeQLaMzhlFsPrUvsKON3pbyg6ZBrq0QRmIkf/ZrQ4xF+1IeMokCWvJJLmSUVOXx4FV/vH0OhifdtokQX4GyaU37y+EzSurZ86aYddPB6MdrSayOtViQFFYZ9dAJvHkMfZmC1IvK8FHyYkXGruamAPYXu6i8pofdwpMRtOPWf4SQmomdBlc12SJQ6TcdpoP/JQ7Fimm49uUVI9T787Gvc4mUDSsV5oPypE4zzElqoRvlZJijmmwn890eB2FIp5Gt5UK3a3zdAg== 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=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2ud2EVsxx+GO5U1A4/zRqMFMJRVM1Ju+SCGZsxk+mtc=; b=OXJnfOCvtPp+nLughzmaYJD0J8rsvveV6qPi9Prdali6sg8FB2A6d2SGwGw1lpZD5TuvOBvIIguSOT8AOYX0oRWU7A1kpg4fpNw2V11IHXUkB9avQsh4spg4vn1koIzZy1MTE68P/hwwqLnCGvQpm8C0d+Gjehf1FysgZUGgUfkWZe9Wsd6zlB6ErhJiLV+rogAUcgK3ukoLj3Mo9aXPNZhHTfUjsxeb5Mf90Mh2SKIQrJFlWZWqqvYNZfYZwKMW0JLqib9PGXtfmMv9ATZ8PpgI7ZJ3x+qVqtnbgrFn4+KZXkJusam0qslroh4nVtATNG8WXVy06GJsweTeU/aPVw== Received: from IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) by LV3PR20MB7003.namprd20.prod.outlook.com (2603:10b6:408:1a8::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.35; Fri, 3 May 2024 02:18:57 +0000 Received: from IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::182f:841b:6e76:b819]) by IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::182f:841b:6e76:b819%2]) with mapi id 15.20.7544.023; Fri, 3 May 2024 02:18:57 +0000 From: Inochi Amaoto To: Jean Delvare , Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen Wang , Inochi Amaoto , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v4 0/2] riscv: sophgo: Add SG2042 external hardware monitor support Date: Fri, 3 May 2024 10:19:30 +0800 Message-ID: X-Mailer: git-send-email 2.45.0 X-TMN: [W/rgHMGl8jyAQ2KJ8/ujSIdgfDX18j7NRhR0QZ9xGfU=] X-ClientProxiedBy: TYAPR01CA0216.jpnprd01.prod.outlook.com (2603:1096:404:29::36) To IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) X-Microsoft-Original-Message-ID: <20240503021932.897404-1-inochiama@outlook.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR20MB4953:EE_|LV3PR20MB7003:EE_ X-MS-Office365-Filtering-Correlation-Id: 2e8dccce-e96a-4550-c81e-08dc6b1762ef X-Microsoft-Antispam: BCL:0;ARA:14566002|461199019|1602099003|3412199016|440099019|1710799017; X-Microsoft-Antispam-Message-Info: 8nTxwLRhk1iptlkIOSzO+H7AksfczkdPUEVhi9Jw/dzbm9lccGeSI1V+zTbQSaBi9hvYZePcfAk7RIhs9wSst8yquzHYPsch5eQsutWbF1QFNTRLVtpVhttJZJV/A/UQKN99e9ujGVMru79JLxX3GPzThpx+02CM6gUw58o1LlJG8zYlU18v0EFl88hXJ6LGTPgCpDAy9aYxfYYgU+GOsbIMQle5gjxN/ivIgbRZaG6DSEB0UWAJ5bFnwmcq+ugkJwhQaJ5TL42yh8kdgvq/noU9/3CY/9z9K/fWS38SxLS2xr6niggMqoQf3e9SIS6vp0Yz9dUTQShBj20QpYh6okmiAxVEj/ErQpVvFVn8TcXafIH1jprZ+c43v1DZHGx7ak4mtPgVPhYrK+JpV4gPsskxTNvvcyKOTQi1TtW/Xw6qj8pCKSF4B1EBsplXgcTEMZkLmQ+a7XGW3X1b0MbdJt1yHetU4Zo4UpYoN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6GZQ9AZg+skT2lxSBrnAmBDrr8MUeU05TPSKbRxslwmO6tCUojyF2Lr0cDY9XC+ZATclmDM2QnYCVxlYL9iWPa68VN32nF3f2R3A3nBNZxU1sX5sBm/LuwGXfv0vux0FdQwOLM899KM14rDG6pR24Bw9+kRQOuFt4xjJuciAApyDGPukSQACFM1NBjc6D/OdyPJaDGSs4ELsyjbxH4wQdsLdwDoDff24MsJwlLAmqmRZHu/7l8a7ht4Y3+8qTZ/Lywj8a687I9qpUeKcLFqbJWDiOJ8Pmb2SK7X4583UZ8rgOWbyYhZMvSD9S7k2SBnJqQP+cg9j6tNfZQIUtMwJ+ywWAz5KX2nr57QwzjZhr5PM1K2/n5SePYG5iqmFfH2iNl7K1qkldik9vMOPJFK/BZw/wlU5ka0t7HC+LSfOTnG139PcUOJAaFuCglaiWRuGthOl4Nv8Z9LytxyC6ddV/JnV0XWWs/tL3ge X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2e8dccce-e96a-4550-c81e-08dc6b1762ef X-MS-Exchange-CrossTenant-AuthSource: IA1PR20MB4953.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2024 02:18:57.0011 (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: LV3PR20MB7003 Add support for the onboard hardware monitor for SG2042. Related SBI patch: https://lists.infradead.org/pipermail/opensbi/2024-April/006849.html Changed from v3: 1. add thermal-sensor check. 2. change node type from syscon to hwmon Changed from v2: 1. fix bindings id path. Changed from v1: 1. Move patch from soc to hwmon. 2. Fix typo. Inochi Amaoto (2): dt-bindings: hwmon: Add Sophgo SG2042 external hardware monitor support drivers: hwmon: sophgo: Add SG2042 external hardware monitor support .../hwmon/sophgo,sg2042-hwmon-mcu.yaml | 43 ++ drivers/hwmon/Kconfig | 11 + drivers/hwmon/Makefile | 1 + drivers/hwmon/sg2042-hwmon-mcu.c | 531 ++++++++++++++++++ 4 files changed, 586 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/sophgo,sg2042-hwmon-mcu.yaml create mode 100644 drivers/hwmon/sg2042-hwmon-mcu.c --- 2.45.0