Commit e577d4b1 authored by Pin-yen Lin's avatar Pin-yen Lin Committed by Robert Foss

drm/bridge: it6505: Initialize AUX channel in it6505_i2c_probe

During device boot, the HPD interrupt could be triggered before the DRM
subsystem registers it6505 as a DRM bridge. In such cases, the driver
tries to access AUX channel and causes NULL pointer dereference.
Initializing the AUX channel earlier to prevent such error.

Fixes: b5c84a9e ("drm/bridge: add it6505 driver")
Signed-off-by: default avatarPin-yen Lin <treapking@chromium.org>
Reviewed-by: default avatarRobert Foss <robert.foss@linaro.org>
Signed-off-by: default avatarRobert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20221013110411.1674359-2-treapking@chromium.org
parent 2556e1a8
...@@ -2871,10 +2871,7 @@ static int it6505_bridge_attach(struct drm_bridge *bridge, ...@@ -2871,10 +2871,7 @@ static int it6505_bridge_attach(struct drm_bridge *bridge,
} }
/* Register aux channel */ /* Register aux channel */
it6505->aux.name = "DP-AUX";
it6505->aux.dev = dev;
it6505->aux.drm_dev = bridge->dev; it6505->aux.drm_dev = bridge->dev;
it6505->aux.transfer = it6505_aux_transfer;
ret = drm_dp_aux_register(&it6505->aux); ret = drm_dp_aux_register(&it6505->aux);
...@@ -3354,6 +3351,11 @@ static int it6505_i2c_probe(struct i2c_client *client, ...@@ -3354,6 +3351,11 @@ static int it6505_i2c_probe(struct i2c_client *client,
debugfs_init(it6505); debugfs_init(it6505);
pm_runtime_enable(dev); pm_runtime_enable(dev);
it6505->aux.name = "DP-AUX";
it6505->aux.dev = dev;
it6505->aux.transfer = it6505_aux_transfer;
drm_dp_aux_init(&it6505->aux);
it6505->bridge.funcs = &it6505_bridge_funcs; it6505->bridge.funcs = &it6505_bridge_funcs;
it6505->bridge.type = DRM_MODE_CONNECTOR_DisplayPort; it6505->bridge.type = DRM_MODE_CONNECTOR_DisplayPort;
it6505->bridge.ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID | it6505->bridge.ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment