mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-28 07:04:00 +08:00
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>
This commit is contained in:
parent
ae558110e5
commit
a8444c7ee2
@ -206,15 +206,17 @@ int sun4i_rgb_init(struct drm_device *drm)
|
|||||||
struct sun4i_rgb *rgb;
|
struct sun4i_rgb *rgb;
|
||||||
int ret;
|
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);
|
rgb = devm_kzalloc(drm->dev, sizeof(*rgb), GFP_KERNEL);
|
||||||
if (!rgb)
|
if (!rgb)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
rgb->drv = drv;
|
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,
|
drm_encoder_helper_add(&rgb->encoder,
|
||||||
&sun4i_rgb_enc_helper_funcs);
|
&sun4i_rgb_enc_helper_funcs);
|
||||||
ret = drm_encoder_init(drm,
|
ret = drm_encoder_init(drm,
|
||||||
|
@ -398,7 +398,7 @@ static int sun4i_tcon_init_regmap(struct device *dev,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct drm_panel *sun4i_tcon_find_panel(struct device_node *node)
|
struct drm_panel *sun4i_tcon_find_panel(struct device_node *node)
|
||||||
{
|
{
|
||||||
struct device_node *port, *remote, *child;
|
struct device_node *port, *remote, *child;
|
||||||
struct device_node *end_node = NULL;
|
struct device_node *end_node = NULL;
|
||||||
@ -485,12 +485,6 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master,
|
|||||||
goto err_free_clocks;
|
goto err_free_clocks;
|
||||||
}
|
}
|
||||||
|
|
||||||
tcon->panel = sun4i_tcon_find_panel(dev->of_node);
|
|
||||||
if (IS_ERR(tcon->panel)) {
|
|
||||||
dev_info(dev, "No panel found... RGB output disabled\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = sun4i_rgb_init(drm);
|
ret = sun4i_rgb_init(drm);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto err_free_clocks;
|
goto err_free_clocks;
|
||||||
|
@ -166,6 +166,8 @@ struct sun4i_tcon {
|
|||||||
struct drm_panel *panel;
|
struct drm_panel *panel;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct drm_panel *sun4i_tcon_find_panel(struct device_node *node);
|
||||||
|
|
||||||
/* Global Control */
|
/* Global Control */
|
||||||
void sun4i_tcon_disable(struct sun4i_tcon *tcon);
|
void sun4i_tcon_disable(struct sun4i_tcon *tcon);
|
||||||
void sun4i_tcon_enable(struct sun4i_tcon *tcon);
|
void sun4i_tcon_enable(struct sun4i_tcon *tcon);
|
||||||
|
Loading…
Reference in New Issue
Block a user