2022-11-29 02:51:59

by Bernhard Rosenkränzer

[permalink] [raw]
Subject: [PATCH v3 0/7] Remove the pins-are-numbered DT property

During the review of my MT8365 support patchset
(https://lore.kernel.org/linux-mediatek/[email protected]/),
the issue of the "pins-are-numbered" DeviceTree property has come up.

This property is unique to Mediatek MT65xx and STM32 pinctrls, and
doesn't seem to serve any purpose (both the Mediatek and STM32 drivers
simply refuse to deal with a device unless pins-are-numbered is set to
true).

There is no other use of this property in the kernel or in other projects
using DeviceTrees (checked u-boot and FreeBSD -- in both of those, the
flag is present in Mediatek and STM devicetrees, but not used anywhere).

There is also no known use in userspace (in fact, a userland application
relying on the property would be broken because it would get true on
any Mediatek or STM chipset and false on all others, even though other
chipsets use numbered pins).

This patchset removes all uses of pins-are-numbered and marks the
property as deprecated.

v3:
- No functional changes; add recent Reviewed-Bys and Acked-Bys,
add linux-gpio to Cc

v2:
- Deprecate the property instead of removing it completely from
schemas
- squash some related commits


Bernhard Rosenkränzer (7):
pinctrl: mediatek: common: Remove check for pins-are-numbered
pinctrl: stm32: Remove check for pins-are-numbered
dt-bindings: pinctrl: mediatek,mt65xx: Deprecate pins-are-numbered
dt-bindings: pinctrl: st,stm32: Deprecate pins-are-numbered
arm64: dts: mediatek: Remove pins-are-numbered property
ARM: dts: mediatek: Remove pins-are-numbered property
ARM: dts: stm32: Remove the pins-are-numbered property

.../bindings/pinctrl/mediatek,mt65xx-pinctrl.yaml | 5 ++---
.../devicetree/bindings/pinctrl/st,stm32-pinctrl.yaml | 7 +++----
arch/arm/boot/dts/mt2701.dtsi | 1 -
arch/arm/boot/dts/mt7623.dtsi | 1 -
arch/arm/boot/dts/mt8135.dtsi | 1 -
arch/arm/boot/dts/stm32f4-pinctrl.dtsi | 1 -
arch/arm/boot/dts/stm32f7-pinctrl.dtsi | 1 -
arch/arm/boot/dts/stm32h743.dtsi | 1 -
arch/arm/boot/dts/stm32mp131.dtsi | 1 -
arch/arm/boot/dts/stm32mp151.dtsi | 2 --
arch/arm64/boot/dts/mediatek/mt2712e.dtsi | 1 -
arch/arm64/boot/dts/mediatek/mt8167.dtsi | 1 -
arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 1 -
arch/arm64/boot/dts/mediatek/mt8173.dtsi | 1 -
arch/arm64/boot/dts/mediatek/mt8516.dtsi | 1 -
drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 6 ------
drivers/pinctrl/stm32/pinctrl-stm32.c | 5 -----
17 files changed, 5 insertions(+), 32 deletions(-)

--
2.38.1


2022-11-29 02:53:18

by Bernhard Rosenkränzer

[permalink] [raw]
Subject: [PATCH v3 4/7] dt-bindings: pinctrl: st,stm32: Deprecate pins-are-numbered

Deprecate the pins-are-numbered property

Signed-off-by: Bernhard Rosenkränzer <[email protected]>
Reviewed-by: Matthias Brugger <[email protected]>
Acked-by: Krzysztof Kozlowski <[email protected]>
---
.../devicetree/bindings/pinctrl/st,stm32-pinctrl.yaml | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.yaml
index 9d59208d83c18..eeb29b4ad4d1a 100644
--- a/Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.yaml
@@ -34,7 +34,9 @@ properties:
const: 1

ranges: true
- pins-are-numbered: true
+ pins-are-numbered:
+ $ref: /schemas/types.yaml#/definitions/flag
+ deprecated: true
hwlocks: true

interrupts:
@@ -206,7 +208,6 @@ required:
- '#address-cells'
- '#size-cells'
- ranges
- - pins-are-numbered

additionalProperties: false

@@ -220,7 +221,6 @@ examples:
#size-cells = <1>;
compatible = "st,stm32f429-pinctrl";
ranges = <0 0x40020000 0x3000>;
- pins-are-numbered;

gpioa: gpio@0 {
gpio-controller;
@@ -238,7 +238,6 @@ examples:
#size-cells = <1>;
compatible = "st,stm32f429-pinctrl";
ranges = <0 0x50020000 0x3000>;
- pins-are-numbered;

gpiob: gpio@1000 {
gpio-controller;
--
2.38.1

2022-11-29 02:53:18

by Bernhard Rosenkränzer

[permalink] [raw]
Subject: [PATCH v3 7/7] ARM: dts: stm32: Remove the pins-are-numbered property

Remove the pins-are-numbered property from STM32 DeviceTrees

Signed-off-by: Bernhard Rosenkränzer <[email protected]>
Reviewed-by: Matthias Brugger <[email protected]>
---
arch/arm/boot/dts/stm32f4-pinctrl.dtsi | 1 -
arch/arm/boot/dts/stm32f7-pinctrl.dtsi | 1 -
arch/arm/boot/dts/stm32h743.dtsi | 1 -
arch/arm/boot/dts/stm32mp131.dtsi | 1 -
arch/arm/boot/dts/stm32mp151.dtsi | 2 --
5 files changed, 6 deletions(-)

diff --git a/arch/arm/boot/dts/stm32f4-pinctrl.dtsi b/arch/arm/boot/dts/stm32f4-pinctrl.dtsi
index 500bcc302d422..4523c63475e4c 100644
--- a/arch/arm/boot/dts/stm32f4-pinctrl.dtsi
+++ b/arch/arm/boot/dts/stm32f4-pinctrl.dtsi
@@ -51,7 +51,6 @@ pinctrl: pinctrl@40020000 {
ranges = <0 0x40020000 0x3000>;
interrupt-parent = <&exti>;
st,syscfg = <&syscfg 0x8>;
- pins-are-numbered;

gpioa: gpio@40020000 {
gpio-controller;
diff --git a/arch/arm/boot/dts/stm32f7-pinctrl.dtsi b/arch/arm/boot/dts/stm32f7-pinctrl.dtsi
index 8f37aefa73150..c8e6c52fb248e 100644
--- a/arch/arm/boot/dts/stm32f7-pinctrl.dtsi
+++ b/arch/arm/boot/dts/stm32f7-pinctrl.dtsi
@@ -15,7 +15,6 @@ pinctrl: pinctrl@40020000 {
ranges = <0 0x40020000 0x3000>;
interrupt-parent = <&exti>;
st,syscfg = <&syscfg 0x8>;
- pins-are-numbered;

gpioa: gpio@40020000 {
gpio-controller;
diff --git a/arch/arm/boot/dts/stm32h743.dtsi b/arch/arm/boot/dts/stm32h743.dtsi
index 28e3deb20e1e1..f30796f7adf36 100644
--- a/arch/arm/boot/dts/stm32h743.dtsi
+++ b/arch/arm/boot/dts/stm32h743.dtsi
@@ -588,7 +588,6 @@ pinctrl: pinctrl@58020000 {
ranges = <0 0x58020000 0x3000>;
interrupt-parent = <&exti>;
st,syscfg = <&syscfg 0x8>;
- pins-are-numbered;

gpioa: gpio@58020000 {
gpio-controller;
diff --git a/arch/arm/boot/dts/stm32mp131.dtsi b/arch/arm/boot/dts/stm32mp131.dtsi
index 2a9b3a5bba830..adaee0f9e1263 100644
--- a/arch/arm/boot/dts/stm32mp131.dtsi
+++ b/arch/arm/boot/dts/stm32mp131.dtsi
@@ -549,7 +549,6 @@ pinctrl: pinctrl@50002000 {
ranges = <0 0x50002000 0x8400>;
interrupt-parent = <&exti>;
st,syscfg = <&exti 0x60 0xff>;
- pins-are-numbered;

gpioa: gpio@50002000 {
gpio-controller;
diff --git a/arch/arm/boot/dts/stm32mp151.dtsi b/arch/arm/boot/dts/stm32mp151.dtsi
index 5491b6c4dec20..4e437d3f2ed66 100644
--- a/arch/arm/boot/dts/stm32mp151.dtsi
+++ b/arch/arm/boot/dts/stm32mp151.dtsi
@@ -1660,7 +1660,6 @@ pinctrl: pinctrl@50002000 {
ranges = <0 0x50002000 0xa400>;
interrupt-parent = <&exti>;
st,syscfg = <&exti 0x60 0xff>;
- pins-are-numbered;

gpioa: gpio@50002000 {
gpio-controller;
@@ -1789,7 +1788,6 @@ pinctrl_z: pinctrl@54004000 {
#size-cells = <1>;
compatible = "st,stm32mp157-z-pinctrl";
ranges = <0 0x54004000 0x400>;
- pins-are-numbered;
interrupt-parent = <&exti>;
st,syscfg = <&exti 0x60 0xff>;

--
2.38.1

2022-11-29 03:19:52

by Bernhard Rosenkränzer

[permalink] [raw]
Subject: [PATCH v3 3/7] dt-bindings: pinctrl: mediatek,mt65xx: Deprecate pins-are-numbered

Make pins-are-numbered optional and deprecate it

Signed-off-by: Bernhard Rosenkränzer <[email protected]>
Reviewed-by: Matthias Brugger <[email protected]>
Acked-by: Krzysztof Kozlowski <[email protected]>
---
.../devicetree/bindings/pinctrl/mediatek,mt65xx-pinctrl.yaml | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/pinctrl/mediatek,mt65xx-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/mediatek,mt65xx-pinctrl.yaml
index 33b5f79e741ab..1b44335b1e947 100644
--- a/Documentation/devicetree/bindings/pinctrl/mediatek,mt65xx-pinctrl.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/mediatek,mt65xx-pinctrl.yaml
@@ -31,7 +31,8 @@ properties:
pins-are-numbered:
$ref: /schemas/types.yaml#/definitions/flag
description: |
- Specify the subnodes are using numbered pinmux to specify pins.
+ Specify the subnodes are using numbered pinmux to specify pins. (UNUSED)
+ deprecated: true

gpio-controller: true

@@ -62,7 +63,6 @@ properties:

required:
- compatible
- - pins-are-numbered
- gpio-controller
- "#gpio-cells"

@@ -150,7 +150,6 @@ examples:
compatible = "mediatek,mt8135-pinctrl";
reg = <0 0x1000B000 0 0x1000>;
mediatek,pctl-regmap = <&syscfg_pctl_a>, <&syscfg_pctl_b>;
- pins-are-numbered;
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
--
2.38.1

Subject: Re: [PATCH v3 3/7] dt-bindings: pinctrl: mediatek,mt65xx: Deprecate pins-are-numbered

Il 29/11/22 03:33, Bernhard Rosenkränzer ha scritto:
> Make pins-are-numbered optional and deprecate it
>
> Signed-off-by: Bernhard Rosenkränzer <[email protected]>
> Reviewed-by: Matthias Brugger <[email protected]>
> Acked-by: Krzysztof Kozlowski <[email protected]>

Reviewed-by: AngeloGioacchino Del Regno <[email protected]>


2022-12-03 09:47:06

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH v3 0/7] Remove the pins-are-numbered DT property

Hi Bero,

long time no see!

On Tue, Nov 29, 2022 at 3:34 AM Bernhard Rosenkränzer <[email protected]> wrote:

> During the review of my MT8365 support patchset
> (https://lore.kernel.org/linux-mediatek/[email protected]/),
> the issue of the "pins-are-numbered" DeviceTree property has come up.

(...)
> This patchset removes all uses of pins-are-numbered and marks the
> property as deprecated.

I don't remember any more why this property was introduced, but
I am happy to see it go.

> Bernhard Rosenkränzer (7):
> pinctrl: mediatek: common: Remove check for pins-are-numbered
> pinctrl: stm32: Remove check for pins-are-numbered
> dt-bindings: pinctrl: mediatek,mt65xx: Deprecate pins-are-numbered
> dt-bindings: pinctrl: st,stm32: Deprecate pins-are-numbered

I applied patches 1-4 to the pin control tree for v6.2,
please funnel the rest through mediatek/stm32 and
SoC trees!

Yours,
Linus Walleij

2022-12-05 14:49:41

by Kevin Hilman

[permalink] [raw]
Subject: Re: [PATCH v3 7/7] ARM: dts: stm32: Remove the pins-are-numbered property

Alexandre,

Bernhard Rosenkränzer <[email protected]> writes:

> Remove the pins-are-numbered property from STM32 DeviceTrees
>
> Signed-off-by: Bernhard Rosenkränzer <[email protected]>
> Reviewed-by: Matthias Brugger <[email protected]>

Now that the driver & binding qre queued, I'm assuming you'll queue this
one via the stm32 tree?

Thanks,

Kevin

2022-12-06 17:05:49

by Bernhard Rosenkränzer

[permalink] [raw]
Subject: Re: [PATCH v3 0/7] Remove the pins-are-numbered DT property

On Sat, Dec 3, 2022 at 10:22 AM Linus Walleij <[email protected]> wrote:
>
> Hi Bero,
>
> long time no see!

Hi Linus,
indeed, I've been doing mostly userland stuff lately, and my latest
kernel patch was x86 (got to keep all of my hardware working ;) ). Now
that I've changed jobs, I'm expecting to be more active on the kernel
side (though still doing a lot of userland).

> > This patchset removes all uses of pins-are-numbered and marks the
> > property as deprecated.
>
> I don't remember any more why this property was introduced, but
> I am happy to see it go.

I couldn't find why it was introduced either (and git blame wasn't
much help). I'm assuming there was some other mode in vendor trees
that never made it into mainline (but the flag for switching between
the modes did).

> I applied patches 1-4 to the pin control tree for v6.2,
> please funnel the rest through mediatek/stm32 and
> SoC trees!

Thanks! Remaining patches reposted and currently waiting.

ttyl
bero

2023-01-03 08:32:39

by Alexandre TORGUE

[permalink] [raw]
Subject: Re: [PATCH v3 7/7] ARM: dts: stm32: Remove the pins-are-numbered property

Hi Kevin

On 12/5/22 14:21, Kevin Hilman wrote:
> Alexandre,
>
> Bernhard Rosenkränzer <[email protected]> writes:
>
>> Remove the pins-are-numbered property from STM32 DeviceTrees
>>
>> Signed-off-by: Bernhard Rosenkränzer <[email protected]>
>> Reviewed-by: Matthias Brugger <[email protected]>
>
> Now that the driver & binding qre queued, I'm assuming you'll queue this
> one via the stm32 tree?
>

Yes I'll take it.

cheers
Alex


> Thanks,
>
> Kevin