Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4583499rdh; Wed, 29 Nov 2023 05:41:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IEnuTmqiC0FZDSYuA+5J6NSAqPiKasd7lut2sPPssGkvtW5T/3Rx+zc1WVIVo9UOBJZOxAB X-Received: by 2002:a05:6830:1c4f:b0:6d8:322e:d8a7 with SMTP id o15-20020a0568301c4f00b006d8322ed8a7mr7423026otg.12.1701265300014; Wed, 29 Nov 2023 05:41:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701265299; cv=none; d=google.com; s=arc-20160816; b=QhFpGGJlW82WMU6bGS/K8Jc57L++CdSfVKHxUGrsdRDoofkY1OzYQX+y9FGn5uTfWH hxqEF8KlEpOC4Krw0tj77T26Z9FCpLI2/TJtPwJXby0rnaABC3dqpi8WnmH+iBxl6Rv4 tW4/rxwt/Ulzd44RnIBv7edER1eF9SZG/fGe8VIrC4jVonqrNGCkcSh/ZV6QqikNRO1L vLcUsAFOOv02yCydCk3re0ZD1ZB4D5YqqnwW7+TIFFX1SyGyRWqKWo9pSStVdoCVsPo/ tcoWlaVMA6uRAiq9pGgQ9HCVVJzF9599N78OfVcX62msOU5KjJ1KSXT5bLS5OzFlze2o /elA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hQRwxx9GEOBkFVTtu0HXXPOcGrMBOKITGaWl4mMUCHI=; fh=TqyquXYhLxTgyF97Uzxe57Le/zYtzRS0nORRNWcIBTw=; b=HCMFjE6fUxbv6ysuna7LJY/PizhzzTsJmpH60Wc4ln0fATJNznN2mlpnSWMIFi2f6m B8vf2cr510QREguKw9vC+l/NEXUwDiHgGSY6GdV3kqGolAD+ogfniqutXEuTwBNt8ZE2 Dqc+QS35Zmfl+gdgNlTyL0X0BvWxdWUrOTNNonxFMZahdO7yBqfzwjP8yEcnbZD1FB4J dJE5E/dpqGdtqQ6hyly+BlFkdvVr/BPRIt/AS8aVhJwIS/7o4tUYQvTdCcmHtaqbv7ld O1ebpDyhFk/k3yVauPI5Ph2+SWMC2o6ho2pvsAtowKHttqApCASVhGJ6Pzrk8BjH3Y/B KYKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=JhJFE5s9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id k126-20020a632484000000b005c5e22e545asi4374373pgk.312.2023.11.29.05.41.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 05:41:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=JhJFE5s9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 6B6AD803954B; Wed, 29 Nov 2023 05:41:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234118AbjK2Nkf (ORCPT + 99 others); Wed, 29 Nov 2023 08:40:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232882AbjK2Nk2 (ORCPT ); Wed, 29 Nov 2023 08:40:28 -0500 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E8F210A for ; Wed, 29 Nov 2023 05:40:34 -0800 (PST) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2c88b7e69dfso80940391fa.0 for ; Wed, 29 Nov 2023 05:40:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1701265232; x=1701870032; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hQRwxx9GEOBkFVTtu0HXXPOcGrMBOKITGaWl4mMUCHI=; b=JhJFE5s9qNJaFRQopr+cK1bLrEwuATVyZ4pBBTf3+Nx8RQ8Rdi6kvrufAEyjSac/b5 flnqbFamH5PzLaGzE8QkgEwGWN2rTuAJcdVgsXGTnxpszd0euFL6l7MqmBJ+0fNhW/wq wO7TCpJBDu9vGy3k79HbyRuLAZ/GqTH8pS73Iq8FTU9V5kP1YCDVbD2lh570QZhBdZFq geMfimrX86N5hsfGe9MsJ7T3HPIRtiuzV/1jwOOUXD1ayvbJhu97sxqQoKDCS1pahgL3 7/3fpVnp5cleisFgVzjlTL+02qD78Kfxq+lUs9Puaf0iWdeXnYNFIHrYSnoXLXILONLf xGmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701265232; x=1701870032; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hQRwxx9GEOBkFVTtu0HXXPOcGrMBOKITGaWl4mMUCHI=; b=Ed2jy0824mTueKamx7HdsGeqHL/U1WNRVkIp/LNOyA95I2nr09IbUU7+xZdklrlqW3 L/vYbuJ/ibTPeW8JZ8rbJIUnuvriLfPqeMTxy9o4yiLmbaFrpanXTVg5Wxv8OG3Jvcdj miI8pDp0tZqGjpdyl0dmevwVySErwr8XW67BEk8kjkAjYCPOG6lwsIcVDxTRk45GA/3u QuuOnfdnvbWy+iMiSeE6hUnWIeyXh07XBU2Oz8KRMANDy06zMxDfQDHg51qoYR2DBR0+ THLo5vxHU0bIJaJ522FLz7C72H7S+KmCRS3YUhjZs0Jq/RkszjiKJFrJNzkNfPClk66W n5sg== X-Gm-Message-State: AOJu0YydonlFm6WMKISNjqopjb5WzAYTjlHdFglFdUpk8X5L5xD2rAuM 4jIptlv3DRlNv5v0hSsCCMQJbw== X-Received: by 2002:a2e:9646:0:b0:2c9:ba44:fd9d with SMTP id z6-20020a2e9646000000b002c9ba44fd9dmr2347821ljh.38.1701265232031; Wed, 29 Nov 2023 05:40:32 -0800 (PST) Received: from toaster.lan ([2a01:e0a:3c5:5fb1:6101:5529:fe2d:d7eb]) by smtp.googlemail.com with ESMTPSA id w17-20020a05600c475100b004080f0376a0sm2285860wmo.42.2023.11.29.05.40.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 05:40:31 -0800 (PST) From: Jerome Brunet To: Thierry Reding , Neil Armstrong , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Jerome Brunet , Kevin Hilman , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-pwm@vger.kernel.org, JunYi Zhao , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Subject: [PATCH v3 2/4] dt-bindings: pwm: amlogic: add new compatible for meson8 pwm type Date: Wed, 29 Nov 2023 14:39:58 +0100 Message-ID: <20231129134004.3642121-3-jbrunet@baylibre.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231129134004.3642121-1-jbrunet@baylibre.com> References: <20231129134004.3642121-1-jbrunet@baylibre.com> MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 29 Nov 2023 05:41:37 -0800 (PST) Add a new compatible for the pwm found in the meson8 to sm1 Amlogic SoCs, dealing with clocks differently. This does not enable new HW. It is meant to fix a bad DT ABI for the currently supported HW. The original clock bindings describe which input the PWM channel multiplexer should pick among its possible parents, which are hard-coded in the driver. As such, it is a setting tied to the driver implementation and does not describe the HW. The new bindings introduce here describe the clocks input of the PWM block as they exist. The old compatible is deprecated but kept to maintain ABI compatibility. The SoC specific compatibles introduced match the SoC families supported by the original bindings. Signed-off-by: Jerome Brunet --- .../devicetree/bindings/pwm/pwm-amlogic.yaml | 52 ++++++++++++++++--- 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml b/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml index 387976ed36d5..eece390114a3 100644 --- a/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml +++ b/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml @@ -21,23 +21,35 @@ properties: - amlogic,meson-g12a-ee-pwm - amlogic,meson-g12a-ao-pwm-ab - amlogic,meson-g12a-ao-pwm-cd - - amlogic,meson-s4-pwm + deprecated: true - items: - const: amlogic,meson-gx-pwm - const: amlogic,meson-gxbb-pwm + deprecated: true - items: - const: amlogic,meson-gx-ao-pwm - const: amlogic,meson-gxbb-ao-pwm + deprecated: true - items: - const: amlogic,meson8-pwm - const: amlogic,meson8b-pwm + deprecated: true + - const: amlogic,meson8-pwm-v2 + - items: + - enum: + - amlogic,meson8b-pwm-v2 + - amlogic,meson-gxbb-pwm-v2 + - amlogic,meson-axg-pwm-v2 + - amlogic,meson-g12-pwm-v2 + - const: amlogic,meson8-pwm-v2 + - const: amlogic,meson-s4-pwm reg: maxItems: 1 clocks: minItems: 1 - maxItems: 2 + maxItems: 4 clock-names: minItems: 1 @@ -58,7 +70,6 @@ allOf: compatible: contains: enum: - - amlogic,meson8-pwm - amlogic,meson8b-pwm - amlogic,meson-gxbb-pwm - amlogic,meson-gxbb-ao-pwm @@ -67,14 +78,15 @@ allOf: - amlogic,meson-g12a-ee-pwm - amlogic,meson-g12a-ao-pwm-ab - amlogic,meson-g12a-ao-pwm-cd - - amlogic,meson-gx-pwm - - amlogic,meson-gx-ao-pwm then: - # Historic bindings tied to the driver implementation + # Obsolete historic bindings tied to the driver implementation # The clocks provided here are meant to be matched with the input # known (hard-coded) in the driver and used to select pwm clock # source. Currently, the linux driver ignores this. + # This is kept to maintain ABI backward compatibility. properties: + clocks: + maxItems: 2 clock-names: oneOf: - items: @@ -83,6 +95,27 @@ allOf: - const: clkin0 - const: clkin1 + # Newer binding where clock describe the actual clock inputs of the pwm + # block. These are necessary but some inputs may be grounded. + - if: + properties: + compatible: + contains: + enum: + - amlogic,meson8-pwm-v2 + then: + properties: + clocks: + minItems: 1 + items: + - description: input clock 0 of the pwm block + - description: input clock 1 of the pwm block + - description: input clock 2 of the pwm block + - description: input clock 3 of the pwm block + clock-names: false + required: + - clocks + # Newer IP block take a single input per channel, instead of 4 inputs # for both channels - if: @@ -112,6 +145,13 @@ examples: clock-names = "clkin0", "clkin1"; #pwm-cells = <3>; }; + - | + pwm@2000 { + compatible = "amlogic,meson8-pwm-v2"; + reg = <0x1000 0x10>; + clocks = <&xtal>, <0>, <&fdiv4>, <&fdiv5>; + #pwm-cells = <3>; + }; - | pwm@1000 { compatible = "amlogic,meson-s4-pwm"; -- 2.42.0