Re: [PATCH v3 2/3] dt-bindings: iio: adc: Add support for QCOM PMIC5 Gen3 ADC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx/)

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





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux