* [PATCH] drm/bridge: dw_hdmi: adapt to updated bridge API
@ 2015-01-26 13:12 Heiko Stübner
2015-01-26 23:19 ` Dave Airlie
0 siblings, 1 reply; 2+ messages in thread
From: Heiko Stübner @ 2015-01-26 13:12 UTC (permalink / raw)
To: dri-devel, Dave Airlie; +Cc: Andy Yan, Ajay Kumar
Commits 8eb17f05bc18 ("drm/bridge: do not pass drm_bridge_funcs to
drm_bridge_init") and fbc4572e9c48 ("drm/bridge: make bridge registration
independent of drm flow") changed the bridge API without taking into account
the also newly introduced dw_hdmi bridge.
Therefore adapt the dw_hdmi bridge to the new bridge API.
The bridge struct is already allocated using devm_kzalloc, so the destroy
function can go away completely.
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
Tested on a rk3288-firefly board
drivers/gpu/drm/bridge/dw_hdmi.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/bridge/dw_hdmi.c b/drivers/gpu/drm/bridge/dw_hdmi.c
index 4cc4569..37e8711 100644
--- a/drivers/gpu/drm/bridge/dw_hdmi.c
+++ b/drivers/gpu/drm/bridge/dw_hdmi.c
@@ -1373,12 +1373,6 @@ static void dw_hdmi_bridge_enable(struct drm_bridge *bridge)
dw_hdmi_poweron(hdmi);
}
-static void dw_hdmi_bridge_destroy(struct drm_bridge *bridge)
-{
- drm_bridge_cleanup(bridge);
- kfree(bridge);
-}
-
static void dw_hdmi_bridge_nop(struct drm_bridge *bridge)
{
/* do nothing */
@@ -1468,7 +1462,6 @@ struct drm_bridge_funcs dw_hdmi_bridge_funcs = {
.post_disable = dw_hdmi_bridge_nop,
.mode_set = dw_hdmi_bridge_mode_set,
.mode_fixup = dw_hdmi_bridge_mode_fixup,
- .destroy = dw_hdmi_bridge_destroy,
};
static irqreturn_t dw_hdmi_hardirq(int irq, void *dev_id)
@@ -1532,7 +1525,15 @@ static int dw_hdmi_register(struct drm_device *drm, struct dw_hdmi *hdmi)
hdmi->bridge = bridge;
bridge->driver_private = hdmi;
- ret = drm_bridge_init(drm, bridge, &dw_hdmi_bridge_funcs);
+ bridge->funcs = &dw_hdmi_bridge_funcs;
+ bridge->of_node = hdmi->dev->of_node;
+ ret = drm_bridge_add(bridge);
+ if (ret) {
+ DRM_ERROR("Failed to add bridge\n");
+ return ret;
+ }
+
+ ret = drm_bridge_attach(drm, bridge);
if (ret) {
DRM_ERROR("Failed to initialize bridge with drm\n");
return -EINVAL;
@@ -1700,6 +1701,8 @@ void dw_hdmi_unbind(struct device *dev, struct device *master, void *data)
hdmi->connector.funcs->destroy(&hdmi->connector);
hdmi->encoder->funcs->destroy(hdmi->encoder);
+ drm_bridge_remove(hdmi->encoder->bridge);
+
clk_disable_unprepare(hdmi->iahb_clk);
clk_disable_unprepare(hdmi->isfr_clk);
i2c_put_adapter(hdmi->ddc);
--
2.1.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/bridge: dw_hdmi: adapt to updated bridge API
2015-01-26 13:12 [PATCH] drm/bridge: dw_hdmi: adapt to updated bridge API Heiko Stübner
@ 2015-01-26 23:19 ` Dave Airlie
0 siblings, 0 replies; 2+ messages in thread
From: Dave Airlie @ 2015-01-26 23:19 UTC (permalink / raw)
To: Heiko Stübner; +Cc: Andy Yan, Ajay Kumar, dri-devel
On 26 January 2015 at 23:12, Heiko Stübner <heiko@sntech.de> wrote:
> Commits 8eb17f05bc18 ("drm/bridge: do not pass drm_bridge_funcs to
> drm_bridge_init") and fbc4572e9c48 ("drm/bridge: make bridge registration
> independent of drm flow") changed the bridge API without taking into account
> the also newly introduced dw_hdmi bridge.
>
> Therefore adapt the dw_hdmi bridge to the new bridge API.
>
> The bridge struct is already allocated using devm_kzalloc, so the destroy
> function can go away completely.
>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Thanks, I merged this after I pulled Thierry's change.
Dave.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-01-26 23:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-26 13:12 [PATCH] drm/bridge: dw_hdmi: adapt to updated bridge API Heiko Stübner
2015-01-26 23:19 ` Dave Airlie
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.