Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp3286597lqo; Tue, 21 May 2024 12:06:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWE40tgz5Qi2fFU5EFRBH7HC/rRjBvta/NQOT+h9/iIouIdmbahhbQ+cNGIqD1dmVv7xVuCFDqU/lVQUphiD7b80TZTzRPtMTnMLINq5g== X-Google-Smtp-Source: AGHT+IFjuVfqrPid7HEQSrrV+dNNfIjLHg/PzRVj7FSCdEKNyncHObWCProJSarzGVTMsBO63l/8 X-Received: by 2002:a05:6a20:ce4a:b0:1af:fcbf:df27 with SMTP id adf61e73a8af0-1affcbfdfefmr28975529637.59.1716318374612; Tue, 21 May 2024 12:06:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716318374; cv=pass; d=google.com; s=arc-20160816; b=oYPyvl41D0VkG1VPmALlDs1zdZbm/ktYAgAg3Kqt4IeD67ckTZDtFO2iXdRF7UCmLz w9flR5T4PURdtcqECa7cjrlZ3xs7gE+PIhyiwQKzeglDhS7EqOl+eTAsQxnadhGg8ONu iCOdVhLNNCdFakdaTlRklvGXC0XWKx6Ljvrud/veMRmdYD7outCZVP/++FhrGZAY9AhP B9qI25tjye2lZ4itIQnJwtLxeNYfxMTApgwjQIfwy4mre1PwsQvPNhPQ3XGOsxxjunXz F8Zp27M+ApG4hgkry2vhhvYtsGYOQNi1wR+yIIUAyhIzK7+ODbspDftvJ0hlntys2eBP RQ/w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=dc+kpD+zkAQTl29Ms2uNziNdJOhB6tZBlB7R/NDLTuI=; fh=EymmIf9cp5tL6DRczpHkVmLrGHse97fHJDSB2LqIuno=; b=QmxOAVDatbVKd4ovYTBy8Ay5CEPBJaQcBbWpgKz9qt3FTX6NLMF9EGp5IMDlwmWgxm 4ZDvHqfLU18Gpve0NO3tz8USAX1ieEN55ZQe20B9XrPgAe3/Zf0xbiRHAzB2WVGDVYEf 3qwiD40l82NAxNVL5orl1ChNhCbLSDYnySmbEOxNnIZfr4qhj9imvc1L6bL+dlT+HZBz 1Y5K8texpIMY47qDCi04/1PlpaTb4gwrE8Hw3PMjp2ETm4KEOroSEMffYog71cuUbaqq EIohqC02z2n8ASU5MuvS9ccE3K0FyOAX5ZxqO/7cy3RtSaalddg8g2eLNUssTVkEAF53 nueQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="I75bpz/Z"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-185363-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185363-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 41be03b00d2f7-6559b87b7c7si11909078a12.799.2024.05.21.12.06.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 12:06:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-185363-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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="I75bpz/Z"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-185363-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185363-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 2337228392A for ; Tue, 21 May 2024 19:06:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4785F148857; Tue, 21 May 2024 19:05:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="I75bpz/Z" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 F15CD69DF7; Tue, 21 May 2024 19:05:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716318357; cv=none; b=D7s2jVTYsI2h/i+f51HW0gGfUDutpoxEVYAfBhZ1yFPxMtOgsmSgRhoDWMp+GUdBgnowKlmUNZ0FOEUo8PLPiTYGShdAc4W+Q4qSPYbq2qI/KIH+IWbVeG2EQiN8ssLWtAbrGQKVyTAzWnov3G+0VTmJ6oK5TFlX/Lz2qjME0pg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716318357; c=relaxed/simple; bh=q2yoRuIo85m8Z6ImV81l45Ie2jVyv8NbcTBVXQYNINE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=cMKVaNoWetLmWgziKCtcMlcTdI6KnMwg8ZVIveL+ZZw7lQY8OmBkeDNwGRtuOi0N1qJDlx7EChf0J+wOwRgwE2DfCxUvqZGH5AYLeW1u0GZADIviWvso0+yikTEg+TSTxF//udw49E1d78GtKf956mcA6y5+kO4IDYewpR41wCk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=I75bpz/Z; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BDF26C2BD11; Tue, 21 May 2024 19:05:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716318356; bh=q2yoRuIo85m8Z6ImV81l45Ie2jVyv8NbcTBVXQYNINE=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=I75bpz/ZrJBhtuMHBG9w8pGgtZBKngSo1hzZjyrTF9hTbZStSyaaa0OXO7aaCWFW9 XZUWM9AlFsDXJxB6wfq2gRpjAT3ODKd9xCnZCQOPCd1XoaF/DAaMtwQDQ9ylUzNQYN Tsz5uVMvpMXzJscDB/CmyfH5Ov7rQT0ARV8gS10QjpXKVBjIldAOvYvd1drtPasKD6 /3eL42gGNe7FRk8HJiea8XobXZ+2QGi4An928gX9we6rdabY6EWgTGenbC0zRBA3qk 722Dui0BA+KRe45YFH8ZLl5QkD68AFIKXgXc1KzS4viOZQYl7sR5LCsAGrWRamlxKN 65oIrFA3ex4pw== Message-ID: <11a383f3-a6db-4de7-a5f8-2938c69e98fc@kernel.org> Date: Tue, 21 May 2024 21:05:50 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/5] dt-bindings: Add bindings for the Analog Devices ADP5585 To: Laurent Pinchart , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pwm@vger.kernel.org Cc: Alexandru Ardelean , Bartosz Golaszewski , Conor Dooley , Krzysztof Kozlowski , Lee Jones , Linus Walleij , Rob Herring , =?UTF-8?Q?Uwe_Kleine-K=C3=B6nig?= References: <20240520195942.11582-1-laurent.pinchart@ideasonboard.com> <20240520195942.11582-3-laurent.pinchart@ideasonboard.com> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzk@kernel.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzSVLcnp5c3p0b2Yg S296bG93c2tpIDxrcnprQGtlcm5lbC5vcmc+wsGVBBMBCgA/AhsDBgsJCAcDAgYVCAIJCgsE FgIDAQIeAQIXgBYhBJvQfg4MUfjVlne3VBuTQ307QWKbBQJgPO8PBQkUX63hAAoJEBuTQ307 QWKbBn8P+QFxwl7pDsAKR1InemMAmuykCHl+XgC0LDqrsWhAH5TYeTVXG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ent.pinchart@ideasonboard.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 20/05/2024 21:59, Laurent Pinchart wrote: > The ADP5585 is a 10/11 input/output port expander with a built in keypad > matrix decoder, programmable logic, reset generator, and PWM generator. > These bindings model the device as an MFD, and support the GPIO expander > and PWM functions. > > These bindings support the GPIO and PWM functions. > > Signed-off-by: Laurent Pinchart > --- > I've limited the bindings to GPIO and PWM as I lack hardware to design, > implement and test the rest of the features the chip supports. > --- > .../bindings/gpio/adi,adp5585-gpio.yaml | 36 ++++++ > .../devicetree/bindings/mfd/adi,adp5585.yaml | 117 ++++++++++++++++++ > .../bindings/pwm/adi,adp5585-pwm.yaml | 35 ++++++ > MAINTAINERS | 7 ++ > 4 files changed, 195 insertions(+) > create mode 100644 Documentation/devicetree/bindings/gpio/adi,adp5585-gpio.yaml > create mode 100644 Documentation/devicetree/bindings/mfd/adi,adp5585.yaml > create mode 100644 Documentation/devicetree/bindings/pwm/adi,adp5585-pwm.yaml > > diff --git a/Documentation/devicetree/bindings/gpio/adi,adp5585-gpio.yaml b/Documentation/devicetree/bindings/gpio/adi,adp5585-gpio.yaml > new file mode 100644 > index 000000000000..210e4d53e764 > --- /dev/null > +++ b/Documentation/devicetree/bindings/gpio/adi,adp5585-gpio.yaml > @@ -0,0 +1,36 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/gpio/adi,adp5585-gpio.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Analog Devices ADP5585 GPIO Expander > + > +maintainers: > + - Laurent Pinchart > + > +description: | > + The Analog Devices ADP5585 has up to 11 GPIOs represented by a "gpio" child > + node of the parent MFD device. See > + Documentation/devicetree/bindings/mfd/adi,adp5585.yaml for further details as > + well as an example. > + > +properties: > + compatible: > + const: adi,adp5585-gpio > + > + gpio-controller: true > + > + '#gpio-cells': > + const: 2 > + > + gpio-reserved-ranges: true There are no resources here, so new compatible is not really warranted. Squash the node into parent. > + > +required: > + - compatible > + - gpio-controller > + - "#gpio-cells" > + > +additionalProperties: false > + > +... > diff --git a/Documentation/devicetree/bindings/mfd/adi,adp5585.yaml b/Documentation/devicetree/bindings/mfd/adi,adp5585.yaml > new file mode 100644 > index 000000000000..217c038b2842 > --- /dev/null > +++ b/Documentation/devicetree/bindings/mfd/adi,adp5585.yaml > @@ -0,0 +1,117 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/mfd/adi,adp5585.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Analog Devices ADP5585 Keypad Decoder and I/O Expansion > + > +maintainers: > + - Laurent Pinchart > + > +description: | Do not need '|' unless you need to preserve formatting. > + The ADP5585 is a 10/11 input/output port expander with a built in keypad > + matrix decoder, programmable logic, reset generator, and PWM generator. > + > +properties: > + compatible: > + items: > + - enum: > + - adi,adp5585-00 # Default > + - adi,adp5585-01 # 11 GPIOs > + - adi,adp5585-02 # No pull-up resistors by default on special pins > + - adi,adp5585-03 # Alternate I2C address > + - adi,adp5585-04 # Pull-down resistors on all pins by default > + - const: adi,adp5585 > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + vdd-supply: true > + > + gpio: > + $ref: /schemas/gpio/adi,adp5585-gpio.yaml > + > + pwm: > + $ref: /schemas/pwm/adi,adp5585-pwm.yaml > + > +required: > + - compatible > + - reg > + - gpio > + - pwm > + > +allOf: > + - if: > + properties: > + compatible: > + contains: > + const: adi,adp5585-01 > + then: > + properties: > + gpio: > + properties: > + gpio-reserved-ranges: false This also points to fact your child node is pointless. It does not stand on its own... > + else: > + properties: > + gpio: > + properties: > + gpio-reserved-ranges: > + items: > + - const: 5 > + - const: 1 > + > +additionalProperties: false > + > +examples: > + - | > + i2c { > + #address-cells = <1>; > + #size-cells = <0>; > + > + mfd@34 { > + compatible = "adi,adp5585-00", "adi,adp5585"; > + reg = <0x34>; > + > + gpio { > + compatible = "adi,adp5585-gpio"; > + gpio-controller; > + #gpio-cells = <2>; > + gpio-reserved-ranges = <5 1>; > + }; > + > + pwm { > + compatible = "adi,adp5585-pwm"; > + #pwm-cells = <3>; > + }; > + }; > + }; > + > + - | > + i2c { > + #address-cells = <1>; > + #size-cells = <0>; > + > + mfd@34 { > + compatible = "adi,adp5585-01", "adi,adp5585"; > + reg = <0x34>; > + > + vdd-supply = <®_3v3>; > + > + gpio { > + compatible = "adi,adp5585-gpio"; > + gpio-controller; > + #gpio-cells = <2>; Different by one property? So just keep one example, unless there are more differences. > + }; > + > + pwm { > + compatible = "adi,adp5585-pwm"; > + #pwm-cells = <3>; > + }; > + }; > + }; > + > +... > diff --git a/Documentation/devicetree/bindings/pwm/adi,adp5585-pwm.yaml b/Documentation/devicetree/bindings/pwm/adi,adp5585-pwm.yaml > new file mode 100644 > index 000000000000..351a9d5da566 > --- /dev/null > +++ b/Documentation/devicetree/bindings/pwm/adi,adp5585-pwm.yaml > @@ -0,0 +1,35 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/pwm/adi,adp5585-pwm.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Analog Devices ADP5585 PWM Generator > + > +maintainers: > + - Laurent Pinchart > + > +description: | Do not need '|' unless you need to preserve formatting. > + The Analog Devices ADP5585 generates a PWM output with configurable frequency > + and duty cycle represented by a "pwm" child node of the parent MFD device. > + See Documentation/devicetree/bindings/mfd/adi,adp5585.yaml for further > + details as well as an example. > + > +allOf: > + - $ref: /schemas/pwm/pwm.yaml# > + > +properties: > + compatible: > + enum: > + - adi,adp5585-pwm > + > + "#pwm-cells": > + const: 3 Also no resources, so this can be part of the parent node. Best regards, Krzysztof