drm/sti: fixup for bridge interface

So sti doesn't build because the bridge interfaces changes didn't
catch up to its new DVO driver.

Now I might just carry this patch, but I might just push the
bridge pull into a side-pull until someone resolves it.

So this might not be the right solution to the problem, so
please figure it out and let me know ASAP.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
This commit is contained in:
Dave Airlie 2015-01-27 09:37:03 +10:00 committed by Thierry Reding
parent b33ef61970
commit 384764c361
1 changed files with 19 additions and 10 deletions

View File

@ -91,6 +91,7 @@ struct sti_dvo {
struct dvo_config *config;
bool enabled;
struct drm_encoder *encoder;
struct drm_bridge *bridge;
};
struct sti_dvo_connector {
@ -272,19 +273,12 @@ static void sti_dvo_bridge_nope(struct drm_bridge *bridge)
/* do nothing */
}
static void sti_dvo_brigde_destroy(struct drm_bridge *bridge)
{
drm_bridge_cleanup(bridge);
kfree(bridge);
}
static const struct drm_bridge_funcs sti_dvo_bridge_funcs = {
.pre_enable = sti_dvo_pre_enable,
.enable = sti_dvo_bridge_nope,
.disable = sti_dvo_disable,
.post_disable = sti_dvo_bridge_nope,
.mode_set = sti_dvo_set_mode,
.destroy = sti_dvo_brigde_destroy,
};
static int sti_dvo_connector_get_modes(struct drm_connector *connector)
@ -416,8 +410,21 @@ static int sti_dvo_bind(struct device *dev, struct device *master, void *data)
return -ENOMEM;
bridge->driver_private = dvo;
drm_bridge_init(drm_dev, bridge, &sti_dvo_bridge_funcs);
bridge->funcs = &sti_dvo_bridge_funcs;
bridge->of_node = dvo->dev.of_node;
err = drm_bridge_add(bridge);
if (err) {
DRM_ERROR("Failed to add bridge\n");
return err;
}
err = drm_bridge_attach(drm_dev, bridge);
if (err) {
DRM_ERROR("Failed to attach bridge\n");
return err;
}
dvo->bridge = bridge;
encoder->bridge = bridge;
connector->encoder = encoder;
dvo->encoder = encoder;
@ -446,7 +453,7 @@ static int sti_dvo_bind(struct device *dev, struct device *master, void *data)
err_sysfs:
drm_connector_unregister(drm_connector);
err_connector:
drm_bridge_cleanup(bridge);
drm_bridge_remove(bridge);
drm_connector_cleanup(drm_connector);
return -EINVAL;
}
@ -454,7 +461,9 @@ err_connector:
static void sti_dvo_unbind(struct device *dev,
struct device *master, void *data)
{
/* do nothing */
struct sti_dvo *dvo = dev_get_drvdata(dev);
drm_bridge_remove(dvo->bridge);
}
static const struct component_ops sti_dvo_ops = {