From patchwork Mon Oct 31 10:38:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Billy Tsai X-Patchwork-Id: 908 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2232553wru; Mon, 31 Oct 2022 03:38:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4PvvpXu5ALS513IZbQliZe9+GRAAmaPMFH7Ng9r7niHB+k34kQ5fB1BX01DBZ6zyN5DXzi X-Received: by 2002:a17:907:2672:b0:781:dc01:6c5a with SMTP id ci18-20020a170907267200b00781dc016c5amr12448146ejc.191.1667212690953; Mon, 31 Oct 2022 03:38:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667212690; cv=none; d=google.com; s=arc-20160816; b=JUvQg0Qvq1+3S1Y1xXfzsycMuuOz1Kp4xlB8Tgf8pRG6SWSwMdA1OrIp2l0ODlxz1X R4RGkipEIkAJKvpr2W3qPi1suP9c8QF0zNBvodp5D7DHyRclW8REoyE4tlDoIFH3FCS6 kEw3N9WbvlMaOrPYzyAO3mcVPmD5FHOkcInvnALxF22x97I7ahoE2LTpaEPv9cF1dcP/ dstfiBZ5Pyo3ZkhdxhFCHlox5Vh1puV/U9zaXU7c8N02S/mMj/cvFqoILeo7LqRuWH6Z 2MF9Pg5hBpclz2uYRGrX8FfV1eVdOsHEIbA4ofElFPap0X8240F4UekQGG0lo72ZOq+e GJag== 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=UMi59DiNs8EL6FFf63th7TqkkURCDwnyXeH9mqGI/ug=; b=xffn40CM5zRj3OmTJx3d83C81709TPNsCbmj4ZACxHZFmjQMWq+vUnGviWfCElp02l ieNYj8g8AiBHxt940ndtqpWkxP+W60XsUXVINwmqdKhBLzPwM4baxt/92bZYyQUa81xN 4ItvREKN0Q8UC9hZQRv+ZQdlP5OjRmzBrmratuN7L+4xiUEDa81KgIRNJGBcGYb02U0M gqxpCQw7Ggf0DoLudMQO4NmzmO8qwH/q3jUXAByyD9jVQ1zjZ2lOxheQxlzpUGYxCJhW OyDTekLxyS4vvVayCXxh3wdQEOJAa07YSWNeduBu2jF6IUj7zpGlwsllBZ2fOCqAoM3H RkjA== 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 y12-20020a50e60c000000b0045bdff8a884si6556584edm.268.2022.10.31.03.37.45; Mon, 31 Oct 2022 03:38:10 -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 S229870AbiJaKhG (ORCPT + 99 others); Mon, 31 Oct 2022 06:37:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230024AbiJaKgz (ORCPT ); Mon, 31 Oct 2022 06:36:55 -0400 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F36FBD2FD for ; Mon, 31 Oct 2022 03:36:53 -0700 (PDT) Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 29VADXEh074630; Mon, 31 Oct 2022 18:13:33 +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; Mon, 31 Oct 2022 18:36:38 +0800 From: Billy Tsai To: , , , , , , , , , , , , , , , , , Subject: [PATCH 0/3] Support pwm/tach driver for aspeed ast26xx Date: Mon, 31 Oct 2022 18:38:05 +0800 Message-ID: <20221031103809.20225-1-billy_tsai@aspeedtech.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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 29VADXEh074630 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748199214888796665?= X-GMAIL-MSGID: =?utf-8?q?1748199214888796665?= 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. 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 ++ drivers/hwmon/Kconfig | 9 + drivers/hwmon/Makefile | 1 + drivers/hwmon/tach-aspeed-ast2600.c | 692 ++++++++++++++++++ drivers/pwm/Kconfig | 10 + drivers/pwm/Makefile | 1 + drivers/pwm/pwm-aspeed-ast2600.c | 325 ++++++++ 9 files changed, 1226 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 drivers/hwmon/tach-aspeed-ast2600.c create mode 100644 drivers/pwm/pwm-aspeed-ast2600.c