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

drm/msm: allow passing struct msm_kms to msm_drv_probe()

In preparation of moving resource allocation to the probe time, allow
MSM KMS drivers to pass struct msm_kms pointer via msm_drv_probe().
Reviewed-by: default avatarRob Clark <robdclark@gmail.com>
Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/561627/Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
parent 1d524571
...@@ -1299,7 +1299,7 @@ static int dpu_kms_init(struct drm_device *ddev) ...@@ -1299,7 +1299,7 @@ static int dpu_kms_init(struct drm_device *ddev)
static int dpu_dev_probe(struct platform_device *pdev) static int dpu_dev_probe(struct platform_device *pdev)
{ {
return msm_drv_probe(&pdev->dev, dpu_kms_init); return msm_drv_probe(&pdev->dev, dpu_kms_init, NULL);
} }
static int dpu_dev_remove(struct platform_device *pdev) static int dpu_dev_remove(struct platform_device *pdev)
......
...@@ -557,7 +557,7 @@ static const struct dev_pm_ops mdp4_pm_ops = { ...@@ -557,7 +557,7 @@ static const struct dev_pm_ops mdp4_pm_ops = {
static int mdp4_probe(struct platform_device *pdev) static int mdp4_probe(struct platform_device *pdev)
{ {
return msm_drv_probe(&pdev->dev, mdp4_kms_init); return msm_drv_probe(&pdev->dev, mdp4_kms_init, NULL);
} }
static int mdp4_remove(struct platform_device *pdev) static int mdp4_remove(struct platform_device *pdev)
......
...@@ -939,7 +939,7 @@ static int mdp5_dev_probe(struct platform_device *pdev) ...@@ -939,7 +939,7 @@ static int mdp5_dev_probe(struct platform_device *pdev)
if (ret) if (ret)
return ret; return ret;
return msm_drv_probe(&pdev->dev, mdp5_kms_init); return msm_drv_probe(&pdev->dev, mdp5_kms_init, NULL);
} }
static int mdp5_dev_remove(struct platform_device *pdev) static int mdp5_dev_remove(struct platform_device *pdev)
......
...@@ -1230,7 +1230,8 @@ const struct component_master_ops msm_drm_ops = { ...@@ -1230,7 +1230,8 @@ const struct component_master_ops msm_drm_ops = {
}; };
int msm_drv_probe(struct device *master_dev, int msm_drv_probe(struct device *master_dev,
int (*kms_init)(struct drm_device *dev)) int (*kms_init)(struct drm_device *dev),
struct msm_kms *kms)
{ {
struct msm_drm_private *priv; struct msm_drm_private *priv;
struct component_match *match = NULL; struct component_match *match = NULL;
...@@ -1240,6 +1241,7 @@ int msm_drv_probe(struct device *master_dev, ...@@ -1240,6 +1241,7 @@ int msm_drv_probe(struct device *master_dev,
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
priv->kms = kms;
priv->kms_init = kms_init; priv->kms_init = kms_init;
dev_set_drvdata(master_dev, priv); dev_set_drvdata(master_dev, priv);
...@@ -1275,7 +1277,7 @@ int msm_drv_probe(struct device *master_dev, ...@@ -1275,7 +1277,7 @@ int msm_drv_probe(struct device *master_dev,
static int msm_pdev_probe(struct platform_device *pdev) static int msm_pdev_probe(struct platform_device *pdev)
{ {
return msm_drv_probe(&pdev->dev, NULL); return msm_drv_probe(&pdev->dev, NULL, NULL);
} }
static int msm_pdev_remove(struct platform_device *pdev) static int msm_pdev_remove(struct platform_device *pdev)
......
...@@ -570,7 +570,8 @@ int msm_pm_prepare(struct device *dev); ...@@ -570,7 +570,8 @@ int msm_pm_prepare(struct device *dev);
void msm_pm_complete(struct device *dev); void msm_pm_complete(struct device *dev);
int msm_drv_probe(struct device *dev, int msm_drv_probe(struct device *dev,
int (*kms_init)(struct drm_device *dev)); int (*kms_init)(struct drm_device *dev),
struct msm_kms *kms);
void msm_drv_shutdown(struct platform_device *pdev); void msm_drv_shutdown(struct platform_device *pdev);
......
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