diff mbox series

[v2,01/20] ASoC: dt-bindings: Add document for mt6359-accdet

Message ID 20250302-mt6359-accdet-dts-v2-1-5bd633ee0d47@collabora.com (mailing list archive)
State New
Headers show
Series Get mt6359-accdet ready for usage in Devicetree | expand

Commit Message

Nícolas F. R. A. Prado March 2, 2025, 4:30 p.m. UTC
Add dt-binding for the MT6359 ACCDET hardware block.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
---
 .../bindings/sound/mediatek,mt6359-accdet.yaml     | 42 ++++++++++++++++++++++
 1 file changed, 42 insertions(+)

Comments

AngeloGioacchino Del Regno March 3, 2025, 11:14 a.m. UTC | #1
Il 02/03/25 17:30, Nícolas F. R. A. Prado ha scritto:
> Add dt-binding for the MT6359 ACCDET hardware block.
> 
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
> ---
>   .../bindings/sound/mediatek,mt6359-accdet.yaml     | 42 ++++++++++++++++++++++
>   1 file changed, 42 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/sound/mediatek,mt6359-accdet.yaml b/Documentation/devicetree/bindings/sound/mediatek,mt6359-accdet.yaml
> new file mode 100644
> index 0000000000000000000000000000000000000000..d08a79301409374714c76135b061e20e8e8acfaf
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/mediatek,mt6359-accdet.yaml
> @@ -0,0 +1,42 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/sound/mediatek,mt6359-accdet.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: MT6359 Accessory Detection
> +
> +maintainers:
> +  - Nícolas F. R. A. Prado <nfraprado@collabora.com>
> +
> +description: |
> +  The MT6359 Accessory Detection block is part of the MT6359 PMIC and allows
> +  detecting audio jack insertion and removal, as well as identifying the type of
> +  events connected to the jack.
> +
> +properties:
> +  compatible:
> +    const: mediatek,mt6359-accdet
> +
> +  mediatek,hp-eint-high:
> +    type: boolean
> +    description:
> +      By default, the HP_EINT pin is assumed to be pulled high and connected to

Just to be clearer about this pin being an internal one and not externally sourced,
so, *not* a SoC GPIO, but somehing that is completely provided and handled by the
accdet IP...

"By default, the accdet IP's internal HP_EINT pin is assumed to be pulled ..."

After which:

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

> +      a normally open 3.5mm jack. Plug insertion is detected when the pin is
> +      brought low in that case. Add this property if the behavior should be
> +      inverted, for example if a normally closed 3.5mm jack is used, or if the
> +      line is pulled low on open.
> +
> +required:
> +  - compatible
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +
> +    accdet: accdet {
> +        compatible = "mediatek,mt6359-accdet";
> +        mediatek,hp-eint-high;
> +    };
>
Nícolas F. R. A. Prado March 3, 2025, 2:45 p.m. UTC | #2
On Mon, Mar 03, 2025 at 12:14:51PM +0100, AngeloGioacchino Del Regno wrote:
> Il 02/03/25 17:30, Nícolas F. R. A. Prado ha scritto:
> > Add dt-binding for the MT6359 ACCDET hardware block.
> > 
> > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
> > ---
> >   .../bindings/sound/mediatek,mt6359-accdet.yaml     | 42 ++++++++++++++++++++++
> >   1 file changed, 42 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/sound/mediatek,mt6359-accdet.yaml b/Documentation/devicetree/bindings/sound/mediatek,mt6359-accdet.yaml
> > new file mode 100644
> > index 0000000000000000000000000000000000000000..d08a79301409374714c76135b061e20e8e8acfaf
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/sound/mediatek,mt6359-accdet.yaml
> > @@ -0,0 +1,42 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/sound/mediatek,mt6359-accdet.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: MT6359 Accessory Detection
> > +
> > +maintainers:
> > +  - Nícolas F. R. A. Prado <nfraprado@collabora.com>
> > +
> > +description: |
> > +  The MT6359 Accessory Detection block is part of the MT6359 PMIC and allows
> > +  detecting audio jack insertion and removal, as well as identifying the type of
> > +  events connected to the jack.
> > +
> > +properties:
> > +  compatible:
> > +    const: mediatek,mt6359-accdet
> > +
> > +  mediatek,hp-eint-high:
> > +    type: boolean
> > +    description:
> > +      By default, the HP_EINT pin is assumed to be pulled high and connected to
> 
> Just to be clearer about this pin being an internal one and not externally sourced,
> so, *not* a SoC GPIO, but somehing that is completely provided and handled by the
> accdet IP...
> 
> "By default, the accdet IP's internal HP_EINT pin is assumed to be pulled ..."

The HP_EINT is an external, not internal, pin of the MT6359 PMIC. It is an input
pin of the MT6359 IC that gets wired to the tip (left channel) of a 3.5mm audio
jack to allow for detecting when a plug is connected.

Since this dt-binding is about an IP in the MT6359 PMIC, I think when saying
"HP_EINT pin" it is already clear that the pin is on the MT6359 IC, but if you
think it's necessary I could make it "MT6359's HP_EINT pin".

