diff options
author | Rob Clark <robdclark@gmail.com> | 2013-12-15 16:23:05 -0500 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2014-08-04 11:55:28 -0400 |
commit | 41e69778c80764c12683beff5ebef12298a5d16b (patch) | |
tree | 494c91f5bdc4ec1ff86fbf59944f856867bb5edd /drivers/gpu/drm/msm/msm_drv.c | |
parent | 8f67da335d08bc06d3333f4bd46b96e6cc096d94 (diff) | |
download | linux-41e69778c80764c12683beff5ebef12298a5d16b.tar.gz linux-41e69778c80764c12683beff5ebef12298a5d16b.tar.bz2 linux-41e69778c80764c12683beff5ebef12298a5d16b.zip |
drm/msm: DT support for 8960/8064 (v3)
Now that we (almost) have enough dependencies in place (MMCC, RPM, etc),
add necessary DT support so that we can use drm/msm on upstream kernel.
v2: update for review comments
v3: rebase on component helper changes
Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_drv.c')
-rw-r--r-- | drivers/gpu/drm/msm/msm_drv.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index a322029983ce..a2f5bf6da6f3 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -905,6 +905,25 @@ static int compare_of(struct device *dev, void *data) { return dev->of_node == data; } + +static int add_components(struct device *dev, struct component_match **matchptr, + const char *name) +{ + struct device_node *np = dev->of_node; + unsigned i; + + for (i = 0; ; i++) { + struct device_node *node; + + node = of_parse_phandle(np, name, i); + if (!node) + break; + + component_match_add(dev, matchptr, compare_of, node); + } + + return 0; +} #else static int compare_dev(struct device *dev, void *data) { @@ -935,21 +954,8 @@ static int msm_pdev_probe(struct platform_device *pdev) { struct component_match *match = NULL; #ifdef CONFIG_OF - /* NOTE: the CONFIG_OF case duplicates the same code as exynos or imx - * (or probably any other).. so probably some room for some helpers - */ - struct device_node *np = pdev->dev.of_node; - unsigned i; - - for (i = 0; ; i++) { - struct device_node *node; - - node = of_parse_phandle(np, "connectors", i); - if (!node) - break; - - component_match_add(&pdev->dev, &match, compare_of, node); - } + add_components(&pdev->dev, &match, "connectors"); + add_components(&pdev->dev, &match, "gpus"); #else /* For non-DT case, it kinda sucks. We don't actually have a way * to know whether or not we are waiting for certain devices (or if @@ -995,7 +1001,8 @@ static const struct platform_device_id msm_id[] = { }; static const struct of_device_id dt_match[] = { - { .compatible = "qcom,mdss_mdp" }, + { .compatible = "qcom,mdp" }, /* mdp4 */ + { .compatible = "qcom,mdss_mdp" }, /* mdp5 */ {} }; MODULE_DEVICE_TABLE(of, dt_match); |