From patchwork Fri Oct 20 10:37:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Qiu X-Patchwork-Id: 15671 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp960566vqb; Fri, 20 Oct 2023 03:38:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGYmPAyc/tl7AjrrlHmrdbrC/v+J3XoCQQdZ3S/Pd3IkKFxoaDe4yayvQ2NBTLTVYUIMLBl X-Received: by 2002:a17:903:41c9:b0:1ca:a07b:361 with SMTP id u9-20020a17090341c900b001caa07b0361mr1398017ple.19.1697798291068; Fri, 20 Oct 2023 03:38:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697798291; cv=none; d=google.com; s=arc-20160816; b=jGZAhryHDDT7h0fGG63UenyeVrl4Jm0Xp8D980z4bb7Y2kOj+YIW7bH+eR56XRj31M TaSVlgQZL3AKcXUyjEc+WFaCTVpz86ZlhVcgiMdloo7f/CZSAteBGgRrDDBdBfT2kWpE +vfvO8FFl55jYkHobyCaCI1o/Ufjz/i7qVerhT5nRXOBcsPzI0Bo0JdfiVE7m1dg+M+g yHxse4TzTVBQkpxYrKTNWsRXxxnmYWrrchqAylf8aI5NNZMIaHQ3JWC0jS6SagWr5fHK pTOG4tbp4uyo4O48InXWX1R9KD3cpmBPmqgeRMA0Ub3p0VDho2+kag0nUKwMnTfFBxJx JA8g== 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=CIFy6tMUHs/SWQUrRq3/TlaWCxezGhYW4TpeDDq884I=; fh=T4gzk7+hgrXGjSNvKGZTlbuKXCiuDaGkxvCBgfgONjs=; b=rHbGBU7IqbB/HZRP16BhkUkkOXqSMCJSW0YjnoO0ntPzHgi6ptvps7oxOF5+wFG17V JTbj17cVr3RFFox0ewyhsGi2QFYh8Vb0jceXjyDviKdhituT96VP8n2O2hvpRdsQdiJh PNfgyLo04bKt/fRKNiITFrgR8QtuPMR6Wl8xzIPkQOjcerdSMZXaaXgj16I9JvrfgS2R 8sKAMhYgBCjIGoe4oD+dhEyJstjEsyBP3QPgjT3dRSOGOJ1gElvKFQWGmawzSRBoYc8T 8FczdwDZRZMNUeCzIPWKsqKj7nCXArlYtih8k0fnuG3mNi67IxwzGqLh/4+L2Eje2HuU VmWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id g19-20020a170902869300b001c9c733c422si1465791plo.95.2023.10.20.03.38.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 03:38:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id 85562826E3AD; Fri, 20 Oct 2023 03:38:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376962AbjJTKhw convert rfc822-to-8bit (ORCPT + 25 others); Fri, 20 Oct 2023 06:37:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376857AbjJTKht (ORCPT ); Fri, 20 Oct 2023 06:37:49 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47B39D5B; Fri, 20 Oct 2023 03:37:46 -0700 (PDT) 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 A854424E0F6; Fri, 20 Oct 2023 18:37:43 +0800 (CST) Received: from EXMBX168.cuchost.com (172.16.6.78) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 20 Oct 2023 18:37:43 +0800 Received: from williamqiu-virtual-machine.starfivetech.com (171.223.208.138) by EXMBX168.cuchost.com (172.16.6.78) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 20 Oct 2023 18:37:42 +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 v6 0/4] StarFive's Pulse Width Modulation driver support Date: Fri, 20 Oct 2023 18:37:37 +0800 Message-ID: <20231020103741.557735-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: EXCAS064.cuchost.com (172.16.6.24) To EXMBX168.cuchost.com (172.16.6.78) 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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Fri, 20 Oct 2023 03:38:08 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780270540819619870 X-GMAIL-MSGID: 1780270540819619870 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 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.6rc5. William Qiu (4): dt-bindings: pwm: Add OpenCores PWM module pwm: opencores: Add PWM driver support riscv: dts: starfive: jh7110: Add PWM node and pins configuration riscv: dts: starfive: jh7100: Add PWM node and pins configuration .../bindings/pwm/opencores,pwm-ocores.yaml | 53 +++++ 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 | 11 + drivers/pwm/Makefile | 1 + drivers/pwm/pwm-ocores.c | 211 ++++++++++++++++++ 9 files changed, 347 insertions(+) create mode 100644 Documentation/devicetree/bindings/pwm/opencores,pwm-ocores.yaml create mode 100644 drivers/pwm/pwm-ocores.c --- 2.34.1