[linux-6.6.y] pinctrl/zhaoxin: kh50000: add multi‑socket support#1694
[linux-6.6.y] pinctrl/zhaoxin: kh50000: add multi‑socket support#1694leoliu-oc wants to merge 1 commit into
Conversation
* Introduce socket‑aware pin definition macros for multi‑socket platforms * Split global pin table into per‑socket pin tables with UID soc_data * Use UID‑based probe to match multi‑socket instances * Dynamically acquire PMIO IO resource instead of hard‑coding address * Fix PMIO offset for multi‑socket compatibility Signed-off-by: LeoLiu-oc <leoliu-oc@zhaoxin.com>
Reviewer's GuideRefactors the KH50000 pinctrl driver to be socket-aware for multi-socket platforms by introducing socket-parameterized pin descriptors and per-socket SoC data, switches probe to UID-based matching, and replaces hard-coded PMIO addresses and offsets with dynamically acquired IO resources suitable for multiple sockets. Sequence diagram for KH50000 probe with UID and dynamic PMIOsequenceDiagram
participant ACPI
participant kh50000_pinctrl_driver
participant zhaoxin_pinctrl_probe_by_uid
participant kh50000_gpio_init
participant platform_get_resource
participant request_region
ACPI->>kh50000_pinctrl_driver: match kh50000_pinctrl_acpi_match
kh50000_pinctrl_driver->>zhaoxin_pinctrl_probe_by_uid: probe
zhaoxin_pinctrl_probe_by_uid->>zhaoxin_pinctrl_probe_by_uid: select kh50000_soc_data by uid
zhaoxin_pinctrl_probe_by_uid->>kh50000_gpio_init: private_init(pctrl)
kh50000_gpio_init->>platform_get_resource: platform_get_resource(pdev, IORESOURCE_IO, 0)
platform_get_resource-->>kh50000_gpio_init: res_pmio
kh50000_gpio_init->>request_region: request_region(res_pmio.start, resource_size(res_pmio), pdev.name)
request_region-->>kh50000_gpio_init: region acquired
kh50000_gpio_init->>kh50000_gpio_init: set pmio_base, pmio_rx90, pmio_rx8c
kh50000_gpio_init-->>zhaoxin_pinctrl_probe_by_uid: return
zhaoxin_pinctrl_probe_by_uid-->>kh50000_pinctrl_driver: probe complete
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @leoliu-oc. Thanks for your PR. I'm waiting for a deepin-community member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
kh50000_gpio_init(), therequest_region()call should be paired with a correspondingrelease_region()in the driver’s remove/shutdown path to avoid leaking IO port regions when devices are unbound or probed multiple times. - The four
socket_X_soc_datastructs are identical except foruidandpins; consider introducing a helper macro or initializer to reduce duplication and make it easier to add or remove sockets consistently.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `kh50000_gpio_init()`, the `request_region()` call should be paired with a corresponding `release_region()` in the driver’s remove/shutdown path to avoid leaking IO port regions when devices are unbound or probed multiple times.
- The four `socket_X_soc_data` structs are identical except for `uid` and `pins`; consider introducing a helper macro or initializer to reduce duplication and make it easier to add or remove sockets consistently.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Summary by Sourcery
Add multi-socket support to the Zhaoxin KH50000 pin controller and fix its PMIO handling.
New Features:
Bug Fixes: