Hi Hans, On 29/04/16 12:39, Hans Verkuil wrote: > From: Hans Verkuil <hans.verkuil@xxxxxxxxx> > > As long as there is a valid physical address in the EDID and the omap > CEC support is enabled, then we keep ls_oe_gpio on to ensure the CEC > signal is passed through the tpd12s015. > > Signed-off-by: Hans Verkuil <hans.verkuil@xxxxxxxxx> > Suggested-by: Tomi Valkeinen <tomi.valkeinen@xxxxxx> > --- > drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c b/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c > index 916a899..efbba23 100644 > --- a/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c > +++ b/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c > @@ -16,6 +16,7 @@ > #include <linux/platform_device.h> > #include <linux/gpio/consumer.h> > > +#include <media/cec-edid.h> > #include <video/omapdss.h> > #include <video/omap-panel-data.h> > > @@ -65,6 +66,7 @@ static void tpd_disconnect(struct omap_dss_device *dssdev, > return; > > gpiod_set_value_cansleep(ddata->ct_cp_hpd_gpio, 0); > + gpiod_set_value_cansleep(ddata->ls_oe_gpio, 0); > > dst->src = NULL; > dssdev->dst = NULL; > @@ -142,6 +144,7 @@ static int tpd_read_edid(struct omap_dss_device *dssdev, > { > struct panel_drv_data *ddata = to_panel_data(dssdev); > struct omap_dss_device *in = ddata->in; > + bool valid_phys_addr = 0; > int r; > > if (!gpiod_get_value_cansleep(ddata->hpd_gpio)) > @@ -151,7 +154,15 @@ static int tpd_read_edid(struct omap_dss_device *dssdev, > > r = in->ops.hdmi->read_edid(in, edid, len); > > - gpiod_set_value_cansleep(ddata->ls_oe_gpio, 0); > +#ifdef CONFIG_OMAP2_DSS_HDMI_CEC > + /* > + * In order to support CEC this pin should remain high > + * as long as the EDID has a valid physical address. > + */ > + valid_phys_addr = > + cec_get_edid_phys_addr(edid, r, NULL) != CEC_PHYS_ADDR_INVALID; > +#endif > + gpiod_set_value_cansleep(ddata->ls_oe_gpio, valid_phys_addr); > > return r; > } I think this works, but... Maybe it would be cleaner to have the LS_OE enabled if a cable is connected. That's actually what we had earlier, but I removed that due to a race issue: a87a6d6b09de3118e5679c2057b99b7791b7673b ("OMAPDSS: encoder-tpd12s015: Fix race issue with LS_OE"). Now, with CEC, there's need to have LS_OE enabled even after reading the EDID, so I think it's better to go back to the old model (after fixing the race issue, of course =). Tomi
Attachment:
signature.asc
Description: OpenPGP digital signature