From patchwork Fri May 31 14:11:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hironori KIKUCHI X-Patchwork-Id: 13681736 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 1AEBBC25B7E for ; Fri, 31 May 2024 14:12: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:MIME-Version:Message-ID:Date:Subject:Cc :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=vt3SXadjf8CNwCfpXZNBXlNvjszU7pcR3Lz6FbHp2nQ=; b=oH7T3nZk3j2aya 885Cx6FEw11XTKxtNtE8Jazk5nisYndy6B81bvJFuWR0/7xPOdpDuxi049LIoucGksdfUQLwXZKet u35bn1HWpXl8E53OIkEw37LnQLUMILNywofS5zABReNCfYryiMOUW8XjHO6K+DIqPGE86P08Ux9Gt 8ec+FBCRmzzzaP13lXJ5nhv3uqYlRh8fduXUsd3Jv/cE0/EoPZ+y2Vo7aYFmy5qm67J+RbD0Ae6B5 teSGA9yx1gV7czFLLNz8EFDfZmyKNoDN5WAw440DQC8DM/SdbI384fqYZ6O7Ij7morq8ktcTE99Dy 7pNO04I3RClK4W58R2KA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD2zS-0000000ASlF-23U2; Fri, 31 May 2024 14:12:18 +0000 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD2zQ-0000000ASkn-0LAs for linux-arm-kernel@lists.infradead.org; Fri, 31 May 2024 14:12:17 +0000 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-70249c5fb36so544091b3a.2 for ; Fri, 31 May 2024 07:12:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717164734; x=1717769534; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Ykvp/0wm2JKYn1VhbfeNlnxDMxT2k1KfiM797oH+i0A=; b=VadQnbVj5nMid+hgLW+dAntcmJuQmqAAChb5+a0WzvrT0xEov7/GBGD8liI6GeBmx/ hM4IO+BxceKxNEgrDkB9i+0l8y/rU8Fqgk+Fp+3nLVu6jbKut+CHqddQ2UIPT8O28TSv bHQAurVCCT4eudtbpvNk94wMsfLxf1p4Q3SauiqH9x1QyO2sxFmgXWjPLrTIfchVIRKt 159pVAsZnDs/NqyJOw61s2LikT5MAs8J+8EEEu4ceF2En48vzk2kNHqvTe+9rYH4v+sb y+j7TjmYFU5LeM5J9hmv3S8nNDEPJU96juiKoy31+1sj+K95i5PxsRDRmQiUeMqfMm6Z QLPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717164734; x=1717769534; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ykvp/0wm2JKYn1VhbfeNlnxDMxT2k1KfiM797oH+i0A=; b=nImq2tF84GzhOkrnxNfKgYxFlwLMG8rdzT0JT9Ow762PDkh5OXTQCw0vqmBTxzVJo4 5FycGdHICDPGMJCEVsnbWY7uDfOIyuJpg4dGomRWGm583dwk6hUsLEPSO0+74x3qJxgX qEApoUcStlwCXkeb0JDYvmm5l5s6xnTKQf28ArlKrfJcCVSJFD96FQmt0YqO4ka14j+g W6Wizedz378fWh18Klwfelp0w3cMUGwTumU59J7G+L5Y6wBQ2M1HD1En/Id0/6SF4M5j qMA8cd+7REeMeLKCpEIwMT2eAXoDjMOJOPkwRjb01tOkHB3XF5Jk/0xxtDBnG/9ydOzP dcnw== X-Forwarded-Encrypted: i=1; AJvYcCU7n4NITGhv7H0jwJxTnzEfKp61WO6T81VOYXJuBL/yrBtJX5/pvsSg7AMJCmD2iVBG73EFqHcSEwuBBuR3zRveD6uEEsXY0MIWPTKKYlu0dpFO8oA= X-Gm-Message-State: AOJu0YyjscNm0qEuqGsr5LOTjnl05d9UuRzJHqWJKd+yZbXgrTZGq6OY PLjwaWpzGGWszNR29d8Vya32BH40pOv8uvAmtIsxBKINVa4vukeG X-Google-Smtp-Source: AGHT+IF9QK1BGyLlONfFHI2NZ/q0q6TlP168YBjy8Girmb88VacbO8e/f7OnxTM2vSORBcmJgAyihA== X-Received: by 2002:a05:6a00:1785:b0:6ea:f05d:d2ec with SMTP id d2e1a72fcca58-702477c2abamr2233447b3a.2.1717164733748; Fri, 31 May 2024 07:12:13 -0700 (PDT) Received: from noel.flets-west.jp ([2405:6586:4480:a10:167:9818:d778:5c14]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70242b057besm1418103b3a.162.2024.05.31.07.12.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 07:12:13 -0700 (PDT) From: Hironori KIKUCHI To: linux-kernel@vger.kernel.org Cc: Hironori KIKUCHI , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Aleksandr Shubin , Cheo Fusi , linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: [PATCH 0/5] Add support for Allwinner H616 PWM Date: Fri, 31 May 2024 23:11:32 +0900 Message-ID: <20240531141152.327592-1-kikuchan98@gmail.com> X-Mailer: git-send-email 2.45.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240531_071216_143424_D899E1B9 X-CRM114-Status: GOOD ( 13.03 ) 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 Add support for the Allwinner H616 PWM, building on top of Aleksandr's Allwinner D1 PWM driver v9. Additionally, the 4th and 5th patches implement the proposed method for delegating the clock source and DIV_M selection to the Device Tree. While it works well without these patches with the original behavior, applying them enables fine-grained control of PWM resolution and prevents non-deterministic behavior dependent on the enabling order. I have only been able to test on H700 (H616 variant) using an oscilloscope. I would greatly appreciate it if someone could test this patch series on the D1 or other models. Regards, kikuchan. Hironori KIKUCHI (5): pwm: sun20i: Use devm_pwmchip_alloc() helper pwm: sun20i: Add support for Allwinner H616 PWM dt-bindings: pwm: sun20i: Add compatible string for Allwinner H616 PWM pwm: sun20i: Delegating the clock source and DIV_M to the Device Tree dt-bindings: pwm: sun20i: Add options to select a clock source and DIV_M .../bindings/pwm/allwinner,sun20i-pwm.yaml | 20 ++ drivers/pwm/pwm-sun20i.c | 326 ++++++++++-------- 2 files changed, 201 insertions(+), 145 deletions(-)