Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp294797rdb; Wed, 17 Jan 2024 02:05:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IF5W+WLazr3cgVjcCsdyvLi+kV06zekWYDS7BmCIscey/l9bkXKBEjwORJ8Vwd1CLJoaflo X-Received: by 2002:a05:6808:3014:b0:3bc:3c51:d066 with SMTP id ay20-20020a056808301400b003bc3c51d066mr10084761oib.36.1705485934823; Wed, 17 Jan 2024 02:05:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705485934; cv=pass; d=google.com; s=arc-20160816; b=zdDH+M2Jk8RU78jYb8cItA67g3MxzJOLs8PNgFykaGVWJISAHB3hxPubWmJgH9NJDp 7QkQ9rGROJ+fKV3jFmT6/AG1ey84EVvXDnlzLHXmgSkmNoR2HYl5dTOAbzkWcR8P88hB E1z6Tv/CBGYAslYDSlJINR1lHz1r3K/OB6PnxyYL/ClZLAb8fa6k9LahKg71n3lZajNB FnkR7UOjPlm7d/Axhwva7HCTRzQHQjkNHyu7wcOE+7W0wLHRpThE/suftOR/RwDlaSEK jgFE2WdExjKN50llNvZ+V1HVArYicH7ktfsNcncIkrB1ju53bbgANlxjAoubgcTnn2WX ysUQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=Hkg89Qmk/NftPIinWdwHdjmifFT7W+IhU2jg0Zzt8Us=; fh=cK3jPpBUNN88ERlvh8hX/o7ckB8tehDqVwf+aCWSY60=; b=O8QIGncCcVGvEucBom/evB7HhBoOdWwvzQk7ieyYYoL8mI9g+FeElNueh3jpT+RHp6 jE8zd5gXJDnSPHsKq7bKezYOwwADgHsOgL/D8Uvvo9G6b6eAeuXLfpDKG/CSoi7BP7O/ 748qcWvSinzqlTkWGv9mMp0wIzSXVIL0yHM9pxOnN/nXTnz3MH0Zjzcyj82WkTRXvYPY tqQEihnm36U4T9+xj4Nh46R1IeWqI0A5uMad/naTuUjv7oi9vHec6fX6oUhgEL3jNPTx EgziwdB6engDhCvpkY1/61aZ2isT/EmRMAibxcL2EE50kWSWPx8GNwbZJQNqUeseyDFD y3AQ== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-28804-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28804-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id c11-20020a056a000acb00b006d9992d5ddcsi1365159pfl.48.2024.01.17.02.05.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 02:05:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-28804-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-28804-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28804-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 7183328935E for ; Wed, 17 Jan 2024 10:05:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C808714299; Wed, 17 Jan 2024 10:03:26 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22F2E14285 for ; Wed, 17 Jan 2024 10:03:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705485806; cv=none; b=jEfeVS3zL4gc3zweVE5hJZXDcOJ2NrgPFg4dntlLLrFsygvJYMKwfV/5l830Y7KqZUwakiITOZcVPQhXzK3Q7H72kuU/D/N6KtPByUVWce0ZMQFvDj3/jAl5D6DvHQvfOJJBJ9uZsxdEOQOU0KcjMAwslUVmZw8+AUVuU/xgcRM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705485806; c=relaxed/simple; bh=2/Pg19mJk7/OgRvVH7Stv2YWNsahvj/2T/Oj3wiLOh4=; h=Received:Received:Received:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To:X-SA-Exim-Connect-IP:X-SA-Exim-Mail-From: X-SA-Exim-Scanned:X-PTX-Original-Recipient; b=O+pLDaCaBitCsHrA0RS+BN2gmizGFFb4TlhxQdxLhgbP3GWhx22ooq08YJp6jBBKxcCuFKyDzrV7450xc7sv0ho9KNr0wb+VcaSPY4NFLBqPUc6KDYiBkfSqiqLa1DyQbOsi4rUgbrMr8MG5pLC/mdJ6TAOT0fQk5EoP4jgobhs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rQ2lR-000651-VN; Wed, 17 Jan 2024 11:03:17 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rQ2lQ-000RMX-RA; Wed, 17 Jan 2024 11:03:16 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rQ2lQ-001aYu-2O; Wed, 17 Jan 2024 11:03:16 +0100 Date: Wed, 17 Jan 2024 11:03:16 +0100 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Jerome Brunet Cc: Thierry Reding , Neil Armstrong , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Kevin Hilman , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-pwm@vger.kernel.org, JunYi Zhao , Rob Herring Subject: Re: [PATCH v4 1/6] dt-bindings: pwm: amlogic: fix s4 bindings Message-ID: References: <20231222111658.832167-1-jbrunet@baylibre.com> <20231222111658.832167-2-jbrunet@baylibre.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="bbfbzv6eijurrhvz" Content-Disposition: inline In-Reply-To: <20231222111658.832167-2-jbrunet@baylibre.com> X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org --bbfbzv6eijurrhvz Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 22, 2023 at 12:16:49PM +0100, Jerome Brunet wrote: > s4 has been added to the compatible list while converting the Amlogic PWM > binding documentation from txt to yaml. >=20 > However, on the s4, the clock bindings have different meaning compared to > the previous SoCs. >=20 > On the previous SoCs the clock bindings used to describe which input the > PWM channel multiplexer should pick among its possible parents. >=20 > 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. >=20 > 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 che= ck > when support is actually added. >=20 > Also the s4 cannot work if the clocks are not provided, so the property no > longer optional. s/no/is no/ > 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. >=20 > 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 | 67 ++++++++++++++++--- > 1 file changed, 58 insertions(+), 9 deletions(-) >=20 > diff --git a/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml b/Doc= umentation/devicetree/bindings/pwm/pwm-amlogic.yaml > index 527864a4d855..a1d382aacb82 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 > =20 > -allOf: > - - $ref: pwm.yaml# > - > properties: > compatible: > oneOf: > @@ -43,12 +40,8 @@ properties: > maxItems: 2 > =20 > clock-names: > - oneOf: > - - items: > - - enum: [clkin0, clkin1] > - - items: > - - const: clkin0 > - - const: clkin1 > + minItems: 1 > + maxItems: 2 > =20 > "#pwm-cells": > const: 3 > @@ -57,6 +50,55 @@ required: > - compatible > - reg > =20 > +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 > + 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. I admit I didn't understand the relevant difference between the old and the new binding yet. (The driver currently doesn't support the s4, right?) Is it possible to detect if the dt uses the old or the new binding? If yes, I suggest to drop the old one from the binding and only keep it in the driver for legacy systems. > + 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 The expectation is that this list contains all compatibles that are not included in the "historic" list above, right? Then maybe use "else:" instead of another explicit list? > + 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 Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --bbfbzv6eijurrhvz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmWnpeMACgkQj4D7WH0S /k7D8ggArnaDEUYvcg/pgZL5jLaqhKI+CoViERryuLi+QxBL1eWhFvl6XyVCjS7N FV4h2WdLIV3wdMGKYdCdv9hzleWVaVx1hJDLmOPunTO9QZUmMu6vRYVpsZcpuSpg T1LNgkK3uEcHBSt6YXynKssZK72/ydv0dDIZ6WZy5+dkdJfWxxCaXubS7Pd6lF8Y bnOKgErPh/7F0d17TOgIcrwUViGdVt6+d4NbgymqWCueJt/sqX5e81lTn+V3/knM NypPZ7UqCNgJ/zL9vJpJZsKQYNNM4yA5n0HlHgDZBlzLeYttXHUKhHqnArC4/PWF CTJ4QZ5qA38yQXWFHypZkl5dLHlniA== =ZKMp -----END PGP SIGNATURE----- --bbfbzv6eijurrhvz--