Skip to content

disp: msm: fix GPIO lookup for kernel >= 7.1#19

Merged
abdesai133410 merged 1 commit into
qualcomm-linux:mainfrom
yashgupta2126:main
Jul 10, 2026
Merged

disp: msm: fix GPIO lookup for kernel >= 7.1#19
abdesai133410 merged 1 commit into
qualcomm-linux:mainfrom
yashgupta2126:main

Conversation

@yashgupta2126

@yashgupta2126 yashgupta2126 commented Jul 9, 2026

Copy link
Copy Markdown

of_get_named_gpio() was removed in kernel 7.1. The msm_gpio.h shim passes the full DT property name as con_id to fwnode_gpiod_get_index(), which appends -gpio again causing a double-suffix lookup failure.

Replace all of_get_named_gpio() / utils->get_named_gpio() calls in the DP and DSI drivers with devm_gpiod_get(dev, con_id, flags), stripping the trailing -gpio from the con_id so the kernel resolves the DT
property correctly on both 6.18 and 7.1. devm handles GPIO lifecycle, removing manual gpio_request()/gpio_free() chains.

of_get_named_gpio() was removed in kernel 7.1. The msm_gpio.h shim
uses fwnode_gpiod_get_index() which appends "-gpios"/"-gpio" suffixes
to the con_id, so passing the full property name (e.g.
"qcom,dp-hpd-gpio" or "qcom,platform-te-gpio") causes a
double-suffix lookup that fails to find the DT property.

Replace all of_get_named_gpio() / utils->get_named_gpio() calls in
dp_gpio_hpd.c, dp_lphw_hpd.c, dsi_display.c and dsi_panel.c with
devm_gpiod_get(dev, con_id, flags) where con_id is the property name
with the trailing "-gpio" stripped. The kernel appends "-gpio" back,
matching the DT property on both 6.18 and 7.1. devm handles GPIO
direction and cleanup, removing manual gpio_request()/gpio_free() calls.

DP changes (dp_gpio_hpd.c, dp_lphw_hpd.c):
- Replace of_get_named_gpio("qcom,dp-hpd-gpio") with
  devm_gpiod_get(dev, "qcom,dp-hpd", GPIOD_IN).
- Remove manual gpio_request()/gpio_direction_input()/gpio_free().
- Replace gpio_to_irq() with gpiod_to_irq().

DSI display changes (dsi_display.c, dsi_display.h):
- Add struct gpio_desc *disp_te_gpiod field to struct dsi_display and
  include <linux/gpio/consumer.h>.
- Replace of_get_named_gpio for disp_te_gpio with devm_gpiod_get;
  populate int disp_te_gpio via desc_to_gpio() so all existing
  gpio_is_valid()/gpio_to_irq() call sites remain unchanged.
- Reuse disp_te_gpio in dsi_display_get_io_resources(); replace
  avdd-regulator-gpio lookup with devm_gpiod_get.

DSI panel changes (dsi_panel.c):
- Replace utils->get_named_gpio + gpio_request/gpio_free with
  devm_gpiod_get + desc_to_gpio() for reset, disp_en (5v-boost /
  platform-en), oled_en, lcd_mode_sel and bklt_en GPIOs.
- dsi_panel_gpio_request() and dsi_panel_gpio_release() reduced to
  no-ops; devm handles GPIO lifecycle.
- qcom,mdss-dsi-panel-test-pin (ends in -pin, not -gpio) is left on
  the shim path as it is an optional debug pin not present in
  production DT.

msm_gpio.h: add comment clarifying the non-const fwnode signature.

Signed-off-by: Yash Gupta <yash.gupta@oss.qualcomm.com>
@yashgupta2126 yashgupta2126 changed the title disp: msm: dp: fix HPD GPIO lookup for kernel >= 7.1 disp: msm: fix GPIO lookup for kernel >= 7.1 Jul 9, 2026
@abdesai133410
abdesai133410 merged commit 70ef6d4 into qualcomm-linux:main Jul 10, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants