Skip to content

Commit

Permalink
omapdrm: omapdss_hdmi_ops: add lost_hotplug op
Browse files Browse the repository at this point in the history
The CEC framework needs to know when the hotplug detect signal
disappears, since that means the CEC physical address has to be
invalidated (i.e. set to f.f.f.f).

Add a lost_hotplug op that is called when the HPD signal goes away.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
  • Loading branch information
Hans Verkuil authored and Tomi Valkeinen committed Oct 12, 2017
1 parent 1897e1a commit 019114e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
8 changes: 6 additions & 2 deletions drivers/gpu/drm/omapdrm/displays/connector-hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,15 @@ static bool hdmic_detect(struct omap_dss_device *dssdev)
{
struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in;
bool connected;

if (gpio_is_valid(ddata->hpd_gpio))
return gpio_get_value_cansleep(ddata->hpd_gpio);
connected = gpio_get_value_cansleep(ddata->hpd_gpio);
else
return in->ops.hdmi->detect(in);
connected = in->ops.hdmi->detect(in);
if (!connected && in->ops.hdmi->lost_hotplug)
in->ops.hdmi->lost_hotplug(in);
return connected;
}

static int hdmic_register_hpd_cb(struct omap_dss_device *dssdev,
Expand Down
6 changes: 5 additions & 1 deletion drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,12 @@ static int tpd_read_edid(struct omap_dss_device *dssdev,
static bool tpd_detect(struct omap_dss_device *dssdev)
{
struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in;
bool connected = gpiod_get_value_cansleep(ddata->hpd_gpio);

return gpiod_get_value_cansleep(ddata->hpd_gpio);
if (!connected && in->ops.hdmi->lost_hotplug)
in->ops.hdmi->lost_hotplug(in);
return connected;
}

static int tpd_register_hpd_cb(struct omap_dss_device *dssdev,
Expand Down
8 changes: 6 additions & 2 deletions drivers/gpu/drm/omapdrm/dss/hdmi4.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,6 @@ static void hdmi_display_disable(struct omap_dss_device *dssdev)

DSSDBG("Enter hdmi_display_disable\n");

hdmi4_cec_set_phys_addr(&hdmi.core, CEC_PHYS_ADDR_INVALID);

mutex_lock(&hdmi.lock);

spin_lock_irqsave(&hdmi.audio_playing_lock, flags);
Expand Down Expand Up @@ -514,6 +512,11 @@ static int hdmi_read_edid(struct omap_dss_device *dssdev,
return r;
}

static void hdmi_lost_hotplug(struct omap_dss_device *dssdev)
{
hdmi4_cec_set_phys_addr(&hdmi.core, CEC_PHYS_ADDR_INVALID);
}

static int hdmi_set_infoframe(struct omap_dss_device *dssdev,
const struct hdmi_avi_infoframe *avi)
{
Expand All @@ -540,6 +543,7 @@ static const struct omapdss_hdmi_ops hdmi_ops = {
.get_timings = hdmi_display_get_timings,

.read_edid = hdmi_read_edid,
.lost_hotplug = hdmi_lost_hotplug,
.set_infoframe = hdmi_set_infoframe,
.set_hdmi_mode = hdmi_set_hdmi_mode,
};
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/omapdrm/dss/omapdss.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ struct omapdss_hdmi_ops {
struct videomode *vm);

int (*read_edid)(struct omap_dss_device *dssdev, u8 *buf, int len);
void (*lost_hotplug)(struct omap_dss_device *dssdev);
bool (*detect)(struct omap_dss_device *dssdev);

int (*register_hpd_cb)(struct omap_dss_device *dssdev,
Expand Down

0 comments on commit 019114e

Please sign in to comment.