devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jishnu Prakash <quic_jprakash@quicinc.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	<jic23@kernel.org>, <robh+dt@kernel.org>,
	<krzysztof.kozlowski+dt@linaro.org>, <conor+dt@kernel.org>,
	<andersson@kernel.org>, <konrad.dybcio@linaro.org>,
	<lee@kernel.org>, <andriy.shevchenko@linux.intel.com>,
	<daniel.lezcano@linaro.org>, <dmitry.baryshkov@linaro.org>
Cc: <lars@metafoo.de>, <luca@z3ntu.xyz>,
	<marijn.suijten@somainline.org>, <agross@kernel.org>,
	<sboyd@kernel.org>, <rafael@kernel.org>, <rui.zhang@intel.com>,
	<lukasz.luba@arm.com>, <linus.walleij@linaro.org>,
	<quic_subbaram@quicinc.com>, <quic_collinsd@quicinc.com>,
	<quic_amelende@quicinc.com>, <quic_kamalw@quicinc.com>,
	<kernel@quicinc.com>, <linux-kernel@vger.kernel.org>,
	<linux-arm-msm@vger.kernel.org>,
	<linux-arm-msm-owner@vger.kernel.org>,
	<linux-iio@vger.kernel.org>, <linux-pm@vger.kernel.org>,
	<devicetree@vger.kernel.org>,
	<cros-qcom-dts-watchers@chromium.org>
Subject: Re: [PATCH v3 2/3] dt-bindings: iio: adc: Add support for QCOM PMIC5 Gen3 ADC
Date: Thu, 14 Mar 2024 13:58:21 +0530	[thread overview]
Message-ID: <1537d42f-fe61-48c2-9ee2-1066db71a19e@quicinc.com> (raw)
In-Reply-To: <d3dc9a41-4738-4634-9a98-fefcf418f552@linaro.org>

Hi Krzysztof,

On 2/21/2024 12:49 PM, Krzysztof Kozlowski wrote:
> On 21/02/2024 06:36, Jishnu Prakash wrote:
>> Hi Krzysztof,
>>
>> On 2/17/2024 7:43 PM, Krzysztof Kozlowski wrote:
>>> On 16/02/2024 11:39, Jishnu Prakash wrote:
>>>> Hi Krzysztof,
>>>>


>>
>>> How is this a problem?
>>
>> In qcom,spmi-vadc.yaml, we have the following top-level constraints for
>> the "reg" and "interrupts" properties:
>>
>>     reg:
>>       maxItems: 1
>>
>>     interrupts:
>>       maxItems: 1
>>
>> For the ADC5 Gen3 device being added now, these constraints cannot be
>> followed always, as there may be more than one peripheral under one
>> device instance, each with a corresponding interrupt. For example, the
>> above properties could be like this for a ADC5 Gen3 device:
>>
>>       reg = <0x9000>, <0x9100>;
>>       interrupts = <0x0 0x90 0x1 IRQ_TYPE_EDGE_RISING>,
>>                    <0x0 0x91 0x1 IRQ_TYPE_EDGE_RISING>;
>>
>>
>> I could not overwrite the top-level constraints for the new device
>> "qcom,spmi-adc5-gen3" alone in qcom,spmi-vadc.yaml, so I tried to remove
>> the constraints from the top level and add them back conditionally for
>> all the device types separately, but you told me not to remove them
>> (full message:
>> https://lore.kernel.org/linux-iio/832053f4-bd5d-4e58-81bb-1a8188e7f364@linaro.org/)
> 
> Because top-level widest constraints must stay, but it is not a problem.
> Most of the multi-device bindings work like this. Dozen of Qualcomm. Why
> you cannot do this the same way we do for all Qualcomm devices?
> 

I would like to clarify a point with you related to the top-level 
constraints, as I think I have not asked this exact question earlier.

For these top-level constraints in qcom,spmi-vadc.yaml:

     reg:
       maxItems: 1

     interrupts:
       maxItems: 1

If we add ADC5 Gen3 bindings in the same file, is it acceptable to 
update the top-level constraints to something like this:

     reg:
       minItems: 1
       maxItems: 2

     interrupts:
       minItems: 1
       maxItems: 2

followed by updating maxItems back to 1 for all the earlier existing 
compatibles, using if:then: conditions, like the below example?

   - if:
       properties:
         compatible:
           contains:
             const: qcom,spmi-adc5

     then:
       properties:
         reg:
           maxItems: 1
         interrupts:
           maxItems: 1


If this is acceptable, I'll add ADC5 Gen3 bindings in the same file with 
changes like the above, else I'll add them in a new file after first 
creating a common schema file as you suggested.

Thanks,
Jishnu

>>
>> Since these constraints cannot be modified for a specific new device or
> 
> ???
> 
>> removed, I think the only way to accommodate this new device is to add
>> it in its own new file.
>>
>> Is this a sufficient justification for adding this documentation in a
>> new file or do you have any other suggestions?
> 
> I already gave you the suggestions and you ignored them. Do like we are
> doing for all other drivers. Don't re-invent stuff. Either this fits to
> existing schema or come with common schema (and then provide rationale
> why it does not fit to existing one).
> 
> Best regards,
> Krzysztof
> 

  reply	other threads:[~2024-03-14  8:29 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-31 17:12 [PATCH v3 0/3] iio: adc: Add support for QCOM SPMI PMIC5 Gen3 ADC Jishnu Prakash
2023-12-31 17:12 ` [PATCH v3 1/3] dt-bindings: iio/adc: Move QCOM ADC bindings to iio/adc folder Jishnu Prakash
2024-01-04  8:08   ` Krzysztof Kozlowski
2023-12-31 17:12 ` [PATCH v3 2/3] dt-bindings: iio: adc: Add support for QCOM PMIC5 Gen3 ADC Jishnu Prakash
2023-12-31 17:41   ` Dmitry Baryshkov
2024-01-01 18:02   ` Jonathan Cameron
2024-02-16 10:39     ` Jishnu Prakash
2024-02-16 13:45       ` Jonathan Cameron
2024-01-04  8:18   ` Krzysztof Kozlowski
2024-02-16 11:44     ` Jishnu Prakash
2024-02-17 14:15       ` Krzysztof Kozlowski
     [not found]     ` <13f2b558-a50d-44d3-85de-38e230212732@quicinc.com>
2024-02-16 10:48       ` Dmitry Baryshkov
2024-02-16 11:18         ` Jishnu Prakash
2024-02-17 14:13       ` Krzysztof Kozlowski
2024-02-21  5:36         ` Jishnu Prakash
2024-02-21  7:19           ` Krzysztof Kozlowski
2024-03-14  8:28             ` Jishnu Prakash [this message]
2024-03-14  8:36               ` Krzysztof Kozlowski
2023-12-31 17:12 ` [PATCH v3 3/3] " Jishnu Prakash
2023-12-31 17:46   ` Dmitry Baryshkov
2024-02-14 13:58     ` Jishnu Prakash
2024-02-16 10:52       ` Dmitry Baryshkov
2024-01-01 17:54   ` Jonathan Cameron
2024-02-16 11:44     ` Jishnu Prakash
     [not found]     ` <b02f20fd-c682-4b47-8d61-1d0e2adbdd57@quicinc.com>
2024-02-16 13:54       ` Jonathan Cameron

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=1537d42f-fe61-48c2-9ee2-1066db71a19e@quicinc.com \
    --to=quic_jprakash@quicinc.com \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=conor+dt@kernel.org \
    --cc=cros-qcom-dts-watchers@chromium.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=jic23@kernel.org \
    --cc=kernel@quicinc.com \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lars@metafoo.de \
    --cc=lee@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-msm-owner@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=luca@z3ntu.xyz \
    --cc=lukasz.luba@arm.com \
    --cc=marijn.suijten@somainline.org \
    --cc=quic_amelende@quicinc.com \
    --cc=quic_collinsd@quicinc.com \
    --cc=quic_kamalw@quicinc.com \
    --cc=quic_subbaram@quicinc.com \
    --cc=rafael@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=sboyd@kernel.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).