summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/sun4i/sun4i_rgb.c
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2016-07-20 10:35:06 +0200
committerMaxime Ripard <maxime.ripard@free-electrons.com>2016-08-22 15:34:16 +0200
commita8444c7ee2c02b567731a6edcd5d328f85aac1b1 (patch)
tree955b9c4e23adc51d594223e8b1a62c46351d23dc /drivers/gpu/drm/sun4i/sun4i_rgb.c
parentae558110e51737b3596f400505ee598acbbf6713 (diff)
downloadblackbird-op-linux-a8444c7ee2c02b567731a6edcd5d328f85aac1b1.tar.gz
blackbird-op-linux-a8444c7ee2c02b567731a6edcd5d328f85aac1b1.zip
drm/sun4i: Move panel retrieval in RGB connector
In order to properly support bridges and use drm_encoder's bridge pointer, move the panel (and bridge eventually) retrieval code in the RGB output init function. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Diffstat (limited to 'drivers/gpu/drm/sun4i/sun4i_rgb.c')
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_rgb.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpu/drm/sun4i/sun4i_rgb.c b/drivers/gpu/drm/sun4i/sun4i_rgb.c
index f5bbac6efb4c..d32f08f9ce5f 100644
--- a/drivers/gpu/drm/sun4i/sun4i_rgb.c
+++ b/drivers/gpu/drm/sun4i/sun4i_rgb.c
@@ -206,15 +206,17 @@ int sun4i_rgb_init(struct drm_device *drm)
struct sun4i_rgb *rgb;
int ret;
- /* If we don't have a panel, there's no point in going on */
- if (IS_ERR(tcon->panel))
- return -ENODEV;
-
rgb = devm_kzalloc(drm->dev, sizeof(*rgb), GFP_KERNEL);
if (!rgb)
return -ENOMEM;
rgb->drv = drv;
+ tcon->panel = sun4i_tcon_find_panel(tcon->dev->of_node);
+ if (IS_ERR(tcon->panel)) {
+ dev_info(drm->dev, "No panel found... RGB output disabled\n");
+ return 0;
+ }
+
drm_encoder_helper_add(&rgb->encoder,
&sun4i_rgb_enc_helper_funcs);
ret = drm_encoder_init(drm,
OpenPOWER on IntegriCloud