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: 12994131 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 126F8C433F5 for ; Thu, 29 Sep 2022 14:04:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:From:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=+IlgstMYoTy6qK6jd0UFaDY5iu55fN5xZvV6vXtOFFI=; b=DOu2Za/TAPxXTI VZbe9Ed+GbtbxCu568zMJIuNTPXblExXv4ex7OPbO4CFQDDUD4ZKE0Zmf2PWwG6Ocrky4Vb36GYSW DP6D400HAyiyhh493lokwkkJ3g7SdqOduAT+rINNyk7vABWCItGN1TZRpP9IqunaXgCrr9PeMi91n KcSuszCJk4/P6ud43F2IuGF3h1X286p2o6vo95Xeu9M4N6p2tGr0RMzENFg1Rb5HRL1bROIXQrji8 hdsF4rDVJlH+PBqXt0qAkQ6je7dhIBQiyDDm0HzCBsfgrECBrxij0q3n5huSCVUps1iX5xi8djcpS o5xhkDHNWbHBZ2MU7DAg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1odu9D-003RSt-2T; Thu, 29 Sep 2022 14:04:19 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1odu91-003ROR-9E; Thu, 29 Sep 2022 14:04:08 +0000 Received: by mail-ej1-x629.google.com with SMTP id bj12so2977800ejb.13; Thu, 29 Sep 2022 07:04:04 -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=ak9KlJGEtoKSiTVgqU95TZGjamrLHhrlqTWC98IWcG7n5FuI6lI9i5f+3ymtxP0uic t64N4+UkawPoLXg9VGXGTvDXjQdX70hQjlSnTMk9CSKvQbg5M0+ttF+Zj7AndX5wHCD4 EdDW2IzkbVs3F2eZ35eqoybGf2bp8H7cNvUZd+SxGDhALkVUtGvHt1zOIqmvhxl8eu+G XVfSoyGYk3DX+XyQUdKaotWmE9/0ShPGFcU8jh0Pf9jg+VeM2Qb+h+6/4qHiQXr6VW/o pOuuV+yuRThznwZw2HQfqF9R2m7J17ptpxtuFO6joU7DQQaRBH22FLcRL6HWPfhkt+9e FpAw== X-Gm-Message-State: ACrzQf1XYV/7B1/4sJGGMMnoYc1qT27+C+NytpNnOCTkZ4ngxJQkqk2K 6zyqfpU96dJ53GgNpaWdqd8= 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220929_070407_353630_EAAF4B3D X-CRM114-Status: GOOD ( 10.13 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.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: 12994132 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 89DE9C433FE for ; Thu, 29 Sep 2022 14:04:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:From:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Lr2oL4/WSDzmSFeOb5j33TyqDGgjIhMHT3b/HxJfqUU=; b=PVwEhK1tn59e5R oTbNppUvaUUcmFUdeTz70SNIGscU7X158b6EG4sUgfd3Qzwyg4EOrDrMro7bVsR+chFHI51nBIF1c H3QfngLSw5ZztpUWGESSj0np8Si6USsOIAx+L67lOz+lJtev4BYN0MhuP4y5XEq/41VCWjdYZuCWo IKZq0J87Vdiq6u0VpOUuBRB3GDA63eIyU8HwfaZ9Gkk1iB89EyeVnhIcNJajz/udZ2dmxIVs11Ukj gE4ds2KJPc9Jo4WCjw/4j19IGxRnGeBSEwRYUoXZDxudgDTkjiXbrUYZo2ddLnRxpwW9SQKwnePTj E82o+wg/8Itk3QfB8OaQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1odu9L-003RVC-Pg; Thu, 29 Sep 2022 14:04:27 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1odu94-003RPh-TJ; Thu, 29 Sep 2022 14:04:12 +0000 Received: by mail-ej1-x632.google.com with SMTP id hy2so3005063ejc.8; 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=ah4EqlTUz8WLmMU6+GXu5qmF8cKDN6ifQv+XEIX7DtiNQG4KxRVT0Hb3676st6VdAS Z75/B9Uh13LSjk03wmPChhu7AEQLGYlDYQ4gk4RgaI3oTRwwu4ESx1p2P16QPa1yi7mm ktskQP8MorwY6N3026NyJPOKTN8v6YxfmoJOj9oyyg3dAzJ5dNm2EshYlPNJiQPvsIeZ NqsCpMy5Biwo1pDNvudcnC9JJbOXtchJ8zm2KDAIA5vAFZSXBcSZI2IR4YLTyNn7vN2A uXcy7fzNZIf2byzsxOIxisXMZApKkNbfJbcBCPl3N6JGCeq4KgonJgv58OOq/Uwrli2j XKFg== X-Gm-Message-State: ACrzQf0tT3WuGfxjkOixZOEf1YTuv0/6bbjGX2a9lAMNVyN1XfTPltt/ LLjLB0Ap2GbdceQsJzeTtMs= 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220929_070410_987636_A741DC9F X-CRM114-Status: GOOD ( 10.31 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.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>;