Thanks,
Nícolas
Rob Herring (Arm) March 3, 2025, 3:11 p.m. UTC | #3
On Sun, Mar 02, 2025 at 01:30:40PM -0300, Nícolas F. R. A. Prado wrote:
> Add dt-binding for the MT6359 ACCDET hardware block.
> 
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
> ---
>  .../bindings/sound/mediatek,mt6359-accdet.yaml     | 42 ++++++++++++++++++++++
>  1 file changed, 42 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/sound/mediatek,mt6359-accdet.yaml b/Documentation/devicetree/bindings/sound/mediatek,mt6359-accdet.yaml
> new file mode 100644
> index 0000000000000000000000000000000000000000..d08a79301409374714c76135b061e20e8e8acfaf
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/mediatek,mt6359-accdet.yaml
> @@ -0,0 +1,42 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/sound/mediatek,mt6359-accdet.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: MT6359 Accessory Detection
> +
> +maintainers:
> +  - Nícolas F. R. A. Prado <nfraprado@collabora.com>
> +
> +description: |

Don't need '|'.

> +  The MT6359 Accessory Detection block is part of the MT6359 PMIC and allows
> +  detecting audio jack insertion and removal, as well as identifying the type of
> +  events connected to the jack.
> +
> +properties:
> +  compatible:
> +    const: mediatek,mt6359-accdet
> +
> +  mediatek,hp-eint-high:
> +    type: boolean
> +    description:
> +      By default, the HP_EINT pin is assumed to be pulled high and connected to
> +      a normally open 3.5mm jack. Plug insertion is detected when the pin is
> +      brought low in that case. Add this property if the behavior should be
> +      inverted, for example if a normally closed 3.5mm jack is used, or if the
> +      line is pulled low on open.
> +
> +required:
> +  - compatible
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +
> +    accdet: accdet {
> +        compatible = "mediatek,mt6359-accdet";
> +        mediatek,hp-eint-high;
> +    };
> 
> -- 
> 2.48.1
>
AngeloGioacchino Del Regno March 3, 2025, 3:33 p.m. UTC | #4
Il 03/03/25 15:45, Nícolas F. R. A. Prado ha scritto:
> On Mon, Mar 03, 2025 at 12:14:51PM +0100, AngeloGioacchino Del Regno wrote:
>> Il 02/03/25 17:30, Nícolas F. R. A. Prado ha scritto:
>>> Add dt-binding for the MT6359 ACCDET hardware block.
>>>
>>> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
>>> ---
>>>    .../bindings/sound/mediatek,mt6359-accdet.yaml     | 42 ++++++++++++++++++++++
>>>    1 file changed, 42 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/sound/mediatek,mt6359-accdet.yaml b/Documentation/devicetree/bindings/sound/mediatek,mt6359-accdet.yaml
>>> new file mode 100644
>>> index 0000000000000000000000000000000000000000..d08a79301409374714c76135b061e20e8e8acfaf
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/sound/mediatek,mt6359-accdet.yaml
>>> @@ -0,0 +1,42 @@
>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>> +%YAML 1.2
>>> +---
>>> +$id: http://devicetree.org/schemas/sound/mediatek,mt6359-accdet.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: MT6359 Accessory Detection
>>> +
>>> +maintainers:
>>> +  - Nícolas F. R. A. Prado <nfraprado@collabora.com>
>>> +
>>> +description: |
>>> +  The MT6359 Accessory Detection block is part of the MT6359 PMIC and allows
>>> +  detecting audio jack insertion and removal, as well as identifying the type of
>>> +  events connected to the jack.
>>> +
>>> +properties:
>>> +  compatible:
>>> +    const: mediatek,mt6359-accdet
>>> +
>>> +  mediatek,hp-eint-high:
>>> +    type: boolean
>>> +    description:
>>> +      By default, the HP_EINT pin is assumed to be pulled high and connected to
>>
>> Just to be clearer about this pin being an internal one and not externally sourced,
>> so, *not* a SoC GPIO, but somehing that is completely provided and handled by the
>> accdet IP...
>>
>> "By default, the accdet IP's internal HP_EINT pin is assumed to be pulled ..."
> 
> The HP_EINT is an external, not internal, pin of the MT6359 PMIC. It is an input
> pin of the MT6359 IC that gets wired to the tip (left channel) of a 3.5mm audio
> jack to allow for detecting when a plug is connected.
> 
> Since this dt-binding is about an IP in the MT6359 PMIC, I think when saying
> "HP_EINT pin" it is already clear that the pin is on the MT6359 IC, but if you
> think it's necessary I could make it "MT6359's HP_EINT pin".
> 

Eh I should've better clarified - I was meaning that the pin is managed internally,
so we're not managing an external SoC pin.

"MT6359's HP_EINT pin" looks good to me, btw.

Cheers!
Angelo
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/sound/mediatek,mt6359-accdet.yaml b/Documentation/devicetree/bindings/sound/mediatek,mt6359-accdet.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..d08a79301409374714c76135b061e20e8e8acfaf
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/mediatek,mt6359-accdet.yaml
@@ -0,0 +1,42 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/mediatek,mt6359-accdet.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MT6359 Accessory Detection
+
+maintainers:
+  - Nícolas F. R. A. Prado <nfraprado@collabora.com>
+
+description: |
+  The MT6359 Accessory Detection block is part of the MT6359 PMIC and allows
+  detecting audio jack insertion and removal, as well as identifying the type of
+  events connected to the jack.
+
+properties:
+  compatible:
+    const: mediatek,mt6359-accdet
+
+  mediatek,hp-eint-high:
+    type: boolean
+    description:
+      By default, the HP_EINT pin is assumed to be pulled high and connected to
+      a normally open 3.5mm jack. Plug insertion is detected when the pin is
+      brought low in that case. Add this property if the behavior should be
+      inverted, for example if a normally closed 3.5mm jack is used, or if the
+      line is pulled low on open.
+
+required:
+  - compatible
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    accdet: accdet {
+        compatible = "mediatek,mt6359-accdet";
+        mediatek,hp-eint-high;
+    };