[PATCH v1 13/14] dt-bindings: input/touchscreen: Convert MELFAS MIP4 Touchscreen to YAML

Ariel D'Alessandro posted 14 patches 1 month, 2 weeks ago
There is a newer version of this series
[PATCH v1 13/14] dt-bindings: input/touchscreen: Convert MELFAS MIP4 Touchscreen to YAML
Posted by Ariel D'Alessandro 1 month, 2 weeks ago
Convert the existing text-based DT bindings for MELFAS MIP4 Touchscreen
controller to a YAML schema.

Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
---
 .../input/touchscreen/melfas,mip4_ts.yaml     | 55 +++++++++++++++++++
 .../input/touchscreen/melfas_mip4.txt         | 20 -------
 2 files changed, 55 insertions(+), 20 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/melfas,mip4_ts.yaml
 delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/melfas_mip4.txt

diff --git a/Documentation/devicetree/bindings/input/touchscreen/melfas,mip4_ts.yaml b/Documentation/devicetree/bindings/input/touchscreen/melfas,mip4_ts.yaml
new file mode 100644
index 0000000000000..170fd4212467e
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/touchscreen/melfas,mip4_ts.yaml
@@ -0,0 +1,55 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/touchscreen/melfas,mip4_ts.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MELFAS MIP4 Touchscreen
+
+maintainers:
+  - Ariel D'Alessandro <ariel.dalessandro@collabora.com>
+
+properties:
+  compatible:
+    const: "melfas,mip4_ts"
+
+  reg:
+    description: I2C address of the chip (0x48 or 0x34)
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  ce-gpios:
+    description: GPIO connected to the CE (chip enable) pin of the chip
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        touchscreen@34 {
+            compatible = "melfas,mip4_ts";
+            reg = <0x34>;
+
+            interrupts-extended = <&tlmm 13 IRQ_TYPE_EDGE_FALLING>;
+            ce-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>;
+
+            pinctrl-0 = <&touchscreen_default>;
+            pinctrl-names = "default";
+        };
+    };
+
+...
diff --git a/Documentation/devicetree/bindings/input/touchscreen/melfas_mip4.txt b/Documentation/devicetree/bindings/input/touchscreen/melfas_mip4.txt
deleted file mode 100644
index b2ab5498e5190..0000000000000
--- a/Documentation/devicetree/bindings/input/touchscreen/melfas_mip4.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-* MELFAS MIP4 Touchscreen
-
-Required properties:
-- compatible: must be "melfas,mip4_ts"
-- reg: I2C slave address of the chip (0x48 or 0x34)
-- interrupts: interrupt to which the chip is connected
-
-Optional properties:
-- ce-gpios: GPIO connected to the CE (chip enable) pin of the chip
-
-Example:
-	i2c@00000000 {
-		touchscreen: melfas_mip4@48 {
-			compatible = "melfas,mip4_ts";
-			reg = <0x48>;
-			interrupt-parent = <&gpio>;
-			interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
-			ce-gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
-		};
-	};
-- 
2.50.1
Re: [PATCH v1 13/14] dt-bindings: input/touchscreen: Convert MELFAS MIP4 Touchscreen to YAML
Posted by Rob Herring 1 month, 1 week ago
On Wed, Aug 20, 2025 at 02:13:01PM -0300, Ariel D'Alessandro wrote:
> Convert the existing text-based DT bindings for MELFAS MIP4 Touchscreen
> controller to a YAML schema.
> 
> Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
> ---
>  .../input/touchscreen/melfas,mip4_ts.yaml     | 55 +++++++++++++++++++
>  .../input/touchscreen/melfas_mip4.txt         | 20 -------
>  2 files changed, 55 insertions(+), 20 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/input/touchscreen/melfas,mip4_ts.yaml
>  delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/melfas_mip4.txt
> 
> diff --git a/Documentation/devicetree/bindings/input/touchscreen/melfas,mip4_ts.yaml b/Documentation/devicetree/bindings/input/touchscreen/melfas,mip4_ts.yaml
> new file mode 100644
> index 0000000000000..170fd4212467e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/touchscreen/melfas,mip4_ts.yaml
> @@ -0,0 +1,55 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/input/touchscreen/melfas,mip4_ts.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: MELFAS MIP4 Touchscreen
> +
> +maintainers:
> +  - Ariel D'Alessandro <ariel.dalessandro@collabora.com>
> +
> +properties:
> +  compatible:
> +    const: "melfas,mip4_ts"

