From patchwork Thu Sep 29 14:04:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 1684482 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-pwm-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=pP4ha6IQ; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4MdZpy0D7Dz1yqH for ; Fri, 30 Sep 2022 00:04:09 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229780AbiI2OEG (ORCPT ); Thu, 29 Sep 2022 10:04:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234453AbiI2OEG (ORCPT ); Thu, 29 Sep 2022 10:04:06 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20A201577E5; Thu, 29 Sep 2022 07:04:05 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id 13so3033649ejn.3; Thu, 29 Sep 2022 07:04:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:content-language:cc:to:subject:from :user-agent:mime-version:date:message-id:from:to:cc:subject:date; bh=lOIr10qng5aLPZ0etG+Hq+3fdw3/2uRq+u/cuL1bsUo=; b=pP4ha6IQQWSyGXsRFLlusYzCDGnGAoqkhrT0gaC/E/ELqjMzuZ1xCIQObAzd6VtWCz WYVa8gavgTY4U1qICCz2uF837VFbIz2wXktnZhqn4Pa8sRLWiHVatF/SwCy+nj595AOu C6Q8fzDACB64FKeRZE3kNR4TL8ph+t/boPeJXU1ZpCkkZaBSVuQ1eqI5SUrcB9EIUphy htXn2i52Y8eo5Y4lfnTN2KqEbhbkxDE8N/PqOWRKGy5lO7bfKCTRBrnHh/9W5DnLi+/J ObscbDs0p0P95mN893mIR0JC4xdHEfKTYfmBdq8c0Qf6zMZq/2p8ULwumQsEKYh/Z7Vp /HFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:cc:to:subject:from :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date; bh=lOIr10qng5aLPZ0etG+Hq+3fdw3/2uRq+u/cuL1bsUo=; b=xo7weqSHOb+sRaUbCcKSjjBMqxmCCphz5m1LFg7o1/dQOwuEVYPsZ5odhB4qiu7YK3 YQdBzCrInAsqQX2wL+o86ZBKsPWUZuF29SomCMdUhMMDms7eyJBY70wF9md06csvuwwH /DqpIcgWTLcVWuoWacbyj5CZt35ITFbKWLNyu8tZfy4kpIZ/r5VxHgB9YvPiv5bGSYtd TYPrRxwA8biLzGfUqAsR95x5cruni+qWfc9oMB99XgqmENGAY5ugENsUmAe3P1WHKqN6 LPNwNitPUJLjg20GclQt0/L+axW6WrBO19i+U897xtYdvTGecIxqlRQc81uoygAzGABj fPZg== X-Gm-Message-State: ACrzQf14nQH4v3MMtResjWV00EBTugF4/gJmng+j48k8KPiooW35vNNw xzoC7BjG5e4U23yP83Pa6/Q= X-Google-Smtp-Source: AMsMyM5RqEf6W8++5Wd/dZ8xiTnvX4qBJZfJOg/gc26XMHarfk00dJSZvruYtjBdG2kEV798u2we9w== X-Received: by 2002:a17:907:6d03:b0:782:abba:936c with SMTP id sa3-20020a1709076d0300b00782abba936cmr2857513ejc.758.1664460242976; Thu, 29 Sep 2022 07:04:02 -0700 (PDT) Received: from [192.168.2.2] (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id y4-20020aa7d504000000b00456d2721d93sm5411275edq.64.2022.09.29.07.04.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Sep 2022 07:04:02 -0700 (PDT) Message-ID: <94bcb278-7bb9-d173-497c-fe12682c4a17@gmail.com> Date: Thu, 29 Sep 2022 16:04:00 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 From: Johan Jonker Subject: [RFC PATCH v1 1/2] dt-bindings: pwm: rockchip: add interrupts property To: heiko@sntech.de Cc: thierry.reding@gmail.com, u.kleine-koenig@pengutronix.de, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, sebastian.reichel@collabora.com, wxt@rock-chips.com, kever.yang@rock-chips.com, linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Content-Language: en-US X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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-pwm@vger.kernel.org The Rockchip SoCs have 4 or more built-in PWM channels. Configurable to operate in capture mode. Measures the high/low polarity effective cycles of this input waveform Generates a single interrupt at the transition of input waveform polarity Configurable to operate in continuous mode or one-shot mode. One-shot operation will produce N + 1 periods of the waveform, where N is the repeat counter value, and generates a single interrupt at the end of operation. Continuous mode generates the waveform continuously and do not generates any interrupts. Older SoCs have an interrupt for each node. Newer models share an interrupt. Add interrupts property to the pwm-rockchip.yaml file. DT describes hardware. Rockchip PWM driver support for interrupts might not available. Signed-off-by: Johan Jonker Acked-by: Rob Herring --- Documentation/devicetree/bindings/pwm/pwm-rockchip.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/pwm/pwm-rockchip.yaml b/Documentation/devicetree/bindings/pwm/pwm-rockchip.yaml index f2d1dc7e7..f7634069d 100644 --- a/Documentation/devicetree/bindings/pwm/pwm-rockchip.yaml +++ b/Documentation/devicetree/bindings/pwm/pwm-rockchip.yaml @@ -37,6 +37,9 @@ properties: reg: maxItems: 1 + interrupts: + maxItems: 1 + clocks: minItems: 1 maxItems: 2 From patchwork Thu Sep 29 14:04:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 1684484 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-pwm-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=AsbbTHW/; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4MdZq32sngz1yqH for ; Fri, 30 Sep 2022 00:04:15 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234453AbiI2OEO (ORCPT ); Thu, 29 Sep 2022 10:04:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235089AbiI2OEK (ORCPT ); Thu, 29 Sep 2022 10:04:10 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63AE115D653; Thu, 29 Sep 2022 07:04:09 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id sd10so3058690ejc.2; Thu, 29 Sep 2022 07:04:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:content-language:cc:to:subject:from :user-agent:mime-version:date:message-id:from:to:cc:subject:date; bh=aaTqeDdRO+djhzLgpWsYFsBYnZe7c1ZyDlDKq9kjNlM=; b=AsbbTHW/qkgPUXo6+GibyYTqC/UvT11BzBBoZ7djQe4SKUDh8YwZbXI89PHugMfbNm 1egcxR39HYIKiFXIrgH7hhOa6nkR1mMQcU3nYCkmyFLoecJxsKcajd/3Z7aqKOUB1XLg 7hcQua+I953Nx/QUnjkWlCQFKpbpMFFYEgvhesUy7OrLMYzXpxdXGWdNkiv1lOPSmfa5 JwZYI/h4SzIcgPDHa3nVqak44JL+CQj1bmURpsV0KnEGzOD2SGnXuZFBtrs2IDxyvXA4 0SiPs4WMCvmeCL/jH63Wk3DxAwZHVj/FpnIPrbrjCYhquvEePHqmYkBpmxkhtAl7AfXi +ObA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:cc:to:subject:from :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date; bh=aaTqeDdRO+djhzLgpWsYFsBYnZe7c1ZyDlDKq9kjNlM=; b=bHbsKFnilyHhyiet2g3OhdKuNeVpbkY1jtcghdQqn3izMElaU4RAzcncomGAq7zNLu WhpnSdI3JSrjzlfgnVf0bQY1ZV7VbjBcIm9bpitohbER/a4+qqkJpo5BUn43G5WrzwCz 5A/mNf+KFWxjZOJxwjSk+TBsoEAvGQ1iG/iZ4GXz6M3N4mtea9M4fyxYg1o9G9XHYqMu Q3g/+a8u1SyUCzSJyhJneGm+K7uO6uHZZ58MG55KqgwihXLY24RGhFsm1qcgyx+HcU59 IKyQVIeFhqkaRWQXLjrthCTVC3T22qdSypJB5Piq386N76A7FZ8VFoiuhCN+Q65UfOfm EALA== X-Gm-Message-State: ACrzQf0jeeb3ey+xO11OD6EuSC+O8TZ2/+Gy1Peq7m8oQFSqRLJfYW8S Sf7qig+v+udk/XM20cme4YM= X-Google-Smtp-Source: AMsMyM6J1MsnlGw55LN2xdQKGrcd4z5IXbVJSVMbllTOO4YiYid0p3lSXe8daZsBKfE9a5aoQ6rRWw== X-Received: by 2002:a17:907:808:b0:730:54cc:b597 with SMTP id wv8-20020a170907080800b0073054ccb597mr2831906ejb.434.1664460247776; Thu, 29 Sep 2022 07:04:07 -0700 (PDT) Received: from [192.168.2.2] (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id d7-20020aa7c1c7000000b0045726e8a22bsm5554595edp.46.2022.09.29.07.04.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Sep 2022 07:04:07 -0700 (PDT) Message-ID: <6eba6c10-9c96-b40f-937a-e02d43b04cd7@gmail.com> Date: Thu, 29 Sep 2022 16:04:06 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 From: Johan Jonker Subject: [RFC PATCH v1 2/2] ARM: dts: rk3288: add the interrupts property for PWM To: heiko@sntech.de Cc: thierry.reding@gmail.com, u.kleine-koenig@pengutronix.de, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, sebastian.reichel@collabora.com, wxt@rock-chips.com, kever.yang@rock-chips.com, linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Content-Language: en-US X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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-pwm@vger.kernel.org The Rockchip rk3288 SoC has 4-built-in PWM channels. Configurable to operate in capture mode. Measures the high/low polarity effective cycles of this input waveform Generates a single interrupt at the transition of input waveform polarity Configurable to operate in continuous mode or one-shot mode. One-shot operation will produce N + 1 periods of the waveform, where N is the repeat counter value, and generates a single interrupt at the end of operation. Continuous mode generates the waveform continuously and do not generates any interrupts. Add interrupts property to rk3288 PWM nodes. Signed-off-by: Caesar Wang Signed-off-by: Johan Jonker --- Original patch location: ARM: dts: rk3288: add the interrupts property for PWM https://github.com/rockchip-linux/kernel/commit/16b7b284618d1652e694f6286f575ce82f5f03e5 --- "rockchip,rk3288-pwm" is in use as fall back string for Rockchip SoCs with combined PWM interrupt. --- arch/arm/boot/dts/rk3288.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi index 487b0e03d..1223aa369 100644 --- a/arch/arm/boot/dts/rk3288.dtsi +++ b/arch/arm/boot/dts/rk3288.dtsi @@ -675,6 +675,7 @@ pwm0: pwm@ff680000 { compatible = "rockchip,rk3288-pwm"; reg = <0x0 0xff680000 0x0 0x10>; + interrupts = ; #pwm-cells = <3>; pinctrl-names = "default"; pinctrl-0 = <&pwm0_pin>; @@ -685,6 +686,7 @@ pwm1: pwm@ff680010 { compatible = "rockchip,rk3288-pwm"; reg = <0x0 0xff680010 0x0 0x10>; + interrupts = ; #pwm-cells = <3>; pinctrl-names = "default"; pinctrl-0 = <&pwm1_pin>; @@ -695,6 +697,7 @@ pwm2: pwm@ff680020 { compatible = "rockchip,rk3288-pwm"; reg = <0x0 0xff680020 0x0 0x10>; + interrupts = ; #pwm-cells = <3>; pinctrl-names = "default"; pinctrl-0 = <&pwm2_pin>; @@ -705,6 +708,7 @@ pwm3: pwm@ff680030 { compatible = "rockchip,rk3288-pwm"; reg = <0x0 0xff680030 0x0 0x10>; + interrupts = ; #pwm-cells = <3>; pinctrl-names = "default"; pinctrl-0 = <&pwm3_pin>;