Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp162855lqp; Tue, 21 May 2024 23:58:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUuGsasXNgnC6FE1+rlUpi+aMTcJswGs3W9nwGQfZqKiQSVDF3+dZTF4K8Tg75HFXTgbGB0281jWBtf+cyoKaS1vBXR2ZZM1TuP/Z00vQ== X-Google-Smtp-Source: AGHT+IGNsdE/9OH8DyJ4grUXnyvOor404R716/0AUjbf7EIrPHSlddTFrvSgF7y2LFJnh77Ypf56 X-Received: by 2002:a17:902:d488:b0:1f3:396:9c8e with SMTP id d9443c01a7336-1f31ad3824dmr20725095ad.25.1716361099212; Tue, 21 May 2024 23:58:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716361099; cv=pass; d=google.com; s=arc-20160816; b=IUWeMVDOeGBuWjf/o1EPXkClIiOV/mVT3dLhWLlfn/q4MU7ZXFF8IeKLzE4Ug5BKLB GWvEpBfWfr9t0dNG2jAR9Cet+6FLX9Cm75qKJW9akGo1TBa7N6+P5jHkIa5ZbA0y9Kka Ns5yjTcfvk5Q256+ldRWROtT4vx61cOJUXrCXBCoyb1po8DjXi3rc1vyXGE5BDPMmmj2 qajkg25sLRadbY+G2FgtOdqlCinGB+q6AYIEs9W2zdVZJRs7y7lUBXoXqdyDDaMmFELc 4HzfDO87Y+LIlUdEcUF1diXtTxIUJXORQFNGvcgsDK7EIqX8TE7w0jnmmKiZ5JAFknfb xkiw== 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=R05+EtT0cNJ5CnYthJgJMGxWPhT6S4eW9dEWOc3dPEE=; fh=BWvfv7E+uoWCFC9Goa0eHdWrfQOmwijhd6li9EVSBeU=; b=NkRF9VeUsuTKbuHIXwyTkwuAUP9uDiFyENzykBBhZvzZwoKYdvCusOcaeSIPrfSgm2 9yCQF8N5bMGuB+888kePUBgD92sICTj9e6e6r2UUOcNQCm3iPgmvCqJGWunjN+gCW2b7 d18xM7pBrIRlldgoeyDRlghnyN9dLduZ7hmnpXuWwCSZT7SYbWHuJzqnAMt26eU2a0Er oHdCDbkG24kbCR40w4bmBXL18N2FiLzX+EvVba+zwy7L5VcXU5riATjF3r03wRFIB/2D Kti1XYUPl37P2vyzw6uZnzjwFKa5SrPXXVG1U4opde+o8CegvOkVRGco+mIejFo4a0r/ T93Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=n1PieJV5; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-185829-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185829-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f3080a8f7asi37826715ad.236.2024.05.21.23.58.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 23:58:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-185829-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=n1PieJV5; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-185829-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185829-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 059E5B21837 for ; Wed, 22 May 2024 06:58:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E68E17A15A; Wed, 22 May 2024 06:58:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="n1PieJV5" 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 BA51459147; Wed, 22 May 2024 06:58:02 +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=1716361082; cv=none; b=giIJbHW5kqG5T1M7TWvGhhS15uBqEwcGBbeYH3ZtvSqTW/hVGs/9hTus7+8KcxXysBlxtoFPSYyZwOhYfwqquW1O67+FG+VtwZO1j3uvCJM3oHn0WF6odPGZpqDO53/gq5NoXIoC3b4Yw8tNAk/Wz/HlIiziCyqkcn4s2mKGEBc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716361082; c=relaxed/simple; bh=zW4bTdJWK81AR2+O8wSlEJaH4FcFXtOYcg1BuXGhn9k=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=JnE3x6GWmoiV60MZPJ8XfMMgJyv/GRdXqhHSmDHUPRW1nNxgge87CsB4i/ut1avsvTGIP/mFZQH3dGg9pSq+OCsj2JgNB7foavYly8NCjRqt8xF8vzNGlPeLuHN8mb3vYOCdUGpMk/pi5MUa3k9I79NNAP2ZnQcXedrAFsdjzQw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=n1PieJV5; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39181C2BD11; Wed, 22 May 2024 06:57:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716361082; bh=zW4bTdJWK81AR2+O8wSlEJaH4FcFXtOYcg1BuXGhn9k=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=n1PieJV5GQxwoN6cinS+3f6pE72OKEoAUIa0NA8eOl045vEbW4KG+TBaS2FLMcYFi hoqtJXIJlLu+b+t5lpPtYujk/3HCY2Fle1dMrj8uRb539SUzWdygSg1Yd3pbOvqDkG iAX4e5Rb7riYGqZIn03i2wAw11jlIeI9ecCoLuVmmBAiuMEeikrei2v3hbVDD+NqBm rMN/z0Rqa5VSedNhqlvReMqTxzLPHt2ku5HHHezgDJbRQ+12h35sIY8Wovxme2sxwN BUq8mBLYvm4xjLetB8qhJsIG9MW2SPyJ3xqVqcUTwlo8X52/Le62oYdYS7r16QozJz yzi7UEd3B1c/g== Message-ID: <075f5a03-f288-4dfb-a293-3a6c0675881b@kernel.org> Date: Wed, 22 May 2024 08:57:56 +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 Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pwm@vger.kernel.org, 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> <11a383f3-a6db-4de7-a5f8-2938c69e98fc@kernel.org> <20240521194309.GA8863@pendragon.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 QWK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TRRdC3g9hmCEuNSr+CLMdnRBY fv0= In-Reply-To: <20240521194309.GA8863@pendragon.ideasonboard.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 21/05/2024 21:43, Laurent Pinchart wrote: > Hi Krzysztof, > > On Tue, May 21, 2024 at 09:05:50PM +0200, Krzysztof Kozlowski wrote: >> 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. > > Child nodes seem (to me) to be the standard way to model functions in > MFD devices. Looking at mfd_add_device(), for OF-based systems, the > function iterates over child nodes. I don't mind going a different Only to assign of node, which could be skipped as well. > routes, could you indicate what you have in mind, perhaps pointing to an > existing driver as an example ? Most of them? OK, let's take the last added driver in MFD directory: cirrus,cs42l43 It has three children and only two nodes, because only these two devices actually need/use/benefit the subnodes. > >>> + >>> +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... > > That doesn't make the child pointless just for that reason. There are > numerous examples of child nodes that don't stand on their own. No, your if-then must be in the schema defining it. This is just unmaintianable code. It proves that child's compatible means nothing. If you cannot use child's compatible to make any meaningful choices, then it is useless. Best regards, Krzysztof