Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2222743rdb; Fri, 8 Dec 2023 01:42:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IFT6om2LkPbwBm8MJCjIqYN2/bJ2SEWD8Yv/nrGEx+BV/M5JxBWTO7huJjdMCn0BOSUiiCK X-Received: by 2002:a05:6a20:6aa0:b0:18b:4632:af0b with SMTP id bi32-20020a056a206aa000b0018b4632af0bmr3782395pzb.17.1702028573040; Fri, 08 Dec 2023 01:42:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702028573; cv=none; d=google.com; s=arc-20160816; b=FcR4T3J4fTsnu/sY773Z99d24vkvA+NrDv66vCLvGXG3aiJoJjbgSFHGfouwbWolv2 Ew0DFwisao08pG3UP24Ldwz2Q3InunMGCQB3xBweP4OiIfivWFPqUceZdrWF/bzyEKQC OqFMOhQuMH+GmxIHXcX4Th0ibhf5G8/4raBNlm363+mqvxubRq+MaIN6SoGGBLcmUtev 0o7k8KDpOklk0K5aHep34sqFbtED5b1yk+eT0AU42+9DXCssjJm9KDmWM02u+dkYACNb BIpfxYikACaua6yy9XEGqtBu4Lqrx2s+FlGGROcevnppuqLOD+zZaNG3/ZIB3GECBPxP Lq9w== 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 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id q9-20020a63f949000000b005c1cc7273bcsi1290515pgk.731.2023.12.08.01.42.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 01:42:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 6245C818452C; Fri, 8 Dec 2023 01:42:50 -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=20Kleine-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 Content-Type: text/plain 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 Content-Transfer-Encoding: 8BIT 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:50 -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 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