Drop quotes. With that,

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Re: [PATCH v1 13/14] dt-bindings: input/touchscreen: Convert MELFAS MIP4 Touchscreen to YAML
Posted by Ariel D'Alessandro 3 weeks, 2 days ago
Rob,

On 8/22/25 12:52 PM, Rob Herring wrote:
> On Wed, Aug 20, 2025 at 02:13:01PM -0300, Ariel D'Alessandro wrote:
>> Convert the existing text-based DT bindings for MELFAS MIP4 Touchscreen
>> controller to a YAML schema.
>>
>> Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
>> ---
>>   .../input/touchscreen/melfas,mip4_ts.yaml     | 55 +++++++++++++++++++
>>   .../input/touchscreen/melfas_mip4.txt         | 20 -------
>>   2 files changed, 55 insertions(+), 20 deletions(-)
>>   create mode 100644 Documentation/devicetree/bindings/input/touchscreen/melfas,mip4_ts.yaml
>>   delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/melfas_mip4.txt
>>
>> diff --git a/Documentation/devicetree/bindings/input/touchscreen/melfas,mip4_ts.yaml b/Documentation/devicetree/bindings/input/touchscreen/melfas,mip4_ts.yaml
>> new file mode 100644
>> index 0000000000000..170fd4212467e
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/input/touchscreen/melfas,mip4_ts.yaml
>> @@ -0,0 +1,55 @@
>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/input/touchscreen/melfas,mip4_ts.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: MELFAS MIP4 Touchscreen
>> +
>> +maintainers:
>> +  - Ariel D'Alessandro <ariel.dalessandro@collabora.com>
>> +
>> +properties:
>> +  compatible:
>> +    const: "melfas,mip4_ts"
> 
> Drop quotes. With that,
> 
> Reviewed-by: Rob Herring (Arm) <robh@kernel.org>

Ack.

Thanks,

-- 
Ariel D'Alessandro
Software Engineer

Collabora Ltd.
Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK 
Registered in England & Wales, no. 5513718
Re: [PATCH v1 13/14] dt-bindings: input/touchscreen: Convert MELFAS MIP4 Touchscreen to YAML
Posted by Linus Walleij 1 month, 1 week ago
Hi Ariel,

thanks for your patch!

On Wed, Aug 20, 2025 at 7:17 PM Ariel D'Alessandro
<ariel.dalessandro@collabora.com> wrote:

> +  ce-gpios:
> +    description: GPIO connected to the CE (chip enable) pin of the chip
> +    maxItems: 1

Mention that this should always have the flag GPIO_ACTIVE_HIGH
as this is required by the hardware.

Unfortunately we have no YAML syntax for enforcing flags :/

With that fix:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Re: [PATCH v1 13/14] dt-bindings: input/touchscreen: Convert MELFAS MIP4 Touchscreen to YAML
Posted by Dmitry Torokhov 4 weeks ago
On Thu, Aug 21, 2025 at 01:56:24PM +0200, Linus Walleij wrote:
> Hi Ariel,
> 
> thanks for your patch!
> 
> On Wed, Aug 20, 2025 at 7:17 PM Ariel D'Alessandro
> <ariel.dalessandro@collabora.com> wrote:
> 
> > +  ce-gpios:
> > +    description: GPIO connected to the CE (chip enable) pin of the chip
> > +    maxItems: 1
> 
> Mention that this should always have the flag GPIO_ACTIVE_HIGH
> as this is required by the hardware.
> 
> Unfortunately we have no YAML syntax for enforcing flags :/

Theoretically there can be an inverter on the line, so from the AP point
of view the line is active low while from the peripheral POV the pin is
active high... 

Thanks.

-- 
Dmitry
Re: [PATCH v1 13/14] dt-bindings: input/touchscreen: Convert MELFAS MIP4 Touchscreen to YAML
Posted by Linus Walleij 4 weeks ago
On Fri, Sep 5, 2025 at 12:02 PM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> On Thu, Aug 21, 2025 at 01:56:24PM +0200, Linus Walleij wrote:
> > Hi Ariel,
> >
> > thanks for your patch!
> >
> > On Wed, Aug 20, 2025 at 7:17 PM Ariel D'Alessandro
> > <ariel.dalessandro@collabora.com> wrote:
> >
> > > +  ce-gpios:
> > > +    description: GPIO connected to the CE (chip enable) pin of the chip
> > > +    maxItems: 1
> >
> > Mention that this should always have the flag GPIO_ACTIVE_HIGH
> > as this is required by the hardware.
> >
> > Unfortunately we have no YAML syntax for enforcing flags :/
>
> Theoretically there can be an inverter on the line, so from the AP point
> of view the line is active low while from the peripheral POV the pin is
> active high...

