From patchwork Sun Nov 24 17:29:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 11259237 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6467A913 for ; Sun, 24 Nov 2019 17:30:12 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3CF25207FD for ; Sun, 24 Nov 2019 17:30:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Xobyrs86"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="vND+AQHe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3CF25207FD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From: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=HytQkdBIoq5Y0yV0mZQmUsbrel1E4c+VTDsq9CG9Oek=; b=Xobyrs86Ftq7Vu 56C0IAlyffk7exR7ctSTG0UMXqkmRSTkIQYcD5iyRgp9VFSABtOFYI6vfykudoBEdKwtT6+LHlwMX 0CzqvQVFmrMsXPF91QvXx9ZexIefldTvXuF48lnmtzahlorw27dhn48ly0DdmtRpMbBNMOV7zEJU7 /nNPX2eqnfsF/DQpU6DIctVN6BerpomOMX4W8GDzwdGC/vpi6AV/+f+OXrlx7jomHg90sQHpHsaih I6zbYQzWspr2JwjVIGmKM2jTw0bqAeGlJomip8greIlCyPwdRCtXXF+KYgVTlYXAAfAeA8wLr0pPs uzs1ykZrxYlXXji9H/Eg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iYvi2-0004tZ-Li; Sun, 24 Nov 2019 17:30:06 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iYvhy-0004Zp-6I for linux-arm-kernel@lists.infradead.org; Sun, 24 Nov 2019 17:30:03 +0000 Received: by mail-wr1-x444.google.com with SMTP id b18so14667501wrj.8 for ; Sun, 24 Nov 2019 09:30:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uGgPipfEFZWFwRwOJjgrASaTd0TQYkmoA4Tjo4oBFUc=; b=vND+AQHeVrhINFZ4UDVHu58t/f+qBqUvbP7TqVB3/0goOOJCe8I2oR7GT1/p+RN5/E WxN2vQ9j0KfPfEYNuAPQT+kTxt6FE2XTlFQJLoH+FYwMyzX7bffYruhqjklwBb+arxjw KIW7ED5yJnXpGr5l3MX8b9v7xm4I4iwMtm1tw24mY4FoIk2ezPzNJ8s65Kz8iHRBcflm QbD/DCVmTfkob2TTDwsGfi4dBcoq7TOi2vwYgu1aO5sp1OaHiz15B62BK/PMVugLz15K zHo/qk/WgWPiG3Yc10JGL153B/mda+vShSnfzFKOOer5XG0NPWcq4+trXvs8yP/6UfmY jc5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uGgPipfEFZWFwRwOJjgrASaTd0TQYkmoA4Tjo4oBFUc=; b=Sq6qvGPZbAo6sEh+ddP1T2mtkQ9E6bCpBXkwsR87AH4nO2z8H+ACa1fL1pK4CQAcE9 j73Nlj61d9Nx1P1C/Pe9RXrHc6au5x2E2aE9Ego1j1FY0N6qtQ3tRyCmvQiy29uwkFYT ip5yKdZACHAEA0aEdd3zK8D9uV03jzyf17/3RBheT9dvs1oINpISu8IyPYjUh18QLgKZ 3o1jlAMbCxbQnQGyOiQLyrKy4qT0yvr8qnXE3FFHE9TduKYcibSpq83MBAWgRtBtVvOX 3JrCCgRgOI74HHspDLM0OAZzc/Dfj+mhD2DqMXcpUIxhimo5CCufuIenZtYZXNCxt/uE MY9A== X-Gm-Message-State: APjAAAWder7EpWlfm1vNt5IL7vh8USWommuwGRyBWBYsq1EWv57zrM5B 5vWhkoSMyiCTGEhswqGHQN8= X-Google-Smtp-Source: APXvYqzCaeqjuWWepuHVZDNLDDp3b8VLbgpBzaodvuX34Rg653xyvG74z8MdFcuL0oOfDoO2AS4FHQ== X-Received: by 2002:a5d:5484:: with SMTP id h4mr25794215wrv.136.1574616598780; Sun, 24 Nov 2019 09:29:58 -0800 (PST) Received: from localhost.localdomain ([2a01:e0a:1f1:d0f0::4e2b:d7ca]) by smtp.gmail.com with ESMTPSA id n13sm5537275wmi.25.2019.11.24.09.29.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Nov 2019 09:29:57 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Thierry Reding , =?utf-8?q?Uwe_Kleine-K=C3=B6n?= =?utf-8?q?ig?= , Maxime Ripard , Chen-Yu Tsai , Philipp Zabel Subject: [PATCH v9 0/6] Add support for H6 PWM Date: Sun, 24 Nov 2019 18:29:02 +0100 Message-Id: <20191124172908.10804-1-peron.clem@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191124_093002_262313_88E769F3 X-CRM114-Status: GOOD ( 17.94 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (peron.clem[at]gmail.com) 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-pwm@vger.kernel.org, linux-sunxi@googlegroups.com, =?utf-8?b?Q2w=?= =?utf-8?b?w6ltZW50IFDDqXJvbg==?= , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Hi, This is a rework of Jernej's previous work[1] taking account all the previous remarks. Bindings is still strict but probe in the driver are now optionnals. If someone could confirm that the PWM is not broken, as my board doesn't output it. Thanks, Clément Jernej's cover: Allwinner H6 SoC has PWM core which is basically the same as that found in A20, it's just depends on additional bus clock and reset line. This series adds support for it and extends PWM driver functionality in a way that it's now possible to bypass whole core and output PWM source clock directly as a PWM signal. This functionality is needed by AC200 chip, which is bundled in same physical package as H6 SoC, to serve as a clock source of 24 MHz. AC200 clock input pin is bonded internally to the second PWM channel. I would be grateful if anyone can test this patch series for any kind of regression on other SoCs. [1]: https://patchwork.kernel.org/cover/11061737/ Changes in v9: - print error code in error message - no capital letter to keep coherency Changes in v8: - Display error return code - split commit - bypass is false if unsupported - return instead of goto Changes in v7: - Fix indent in Yaml bindings Changes in v6: - Update git commit log - Distinguish error message Changes in v5: - Move bypass calculation to pwm_calculate - Split mod_clock fallback from bus_clk probe - Update comment - Move my SoB after acked-by/reviewed-by Changes in v4: - item description in correct order and add a blank line - use %pe for printing PTR_ERR - don't print error when it's an EPROBE_DEFER - change output clock bypass formula to match PWM policy Changes in v3: - Documentation update to allow one clock without name - Change reset optional to shared - If reset probe failed return an error - Remove old clock probe - Update bypass enabled formula Changes in v2: - Remove allOf in Documentation - Add H6 example in Documentation - Change clock name from "pwm" to "mod" - Change reset quirk to optional probe - Change bus_clock quirk to optional probe - Add limitation comment about mod_clk_output - Add quirk for mod_clk_output - Change bypass formula Clément Péron (2): pwm: sun4i: Prefer "mod" clock to unnamed pwm: sun4i: Always calculate params when applying new parameters Jernej Skrabec (4): pwm: sun4i: Add an optional probe for reset line pwm: sun4i: Add an optional probe for bus clock pwm: sun4i: Add support to output source clock directly pwm: sun4i: Add support for H6 PWM drivers/pwm/pwm-sun4i.c | 187 +++++++++++++++++++++++++++++++++------- 1 file changed, 156 insertions(+), 31 deletions(-)