From patchwork Fri Dec 8 09:42:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Qiu X-Patchwork-Id: 17744 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp5345271vqy; Fri, 8 Dec 2023 01:42:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IF04iD9TtaivC/ta+Hkh1AQfpxfUE5WlGkuUC7wO8EBsBFz9zq3Vl2Dhl1qQcRGPskR2Hi8 X-Received: by 2002:a05:6358:2786:b0:170:4322:4040 with SMTP id l6-20020a056358278600b0017043224040mr4338366rwb.17.1702028569438; Fri, 08 Dec 2023 01:42:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702028569; cv=none; d=google.com; s=arc-20160816; b=iwX3kuYI03PoXroBTnimBn5+H2T13SOCp+1mcOwlBdnKW7tEx/yfV80aOKoEN0lIEq e3Zi1DOmMF5cUSeffCMzyZfq2cXW/V2tz0frtmewW0TyRvRX0QB3QSdHbRYBBOCp87mc jaT9gQGKNp/kD3xDEY80Q5Wi2njN8w/Y3Nr7MEsX6hQYdpraXo+aPCRobVS3ad9ftsUA 8P/UHgoO8CtjSK7sT/OKQSIVxl/f0oOcwArvEBMn4lmCIofAkxG6YH7nXhH1Q56O50ma fLQd381SitHmXJLMcj2JS45GsB1fLMQMRtTFuBakj1f3JQlKwHouaAE13VVvL0+1T/1w RFpA== 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=mkMp3jnawY4BBwiVVswpbMQPBokC1TXMbrLqkdJqZ50=; fh=T4gzk7+hgrXGjSNvKGZTlbuKXCiuDaGkxvCBgfgONjs=; b=Nbpywybr/R6HiR2luPZumm29Qkok+ojxAoSmSXfg0g0IuXPnggVR1ZZidHO/BCGydM EqAv0n14+t+8tiLtQKUxlJFoJBCTjs6SIcOTLU50ZMo2PGQnRmyhv6MeYg4dNDwBYzc8 tYul+hQAjRkaenidJzKiwgCwoNtaP/6b5U2e6QHj0i42K1Ssh5gy0Yf6O8h/FUcmTEKf YcCczEYNE3vIrvw6NRZWZ69gG4Lqsl3XJdDgdusGqyaCFWYS8hOh0gG5Dq12R9ZIC08g LgN4bMvPD8Q/rS1/uVlI0+gwheuqN4xsI+vYeqtqVaW7lTaU4ijkuuNi6KKPSAZQpYpz mc7Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id d3-20020a056a00244300b006cd989cfe57si1268105pfj.195.2023.12.08.01.42.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 01:42:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id E87FE8184A82; Fri, 8 Dec 2023 01:42:45 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235865AbjLHJmZ convert rfc822-to-8bit (ORCPT + 99 others); Fri, 8 Dec 2023 04:42:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233242AbjLHJmO (ORCPT ); Fri, 8 Dec 2023 04:42:14 -0500 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B2F390; Fri, 8 Dec 2023 01:42:15 -0800 (PST) Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 4E9A317F43; Fri, 8 Dec 2023 17:42:11 +0800 (CST) Received: from EXMBX068.cuchost.com (172.16.6.68) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 8 Dec 2023 17:42:11 +0800 Received: from williamqiu-virtual-machine.starfivetech.com (171.223.208.138) by EXMBX068.cuchost.com (172.16.6.68) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 8 Dec 2023 17:42:10 +0800 From: William Qiu To: , , , CC: Emil Renner Berthing , Rob Herring , Thierry Reding , Philipp Zabel , Krzysztof Kozlowski , Conor Dooley , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , "Hal Feng" , Paul Walmsley , Palmer Dabbelt , Albert Ou , William Qiu Subject: [PATCH v9 0/4] StarFive's Pulse Width Modulation driver support Date: Fri, 8 Dec 2023 17:42:05 +0800 Message-ID: <20231208094209.1910934-1-william.qiu@starfivetech.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [171.223.208.138] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX068.cuchost.com (172.16.6.68) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 08 Dec 2023 01:42:46 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784706308928376691 X-GMAIL-MSGID: 1784706308928376691 Hi, This patchset adds initial rudimentary support for the StarFive Pulse Width Modulation controller driver. And this driver will be used in StarFive's VisionFive 2 board.The first patch add Documentations for the device and Patch 2 adds device probe for the module. Changes v8->v9: - Rebased to v6.7rc4. - Updated the bindings format. - Dropped removed() interface. Changes v7->v8: - Rebased to v6.7rc3. - Changed compatible to "opencores,pwm-v1" - Adjusted the clock unprepare order. - Followed dt-bindings Coding style. Changes v6->v7: - Rebased to v6.6. - Added dependency architecture. - Adopted new rounding algorithm. - Added limitation descripton. - Used function interfaces instead of macro definitions. - Followed the linux coding style. Changes v5->v6: - Rebased to v6.6rc5. - Changed driver into a generic OpenCores driver. - Modified dt-bindings description into OpenCores. - Uesd the StarFive compatible string to parameterize. Changes v4->v5: - Rebased to v6.6rc2. - Updated macro definition indent. - Replaced the clock initializes the interface. - Fixed patch description. Changes v3->v4: - Rebased to v6.5rc7. - Sorted the header files in alphabetic order. - Changed iowrite32() to writel(). - Added a way to turn off. - Modified polarity inversion implementation. - Added 7100 support. - Added dts patches. - Used the various helpers in linux/math.h. - Corrected formatting problems. - Renamed dtbinding to 'starfive,jh7100-pwm.yaml'. - Dropped the redundant code. Changes v2->v3: - Fixed some formatting issues. Changes v1->v2: - Renamed the dt-binding 'pwm-starfive.yaml' to 'starfive,jh7110-pwm.yaml'. - Dropped the compatible's Items. - Dropped the unuse defines. - Modified the code to follow the Linux coding style. - Changed return value to dev_err_probe. - Dropped the unnecessary local variable. The patch series is based on v6.7rc4. William Qiu (4): dt-bindings: pwm: Add bindings for OpenCores PWM Controller pwm: opencores: Add PWM driver support riscv: dts: starfive: jh7100: Add PWM node and pins configuration riscv: dts: starfive: jh7110: Add PWM node and pins configuration .../bindings/pwm/opencores,pwm.yaml | 55 +++++ MAINTAINERS | 7 + .../boot/dts/starfive/jh7100-common.dtsi | 24 ++ arch/riscv/boot/dts/starfive/jh7100.dtsi | 9 + .../jh7110-starfive-visionfive-2.dtsi | 22 ++ arch/riscv/boot/dts/starfive/jh7110.dtsi | 9 + drivers/pwm/Kconfig | 12 + drivers/pwm/Makefile | 1 + drivers/pwm/pwm-ocores.c | 229 ++++++++++++++++++ 9 files changed, 368 insertions(+) create mode 100644 Documentation/devicetree/bindings/pwm/opencores,pwm.yaml create mode 100644 drivers/pwm/pwm-ocores.c --- 2.34.1