Commit b8ec1e7f authored by Dmitry Baryshkov's avatar Dmitry Baryshkov Committed by Rob Clark

drm/msm/dp: move pdev from struct dp_display_private to struct msm_dp

The dp_drm needs accessing the DP's platform device. Move pdev to the
public structure.
Reviewed-by: default avatarRob Clark <robdclark@gmail.com>
Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/561642/Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
parent 719093a6
...@@ -88,7 +88,6 @@ struct dp_display_private { ...@@ -88,7 +88,6 @@ struct dp_display_private {
bool audio_supported; bool audio_supported;
struct drm_device *drm_dev; struct drm_device *drm_dev;
struct platform_device *pdev;
struct dentry *root; struct dentry *root;
struct dp_parser *parser; struct dp_parser *parser;
...@@ -595,7 +594,7 @@ static int dp_hpd_plug_handle(struct dp_display_private *dp, u32 data) ...@@ -595,7 +594,7 @@ static int dp_hpd_plug_handle(struct dp_display_private *dp, u32 data)
return 0; return 0;
} }
ret = dp_display_usbpd_configure_cb(&dp->pdev->dev); ret = dp_display_usbpd_configure_cb(&dp->dp_display.pdev->dev);
if (ret) { /* link train failed */ if (ret) { /* link train failed */
dp->hpd_state = ST_DISCONNECTED; dp->hpd_state = ST_DISCONNECTED;
} else { } else {
...@@ -643,7 +642,7 @@ static int dp_hpd_unplug_handle(struct dp_display_private *dp, u32 data) ...@@ -643,7 +642,7 @@ static int dp_hpd_unplug_handle(struct dp_display_private *dp, u32 data)
if (dp->link->sink_count == 0) { if (dp->link->sink_count == 0) {
dp_display_host_phy_exit(dp); dp_display_host_phy_exit(dp);
} }
dp_display_notify_disconnect(&dp->pdev->dev); dp_display_notify_disconnect(&dp->dp_display.pdev->dev);
mutex_unlock(&dp->event_mutex); mutex_unlock(&dp->event_mutex);
return 0; return 0;
} else if (state == ST_DISCONNECT_PENDING) { } else if (state == ST_DISCONNECT_PENDING) {
...@@ -653,7 +652,7 @@ static int dp_hpd_unplug_handle(struct dp_display_private *dp, u32 data) ...@@ -653,7 +652,7 @@ static int dp_hpd_unplug_handle(struct dp_display_private *dp, u32 data)
dp_ctrl_off_link(dp->ctrl); dp_ctrl_off_link(dp->ctrl);
dp_display_host_phy_exit(dp); dp_display_host_phy_exit(dp);
dp->hpd_state = ST_DISCONNECTED; dp->hpd_state = ST_DISCONNECTED;
dp_display_notify_disconnect(&dp->pdev->dev); dp_display_notify_disconnect(&dp->dp_display.pdev->dev);
mutex_unlock(&dp->event_mutex); mutex_unlock(&dp->event_mutex);
return 0; return 0;
} }
...@@ -662,7 +661,7 @@ static int dp_hpd_unplug_handle(struct dp_display_private *dp, u32 data) ...@@ -662,7 +661,7 @@ static int dp_hpd_unplug_handle(struct dp_display_private *dp, u32 data)
* We don't need separate work for disconnect as * We don't need separate work for disconnect as
* connect/attention interrupts are disabled * connect/attention interrupts are disabled
*/ */
dp_display_notify_disconnect(&dp->pdev->dev); dp_display_notify_disconnect(&dp->dp_display.pdev->dev);
if (state == ST_DISPLAY_OFF) { if (state == ST_DISPLAY_OFF) {
dp->hpd_state = ST_DISCONNECTED; dp->hpd_state = ST_DISCONNECTED;
...@@ -704,7 +703,7 @@ static int dp_irq_hpd_handle(struct dp_display_private *dp, u32 data) ...@@ -704,7 +703,7 @@ static int dp_irq_hpd_handle(struct dp_display_private *dp, u32 data)
return 0; return 0;
} }
dp_display_usbpd_attention_cb(&dp->pdev->dev); dp_display_usbpd_attention_cb(&dp->dp_display.pdev->dev);
drm_dbg_dp(dp->drm_dev, "After, type=%d hpd_state=%d\n", drm_dbg_dp(dp->drm_dev, "After, type=%d hpd_state=%d\n",
dp->dp_display.connector_type, state); dp->dp_display.connector_type, state);
...@@ -725,12 +724,12 @@ static void dp_display_deinit_sub_modules(struct dp_display_private *dp) ...@@ -725,12 +724,12 @@ static void dp_display_deinit_sub_modules(struct dp_display_private *dp)
static int dp_init_sub_modules(struct dp_display_private *dp) static int dp_init_sub_modules(struct dp_display_private *dp)
{ {
int rc = 0; int rc = 0;
struct device *dev = &dp->pdev->dev; struct device *dev = &dp->dp_display.pdev->dev;
struct dp_panel_in panel_in = { struct dp_panel_in panel_in = {
.dev = dev, .dev = dev,
}; };
dp->parser = dp_parser_get(dp->pdev); dp->parser = dp_parser_get(dp->dp_display.pdev);
if (IS_ERR(dp->parser)) { if (IS_ERR(dp->parser)) {
rc = PTR_ERR(dp->parser); rc = PTR_ERR(dp->parser);
DRM_ERROR("failed to initialize parser, rc = %d\n", rc); DRM_ERROR("failed to initialize parser, rc = %d\n", rc);
...@@ -791,7 +790,7 @@ static int dp_init_sub_modules(struct dp_display_private *dp) ...@@ -791,7 +790,7 @@ static int dp_init_sub_modules(struct dp_display_private *dp)
goto error_ctrl; goto error_ctrl;
} }
dp->audio = dp_audio_get(dp->pdev, dp->panel, dp->catalog); dp->audio = dp_audio_get(dp->dp_display.pdev, dp->panel, dp->catalog);
if (IS_ERR(dp->audio)) { if (IS_ERR(dp->audio)) {
rc = PTR_ERR(dp->audio); rc = PTR_ERR(dp->audio);
pr_err("failed to initialize audio, rc = %d\n", rc); pr_err("failed to initialize audio, rc = %d\n", rc);
...@@ -1197,7 +1196,7 @@ int dp_display_request_irq(struct msm_dp *dp_display) ...@@ -1197,7 +1196,7 @@ int dp_display_request_irq(struct msm_dp *dp_display)
dp = container_of(dp_display, struct dp_display_private, dp_display); dp = container_of(dp_display, struct dp_display_private, dp_display);
dp->irq = irq_of_parse_and_map(dp->pdev->dev.of_node, 0); dp->irq = irq_of_parse_and_map(dp->dp_display.pdev->dev.of_node, 0);
if (!dp->irq) { if (!dp->irq) {
DRM_ERROR("failed to get irq\n"); DRM_ERROR("failed to get irq\n");
return -EINVAL; return -EINVAL;
...@@ -1253,7 +1252,7 @@ static int dp_display_probe(struct platform_device *pdev) ...@@ -1253,7 +1252,7 @@ static int dp_display_probe(struct platform_device *pdev)
if (!desc) if (!desc)
return -EINVAL; return -EINVAL;
dp->pdev = pdev; dp->dp_display.pdev = pdev;
dp->name = "drm_dp"; dp->name = "drm_dp";
dp->id = desc->id; dp->id = desc->id;
dp->dp_display.connector_type = desc->connector_type; dp->dp_display.connector_type = desc->connector_type;
...@@ -1461,7 +1460,7 @@ void msm_dp_debugfs_init(struct msm_dp *dp_display, struct drm_minor *minor) ...@@ -1461,7 +1460,7 @@ void msm_dp_debugfs_init(struct msm_dp *dp_display, struct drm_minor *minor)
int rc; int rc;
dp = container_of(dp_display, struct dp_display_private, dp_display); dp = container_of(dp_display, struct dp_display_private, dp_display);
dev = &dp->pdev->dev; dev = &dp->dp_display.pdev->dev;
dp->debug = dp_debug_get(dev, dp->panel, dp->debug = dp_debug_get(dev, dp->panel,
dp->link, dp->dp_display.connector, dp->link, dp->dp_display.connector,
...@@ -1481,7 +1480,7 @@ static int dp_display_get_next_bridge(struct msm_dp *dp) ...@@ -1481,7 +1480,7 @@ static int dp_display_get_next_bridge(struct msm_dp *dp)
struct device *dev; struct device *dev;
dp_priv = container_of(dp, struct dp_display_private, dp_display); dp_priv = container_of(dp, struct dp_display_private, dp_display);
dev = &dp_priv->pdev->dev; dev = &dp_priv->dp_display.pdev->dev;
aux_bus = of_get_child_by_name(dev->of_node, "aux-bus"); aux_bus = of_get_child_by_name(dev->of_node, "aux-bus");
if (aux_bus && dp->is_edp) { if (aux_bus && dp->is_edp) {
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
struct msm_dp { struct msm_dp {
struct drm_device *drm_dev; struct drm_device *drm_dev;
struct platform_device *pdev;
struct device *codec_dev; struct device *codec_dev;
struct drm_bridge *bridge; struct drm_bridge *bridge;
struct drm_connector *connector; struct drm_connector *connector;
......
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