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: 12994133 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 B0805C433FE for ; Thu, 29 Sep 2022 14:05:09 +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=/gPPmCD4yS/fp2Z7UbE+ZmztzuwdpHzhNveTVkuEW8g=; b=qZv927/taHkS+I rY5noDAAbPUmiLZglcrL2Zpew0JKhWqrYgExJpkg9oLSfdQAsrxd3lCgTvZ7mq//L253fzBrLqfcU 99K+V5pt2wwgF2DqnLRcCdwZMbfBGknfUmL4lzc8YN/RYQ1w2BpgVgto3gNcXnO3sTl2EsW7guSk1 4OXRqFv/7LapMfS+4b1JmDI7PojlOUAtfP24dPDrfRl0JDOWzTzs8cnkKVI4qm7c/WXbKT7QquGSb Ua9AUsl4bK2unun2VMooIm67rcQA9VFsGdwpaSQm6PR3fHOnZ91ErmDqKLPIBxutNPhp9wLoe4sKX ayFlQx2gC/SXC/jRpF4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1odu94-003RQf-Sw; Thu, 29 Sep 2022 14:04:11 +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-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=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: 12994134 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 1CF0AC43217 for ; Thu, 29 Sep 2022 14:05:23 +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=4OTnltjWrRrxv+VIUWqZdaBLv+SDzUixs0JCQZnFk4A=; b=Uu/Qahc5NLDpEY b2y/CWmZtiqj6YEi1I8OSscoZADtzYtA9yF8UAGiJ2QeD8OWwavQXvgJb3CBVYpHWoenn//RsljQT 6vG8pob470kJAN46HvfoKn8dGCVqQMtZN7SnwTLDLwYa69rCboAuedNdH/dqowNrGXM6AsMZ7YQ+x mb3frOrlaKnB9/KIVEDYZ1tSu8caxQ+PQlw0wpSdYvf6pk59D0V2qrv8YhpLezCuDAymiexzDjkQN Lbw1BIHw0YDYYgYjfr6rAc6fmnfVEeze5mi7izM+Uhuvw0T+7fGNNhmhZhNQ7C8tDDfYzW7JDhQeA bPRk8AYt6FpSix4stLcQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1odu9D-003RT2-Q1; Thu, 29 Sep 2022 14:04:19 +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-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=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>;