Permalink
Browse files

video: mxc_hdmi: Fix DVI EDID parsing

Handling non-CEA edid parsing and configuration.  This includes
checking for a non-HDMI connection in the audio driver startup
and bailing out.
  • Loading branch information...
1 parent 77c8ee8 commit 22cab1464f4e9ee6f30ed54de95b803018a795b6 @linux4kix committed Apr 22, 2014
Showing with 28 additions and 19 deletions.
  1. +21 −15 drivers/video/mxc/mxc_hdmi.c
  2. +7 −4 sound/soc/fsl/fsl_hdmi.c
@@ -1590,8 +1590,13 @@ static int mxc_edid_read_internal(struct mxc_hdmi *hdmi, unsigned char *edid,
ret = mxc_edid_parse_ext_blk(edid + EDID_LENGTH,
cfg, &fbi->monspecs);
- if (ret < 0)
- return -ENOENT;
+ if (ret < 0) {
+ fb_edid_add_monspecs(edid + EDID_LENGTH, &fbi->monspecs);
+ if (fbi->monspecs.modedb_len > 0)
+ hdmi->edid_cfg.hdmi_cap = false;
+ else
+ return -ENOENT;
+ }
/* need read segment block? */
if (extblknum > 1) {
@@ -1810,20 +1815,21 @@ static void mxc_hdmi_edid_rebuild_modelist(struct mxc_hdmi *hdmi)
*/
mode = &hdmi->fbi->monspecs.modedb[i];
- if (!(mode->vmode & FB_VMODE_INTERLACED) &&
- (mxc_edid_mode_to_vic(mode) != 0)) {
+ if (hdmi->edid_cfg.hdmi_cap &&
+ (mode->vmode & FB_VMODE_INTERLACED) &&
+ (mxc_edid_mode_to_vic(mode) == 0))
+ continue;
- dev_dbg(&hdmi->pdev->dev, "Added mode %d:", i);
- dev_dbg(&hdmi->pdev->dev,
- "xres = %d, yres = %d, freq = %d, vmode = %d, flag = %d\n",
- hdmi->fbi->monspecs.modedb[i].xres,
- hdmi->fbi->monspecs.modedb[i].yres,
- hdmi->fbi->monspecs.modedb[i].refresh,
- hdmi->fbi->monspecs.modedb[i].vmode,
- hdmi->fbi->monspecs.modedb[i].flag);
-
- fb_add_videomode(mode, &hdmi->fbi->modelist);
- }
+ dev_dbg(&hdmi->pdev->dev, "Added mode %d:", i);
+ dev_dbg(&hdmi->pdev->dev,
+ "xres = %d, yres = %d, freq = %d, vmode = %d, flag = %d\n",
+ hdmi->fbi->monspecs.modedb[i].xres,
+ hdmi->fbi->monspecs.modedb[i].yres,
+ hdmi->fbi->monspecs.modedb[i].refresh,
+ hdmi->fbi->monspecs.modedb[i].vmode,
+ hdmi->fbi->monspecs.modedb[i].flag);
+
+ fb_add_videomode(mode, &hdmi->fbi->modelist);
}
console_unlock();
View
@@ -338,6 +338,9 @@ static int fsl_hdmi_update_constraints(struct snd_pcm_substream *substream)
hdmi_get_edid_cfg(&edid_cfg);
+ if (!edid_cfg.hdmi_cap)
+ return -1;
+
fsl_hdmi_get_playback_rates();
ret = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
&playback_constraint_rates);
@@ -369,17 +372,17 @@ static int fsl_hdmi_soc_startup(struct snd_pcm_substream *substream,
struct imx_hdmi *hdmi_data = snd_soc_dai_get_drvdata(dai);
int ret;
+ ret = fsl_hdmi_update_constraints(substream);
+ if (ret < 0)
+ return ret;
+
clk_prepare_enable(hdmi_data->isfr_clk);
clk_prepare_enable(hdmi_data->iahb_clk);
dev_dbg(dai->dev, "%s hdmi clks: isfr:%d iahb:%d\n", __func__,
(int)clk_get_rate(hdmi_data->isfr_clk),
(int)clk_get_rate(hdmi_data->iahb_clk));
- ret = fsl_hdmi_update_constraints(substream);
- if (ret < 0)
- return ret;
-
/* Indicates the subpacket represents a flatline sample */
hdmi_audio_writeb(FC_AUDSCONF, AUD_PACKET_SAMPFIT, 0x0);

0 comments on commit 22cab14

Please sign in to comment.