Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4583138rdh; Wed, 29 Nov 2023 05:41:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IEG+i23RX1wvz4reanOEct1cTpS0hYCPjRwB+2TjGPGpsBJGW3vhlZmemWfRLCVxZa3cNEZ X-Received: by 2002:a05:6a00:188f:b0:6cd:dfff:19b3 with SMTP id x15-20020a056a00188f00b006cddfff19b3mr388266pfh.32.1701265263458; Wed, 29 Nov 2023 05:41:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701265263; cv=none; d=google.com; s=arc-20160816; b=rj3B8281ssPd203vck6iOmw+ar4RB2YHgArhfiO2jP7iBuQTZu0vSK5fsOS+SEGCF2 GlVr9kyMXd29fdud8TCcXQ68KZZTK1PgRNepFrjzVp8qQ6Sr8nZWtYX6tQPQZc8lc99W QPLqlsoWvDYszoWbJY6q/O9eQloG4rA0WoA/ce+UZ3FOnABMDItzdtYdyUsIJntRJyZw 64/4urx9NGZASHXYbM/p3u3Zsb63yGyZ5SXUg2jT1ZXpEXnETAWC7EV6B+MZGyosU+bA 6Bdyn7o6Saz1argBSliMH3qnRt4QfV/9U+WI6WmheyrLT1faqjlQMJ1L8atzZCDyGcpg I1Cw== 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=dNV0r1tk7i0wstK5L78tpqt0TYtEG6tPq8iOAeVFOuU=; fh=bNEpYFpxs612SaIebQIvUss98KHfXeaSCGFcUCsewj0=; b=cQ8WD9PILul+8TJ+HWfY1J6phXu+I0E1kiu/JraHnSuxqeApSUw815zux2/yaDlkTX S3hYrhfAFxbBjJeAsS+41bd+ziYByPH50rrVNLUPmC+7hIJQDPcZwGEZzg/iHB9/5YNo SRcipAmlFfzD65NJptS5pwXkr+qtYw/5SLh0X75m2gZ1CQ1q6gr7IZgYYN/3c3oXAskI 2u3RD9KnQoWOvLqK1NZuRghBwMeNpczLlBo3wfkCsmwrwZAcdSyOQ8j7Aibwlhfxm6Gq zmHCUqYVq6N35kLZOKPdd6sZgNXHg6UdRcO0h/HF/d3rWdT8P6BOpa4k6gvL97RJHKgg HALA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=PR3NUmXg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id u23-20020a056a00099700b0069347c30c78si14898491pfg.230.2023.11.29.05.41.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 05:41:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=PR3NUmXg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 337ED8096FD3; Wed, 29 Nov 2023 05:40:59 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234105AbjK2Nkc (ORCPT + 99 others); Wed, 29 Nov 2023 08:40:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234059AbjK2Nk1 (ORCPT ); Wed, 29 Nov 2023 08:40:27 -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 DBB0BDD for ; Wed, 29 Nov 2023 05:40:32 -0800 (PST) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2c997447ff9so56512651fa.0 for ; Wed, 29 Nov 2023 05:40:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1701265231; x=1701870031; 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=dNV0r1tk7i0wstK5L78tpqt0TYtEG6tPq8iOAeVFOuU=; b=PR3NUmXggT3VAc2Q9lPcRj3wE/QB8VSIu04RTsr7v8NVdOQyXdHmj3XKr+BCKDXH7O ZypBSTkOq6toplifydqrYTstPKQRuSY8XTxRCWQVmEpDHXJOB/WagnXap7Qyk/ahrW5m vek7mm4Uzttnu1TH6ULjdVLKmrsgwIgrcOiHVg/3SilJkKvJD/kLrP7Abm0i7NWJ5SAZ vMUpq8av6xu9geJzHgd752LCtqIX1kHysqPa0X6a/HHPH1c4UIGDQRIc38yOVN/Kce94 x/31TOoGWUOW/s/WApBpbAHRmIwnhdNcN751ynhinSP+2OS5U2+CH4YugB/RYnrz7grv qchg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701265231; x=1701870031; 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=dNV0r1tk7i0wstK5L78tpqt0TYtEG6tPq8iOAeVFOuU=; b=jn7MunhZ6o7A74ekj6kb/VaI/RtlJq+0DWyUj6RdlEuZOl/BvtwLaw6nFU+3nsTdO1 C6sapdZUQoYiX1qcFrO6eVnlrubEcoODIr6fbKVBgalK4jIwutbEY+E71VNlU2eEqPJh Wl+3J6TKBL0joWl+SEvvlHstW5ZyENh+sgGruTeP4Xs8Sl0NZrI+KfMgGk1e4IaoN/DA 4CKRWSVIvuoCiyutujoeBFXX4/wYGudx04IHYk505BWaKnBEjn81Hx8FYRr2WdrZVIhi NvLkx9PhTCxuHs2s/fDCi5LHFeteZLevcNEUsqx4AxJ1sCFxeAzYZNcMQwDxUxZ0c7XK Bf7A== X-Gm-Message-State: AOJu0YzjH7I5NooXLVCgSGzgtFypUkhrX2O57kCDGaISLhvTdEMhyQMw KGbJMPDxm1bB61Kvhkf4fbzj/g== X-Received: by 2002:a05:651c:c85:b0:2c9:9376:1ae7 with SMTP id bz5-20020a05651c0c8500b002c993761ae7mr11736281ljb.28.1701265231148; Wed, 29 Nov 2023 05:40:31 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 05:40:30 -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?= , Rob Herring Subject: [PATCH v3 1/4] dt-bindings: pwm: amlogic: fix s4 bindings Date: Wed, 29 Nov 2023 14:39:57 +0100 Message-ID: <20231129134004.3642121-2-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 groat.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 (groat.vger.email [0.0.0.0]); Wed, 29 Nov 2023 05:40:59 -0800 (PST) s4 has been added to the compatible list while converting the Amlogic PWM binding documentation from txt to yaml. However, on the s4, the clock bindings have different meaning compared to the previous SoCs. On the previous SoCs the clock bindings used to describe which input the PWM channel multiplexer should pick among its possible parents. This is very much tied to the driver implementation, instead of describing the HW for what it is. When support for the Amlogic PWM was first added, how to deal with clocks through DT was not as clear as it nowadays. The Linux driver now ignores this DT setting, but still relies on the hard-coded list of clock sources. On the s4, the input multiplexer is gone. The clock bindings actually describe the clock as it exists, not a setting. The property has a different meaning, even if it is still 2 clocks and it would pass the check when support is actually added. Also the s4 cannot work if the clocks are not provided, so the property no longer optional. Finally, for once it makes sense to see the input as being numbered somehow. No need to bother with clock-names on the s4 type of PWM. Fixes: 43a1c4ff3977 ("dt-bindings: pwm: Convert Amlogic Meson PWM binding") Reviewed-by: Rob Herring Signed-off-by: Jerome Brunet --- .../devicetree/bindings/pwm/pwm-amlogic.yaml | 69 ++++++++++++++++--- 1 file changed, 60 insertions(+), 9 deletions(-) diff --git a/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml b/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml index 527864a4d855..387976ed36d5 100644 --- a/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml +++ b/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml @@ -9,9 +9,6 @@ title: Amlogic PWM maintainers: - Heiner Kallweit -allOf: - - $ref: pwm.yaml# - properties: compatible: oneOf: @@ -43,12 +40,8 @@ properties: maxItems: 2 clock-names: - oneOf: - - items: - - enum: [clkin0, clkin1] - - items: - - const: clkin0 - - const: clkin1 + minItems: 1 + maxItems: 2 "#pwm-cells": const: 3 @@ -57,6 +50,57 @@ required: - compatible - reg +allOf: + - $ref: pwm.yaml# + + - if: + properties: + compatible: + contains: + enum: + - amlogic,meson8-pwm + - amlogic,meson8b-pwm + - amlogic,meson-gxbb-pwm + - amlogic,meson-gxbb-ao-pwm + - amlogic,meson-axg-ee-pwm + - amlogic,meson-axg-ao-pwm + - 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 + # 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. + properties: + clock-names: + oneOf: + - items: + - enum: [clkin0, clkin1] + - items: + - const: clkin0 + - const: clkin1 + + # Newer IP block take a single input per channel, instead of 4 inputs + # for both channels + - if: + properties: + compatible: + contains: + enum: + - amlogic,meson-s4-pwm + then: + properties: + clocks: + items: + - description: input clock of PWM channel A + - description: input clock of PWM channel B + clock-names: false + required: + - clocks + additionalProperties: false examples: @@ -68,3 +112,10 @@ examples: clock-names = "clkin0", "clkin1"; #pwm-cells = <3>; }; + - | + pwm@1000 { + compatible = "amlogic,meson-s4-pwm"; + reg = <0x1000 0x10>; + clocks = <&pwm_src_a>, <&pwm_src_b>; + #pwm-cells = <3>; + }; -- 2.42.0