2022-06-01 20:46:00

by Nícolas F. R. A. Prado

[permalink] [raw]
Subject: [PATCH v2 0/2] MT8192 pinctrl properties adjustments


The two patches in this series substitute properties in the mt8192
pinctrl dt-binding for ones which have a clearer meaning and are more
standardized. At this point there's no DT using the mt8192 pinctrl
binding, so if such changes are to be made, they need to happen now.

v1: https://lore.kernel.org/linux-mediatek/[email protected]/

Changes in v2:
- Dropped Fixes tags
- Added 'if' blocks to enforce mutual exclusion of properties

Nícolas F. R. A. Prado (2):
dt-bindings: pinctrl: mt8192: Switch drive-strength-adv for -microamp
dt-bindings: pinctrl: mt8192: Use generic bias instead of pull-*-adv

.../bindings/pinctrl/pinctrl-mt8192.yaml | 81 ++++++++++---------
1 file changed, 41 insertions(+), 40 deletions(-)

--
2.36.1



2022-06-01 20:52:09

by Nícolas F. R. A. Prado

[permalink] [raw]
Subject: [PATCH v2 1/2] dt-bindings: pinctrl: mt8192: Switch drive-strength-adv for -microamp

Commit e5fabbe43f3f ("pinctrl: mediatek: paris: Support generic
PIN_CONFIG_DRIVE_STRENGTH_UA") added support for using
drive-strength-microamp instead of mediatek,drive-strength-adv.

Since there aren't any users of mediatek,drive-strength-adv on mt8192
yet, remove this property and add drive-strength-microamp in its place,
which has a clearer meaning.

While at it, add a new 'if' block to validate that drive-strength and
drive-strength-microamp aren't used together, since they're mutually
exclusive.

Signed-off-by: Nícolas F. R. A. Prado <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>

---

Changes in v2:
- Added 'if' block to make drive-strength and drive-strength-microamp
mutually exclusive
- Changed commit title to be more precise
- Dropped Fixes tag

.../bindings/pinctrl/pinctrl-mt8192.yaml | 35 ++++++-------------
1 file changed, 10 insertions(+), 25 deletions(-)

diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8192.yaml b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8192.yaml
index c90a132fbc79..c8092b218f2f 100644
--- a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8192.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8192.yaml
@@ -80,31 +80,8 @@ patternProperties:
dt-bindings/pinctrl/mt65xx.h. It can only support 2/4/6/8/10/12/14/16mA in mt8192.
enum: [2, 4, 6, 8, 10, 12, 14, 16]

- mediatek,drive-strength-adv:
- description: |
- Describe the specific driving setup property.
- For I2C pins, the existing generic driving setup can only support
- 2/4/6/8/10/12/14/16mA driving. But in specific driving setup, they
- can support 0.125/0.25/0.5/1mA adjustment. If we enable specific
- driving setup, the existing generic setup will be disabled.
- The specific driving setup is controlled by E1E0EN.
- When E1=0/E0=0, the strength is 0.125mA.
- When E1=0/E0=1, the strength is 0.25mA.
- When E1=1/E0=0, the strength is 0.5mA.
- When E1=1/E0=1, the strength is 1mA.
- EN is used to enable or disable the specific driving setup.
- Valid arguments are described as below:
- 0: (E1, E0, EN) = (0, 0, 0)
- 1: (E1, E0, EN) = (0, 0, 1)
- 2: (E1, E0, EN) = (0, 1, 0)
- 3: (E1, E0, EN) = (0, 1, 1)
- 4: (E1, E0, EN) = (1, 0, 0)
- 5: (E1, E0, EN) = (1, 0, 1)
- 6: (E1, E0, EN) = (1, 1, 0)
- 7: (E1, E0, EN) = (1, 1, 1)
- So the valid arguments are from 0 to 7.
- $ref: /schemas/types.yaml#/definitions/uint32
- enum: [0, 1, 2, 3, 4, 5, 6, 7]
+ drive-strength-microamp:
+ enum: [125, 250, 500, 1000]

mediatek,pull-up-adv:
description: |
@@ -138,6 +115,14 @@ patternProperties:
required:
- pinmux

+ allOf:
+ - if:
+ required:
+ - drive-strength-microamp
+ then:
+ properties:
+ drive-strength: false
+
additionalProperties: false

allOf:
--
2.36.1


2022-06-09 14:22:40

by Nícolas F. R. A. Prado

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] dt-bindings: pinctrl: mt8192: Switch drive-strength-adv for -microamp

