From patchwork Thu Jun 1 08:51:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Qiu X-Patchwork-Id: 10148 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp159662vqr; Thu, 1 Jun 2023 02:16:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ74cOmB/nADr1J8iN0FuDUr0OA+hpebGDFxHeJCl2Qm6ohQYJrgBMbqavHO69rf6C5z8e24 X-Received: by 2002:a05:6a00:390c:b0:645:ac97:5295 with SMTP id fh12-20020a056a00390c00b00645ac975295mr6666080pfb.9.1685611015244; Thu, 01 Jun 2023 02:16:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685611015; cv=none; d=google.com; s=arc-20160816; b=hgz0ZStBG1Yp94VpgvIW9UXjTbmPr0cf6LaLa+81SY8Qc0WKERi7NgXPByQjk5n40A vmt8mU4SQhQ97tRcpzoes7SUNzbuv3f7oXhIcFaYRDyvSDTX7KtzJvbKLTjbtmHHZUmB JmDETNjosvN9XHVWASWr0AYdV0J6k4nbn4I2S05qrGu5T8bGlKLBl6C/0E0mh/iZu9OQ udrmwu1zAwJM0SJnYfUCgzuCeRLUqdowUEHhnzR4ogKZwy55zDmqry+NWTuvMlmDmlAI ERtBNMrcko/doX5KmEYJrI9oowrFgA+84qk8Vvpqt30TWFngCH51rBKP79/QQwME0JYR 3ntw== 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=1Lyg6hhBg6zqRbHe3MASQVmAVsTaw9UtJDZt2b8KbRs=; b=V+Uxd74LDxJNrNOIOGETeOZt4VdAiFaEH1A3zdPlvadaqY1hBqo601T2KJm1NGQwvE DJlTgalZFhJf5JmDr+LP/wm3wq6NCGPM1N3wCfYqsTGZ1Ss+z0iOnCgutZ0iZ8JcakVj zqrtJeyCa4wHYFuXhLrL9BoGLlfQlzWheUC1g/XWnWhz+nM9axJXn8VzLNHne99kshKa L80hZaj+grQdn0aBfo2wh8J/HvmQzYW37ib1BZcGQnq4HhNYip0tTvSq7WJEQuxiXxy7 3EWb5q2HNw3oZP8Rjd2y60nYpZPkbuj3ljdslfC7QYezDjVkFuDXNNB1WFZ/3KMQX/GC tHpQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h69-20020a638348000000b0053ff5bae4c6si492554pge.514.2023.06.01.02.16.42; Thu, 01 Jun 2023 02:16:55 -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 S232382AbjFAIwH convert rfc822-to-8bit (ORCPT + 99 others); Thu, 1 Jun 2023 04:52:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232314AbjFAIwD (ORCPT ); Thu, 1 Jun 2023 04:52:03 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B64B133; Thu, 1 Jun 2023 01:51:59 -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 3EA9624DC28; Thu, 1 Jun 2023 16:51:56 +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; Thu, 1 Jun 2023 16:51:56 +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; Thu, 1 Jun 2023 16:51:55 +0800 From: William Qiu To: , , , CC: Thierry Reding , Philipp Zabel , Rob Herring , "Krzysztof Kozlowski" , Conor Dooley , Emil Renner Berthing , Hal Feng , William Qiu Subject: [PATCH v4 0/4] StarFive's Pulse Width Modulation driver support Date: Thu, 1 Jun 2023 16:51:50 +0800 Message-ID: <20230601085154.36938-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: EXCAS062.cuchost.com (172.16.6.22) To EXMBX168.cuchost.com (172.16.6.78) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767491256059938543?= X-GMAIL-MSGID: =?utf-8?q?1767491256059938543?= 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 v2->v3: - Rebased to v6.4rc3. - Sorted the header files in alphabetic order. - Changed iowrite32() to writel(). - Added a way to turn off. - Moified 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.4rc3. William Qiu (4): dt-bindings: pwm: Add StarFive PWM module pwm: starfive: 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/starfive,jh7100-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 | 9 + drivers/pwm/Makefile | 1 + drivers/pwm/pwm-starfive-ptc.c | 192 ++++++++++++++++++ 9 files changed, 328 insertions(+) create mode 100644 Documentation/devicetree/bindings/pwm/starfive,jh7100-pwm.yaml create mode 100644 drivers/pwm/pwm-starfive-ptc.c --- 2.34.1