Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dts: arm: st: add npgios to all stm32 gpio controllers #73953

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dts/arm/st/l4/stm32l496.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
compatible = "st,stm32-gpio";
gpio-controller;
#gpio-cells = <2>;
ngpios = <12>;
reg = <0x48002000 0x400>;
clocks = <&rcc STM32_CLOCK_BUS_AHB2 0x00000100>;
};
Expand Down
2 changes: 2 additions & 0 deletions dts/arm/st/wb/stm32wb.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@
compatible = "st,stm32-gpio";
gpio-controller;
#gpio-cells = <2>;
ngpios = <5>;
reg = <0x48001000 0x400>;
clocks = <&rcc STM32_CLOCK_BUS_AHB2 0x00000010>;
};
Expand All @@ -236,6 +237,7 @@
compatible = "st,stm32-gpio";
gpio-controller;
#gpio-cells = <2>;
ngpios = <4>;
reg = <0x48001c00 0x400>;
clocks = <&rcc STM32_CLOCK_BUS_AHB2 0x00000080>;
};
Expand Down
19 changes: 18 additions & 1 deletion dts/bindings/gpio/st,stm32-gpio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ description: STM32 GPIO node

compatible: "st,stm32-gpio"

include: [gpio-controller.yaml, base.yaml]
include:
- name: gpio-controller.yaml
property-blocklist:
- ngpios
Comment on lines +10 to +11
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seem necessary to do that. See the example provided by @erwango in nxp,pcal6416a.yaml, I don't see a property-blocklist (and it presumably works).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since that used const/required, it basically just added a const to the property binding. However, if there was a tree that used it (I actually dont see this driver in any board/shield), it would still need to be in the tree; its just anything other than ngpios = <8>; would be an error (missing it would be a violation of required and any other value a violation of const: 8)

- name: base.yaml

properties:
reg:
Expand All @@ -17,6 +21,19 @@ properties:
"#gpio-cells":
const: 2

ngpios:
type: int
default: 16
henrikbrixandersen marked this conversation as resolved.
Show resolved Hide resolved
description: |
This property indicates the number of in-use slots of available slots
for GPIOs. The STM32 GPIO controller typically has all 16 possible port
IO with few exceptions. It should only be necessary to explicitly set
this property if the controller itself does not implement all 16 port
IO register bits; for example PORTE in the STM32WB55xx series which only
implements the first 5. Package restrictions on the number of exposed
GPIO should not influence this property. For cases in which there might
be holes in the slot range, this value should be the max slot number+1.

gpio-cells:
- pin
- flags
Loading