Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70c963ec authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Archit Taneja
Browse files

drm: bridge: dw-hdmi: Embed drm_bridge in struct dw_hdmi

parent dfa73065
Loading
Loading
Loading
Loading
+3 −10
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ struct dw_hdmi_i2c {
struct dw_hdmi {
	struct drm_connector connector;
	struct drm_encoder *encoder;
	struct drm_bridge *bridge;
	struct drm_bridge bridge;

	struct platform_device *audio;
	enum dw_hdmi_devtype dev_type;
@@ -1806,7 +1806,7 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id)
	if (intr_stat & HDMI_IH_PHY_STAT0_HPD) {
		dev_dbg(hdmi->dev, "EVENT=%s\n",
			phy_int_pol & HDMI_PHY_HPD ? "plugin" : "plugout");
		drm_helper_hpd_irq_event(hdmi->bridge->dev);
		drm_helper_hpd_irq_event(hdmi->bridge.dev);
	}

	hdmi_writeb(hdmi, intr_stat, HDMI_IH_PHY_STAT0);
@@ -1819,16 +1819,9 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id)
static int dw_hdmi_register(struct drm_device *drm, struct dw_hdmi *hdmi)
{
	struct drm_encoder *encoder = hdmi->encoder;
	struct drm_bridge *bridge;
	struct drm_bridge *bridge = &hdmi->bridge;
	int ret;

	bridge = devm_kzalloc(drm->dev, sizeof(*bridge), GFP_KERNEL);
	if (!bridge) {
		DRM_ERROR("Failed to allocate drm bridge\n");
		return -ENOMEM;
	}

	hdmi->bridge = bridge;
	bridge->driver_private = hdmi;
	bridge->funcs = &dw_hdmi_bridge_funcs;
	ret = drm_bridge_attach(encoder, bridge, NULL);