Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp3706387rwi; Wed, 2 Nov 2022 02:04:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6xrj5H1n1SSeOnTaw8B09UifZlOjhfIQfBmZ1NJgZzjUpSkkRHWV1viZUYHHFBMRxZGx9A X-Received: by 2002:a05:6402:204d:b0:463:153d:6790 with SMTP id bc13-20020a056402204d00b00463153d6790mr20580126edb.293.1667379883164; Wed, 02 Nov 2022 02:04:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667379883; cv=none; d=google.com; s=arc-20160816; b=Uybt5uQQWONjCtA+GMQ7OPXaPUwVXMQXBmFyuarL94akV8ZD/UmO5jD5IxKVckcfBC YBLfVyjYITyuR8g/sBEQCkz2dBeN7F5pZkeU+YpQiyjT4GBZ9j1mLFD1ietmJaCWMgAc qGnv/qpW8Syz29gwOJxXSx4w47euYVIH/HIXdg9OkU1iRdqWI4Olj/lrlt4+jFomx6Dx t8/NG+92sw7kL0EdwNrKB4O1IOsOomCsM0OtipWbZ8R9Es3Bh5r/FEr+6HqvWd77CfQI CXNZre7l7/9ENFbFBJDqRmffSIgNlOhK4jxkxAD2Gvf5OGpgMknRP/aMIOUbRmty3fWs 2R1g== 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:to:from; bh=Ee2x0mRoLMhYJ3hg5HgBc52jAXnbsAoLd+DkzqWPUJM=; b=btX+kzQQXhaqfo04ug5JfkQS7bTb/f2FBEjlnFa7hSrd2xIZ99msSsrhWwWVeM/WMd u/4jBYTFvJSLyXfBUpn5Isi+iyBFC8PQc7F2ckxd/zNrFVhJB+NA9JVgRsOGcnBiE0tf nYr0cEq5xoPN9oXjE3IrPI+f4GFE79bsEOSQfwIbvDyZdTbtPvLa6WPzfqXqW3BItAM/ IPxx0PDWNKMt26mYeDC2tzEQZnqkFcMf+U/85RE+BDGI3BDrHly1WVfrecXvgXTKhW2A YCecQY2oK7x93OOtlrIfb2LiU/O5rbdpEhSZf2A2V62V6RuGx48xVEakVNZetWIumGdw RWvg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b11-20020a170906708b00b007801a197a1bsi10941755ejk.449.2022.11.02.02.04.07; Wed, 02 Nov 2022 02:04:43 -0700 (PDT) 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 S229866AbiKBIef (ORCPT + 97 others); Wed, 2 Nov 2022 04:34:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230045AbiKBIed (ORCPT ); Wed, 2 Nov 2022 04:34:33 -0400 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FDBD6359 for ; Wed, 2 Nov 2022 01:34:31 -0700 (PDT) Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 2A28BARc072662; Wed, 2 Nov 2022 16:11:10 +0800 (GMT-8) (envelope-from billy_tsai@aspeedtech.com) Received: from BillyTsai-pc.aspeed.com (192.168.2.149) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 2 Nov 2022 16:34:23 +0800 From: Billy Tsai To: , , , , , , , , , , , , , , , , , Subject: [v3 0/3] Support pwm/tach driver for aspeed ast26xx Date: Wed, 2 Nov 2022 16:35:58 +0800 Message-ID: <20221102083601.10456-1-billy_tsai@aspeedtech.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [192.168.2.149] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 2A28BARc072662 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, 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 Unlike the old design that the register setting of the TACH should based on the configure of the PWM. In ast26xx, the dependency between pwm and tach controller is eliminated and becomes a separate hardware block. One is used to provide pwm output and another is used to monitor the frequency of the input. Therefore, this patch serials implements them by writing the two driver "pwm-aspeed-ast2600.c" and "tach-aspeed-ast2600.c". The former is following the pwm subsystem which can apply the existed driver to controller the fan(pwm-fan.c), beeper(pwm-beeper.c) and so on. The latter is following the sysfs interface of hwmon to creat the node for fan monitor. Changes since v2: - pwm: - Use devm_* api to simplify the error cleanup - Fix the multi-line alignment problem - tach: - Add tach-aspeed-ast2600 to index.rst - Fix the multi-line alignment problem - Remove the tach enable/disable when read the rpm - Fix some coding format issue Changes since v1: - tach: - Add the document tach-aspeed-ast2600.rst - Use devm_* api to simplify the error cleanup. - Change hwmon register api to devm_hwmon_device_register_with_info Billy Tsai (3): dt-bindings: Add bindings for aspeed pwm-tach. pwm: Add Aspeed ast2600 PWM support hwmon: Add Aspeed ast2600 TACH support .../bindings/hwmon/aspeed,ast2600-tach.yaml | 48 ++ .../bindings/mfd/aspeed,ast2600-pwm-tach.yaml | 76 +++ .../bindings/pwm/aspeed,ast2600-pwm.yaml | 64 +++ Documentation/hwmon/index.rst | 1 + Documentation/hwmon/tach-aspeed-ast2600.rst | 28 ++ drivers/hwmon/Kconfig | 9 + drivers/hwmon/Makefile | 1 + drivers/hwmon/tach-aspeed-ast2600.c | 476 ++++++++++++++++++ drivers/pwm/Kconfig | 10 + drivers/pwm/Makefile | 1 + drivers/pwm/pwm-aspeed-ast2600.c | 319 ++++++++++++ 11 files changed, 1033 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/aspeed,ast2600-tach.yaml create mode 100644 Documentation/devicetree/bindings/mfd/aspeed,ast2600-pwm-tach.yaml create mode 100644 Documentation/devicetree/bindings/pwm/aspeed,ast2600-pwm.yaml create mode 100644 Documentation/hwmon/tach-aspeed-ast2600.rst create mode 100644 drivers/hwmon/tach-aspeed-ast2600.c create mode 100644 drivers/pwm/pwm-aspeed-ast2600.c -- 2.25.1