From patchwork Mon Feb 27 13:41:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Feng X-Patchwork-Id: 5894 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2424916wrd; Mon, 27 Feb 2023 05:45:34 -0800 (PST) X-Google-Smtp-Source: AK7set/LuAOFJG+7cAgODz1rqXeDu6Ik0hVUnbzGrN7++5PmNyx2UfFDdZUvenF/Wrmnla+4A+GB X-Received: by 2002:a17:902:e851:b0:19a:839f:435 with SMTP id t17-20020a170902e85100b0019a839f0435mr8730839plg.3.1677505534578; Mon, 27 Feb 2023 05:45:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677505534; cv=none; d=google.com; s=arc-20160816; b=TNeF+uQBo2YyFoh185sbEyAAQ6/pI1sKiBlN5YlOu6ihK2JSTpx9CZHtKoJVkgFGO8 YyWjJ7i5B+cdzbz3dLPt4nsW9KGoYI9MYaud2izR2qP6nsIqrD6dRD1rjDj9q7ZSkJVG Vov34u4kOickbGUKZ5lkel1voDzJccNr+W+kEAnkzSRu1CLdXrATi29ri/jLV3q4eTAM 4jpllSWEWKK+ykW4qHz72XarrZr85zy+t5w//Tw34w53/xYJacaJ7CqCQ/Q3DhHOrbYo 5iV6VPjx0XIMJPebr/3TvReotwdkLmkJvrhWtuvMRg6MIU7G+eyPLI0V35RklXDay7cV 5tvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=L8LyaSOy8wo13H7cQ+IGDVb3MVu4wssBUNze8ZY+wgQ=; b=NiHl5bc5j3P0QudYT8ECZLQz8xKvo4kCHqQln2J3FhIy9TpPFphsAJ8UFS28PBotRM lbhoQDRfAMnUWZIj0vJcfk03C5yytzINQaUmQFmSzgxvIA8JCLXcWuoszQduAKuTQemV gMIplkoY5O96VPC91zsuNDzuhMWEN3wJqVhrfnFUNc8uJgOYUy70pgZN0Ge6ERmcSdFh iNz7rqti8sdDbpveXQAXqyLa2IDMQgx18hnV0IoaPuyso5m/LkgZq06yXEVashk3EdM2 Tb/ie3WWE6WUrMjTMNaux23D0IlpH5QuzVwhMriOy4pEFU1HCdxL3Qa8gvY+L4ELhnBs 8QWA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 130-20020a630688000000b004fcfa513fc9si7634047pgg.184.2023.02.27.05.45.19; Mon, 27 Feb 2023 05:45:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229703AbjB0Nld convert rfc822-to-8bit (ORCPT + 99 others); Mon, 27 Feb 2023 08:41:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbjB0Nlc (ORCPT ); Mon, 27 Feb 2023 08:41:32 -0500 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 354DC9008; Mon, 27 Feb 2023 05:41:30 -0800 (PST) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 8FF8824E336; Mon, 27 Feb 2023 21:41:28 +0800 (CST) Received: from EXMBX172.cuchost.com (172.16.6.92) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 27 Feb 2023 21:41:28 +0800 Received: from ubuntu.localdomain (113.72.145.171) by EXMBX172.cuchost.com (172.16.6.92) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 27 Feb 2023 21:41:27 +0800 From: Hal Feng To: , , , CC: Jean Delvare , Guenter Roeck , Jonathan Corbet , Rob Herring , "Krzysztof Kozlowski" , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Emil Renner Berthing , Samin Guo , Hal Feng , Subject: [PATCH v5 0/2] hwmon: Add StarFive JH71X0 temperature sensor Date: Mon, 27 Feb 2023 21:41:23 +0800 Message-ID: <20230227134125.120638-1-hal.feng@starfivetech.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Originating-IP: [113.72.145.171] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX172.cuchost.com (172.16.6.92) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758992043818195727?= X-GMAIL-MSGID: =?utf-8?q?1758992043818195727?= This adds a driver for the temperature sensor on the JH7100 and JH7110, RISC-V SoCs by StarFive Technology Co. Ltd.. The JH7100 is used on the BeagleV Starlight board and StarFive VisionFive board. The JH7110 is used on the StarFive VisionFive 2 board. v5: * Dropp the "interrupts" property in dt-bindings. * Reword the commit message of patch 2. * Use continuous mode instead of single mode and drop the interrupt related code used in the single mode. * Add the missing "default:" statements in the driver. * Change the device name to "sfctemp" which avoids a warning when startup. v4: * Change the node name from "tmon" to "temperature-sensor" in dt-binding example, which is more generic. * Add support for StarFive JH7110 SoC besides JH7100. * Add clock and reset support in the dt-bindings and driver. * Add the missing headers in patch 2. * Use devm_platform_ioremap_resource() to remap instead of platform_get_resource() and devm_ioremap_resource(). * Use dev_err_probe() instead of dev_err(). * Add Signed-off-by tag for Hal Feng. Add Co-developed-by tag for Samin Guo in patch 2. v3: * Handle timeouts from wait_for_completion_interruptible_timeout properly. v2: * Fix checkpatch.pl --strict warnings - Add myself to MAINTAINERS - Fix multiline comments - Use proper case and whitespace for #defines - Add comment to sfctemp::lock mutex. * Remaining comments by Guenter Roeck - Add Documentation/hwmon/sfctemp.rst - Use devm_add_action() and devm_hwmon_device_register_with_info() instead of a driver .remove function. - Don't do test conversion at probe time. - #include - Remove unused #defines - Use int return variable in sfctemp_convert(). * Add Samin's Signed-off-by to patch 2/2 History: v4: https://lore.kernel.org/all/20230207072314.62040-1-hal.feng@starfivetech.com/ v3: https://lore.kernel.org/all/20210726171802.1052716-1-kernel@esmil.dk/ v2: https://lore.kernel.org/all/20210624162108.832518-1-esmil@mailme.dk/ v1: https://lore.kernel.org/all/20210616181545.496149-1-kernel@esmil.dk/ Emil Renner Berthing (2): dt-bindings: hwmon: Add starfive,jh71x0-temp hwmon: (sfctemp) Add StarFive JH71x0 temperature sensor .../bindings/hwmon/starfive,jh71x0-temp.yaml | 70 ++++ Documentation/hwmon/index.rst | 1 + Documentation/hwmon/sfctemp.rst | 33 ++ MAINTAINERS | 8 + drivers/hwmon/Kconfig | 10 + drivers/hwmon/Makefile | 1 + drivers/hwmon/sfctemp.c | 331 ++++++++++++++++++ 7 files changed, 454 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/starfive,jh71x0-temp.yaml create mode 100644 Documentation/hwmon/sfctemp.rst create mode 100644 drivers/hwmon/sfctemp.c