Yes, I think someone even proposed adding inverters to the
device tree and was nixed.

It's a matter of phrasing I would say:

"Mention that this should nominally have the flag GPIO_ACTIVE_HIGH
as this is required by the hardware."

s/always/nominally/g

Yours,
Linus Walleij
Re: [PATCH v1 13/14] dt-bindings: input/touchscreen: Convert MELFAS MIP4 Touchscreen to YAML
Posted by Krzysztof Kozlowski 3 weeks, 3 days ago
On 05/09/2025 13:33, Linus Walleij wrote:
> On Fri, Sep 5, 2025 at 12:02 PM Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
>> On Thu, Aug 21, 2025 at 01:56:24PM +0200, Linus Walleij wrote:
>>> Hi Ariel,
>>>
>>> thanks for your patch!
>>>
>>> On Wed, Aug 20, 2025 at 7:17 PM Ariel D'Alessandro
>>> <ariel.dalessandro@collabora.com> wrote:
>>>
>>>> +  ce-gpios:
>>>> +    description: GPIO connected to the CE (chip enable) pin of the chip
>>>> +    maxItems: 1
>>>
>>> Mention that this should always have the flag GPIO_ACTIVE_HIGH
>>> as this is required by the hardware.
>>>
>>> Unfortunately we have no YAML syntax for enforcing flags :/
>>
>> Theoretically there can be an inverter on the line, so from the AP point
>> of view the line is active low while from the peripheral POV the pin is
>> active high...
> 
> Yes, I think someone even proposed adding inverters to the
> device tree and was nixed.

It's not about DT, it's about board design - you can (almost?) always
invert the logical signal, so this should match what hardware requires
plus any inverter on the board.


> 
> It's a matter of phrasing I would say:
> 
> "Mention that this should nominally have the flag GPIO_ACTIVE_HIGH

No, please do not, it is wrong. If hardware requires active high, then
just say this is active high. But the actual GPIO flag depends on the
board design if signal is inverted.


Best regards,
Krzysztof
Re: [PATCH v1 13/14] dt-bindings: input/touchscreen: Convert MELFAS MIP4 Touchscreen to YAML
Posted by Ariel D'Alessandro 3 weeks, 2 days ago
Krzysztof, all,

On 9/9/25 3:56 AM, Krzysztof Kozlowski wrote:
> On 05/09/2025 13:33, Linus Walleij wrote:
>> On Fri, Sep 5, 2025 at 12:02 PM Dmitry Torokhov
>> <dmitry.torokhov@gmail.com> wrote:
>>> On Thu, Aug 21, 2025 at 01:56:24PM +0200, Linus Walleij wrote:
>>>> Hi Ariel,
>>>>
>>>> thanks for your patch!
>>>>
>>>> On Wed, Aug 20, 2025 at 7:17 PM Ariel D'Alessandro
>>>> <ariel.dalessandro@collabora.com> wrote:
>>>>
>>>>> +  ce-gpios:
>>>>> +    description: GPIO connected to the CE (chip enable) pin of the chip
>>>>> +    maxItems: 1
>>>>
>>>> Mention that this should always have the flag GPIO_ACTIVE_HIGH
>>>> as this is required by the hardware.
>>>>
>>>> Unfortunately we have no YAML syntax for enforcing flags :/
>>>
>>> Theoretically there can be an inverter on the line, so from the AP point
>>> of view the line is active low while from the peripheral POV the pin is
>>> active high...
>>
>> Yes, I think someone even proposed adding inverters to the
>> device tree and was nixed.
> 
> It's not about DT, it's about board design - you can (almost?) always
> invert the logical signal, so this should match what hardware requires
> plus any inverter on the board.
> 
> 
>>
>> It's a matter of phrasing I would say:
>>
>> "Mention that this should nominally have the flag GPIO_ACTIVE_HIGH
> 
> No, please do not, it is wrong. If hardware requires active high, then
> just say this is active high. But the actual GPIO flag depends on the
> board design if signal is inverted.

After the discussion from this thread, will mark it a "active high" in 
the property description for v2.

Thanks,

-- 
Ariel D'Alessandro
Software Engineer

Collabora Ltd.
Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK 
Registered in England & Wales, no. 5513718