Hi Guodong,

On Wed, Jun 08, 2022 at 04:08:13PM +0800, Guodong Liu wrote:
> -----Original Message-----
> From: N?colas F. R. A. Prado <[email protected]>
> To: Linus Walleij <[email protected]>
> Cc: AngeloGioacchino Del Regno <[email protected]
> >, [email protected], N?colas F. R. A. Prado <
> [email protected]>, Krzysztof Kozlowski <
> [email protected]>, Matthias Brugger <
> [email protected]>, Rob Herring <[email protected]>, Sean Wang <
> [email protected]>, [email protected],
> [email protected], [email protected],
> [email protected], [email protected]
> Subject: [PATCH v2 1/2] dt-bindings: pinctrl: mt8192: Switch drive-
> strength-adv for -microamp
> Date: Tue, 31 May 2022 18:19:53 -0400
>
> Commit e5fabbe43f3f ("pinctrl: mediatek: paris: Support generic
> PIN_CONFIG_DRIVE_STRENGTH_UA") added support for using
> drive-strength-microamp instead of mediatek,drive-strength-adv.
>
> Since there aren't any users of mediatek,drive-strength-adv on mt8192
> yet, remove this property and add drive-strength-microamp in its place,
> which has a clearer meaning.
>
> While at it, add a new 'if' block to validate that drive-strength and
> drive-strength-microamp aren't used together, since they're mutually
> exclusive.
>
> Signed-off-by: N?colas F. R. A. Prado <[email protected]>
> Reviewed-by: Rob Herring <[email protected]>
> Reviewed-by: AngeloGioacchino Del Regno <
> [email protected]>
> ---
>
> Changes in v2:
> - Added 'if' block to make drive-strength and drive-strength-microamp
> mutually exclusive
> - Changed commit title to be more precise
> - Dropped Fixes tag
>
> .../bindings/pinctrl/pinctrl-mt8192.yaml | 35 ++++++-------------
> 1 file changed, 10 insertions(+), 25 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-
> mt8192.yaml b/Documentation/devicetree/bindings/pinctrl/pinctrl-
> mt8192.yaml
> index c90a132fbc79..c8092b218f2f 100644
> --- a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8192.yaml
> +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8192.yaml
> @@ -80,31 +80,8 @@ patternProperties:
> dt-bindings/pinctrl/mt65xx.h. It can only support
> 2/4/6/8/10/12/14/16mA in mt8192.
> enum: [2, 4, 6, 8, 10, 12, 14, 16]
>
> - mediatek,drive-strength-adv:
> - description: |
> - Describe the specific driving setup property.
> - For I2C pins, the existing generic driving setup can
> only support
> - 2/4/6/8/10/12/14/16mA driving. But in specific driving
> setup, they
> - can support 0.125/0.25/0.5/1mA adjustment. If we enable
> specific
> - driving setup, the existing generic setup will be
> disabled.
> - The specific driving setup is controlled by E1E0EN.
> - When E1=0/E0=0, the strength is 0.125mA.
> - When E1=0/E0=1, the strength is 0.25mA.
> - When E1=1/E0=0, the strength is 0.5mA.
> - When E1=1/E0=1, the strength is 1mA.
> - EN is used to enable or disable the specific driving
> setup.
> - Valid arguments are described as below:
> - 0: (E1, E0, EN) = (0, 0, 0)
> - 1: (E1, E0, EN) = (0, 0, 1)
> - 2: (E1, E0, EN) = (0, 1, 0)
> - 3: (E1, E0, EN) = (0, 1, 1)
> - 4: (E1, E0, EN) = (1, 0, 0)
> - 5: (E1, E0, EN) = (1, 0, 1)
> - 6: (E1, E0, EN) = (1, 1, 0)
> - 7: (E1, E0, EN) = (1, 1, 1)
> - So the valid arguments are from 0 to 7.
> - $ref: /schemas/types.yaml#/definitions/uint32
> - enum: [0, 1, 2, 3, 4, 5, 6, 7]
>
> Can't remove mediatek,drive-strength-adv property, I2C pins will ofter
> use this property

Yes, the point is that they should use drive-strength-microamp instead, which
does the exact same thing while also having a clearer meaning.

>
> + drive-strength-microamp:
> + enum: [125, 250, 500, 1000]
>
> mediatek,pull-up-adv:
> description: |
> @@ -138,6 +115,14 @@ patternProperties:
> required:
> - pinmux
>
> + allOf:
> + - if:
> + required:
> + - drive-strength-microamp
> + then:
> + properties:
> + drive-strength: false
> +
> additionalProperties: false
>
> Property drive-strength-microamp and drive-strength aren't exclusive,
> just i2c pins support drive-strength-microamp property .

They are exclusive in the sense that both drive-strength-microamp and
drive-strength shouldn't be used on the same pin configuration. The fact that
only i2c pins use drive-strength-microamp doesn't have to do with this, and is
perfectly fine.

Thanks,
N?colas

2022-06-15 13:50:47

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH v2 0/2] MT8192 pinctrl properties adjustments

