.destroy = rockchip_dp_drm_encoder_destroy,
};
-static int rockchip_dp_init(struct rockchip_dp_device *dp)
+static int rockchip_dp_of_probe(struct rockchip_dp_device *dp)
{
struct device *dev = dp->dev;
struct device_node *np = dev->of_node;
return PTR_ERR(dp->rst);
}
- ret = clk_prepare_enable(dp->pclk);
- if (ret < 0) {
- DRM_DEV_ERROR(dp->dev, "failed to enable pclk %d\n", ret);
- return ret;
- }
-
- ret = rockchip_dp_pre_init(dp);
- if (ret < 0) {
- DRM_DEV_ERROR(dp->dev, "failed to pre init %d\n", ret);
- clk_disable_unprepare(dp->pclk);
- return ret;
- }
-
return 0;
}
if (!dp_data)
return -ENODEV;
- ret = rockchip_dp_init(dp);
- if (ret < 0)
- return ret;
-
dp->data = dp_data;
dp->drm_dev = drm_dev;
rockchip_drm_psr_unregister(&dp->encoder);
analogix_dp_unbind(dev, master, data);
- clk_disable_unprepare(dp->pclk);
}
static const struct component_ops rockchip_dp_component_ops = {
int ret;
ret = drm_of_find_panel_or_bridge(dev->of_node, 1, 0, &panel, NULL);
- if (ret)
+ if (ret < 0)
return ret;
dp = devm_kzalloc(dev, sizeof(*dp), GFP_KERNEL);
return -ENOMEM;
dp->dev = dev;
-
dp->plat_data.panel = panel;
+ ret = rockchip_dp_of_probe(dp);
+ if (ret < 0)
+ return ret;
+
/*
* We just use the drvdata until driver run into component
* add function, and then we would set drvdata to null, so