Skip to content

Conversation

elmo9999
Copy link
Contributor

@elmo9999 elmo9999 commented Aug 29, 2025

Provide a map from RTS5912_GPIO_NUM_000 to RTS5912_GPIO_NUM_131
for appication call be easier read.
For example:
Used: <&gpiog 6 (GPIO_OUTPUT)>
Now: <RTS5912_GPIO_NUM_102 (GPIO_OUTPUT)>

@@ -39,4 +39,112 @@
/** Interrupt Mask since rts5912 does not support GPIO_INT_LEVELS_LOGICAL*/
#define RTS5912_GPIO_INTR_MASK (1U << 21 | 1U << 22 | 1U << 24 | 1U << 25 | 1U << 26)

/** GPIO number map between spec and zephyr */
Copy link
Contributor

Choose a reason for hiding this comment

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

Non-blocking suggestion "Map GPIO signal name to devicetree binding."

Please also add a comment describing how to use this macro. See dt-bindings/gpio/microchip-xec-gpio.h for an example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the advice, I added it.

@@ -39,4 +39,112 @@
/** Interrupt Mask since rts5912 does not support GPIO_INT_LEVELS_LOGICAL*/
#define RTS5912_GPIO_INTR_MASK (1U << 21 | 1U << 22 | 1U << 24 | 1U << 25 | 1U << 26)

/** GPIO number map between spec and zephyr */
#define RTS5912_GPIO_NUM_000 &gpioa 0
Copy link
Contributor

Choose a reason for hiding this comment

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

Considering the symbol name is just GPIO000, I suggest dropping the _NUM_ designator.

Suggested change
#define RTS5912_GPIO_NUM_000 &gpioa 0
#define RTS5912_GPIO000 &gpioa 0

Copy link
Contributor Author

@elmo9999 elmo9999 Sep 5, 2025

Choose a reason for hiding this comment

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

Thanks for the advice, the _NUM_ is removed.

@elmo9999 elmo9999 force-pushed the gpio_remap branch 2 times, most recently from 16035e8 to 7bde92c Compare September 5, 2025 11:25
Provide a map from RTS5912_GPIO_NUM_000 to RTS5912_GPIO_NUM_131
for appication call be easier read.
For example:
Used: <&gpiog 6 (GPIO_OUTPUT)>
Now: <RTS5912_GPIO_NUM_102 (GPIO_OUTPUT)>

Signed-off-by: Elmo Lan <elmo_lan@realtek.com>
Copy link

sonarqubecloud bot commented Sep 5, 2025

@kartben kartben merged commit ee2ebbd into zephyrproject-rtos:main Sep 8, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants