From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 57FBC133987; Mon, 17 Mar 2025 09:30:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742203837; cv=none; b=cVnOmEOEMJjNVjMZbkKKOwukUGDz6RgUSORSgy4AL8BEzwz658tPGS7FMNOmp0QBmZnyV1WFfEqRxrvR4fWsFgrcGZjVihl/v+ObFHl6y13ZMZYkDmS9GLZRk4sRix0d6x05beSXh1k6iCMh9MFrSKdn2rOp+stsDQlMoM73Vv0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742203837; c=relaxed/simple; bh=qhhkurOO1/r/FUzk14/TdKBO8AXtyjU2NgmH4MtYBt4=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=WZayaYHgwDCEu8NLHjJuys87iedt640GmpTz205j+rd9okX9H6Qv2LsZHXJjAp29+AnTG8ZoM7aV4aTPlsPXhX4yDl2fYKnHSkbTNo74H0iroS05LY/5+J5j8hMQmyu8jfW/kOZWF30KhcPt+5wYF4cnn17C5FkCnwEW5/Bpbls= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XQqDGFA/; arc=none smtp.client-ip=209.85.221.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XQqDGFA/" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-390cf7458f5so3628221f8f.2; Mon, 17 Mar 2025 02:30:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742203832; x=1742808632; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=eig1iFcSepoHSxapZeehFNku7IVWpcgwRa3rcpt4M5U=; b=XQqDGFA/5CQere/6/1YS2zgzVWNHR5+vqYPWHl9MlLrtQ60ki/uaN4G7dn8IQofybW Mb+WPly4p5ZuDL0hlRCDmzZTpm/uwA4yXdTzhSpSZjV0kHHFmh6U0SMl+DTjwlRe8Kan yU6PkJv3o2q1OZowZrv3CWKO74z3Le0uILCQKjXMgle2qW7AFHRfkKQu3mVT6m1Iz0bn ecXpQQ+C0JKfBbLXZc3DWyV6ifym/3rgoSeiNGbOGUMrIBgYCvmqrjdFZwKgBsDgs1pH QgNdl2Ene34rxqX9m1EJJjgQHl7JQNEIlUtImcFgpzs8MKeB8tk3OdajErqlgdRG/HiD Et7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742203832; x=1742808632; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=eig1iFcSepoHSxapZeehFNku7IVWpcgwRa3rcpt4M5U=; b=DmkxMp/GTGhTL1DnKH4JiiR9JNCXKkCBgQPmoX5/pe7vvNUveKHUsSmBNz0qWEcQq/ X/+7UZWg9pAkqrVUYA4m/dAkBohR1XE0urYkTSieE7hwgD6WiW1dRqe/MkbFU1F/Qgsx oaVCk/ZxhFLu5sWxRfs9skucYPe5UL4FiIApxM0fcnhoHlRT1Z8qS2C1d4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wpiUiTLd8Hw== X-Received: by 2002:a5d:47ae:0:b0:391:a43:8bbd with SMTP id ffacd0b85a97d-3971e876615mr13523314f8f.21.1742203832369; Mon, 17 Mar 2025 02:30:32 -0700 (PDT) Received: from ?IPv6:2001:818:ea8e:7f00:2575:914:eedd:620e? ([2001:818:ea8e:7f00:2575:914:eedd:620e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-395c7df3506sm14803542f8f.11.2025.03.17.02.30.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Mar 2025 02:30:31 -0700 (PDT) Message-ID: Subject: Re: [PATCH 05/18] dt-bindings: mfd: adp5585: document adp5589 I/O expander From: Nuno =?ISO-8859-1?Q?S=E1?= To: Krzysztof Kozlowski , Nuno =?ISO-8859-1?Q?S=E1?= Cc: linux-gpio@vger.kernel.org, linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, linux-input@vger.kernel.org, Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Uwe =?ISO-8859-1?Q?Kleine-K=F6nig?= , Linus Walleij , Bartosz Golaszewski , Dmitry Torokhov , Laurent Pinchart , Liu Ying Date: Mon, 17 Mar 2025 09:30:37 +0000 In-Reply-To: References: <20250313-dev-adp5589-fw-v1-0-20e80d4bd4ea@analog.com> <20250313-dev-adp5589-fw-v1-5-20e80d4bd4ea@analog.com> <20250314-outstanding-futuristic-cat-5d8240@krzk-bin> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.3 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Mon, 2025-03-17 at 08:41 +0100, Krzysztof Kozlowski wrote: > On 14/03/2025 10:38, Nuno S=C3=A1 wrote: > > On Fri, 2025-03-14 at 09:49 +0100, Krzysztof Kozlowski wrote: > > > On Thu, Mar 13, 2025 at 02:19:22PM +0000, Nuno S=C3=A1 wrote: > > > > =C2=A0=C2=A0 reg: > > > > =C2=A0=C2=A0=C2=A0=C2=A0 maxItems: 1 > > > > @@ -63,13 +70,26 @@ allOf: > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 properties: > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 gpio-reserved-rang= es: false > > > > =C2=A0=C2=A0=C2=A0=C2=A0 else: > > > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 properties: > > > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 gpio-reserved-ranges: > > > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 maxItems: 1 > > > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 items: > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if: > > >=20 > > > Do not nest if:then:else:if:then, it leads to code impossible to read= . > > > Just provide if-then cases for each of your variant. > > >=20 > >=20 > > Alright... > >=20 > > >=20 > > >=20 > > >=20 > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 properties: > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 compatible: > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= contains: > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 enum: > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 - adi,adp5585-00 > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 - adi,adp5585-02 > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 - adi,adp5585-03 > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 - adi,adp5585-04 > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 then: > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 properties: > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 gpio-reserv= ed-ranges: > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= maxItems: 1 > > >=20 > > > one tem? > > >=20 > > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 items: > > > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 - const: 5 > > > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 - const: 1 > > >=20 > > > But here two... > > >=20 > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 items: > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 - const: 5 > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 - const: 1 > > >=20 > > > and this is confusing. I don't get what you want to express. > > >=20 > >=20 > > I just kept it as before (maybe I messed up in some other way but the 2 > > items: >=20 > No, your code is very different. >=20 > > were already in the binding): >=20 > I see only one GPIO range. >=20 > >=20 > > https://elixir.bootlin.com/linux/v6.14-rc6/source/Documentation/devicet= ree/bindings/mfd/adi,adp5585.yaml#L70 > >=20 > > If this is not needed I can simplifying during this patch. Is this > > sufficient? > >=20 > > ... > >=20 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 gpio-reserved-ranges: > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 maxItems: 1 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 items: > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - co= nst: 5 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - co= nst: 1 >=20 > Again, different code and not correct as you have now two ranges. Open > original code - it is clear not the same. So two tries - your patch and > code above - are different but I don't get why you claim your code is > identical. >=20 I'm really missing something obvious but how is it different? The original = code was: - if: properties: compatible: contains: const: adi,adp5585-01 then: properties: gpio-reserved-ranges: false else: properties: gpio-reserved-ranges: maxItems: 1 items: items: - const: 5 - const: 1 Now, I have: - if: properties: compatible: contains: const: adi,adp5585-01 then: properties: gpio-reserved-ranges: false else: if: properties: compatible: contains: enum: - adi,adp5585-00 - adi,adp5585-02 - adi,adp5585-03 - adi,adp5585-04 then: properties: gpio-reserved-ranges: maxItems: 1 items: items: - const: 5 - const: 1 else: properties: gpio-reserved-ranges: false So the only thing I have is the nested 'if else' (that you already complain= ed about) and I need to have 'gpio-reserved-ranges: false' for the adp5589 fam= ily of devices since there is no such constrain. But this part: properties: gpio-reserved-ranges: maxItems: 1 items: items: - const: 5 - const: 1 is very much what we have today. So, sorry if I'm missing something obvious but I'm really not getting what = you mean... - Nuno S=C3=A1