Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4443894rdh; Wed, 29 Nov 2023 01:28:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IEG1ca+T8IHL0abXc85neQCMl+QiL+vRatuScviJLaD98njnh9D3LKerLCq05uLpkXve1Hb X-Received: by 2002:a05:6358:591c:b0:16d:e744:1931 with SMTP id g28-20020a056358591c00b0016de7441931mr17311827rwf.22.1701250080581; Wed, 29 Nov 2023 01:28:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701250080; cv=none; d=google.com; s=arc-20160816; b=WiDHguBhPsy8wLyPvPMDoP6dGC2JWyhmCfb+48F6Hf4VOPHt8+AjMCoS7SUA/0Z8LM 1umL3d+B8shR35bwP9tSeGCdOSEeluul/DyRtctcLXgq/pxzs1Y32gyc0lZA1OFYcp6F ziLF6VzA1l+Mnynl9eAT3TKQANkaa2JmhNj7o7QVBoFMtOxg28Pk3dfNGOl0snvTPKtm LCs1HTt8knqYx4JfXChlBj+jFcEMKoBUHrlnaOz5aEbCBp6f/GI2NbIiPth0xkH8H0dq SOKKUBAJ7BM2uSKFrRlX7cPCHiYl4gog0qPLWqNBFt3+KpIYwpHk8u5lzVznXAhdwI7z k0KA== 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=U5Q1ojHs4Ej9mINslJkmuRgoBWwqFLn1v+LGN9TwqCI=; fh=T4gzk7+hgrXGjSNvKGZTlbuKXCiuDaGkxvCBgfgONjs=; b=qVJWqGzS7eBpHo8pBPUe3+ynVZKMDrqYWQbdnVQk/vwXLDmQJ4fBPgKLL0gFba6moy HMolgbCRfGf7spbORJRFUx1QVPop+/NCv3h9LXIwCKQOJDk5HxBeSd+NKr6EY3uBTtjb xvtaLr8gg6LMuTiPd5MjKuF/wAMZUD3Of9QYNML2oaZTJopXmbwMAt4ByzAbN5t8h968 J3g+x3Uv5ORxUl61Z91+LScuFJs5E0HpVaNShqLLWzMlRY7S3q9b1CFM5f/xlfvtlg3m ZNhZ4FeeC7RPWQQensos/UjSab4hB7v96vO2BiKd78tbWahYATprmYM6uWQbRUs2ki+n OWPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id bz3-20020a056a02060300b005be09a118d3si15577739pgb.143.2023.11.29.01.28.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 01:28:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 044D780C65E8; Wed, 29 Nov 2023 01:27:59 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230168AbjK2J1m convert rfc822-to-8bit (ORCPT + 99 others); Wed, 29 Nov 2023 04:27:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230135AbjK2J1l (ORCPT ); Wed, 29 Nov 2023 04:27:41 -0500 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1100F1BD4; Wed, 29 Nov 2023 01:27:41 -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 ex01.ufhost.com (Postfix) with ESMTP id 18E1B24E2D4; Wed, 29 Nov 2023 17:27:34 +0800 (CST) Received: from EXMBX168.cuchost.com (172.16.6.78) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 29 Nov 2023 17:27:34 +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; Wed, 29 Nov 2023 17:27:32 +0800 From: William Qiu To: , , , CC: Emil Renner Berthing , Rob Herring , Thierry Reding , Philipp Zabel , Krzysztof Kozlowski , Conor Dooley , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , "Hal Feng" , Paul Walmsley , Palmer Dabbelt , Albert Ou , William Qiu Subject: [PATCH v8 0/4] StarFive's Pulse Width Modulation driver support Date: Wed, 29 Nov 2023 17:27:28 +0800 Message-ID: <20231129092732.43387-1-william.qiu@starfivetech.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [171.223.208.138] X-ClientProxiedBy: EXCAS062.cuchost.com (172.16.6.22) To EXMBX168.cuchost.com (172.16.6.78) X-YovoleRuleAgent: yovoleflag Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 29 Nov 2023 01:27:59 -0800 (PST) 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 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.7rc3. 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 | 56 +++++ 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 | 232 ++++++++++++++++++ 9 files changed, 372 insertions(+) create mode 100644 Documentation/devicetree/bindings/pwm/opencores,pwm.yaml create mode 100644 drivers/pwm/pwm-ocores.c -- 2.34.1