devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pratyush Yadav <p.yadav@ti.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Cc: Andi Shyti <andi@etezian.org>, Mark Brown <broonie@kernel.org>,
	Rob Herring <robh+dt@kernel.org>, <linux-spi@vger.kernel.org>,
	<linux-samsung-soc@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	Sam Protsenko <semen.protsenko@linaro.org>
Subject: Re: [PATCH v3 2/4] spi: dt-bindings: samsung: convert to dtschema
Date: Thu, 20 Jan 2022 14:30:02 +0530	[thread overview]
Message-ID: <20220120090002.hg4jmb7q2s25k64y@ti.com> (raw)
In-Reply-To: <0c0a22ed-2c4b-374c-4f4c-06afd4e8681d@canonical.com>

On 20/01/22 08:36AM, Krzysztof Kozlowski wrote:
> On 20/01/2022 08:06, Pratyush Yadav wrote:
> > On 19/01/22 08:49PM, Krzysztof Kozlowski wrote:
> >> On 19/01/2022 20:31, Pratyush Yadav wrote:
> >>> On 12/01/22 11:00AM, Krzysztof Kozlowski wrote:
> >>>> Convert the Samsung SoC (S3C24xx, S3C64xx, S5Pv210, Exynos) SPI
> >>>> controller bindings to DT schema format
> >>>>
> >>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> >>>> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
> >>>> ---
> >>>>  .../spi/samsung,spi-peripheral-props.yaml     |  35 ++++
> >>>>  .../devicetree/bindings/spi/samsung,spi.yaml  | 187 ++++++++++++++++++
> >>>>  .../bindings/spi/spi-peripheral-props.yaml    |   1 +
> >>>>  .../devicetree/bindings/spi/spi-samsung.txt   | 122 ------------
> >>>>  MAINTAINERS                                   |   2 +-
> >>>>  5 files changed, 224 insertions(+), 123 deletions(-)
> >>>>  create mode 100644 Documentation/devicetree/bindings/spi/samsung,spi-peripheral-props.yaml
> >>>>  create mode 100644 Documentation/devicetree/bindings/spi/samsung,spi.yaml
> >>>>  delete mode 100644 Documentation/devicetree/bindings/spi/spi-samsung.txt
> >>>>
> >>>> diff --git a/Documentation/devicetree/bindings/spi/samsung,spi-peripheral-props.yaml b/Documentation/devicetree/bindings/spi/samsung,spi-peripheral-props.yaml
> >>>> new file mode 100644
> >>>> index 000000000000..aa5a1f48494b
> >>>> --- /dev/null
> >>>> +++ b/Documentation/devicetree/bindings/spi/samsung,spi-peripheral-props.yaml
> >>>> @@ -0,0 +1,35 @@
> >>>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> >>>> +%YAML 1.2
> >>>> +---
> >>>> +$id: http://devicetree.org/schemas/spi/samsung,spi-peripheral-props.yaml#
> >>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> >>>> +
> >>>> +title: Peripheral-specific properties for Samsung S3C/S5P/Exynos SoC SPI controller
> >>>> +
> >>>> +maintainers:
> >>>> +  - Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> >>>> +
> >>>> +description:
> >>>> +  See spi-peripheral-props.yaml for more info.
> >>>> +
> >>>> +properties:
> >>>> +  controller-data:
> >>>> +    type: object
> >>>> +    additionalProperties: false
> >>>> +
> >>>> +    properties:
> >>>> +      samsung,spi-feedback-delay:
> >>>> +        description: |
> >>>> +          The sampling phase shift to be applied on the miso line (to account
> >>>> +          for any lag in the miso line). Valid values:
> >>>> +           - 0: No phase shift.
> >>>> +           - 1: 90 degree phase shift sampling.
> >>>> +           - 2: 180 degree phase shift sampling.
> >>>> +           - 3: 270 degree phase shift sampling.
> >>>> +        $ref: /schemas/types.yaml#/definitions/uint32
> >>>> +        enum: [0, 1, 2, 3]
> >>>> +
> >>>> +    required:
> >>>> +      - samsung,spi-feedback-delay
> >>>
> >>> I am not quite sure if this required would work here. Let's say another 
> >>> controller also uses a controller-data node, but it contains a different 
> >>> set of properties. Won't this cause an error to be raised for that 
> >>> controller since this property is not there?
> >>
> >> The controller-data is Samsung SPI specific (does not exist in any other
> >> binding), so why would controller-data get added to a different controller?
> > 
> > It does not as of now, but the name is fairly generic and some 
> > controller in the future might use it. I do not think it is a good idea 
> > to list required properties in X-peripheral-props.yaml in general since 
> > all those will be collected by spi-peripheral-props.yaml and so will 
> > apply to _all_ controllers that reference it.
> 
> Right, but have in mind this is merely a bindings conversion. These were
> made like this long time ago.

Yes, but the bindings infrastructure is not capable of handling these 
required properties as of now. So even if your next patch was _not_ 
making it optional, I would still say you should drop the "required:". 
Even though the property is actually a required one, we currently do not 
have the means to express that.

> 
> I think we can drop the "required:" entirely with the commit 3/4 which
> makes it optional.

I would prefer you never add it in the first place.

-- 
Regards,
Pratyush Yadav
Texas Instruments Inc.

  reply	other threads:[~2022-01-20  9:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-12 10:00 [PATCH v3 0/4] spi: dt-bindings: samsung: convert to dtschema Krzysztof Kozlowski
2022-01-12 10:00 ` [PATCH v3 1/4] ARM: dts: exynos: split dmas into array of phandles in Exynos5250 Krzysztof Kozlowski
2022-01-16 15:28   ` Alim Akhtar
2022-01-12 10:00 ` [PATCH v3 2/4] spi: dt-bindings: samsung: convert to dtschema Krzysztof Kozlowski
2022-01-19 19:31   ` Pratyush Yadav
2022-01-19 19:49     ` Krzysztof Kozlowski
2022-01-20  7:06       ` Pratyush Yadav
2022-01-20  7:36         ` Krzysztof Kozlowski
2022-01-20  9:00           ` Pratyush Yadav [this message]
2022-01-20  9:24             ` Krzysztof Kozlowski
2022-01-20 10:08               ` Pratyush Yadav
2022-01-12 10:00 ` [PATCH v3 3/4] spi: dt-bindings: samsung: allow controller-data to be optional Krzysztof Kozlowski
2022-01-12 10:00 ` [PATCH v3 4/4] spi: s3c64xx: " Krzysztof Kozlowski
2022-01-14  5:57   ` Chanho Park
2022-01-14 16:13   ` Sam Protsenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220120090002.hg4jmb7q2s25k64y@ti.com \
    --to=p.yadav@ti.com \
    --cc=andi@etezian.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=semen.protsenko@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).