Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp2057140rwi; Tue, 1 Nov 2022 03:22:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Ma8HUn9TeVV39ORTUl2m5GOAb4eLl5LqU5u0XVzeZWONElzjNbd1RSgzX7vB69iDowX/m X-Received: by 2002:a62:1a8d:0:b0:544:1309:19f3 with SMTP id a135-20020a621a8d000000b00544130919f3mr19142487pfa.37.1667298136243; Tue, 01 Nov 2022 03:22:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667298136; cv=none; d=google.com; s=arc-20160816; b=hrCUMNYhNR6TJyWi5I69e2H8+0yGpwqHcxUGm3XKZ7qmvZc/PMzjALAYaYLTgQvRHE p6hgLcZYTCjriUrQFMhKiAWdLdrpuT9uEutvSR/8uFPpUNsc54cD7EmwdyPVO1LWGmPI frfT8PEXlQOcqsfEwwuIXQl3hb8BcT2sR2dSXM8cdRe2nY6NUCm0ovm5TXz0QB9AHizD 0GhjlIWCxQLi5sjeDOGcctRswLvaNtbr6JcFrDE2A7EIMiSVqN4GU0SjhmmMtk5roXV6 uXpAuSfPuPClPEahTowb123W+EcvPiX8qf7v/IaRB/dDJovMkNb+fYxkPUKciyDnjcTy UPrg== 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=Prowbb1gri3JAj05LnzvAcB6UDy230Cw/R9cPWXVOx8=; b=aRGXQ+rxSQdExj8Iz/qproQYC/t6OjmXhv4kvVay3iKwY89QmAZlPWzyXo2gmEBDYg WN+90pf7hKjhcW9kir/NehQFSQhqGDu4l7YP++5lFjPJMtayBuxW+lKVPiFtCml9Y2Gg fQcK2N5HW0LTuQudEBY2KwYLRw4SojvMWL4J2ZOEUHg5uhpVfZSlPX2nANeCffVxhvRV Fm25atLBW5r1tJTP3DQ11YvSV8Wzt06dcb8QUStT4fMnJpGhtEspRvYeZWCFgx0Xqq0O mswJC1kuPLgjjkw6gL7vfDaOLaXv2yAf+475ocKPl0JuDW9jp6AmxA2DV57cr4Fu9XqQ eRZg== 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 y192-20020a638ac9000000b0046b3dce845dsi11367948pgd.470.2022.11.01.03.22.03; Tue, 01 Nov 2022 03:22:16 -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 S230314AbiKAJue (ORCPT + 97 others); Tue, 1 Nov 2022 05:50:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229912AbiKAJub (ORCPT ); Tue, 1 Nov 2022 05:50:31 -0400 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 056CB1900B for ; Tue, 1 Nov 2022 02:50:28 -0700 (PDT) Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 2A19RBEV025158; Tue, 1 Nov 2022 17:27:11 +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; Tue, 1 Nov 2022 17:50:21 +0800 From: Billy Tsai To: , , , , , , , , , , , , , , , , , Subject: [v2 0/3] upport pwm/tach driver for aspeed ast26xx Date: Tue, 1 Nov 2022 17:51:53 +0800 Message-ID: <20221101095156.30591-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 2A19RBEV025158 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 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/tach-aspeed-ast2600.rst | 28 + drivers/hwmon/Kconfig | 9 + drivers/hwmon/Makefile | 1 + drivers/hwmon/tach-aspeed-ast2600.c | 484 ++++++++++++++++++ drivers/pwm/Kconfig | 10 + drivers/pwm/Makefile | 1 + drivers/pwm/pwm-aspeed-ast2600.c | 325 ++++++++++++ 10 files changed, 1046 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