Skip to content

Commit

Permalink
mxc_hdmi: default to keep-alive (don't detect disconnect)
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
(cherry picked from commit 60709839eda8310d86b778aab8c2c22844e4141c)
  • Loading branch information
Eric Nelson authored and johnweber committed Aug 28, 2014
1 parent b26994f commit d08f50d
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions drivers/video/mxc/mxc_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,9 @@ static u8 hdmi_edid_i2c_read(struct mxc_hdmi *hdmi,
return data;
}

static int keepalive=1;
module_param(keepalive, int, 0644);
MODULE_PARM_DESC(keepalive, "Allow only CEA modes");

/* "Power-down enable (active low)"
* That mean that power up == 1! */
Expand Down Expand Up @@ -1981,6 +1984,7 @@ static void hotplug_worker(struct work_struct *work)
u32 hdmi_phy_stat0, hdmi_phy_pol0, hdmi_phy_mask0;
unsigned long flags;
char event_string[32];
int isalive = 0;
char *envp[] = { event_string, NULL };


Expand All @@ -2007,7 +2011,10 @@ static void hotplug_worker(struct work_struct *work)
#endif
hdmi_set_cable_state(1);

} else {
if (keepalive)
hdmi_writeb(HDMI_DVI_STAT, HDMI_PHY_POL0);
isalive=1;
} else if (!keepalive) {
/* Plugout event */
dev_dbg(&hdmi->pdev->dev, "EVENT=plugout\n");
hdmi_set_cable_state(0);
Expand All @@ -2026,16 +2033,18 @@ static void hotplug_worker(struct work_struct *work)
* completed before next interrupt processed */
spin_lock_irqsave(&hdmi->irq_lock, flags);

/* Re-enable HPD interrupts */
hdmi_phy_mask0 = hdmi_readb(HDMI_PHY_MASK0);
hdmi_phy_mask0 &= ~HDMI_DVI_STAT;
hdmi_writeb(hdmi_phy_mask0, HDMI_PHY_MASK0);
if (!(keepalive || isalive)) {
/* Re-enable HPD interrupts */
hdmi_phy_mask0 = hdmi_readb(HDMI_PHY_MASK0);
hdmi_phy_mask0 &= ~HDMI_DVI_STAT;
hdmi_writeb(hdmi_phy_mask0, HDMI_PHY_MASK0);

/* Unmute interrupts */
hdmi_writeb(~HDMI_DVI_IH_STAT, HDMI_IH_MUTE_PHY_STAT0);
/* Unmute interrupts */
hdmi_writeb(~HDMI_DVI_IH_STAT, HDMI_IH_MUTE_PHY_STAT0);

if (hdmi_readb(HDMI_IH_FC_STAT2) & HDMI_IH_FC_STAT2_OVERFLOW_MASK)
mxc_hdmi_clear_overflow(hdmi);
if (hdmi_readb(HDMI_IH_FC_STAT2) & HDMI_IH_FC_STAT2_OVERFLOW_MASK)
mxc_hdmi_clear_overflow(hdmi);
}

spin_unlock_irqrestore(&hdmi->irq_lock, flags);
}
Expand Down

0 comments on commit d08f50d

Please sign in to comment.