Commit 384764c3 authored by Dave Airlie's avatar Dave Airlie Committed by Thierry Reding

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: default avatarDave Airlie <airlied@redhat.com>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent b33ef619
...@@ -91,6 +91,7 @@ struct sti_dvo { ...@@ -91,6 +91,7 @@ struct sti_dvo {
struct dvo_config *config; struct dvo_config *config;
bool enabled; bool enabled;
struct drm_encoder *encoder; struct drm_encoder *encoder;
struct drm_bridge *bridge;
}; };
struct sti_dvo_connector { struct sti_dvo_connector {
...@@ -272,19 +273,12 @@ static void sti_dvo_bridge_nope(struct drm_bridge *bridge) ...@@ -272,19 +273,12 @@ static void sti_dvo_bridge_nope(struct drm_bridge *bridge)
/* do nothing */ /* 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 = { static const struct drm_bridge_funcs sti_dvo_bridge_funcs = {
.pre_enable = sti_dvo_pre_enable, .pre_enable = sti_dvo_pre_enable,
.enable = sti_dvo_bridge_nope, .enable = sti_dvo_bridge_nope,
.disable = sti_dvo_disable, .disable = sti_dvo_disable,
.post_disable = sti_dvo_bridge_nope, .post_disable = sti_dvo_bridge_nope,
.mode_set = sti_dvo_set_mode, .mode_set = sti_dvo_set_mode,
.destroy = sti_dvo_brigde_destroy,
}; };
static int sti_dvo_connector_get_modes(struct drm_connector *connector) 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) ...@@ -416,8 +410,21 @@ static int sti_dvo_bind(struct device *dev, struct device *master, void *data)
return -ENOMEM; return -ENOMEM;
bridge->driver_private = dvo; 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; encoder->bridge = bridge;
connector->encoder = encoder; connector->encoder = encoder;
dvo->encoder = encoder; dvo->encoder = encoder;
...@@ -446,7 +453,7 @@ static int sti_dvo_bind(struct device *dev, struct device *master, void *data) ...@@ -446,7 +453,7 @@ static int sti_dvo_bind(struct device *dev, struct device *master, void *data)
err_sysfs: err_sysfs:
drm_connector_unregister(drm_connector); drm_connector_unregister(drm_connector);
err_connector: err_connector:
drm_bridge_cleanup(bridge); drm_bridge_remove(bridge);
drm_connector_cleanup(drm_connector); drm_connector_cleanup(drm_connector);
return -EINVAL; return -EINVAL;
} }
...@@ -454,7 +461,9 @@ static int sti_dvo_bind(struct device *dev, struct device *master, void *data) ...@@ -454,7 +461,9 @@ static int sti_dvo_bind(struct device *dev, struct device *master, void *data)
static void sti_dvo_unbind(struct device *dev, static void sti_dvo_unbind(struct device *dev,
struct device *master, void *data) 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 = { static const struct component_ops sti_dvo_ops = {
......
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