From mboxrd@z Thu Jan 1 00:00:00 1970 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 E08AA185B4D; Mon, 4 Nov 2024 11:37:32 +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=1730720253; cv=none; b=ChZAH+98QLq9Rqo5ZmUSrBbtrX9tsuyDb+UtXQx5Osp68rCBLDp8bDIGWKmmdcOV/mv44PEInPbJQjzTTYpwr8Ic6uORzecgsm/XPZoQBp2VFtn5F++XKvEVGSszjhC8OOAmn+L9t3jUFmiJXkrkiRPnUZo8OlAeBuby9Ts8my8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730720253; c=relaxed/simple; bh=r0F7WWieVy3G1VNWPIWM2T4e1JEAK4pK6vQsE3LT8/g=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ICz+ZuixrW3cP6Pjsjj3/HleLwiJwCn6NqCtGheW+ErDs8WGGn0SQlZYef9BNbIxhQcn0Sdnma6VAwGM7OotwoI52YsEYn3/M0GgExDD+gdln9J2eJbQ575Utx/1jfil/UXr0NSu6+JTjWUFhWpBcPjCiviM/0WJnZeurnl52Wo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WjYy3U1A; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WjYy3U1A" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8F67C4CECE; Mon, 4 Nov 2024 11:37:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730720252; bh=r0F7WWieVy3G1VNWPIWM2T4e1JEAK4pK6vQsE3LT8/g=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=WjYy3U1AobPrUtwdAIEqkg0GLwohYbqHHLLiXv53qNDF1oik49YeZmX9T9naY3H2s AsHCzYY2Ld/iRPoOcVGt1I4QvsweQZqnDDPRjmrDg3ysXuZS+jTAEU6lo/la0zecLt 6iuPYlPtY0GoVff5TGjm712paAM61lqNRs8WIrfcC9LI3//pWHFWeEQ8Mz8lkq4BHo bYKqxtMSL86VC/Nr81+YaFNaxhoWo0HBSIufAFXHq/yPPp1LB9Bz9qpVp47grgE5Ij KzVM8PhfXg4V9UTUPSPvwxoX0Ot6sfYvbmYvBV0yNoy5Fvp0F5mYPsECmym5UZEpJk 4qMDnFLMGPTWg== Message-ID: Date: Mon, 4 Nov 2024 12:37:24 +0100 Precedence: bulk X-Mailing-List: linux-can@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH] dt-bindings: can: convert tcan4x5x.txt to DT schema To: Sean Nyekjaer Cc: Marc Kleine-Budde , Vincent Mailhol , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-can@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20241104085616.469862-1-sean@geanix.com> <2mx3fpwo5miho3tdhfbt7ogwnifnhe7qlvjs3zjb2y2iifgjwo@23mxoxvwsogy> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzk@kernel.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf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PwARAQABwsF8BBgBCgAmAhsMFiEEm9B+DgxR+NWWd7dUG5NDfTtB YpsFAmA872oFCRRflLYACgkQG5NDfTtBYpvScw/9GrqBrVLuJoJ52qBBKUBDo4E+5fU1bjt0 Gv0nh/hNJuecuRY6aemU6HOPNc2t8QHMSvwbSF+Vp9ZkOvrM36yUOufctoqON+wXrliEY0J4 ksR89ZILRRAold9Mh0YDqEJc1HmuxYLJ7lnbLYH1oui8bLbMBM8S2Uo9RKqV2GROLi44enVt vdrDvo+CxKj2K+d4cleCNiz5qbTxPUW/cgkwG0lJc4I4sso7l4XMDKn95c7JtNsuzqKvhEVS oic5by3fbUnuI0cemeizF4QdtX2uQxrP7RwHFBd+YUia7zCcz0//rv6FZmAxWZGy5arNl6Vm lQqNo7/Poh8WWfRS+xegBxc6hBXahpyUKphAKYkah+m+I0QToCfnGKnPqyYIMDEHCS/RfqA5 t8F+O56+oyLBAeWX7XcmyM6TGeVfb+OZVMJnZzK0s2VYAuI0Rl87FBFYgULdgqKV7R7WHzwD uZwJCLykjad45hsWcOGk3OcaAGQS6NDlfhM6O9aYNwGL6tGt/6BkRikNOs7VDEa4/HlbaSJo 7FgndGw1kWmkeL6oQh7wBvYll2buKod4qYntmNKEicoHGU+x91Gcan8mCoqhJkbqrL7+nXG2 5Q/GS5M9RFWS+nYyJh+c3OcfKqVcZQNANItt7+ULzdNJuhvTRRdC3g9hmCEuNSr+CLMdnRBY fv0= In-Reply-To: <2mx3fpwo5miho3tdhfbt7ogwnifnhe7qlvjs3zjb2y2iifgjwo@23mxoxvwsogy> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 04/11/2024 11:54, Sean Nyekjaer wrote: > > diff --git a/Documentation/devicetree/bindings/net/can/ti,tcan4x5x.yaml b/Documentation/devicetree/bindings/net/can/ti,tcan4x5x.yaml > index 9ff52b8b3063..0fc37b10e899 100644 > --- a/Documentation/devicetree/bindings/net/can/ti,tcan4x5x.yaml > +++ b/Documentation/devicetree/bindings/net/can/ti,tcan4x5x.yaml > @@ -50,7 +50,7 @@ properties: > maxItems: 1 > > bosch,mram-cfg: > - $ref: bosch,m_can.yaml# > + $ref: /schemas/net/can/bosch,m_can.yaml#/properties/bosch,mram-cfg > > spi-max-frequency: > description: > > Still results in: > % make dt_binding_check DT_SCHEMA_FILES=ti,tcan4x5x.yaml > SCHEMA Documentation/devicetree/bindings/processed-schema.json > CHKDT Documentation/devicetree/bindings > Documentation/devicetree/bindings/net/can/ti,tcan4x5x.yaml: properties:bosch,mram-cfg: 'anyOf' conditional failed, one must be fixed: > 'description' is a dependency of '$ref' > '/schemas/net/can/bosch,m_can.yaml#/properties/bosch,mram-cfg' does not match 'types.yaml#/definitions/' > hint: A vendor property needs a $ref to types.yaml > '/schemas/net/can/bosch,m_can.yaml#/properties/bosch,mram-cfg' does not match '^#/(definitions|\\$defs)/' > hint: A vendor property can have a $ref to a a $defs schema > hint: Vendor specific properties must have a type and description unless they have a defined, common suffix. > from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml# Yeah, probably not much benefits of referencing other schema. Just copy the property. > >> >>> >>> Any hints to share a property? >>> >>> .../devicetree/bindings/net/can/tcan4x5x.txt | 48 --------- >>> .../bindings/net/can/ti,tcan4x5x.yaml | 97 +++++++++++++++++++ >>> 2 files changed, 97 insertions(+), 48 deletions(-) >>> delete mode 100644 Documentation/devicetree/bindings/net/can/tcan4x5x.txt >>> create mode 100644 Documentation/devicetree/bindings/net/can/ti,tcan4x5x.yaml >>> >> >> ... >> >>> diff --git a/Documentation/devicetree/bindings/net/can/ti,tcan4x5x.yaml b/Documentation/devicetree/bindings/net/can/ti,tcan4x5x.yaml >>> new file mode 100644 >>> index 000000000000..62c108fac6b3 >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/net/can/ti,tcan4x5x.yaml >>> @@ -0,0 +1,97 @@ >>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) >>> +%YAML 1.2 >>> +--- >>> +$id: http://devicetree.org/schemas/net/can/ti,tcan4x5x.yaml# >>> +$schema: http://devicetree.org/meta-schemas/core.yaml# >>> + >>> +title: Texas Instruments TCAN4x5x CAN Controller >>> + >>> +maintainers: >>> + - Marc Kleine-Budde >>> + >>> +allOf: >>> + - $ref: can-controller.yaml# >>> + >>> +properties: >>> + compatible: >>> + oneOf: >>> + - enum: >>> + - ti,tcan4552 >>> + - ti,tcan4553 >>> + - ti,tcan4x5x >> >> That's not really what old binding said. >> >> It said for example: >> "ti,tcan4552", "ti,tcan4x5x" >> >> Which is not allowed above. You need list. Considering there are no >> in-tree users of ti,tcan4x5x alone, I would allow only lists followed by >> ti,tcan4x5x. IOW: disallow ti,tcan4x5x alone. >> >> Mention this change to the binding in the commit message. >> >> > > I would prefer to not change anything other that doing the conversion to > DT schema. Well, above you changed a lot :/, but fine - wildcard can stay. But anyway compatible list has to be fixed. > >>> + >>> + reg: >>> + maxItems: 1 >>> + >>> + interrupts: >>> + maxItems: 1 >>> + >>> + clocks: >>> + maxItems: 1 >>> + >>> + vdd-supply: >>> + description: Regulator that powers the CAN controller. >>> + >>> + xceiver-supply: >>> + description: Regulator that powers the CAN transceiver. >> >> You need to mention all changes done to the binding in the commit msg. >> > Is this a change? It existed in the old doc aswell... Where? I pointed out that this is a change. I cannot find it. If you disagree, please point to the patch. And it's tricky for me to prove my point - to show that such thing did not exist... Two more comments below: > >>> + >>> + reset-gpios: >>> + description: Hardwired output GPIO. If not defined then software reset. >>> + maxItems: 1 >>> + >>> + device-state-gpios: >>> + description: Input GPIO that indicates if the device is in a sleep state or if the device is active. Please wrap code according to coding style (checkpatch is not a coding style description, but only a tool). >>> + Not available with tcan4552/4553. Then you need if:then: inside allOf: block disallowing it for this variant. https://elixir.bootlin.com/linux/v5.19/source/Documentation/devicetree/bindings/example-schema.yaml#L223 Best regards, Krzysztof