On Wed, Jun 1, 2022 at 12:19 AM Nícolas F. R. A. Prado
<[email protected]> wrote:

> The two patches in this series substitute properties in the mt8192
> pinctrl dt-binding for ones which have a clearer meaning and are more
> standardized. At this point there's no DT using the mt8192 pinctrl
> binding, so if such changes are to be made, they need to happen now.
>
> v1: https://lore.kernel.org/linux-mediatek/[email protected]/
>
> Changes in v2:
> - Dropped Fixes tags
> - Added 'if' blocks to enforce mutual exclusion of properties

This does not apply on the current pinctrl devel branch:
https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git/log/?h=devel

Could you please rebase onto my branch and resend as v3?

Yours,
Linus Walleij

2022-06-15 14:25:04

by Nícolas F. R. A. Prado

[permalink] [raw]
Subject: Re: [PATCH v2 0/2] MT8192 pinctrl properties adjustments

On Wed, Jun 15, 2022 at 03:31:00PM +0200, Linus Walleij wrote:
> On Wed, Jun 1, 2022 at 12:19 AM N?colas F. R. A. Prado
> <[email protected]> wrote:
>
> > The two patches in this series substitute properties in the mt8192
> > pinctrl dt-binding for ones which have a clearer meaning and are more
> > standardized. At this point there's no DT using the mt8192 pinctrl
> > binding, so if such changes are to be made, they need to happen now.
> >
> > v1: https://lore.kernel.org/linux-mediatek/[email protected]/
> >
> > Changes in v2:
> > - Dropped Fixes tags
> > - Added 'if' blocks to enforce mutual exclusion of properties
>
> This does not apply on the current pinctrl devel branch:
> https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git/log/?h=devel
>
> Could you please rebase onto my branch and resend as v3?

Hi Linus,

I checked out your branch locally and was able to apply the patch cleanly. Maybe
you haven't pushed out all your local changes to that branch yet? Otherwise let
me know and I'll send a rebased v3 to see if it helps in some way.

Thanks,
N?colas

>
> Yours,
> Linus Walleij

2022-06-15 14:42:32

by Nícolas F. R. A. Prado

[permalink] [raw]
Subject: Re: [PATCH v2 0/2] MT8192 pinctrl properties adjustments

On Wed, Jun 15, 2022 at 10:23:55AM -0400, N?colas F. R. A. Prado wrote:
> On Wed, Jun 15, 2022 at 03:31:00PM +0200, Linus Walleij wrote:
> > On Wed, Jun 1, 2022 at 12:19 AM N?colas F. R. A. Prado
> > <[email protected]> wrote:
> >
> > > The two patches in this series substitute properties in the mt8192
> > > pinctrl dt-binding for ones which have a clearer meaning and are more
> > > standardized. At this point there's no DT using the mt8192 pinctrl
> > > binding, so if such changes are to be made, they need to happen now.
> > >
> > > v1: https://lore.kernel.org/linux-mediatek/[email protected]/
> > >
> > > Changes in v2:
> > > - Dropped Fixes tags
> > > - Added 'if' blocks to enforce mutual exclusion of properties
> >
> > This does not apply on the current pinctrl devel branch:
> > https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git/log/?h=devel
> >
> > Could you please rebase onto my branch and resend as v3?
>
> Hi Linus,
>
> I checked out your branch locally and was able to apply the patch cleanly. Maybe
> you haven't pushed out all your local changes to that branch yet? Otherwise let
> me know and I'll send a rebased v3 to see if it helps in some way.

Actually, I just noticed that you applied 2/2 from v1, maybe that's the reason
this v2 series isn't applying?

>
> Thanks,
> N?colas
>
> >
> > Yours,
> > Linus Walleij

2022-06-25 23:27:17

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH v2 0/2] MT8192 pinctrl properties adjustments

On Wed, Jun 15, 2022 at 4:23 PM Nícolas F. R. A. Prado
<[email protected]> wrote:
> On Wed, Jun 15, 2022 at 03:31:00PM +0200, Linus Walleij wrote:
> > On Wed, Jun 1, 2022 at 12:19 AM Nícolas F. R. A. Prado
> > <[email protected]> wrote:
> >
> > > The two patches in this series substitute properties in the mt8192
> > > pinctrl dt-binding for ones which have a clearer meaning and are more
> > > standardized. At this point there's no DT using the mt8192 pinctrl
> > > binding, so if such changes are to be made, they need to happen now.
> > >
> > > v1: https://lore.kernel.org/linux-mediatek/[email protected]/
> > >
> > > Changes in v2:
> > > - Dropped Fixes tags
> > > - Added 'if' blocks to enforce mutual exclusion of properties
> >
> > This does not apply on the current pinctrl devel branch:
> > https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git/log/?h=devel
> >
> > Could you please rebase onto my branch and resend as v3?
>
> Hi Linus,
>
> I checked out your branch locally and was able to apply the patch cleanly. Maybe
> you haven't pushed out all your local changes to that branch yet? Otherwise let
> me know and I'll send a rebased v3 to see if it helps in some way.

Doing this:

[linus@fedora linux-pinctrl]$ b4 am -t -S
[email protected]
Analyzing 8 messages in the thread
Checking attestation on all messages, may take a moment...
---
✓ [PATCH v2 1/2] dt-bindings: pinctrl: mt8192: Switch
drive-strength-adv for -microamp
✓ [PATCH v2 2/2] dt-bindings: pinctrl: mt8192: Use generic bias
instead of pull-*-adv
---
✓ Signed: DKIM/collabora.com
---
Total patches: 2
---
Cover: ./v2_20220531_nfraprado_mt8192_pinctrl_properties_adjustments.cover
Link: https://lore.kernel.org/r/[email protected]
Base: not specified
git am ./v2_20220531_nfraprado_mt8192_pinctrl_properties_adjustments.mbx
[linus@fedora linux-pinctrl]$ git am --signoff
./v2_20220531_nfraprado_mt8192_pinctrl_properties_adjustments.mbx
Applying: dt-bindings: pinctrl: mt8192: Switch drive-strength-adv for -microamp
error: patch failed:
Documentation/devicetree/bindings/pinctrl/pinctrl-mt8192.yaml:80
error: Documentation/devicetree/bindings/pinctrl/pinctrl-mt8192.yaml:
patch does not apply
Patch failed at 0001 dt-bindings: pinctrl: mt8192: Switch
drive-strength-adv for -microamp
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

Yours,
Linus Walleij