Lines Matching refs:hdmi
77 static void dw_hdmi_write(struct dw_hdmi *hdmi, u8 val, int offset) in dw_hdmi_write() argument
79 switch (hdmi->reg_io_width) { in dw_hdmi_write()
81 writeb(val, hdmi->ioaddr + offset); in dw_hdmi_write()
84 writel(val, hdmi->ioaddr + (offset << 2)); in dw_hdmi_write()
92 static u8 dw_hdmi_read(struct dw_hdmi *hdmi, int offset) in dw_hdmi_read() argument
94 switch (hdmi->reg_io_width) { in dw_hdmi_read()
96 return readb(hdmi->ioaddr + offset); in dw_hdmi_read()
98 return readl(hdmi->ioaddr + (offset << 2)); in dw_hdmi_read()
107 static u8 (*hdmi_read)(struct dw_hdmi *hdmi, int offset) = dw_hdmi_read;
108 static void (*hdmi_write)(struct dw_hdmi *hdmi, u8 val, int offset) =
111 static void hdmi_mod(struct dw_hdmi *hdmi, unsigned reg, u8 mask, u8 data) in hdmi_mod() argument
113 u8 val = hdmi_read(hdmi, reg) & ~mask; in hdmi_mod()
116 hdmi_write(hdmi, val, reg); in hdmi_mod()
119 static void hdmi_set_clock_regenerator(struct dw_hdmi *hdmi, u32 n, u32 cts) in hdmi_set_clock_regenerator() argument
126 hdmi_write(hdmi, n3, HDMI_AUD_N3); in hdmi_set_clock_regenerator()
135 hdmi_write(hdmi, cts3, HDMI_AUD_CTS3); in hdmi_set_clock_regenerator()
136 hdmi_write(hdmi, (cts >> 8) & 0xff, HDMI_AUD_CTS2); in hdmi_set_clock_regenerator()
137 hdmi_write(hdmi, cts & 0xff, HDMI_AUD_CTS1); in hdmi_set_clock_regenerator()
141 hdmi_write(hdmi, n3, HDMI_AUD_N3); in hdmi_set_clock_regenerator()
142 hdmi_write(hdmi, (n >> 8) & 0xff, HDMI_AUD_N2); in hdmi_set_clock_regenerator()
143 hdmi_write(hdmi, n & 0xff, HDMI_AUD_N3); in hdmi_set_clock_regenerator()
145 hdmi_write(hdmi, HDMI_AUD_INPUTCLKFS_128, HDMI_AUD_INPUTCLKFS); in hdmi_set_clock_regenerator()
162 static void hdmi_audio_set_samplerate(struct dw_hdmi *hdmi, u32 pixel_clk) in hdmi_audio_set_samplerate() argument
175 hdmi_set_clock_regenerator(hdmi, clk_n, clk_cts); in hdmi_audio_set_samplerate()
185 static void hdmi_video_sample(struct dw_hdmi *hdmi) in hdmi_video_sample() argument
190 switch (hdmi->hdmi_data.enc_in_bus_format) { in hdmi_video_sample()
237 hdmi_write(hdmi, val, HDMI_TX_INVID0); in hdmi_video_sample()
243 hdmi_write(hdmi, val, HDMI_TX_INSTUFFING); in hdmi_video_sample()
244 hdmi_write(hdmi, 0x0, HDMI_TX_GYDATA0); in hdmi_video_sample()
245 hdmi_write(hdmi, 0x0, HDMI_TX_GYDATA1); in hdmi_video_sample()
246 hdmi_write(hdmi, 0x0, HDMI_TX_RCRDATA0); in hdmi_video_sample()
247 hdmi_write(hdmi, 0x0, HDMI_TX_RCRDATA1); in hdmi_video_sample()
248 hdmi_write(hdmi, 0x0, HDMI_TX_BCBDATA0); in hdmi_video_sample()
249 hdmi_write(hdmi, 0x0, HDMI_TX_BCBDATA1); in hdmi_video_sample()
252 static void hdmi_video_packetize(struct dw_hdmi *hdmi) in hdmi_video_packetize() argument
264 hdmi_write(hdmi, val, HDMI_VP_PR_CD); in hdmi_video_packetize()
266 hdmi_mod(hdmi, HDMI_VP_STUFF, HDMI_VP_STUFF_PR_STUFFING_MASK, in hdmi_video_packetize()
273 hdmi_mod(hdmi, HDMI_VP_CONF, HDMI_VP_CONF_PR_EN_MASK | in hdmi_video_packetize()
276 hdmi_mod(hdmi, HDMI_VP_STUFF, HDMI_VP_STUFF_IDEFAULT_PHASE_MASK, in hdmi_video_packetize()
279 hdmi_write(hdmi, remap_size, HDMI_VP_REMAP); in hdmi_video_packetize()
285 hdmi_mod(hdmi, HDMI_VP_CONF, HDMI_VP_CONF_BYPASS_EN_MASK | in hdmi_video_packetize()
289 hdmi_mod(hdmi, HDMI_VP_STUFF, HDMI_VP_STUFF_PP_STUFFING_MASK | in hdmi_video_packetize()
294 hdmi_mod(hdmi, HDMI_VP_CONF, HDMI_VP_CONF_OUTPUT_SELECTOR_MASK, in hdmi_video_packetize()
298 static inline void hdmi_phy_test_clear(struct dw_hdmi *hdmi, uint bit) in hdmi_phy_test_clear() argument
300 hdmi_mod(hdmi, HDMI_PHY_TST0, HDMI_PHY_TST0_TSTCLR_MASK, in hdmi_phy_test_clear()
304 static int hdmi_phy_wait_i2c_done(struct dw_hdmi *hdmi, u32 msec) in hdmi_phy_wait_i2c_done() argument
311 val = hdmi_read(hdmi, HDMI_IH_I2CMPHY_STAT0); in hdmi_phy_wait_i2c_done()
313 hdmi_write(hdmi, val, HDMI_IH_I2CMPHY_STAT0); in hdmi_phy_wait_i2c_done()
323 static void hdmi_phy_i2c_write(struct dw_hdmi *hdmi, uint data, uint addr) in hdmi_phy_i2c_write() argument
325 hdmi_write(hdmi, 0xff, HDMI_IH_I2CMPHY_STAT0); in hdmi_phy_i2c_write()
326 hdmi_write(hdmi, addr, HDMI_PHY_I2CM_ADDRESS_ADDR); in hdmi_phy_i2c_write()
327 hdmi_write(hdmi, (u8)(data >> 8), HDMI_PHY_I2CM_DATAO_1_ADDR); in hdmi_phy_i2c_write()
328 hdmi_write(hdmi, (u8)(data >> 0), HDMI_PHY_I2CM_DATAO_0_ADDR); in hdmi_phy_i2c_write()
329 hdmi_write(hdmi, HDMI_PHY_I2CM_OPERATION_ADDR_WRITE, in hdmi_phy_i2c_write()
332 hdmi_phy_wait_i2c_done(hdmi, 1000); in hdmi_phy_i2c_write()
335 static void hdmi_phy_enable_power(struct dw_hdmi *hdmi, uint enable) in hdmi_phy_enable_power() argument
337 hdmi_mod(hdmi, HDMI_PHY_CONF0, HDMI_PHY_CONF0_PDZ_MASK, in hdmi_phy_enable_power()
341 static void hdmi_phy_enable_tmds(struct dw_hdmi *hdmi, uint enable) in hdmi_phy_enable_tmds() argument
343 hdmi_mod(hdmi, HDMI_PHY_CONF0, HDMI_PHY_CONF0_ENTMDS_MASK, in hdmi_phy_enable_tmds()
347 static void hdmi_phy_enable_spare(struct dw_hdmi *hdmi, uint enable) in hdmi_phy_enable_spare() argument
349 hdmi_mod(hdmi, HDMI_PHY_CONF0, HDMI_PHY_CONF0_SPARECTRL_MASK, in hdmi_phy_enable_spare()
353 static void hdmi_phy_gen2_pddq(struct dw_hdmi *hdmi, uint enable) in hdmi_phy_gen2_pddq() argument
355 hdmi_mod(hdmi, HDMI_PHY_CONF0, HDMI_PHY_CONF0_GEN2_PDDQ_MASK, in hdmi_phy_gen2_pddq()
359 static void hdmi_phy_gen2_txpwron(struct dw_hdmi *hdmi, uint enable) in hdmi_phy_gen2_txpwron() argument
361 hdmi_mod(hdmi, HDMI_PHY_CONF0, in hdmi_phy_gen2_txpwron()
366 static void hdmi_phy_sel_data_en_pol(struct dw_hdmi *hdmi, uint enable) in hdmi_phy_sel_data_en_pol() argument
368 hdmi_mod(hdmi, HDMI_PHY_CONF0, in hdmi_phy_sel_data_en_pol()
373 static void hdmi_phy_sel_interface_control(struct dw_hdmi *hdmi, in hdmi_phy_sel_interface_control() argument
376 hdmi_mod(hdmi, HDMI_PHY_CONF0, HDMI_PHY_CONF0_SELDIPIF_MASK, in hdmi_phy_sel_interface_control()
380 static int hdmi_phy_configure(struct dw_hdmi *hdmi, u32 mpixelclock) in hdmi_phy_configure() argument
385 if (!hdmi->mpll_cfg || !hdmi->phy_cfg) in hdmi_phy_configure()
389 hdmi_phy_gen2_txpwron(hdmi, 0); in hdmi_phy_configure()
392 hdmi_phy_gen2_pddq(hdmi, 1); in hdmi_phy_configure()
395 hdmi_write(hdmi, HDMI_MC_PHYRSTZ_DEASSERT, HDMI_MC_PHYRSTZ); in hdmi_phy_configure()
396 hdmi_write(hdmi, HDMI_MC_PHYRSTZ_ASSERT, HDMI_MC_PHYRSTZ); in hdmi_phy_configure()
397 hdmi_write(hdmi, HDMI_MC_HEACPHY_RST_ASSERT, HDMI_MC_HEACPHY_RST); in hdmi_phy_configure()
399 hdmi_phy_test_clear(hdmi, 1); in hdmi_phy_configure()
400 hdmi_write(hdmi, HDMI_PHY_I2CM_SLAVE_ADDR_PHY_GEN2, in hdmi_phy_configure()
402 hdmi_phy_test_clear(hdmi, 0); in hdmi_phy_configure()
405 for (i = 0; hdmi->mpll_cfg[i].mpixelclock != (~0ul); i++) in hdmi_phy_configure()
406 if (mpixelclock <= hdmi->mpll_cfg[i].mpixelclock) in hdmi_phy_configure()
409 hdmi_phy_i2c_write(hdmi, hdmi->mpll_cfg[i].cpce, PHY_OPMODE_PLLCFG); in hdmi_phy_configure()
410 hdmi_phy_i2c_write(hdmi, hdmi->mpll_cfg[i].gmp, PHY_PLLGMPCTRL); in hdmi_phy_configure()
411 hdmi_phy_i2c_write(hdmi, hdmi->mpll_cfg[i].curr, PHY_PLLCURRCTRL); in hdmi_phy_configure()
413 hdmi_phy_i2c_write(hdmi, 0x0000, PHY_PLLPHBYCTRL); in hdmi_phy_configure()
414 hdmi_phy_i2c_write(hdmi, 0x0006, PHY_PLLCLKBISTPHASE); in hdmi_phy_configure()
416 for (i = 0; hdmi->phy_cfg[i].mpixelclock != (~0ul); i++) in hdmi_phy_configure()
417 if (mpixelclock <= hdmi->phy_cfg[i].mpixelclock) in hdmi_phy_configure()
425 hdmi_phy_i2c_write(hdmi, hdmi->phy_cfg[i].term, PHY_TXTERM); in hdmi_phy_configure()
426 hdmi_phy_i2c_write(hdmi, hdmi->phy_cfg[i].sym_ctr, PHY_CKSYMTXCTRL); in hdmi_phy_configure()
427 hdmi_phy_i2c_write(hdmi, hdmi->phy_cfg[i].vlev_ctr, PHY_VLEVCTRL); in hdmi_phy_configure()
430 hdmi_phy_i2c_write(hdmi, 0x8000, PHY_CKCALCTRL); in hdmi_phy_configure()
432 hdmi_phy_enable_power(hdmi, 1); in hdmi_phy_configure()
435 hdmi_phy_enable_tmds(hdmi, 0); in hdmi_phy_configure()
436 hdmi_phy_enable_tmds(hdmi, 1); in hdmi_phy_configure()
439 hdmi_phy_gen2_txpwron(hdmi, 1); in hdmi_phy_configure()
440 hdmi_phy_gen2_pddq(hdmi, 0); in hdmi_phy_configure()
442 hdmi_phy_enable_spare(hdmi, 1); in hdmi_phy_configure()
447 val = hdmi_read(hdmi, HDMI_PHY_STAT0); in hdmi_phy_configure()
457 static void hdmi_av_composer(struct dw_hdmi *hdmi, in hdmi_av_composer() argument
493 hdmi_write(hdmi, inv_val, HDMI_FC_INVIDCONF); in hdmi_av_composer()
496 hdmi_write(hdmi, edid->hactive.typ >> 8, HDMI_FC_INHACTV1); in hdmi_av_composer()
497 hdmi_write(hdmi, edid->hactive.typ, HDMI_FC_INHACTV0); in hdmi_av_composer()
500 hdmi_write(hdmi, edid->vactive.typ >> 8, HDMI_FC_INVACTV1); in hdmi_av_composer()
501 hdmi_write(hdmi, edid->vactive.typ, HDMI_FC_INVACTV0); in hdmi_av_composer()
504 hdmi_write(hdmi, hbl >> 8, HDMI_FC_INHBLANK1); in hdmi_av_composer()
505 hdmi_write(hdmi, hbl, HDMI_FC_INHBLANK0); in hdmi_av_composer()
508 hdmi_write(hdmi, vbl, HDMI_FC_INVBLANK); in hdmi_av_composer()
511 hdmi_write(hdmi, edid->hfront_porch.typ >> 8, HDMI_FC_HSYNCINDELAY1); in hdmi_av_composer()
512 hdmi_write(hdmi, edid->hfront_porch.typ, HDMI_FC_HSYNCINDELAY0); in hdmi_av_composer()
515 hdmi_write(hdmi, edid->vfront_porch.typ, HDMI_FC_VSYNCINDELAY); in hdmi_av_composer()
518 hdmi_write(hdmi, edid->hsync_len.typ >> 8, HDMI_FC_HSYNCINWIDTH1); in hdmi_av_composer()
519 hdmi_write(hdmi, edid->hsync_len.typ, HDMI_FC_HSYNCINWIDTH0); in hdmi_av_composer()
522 hdmi_write(hdmi, edid->vsync_len.typ, HDMI_FC_VSYNCINWIDTH); in hdmi_av_composer()
566 static int is_color_space_interpolation(struct dw_hdmi *hdmi) in is_color_space_interpolation() argument
568 if (!hdmi_bus_fmt_is_yuv422(hdmi->hdmi_data.enc_in_bus_format)) in is_color_space_interpolation()
571 if (hdmi_bus_fmt_is_rgb(hdmi->hdmi_data.enc_out_bus_format) || in is_color_space_interpolation()
572 hdmi_bus_fmt_is_yuv444(hdmi->hdmi_data.enc_out_bus_format)) in is_color_space_interpolation()
578 static int is_color_space_decimation(struct dw_hdmi *hdmi) in is_color_space_decimation() argument
580 if (!hdmi_bus_fmt_is_yuv422(hdmi->hdmi_data.enc_out_bus_format)) in is_color_space_decimation()
583 if (hdmi_bus_fmt_is_rgb(hdmi->hdmi_data.enc_in_bus_format) || in is_color_space_decimation()
584 hdmi_bus_fmt_is_yuv444(hdmi->hdmi_data.enc_in_bus_format)) in is_color_space_decimation()
621 static int is_color_space_conversion(struct dw_hdmi *hdmi) in is_color_space_conversion() argument
623 return hdmi->hdmi_data.enc_in_bus_format != in is_color_space_conversion()
624 hdmi->hdmi_data.enc_out_bus_format; in is_color_space_conversion()
627 static void dw_hdmi_update_csc_coeffs(struct dw_hdmi *hdmi) in dw_hdmi_update_csc_coeffs() argument
633 if (is_color_space_conversion(hdmi)) { in dw_hdmi_update_csc_coeffs()
634 if (hdmi_bus_fmt_is_rgb(hdmi->hdmi_data.enc_out_bus_format)) { in dw_hdmi_update_csc_coeffs()
637 hdmi->hdmi_data.enc_in_bus_format)) { in dw_hdmi_update_csc_coeffs()
649 hdmi_write(hdmi, coeff_a & 0xff, HDMI_CSC_COEF_A1_LSB + i * 2); in dw_hdmi_update_csc_coeffs()
650 hdmi_write(hdmi, coeff_a >> 8, HDMI_CSC_COEF_A1_MSB + i * 2); in dw_hdmi_update_csc_coeffs()
651 hdmi_write(hdmi, coeff_b & 0xff, HDMI_CSC_COEF_B1_LSB + i * 2); in dw_hdmi_update_csc_coeffs()
652 hdmi_write(hdmi, coeff_b >> 8, HDMI_CSC_COEF_B1_MSB + i * 2); in dw_hdmi_update_csc_coeffs()
653 hdmi_write(hdmi, coeff_c & 0xff, HDMI_CSC_COEF_C1_LSB + i * 2); in dw_hdmi_update_csc_coeffs()
654 hdmi_write(hdmi, coeff_c >> 8, HDMI_CSC_COEF_C1_MSB + i * 2); in dw_hdmi_update_csc_coeffs()
657 hdmi_mod(hdmi, HDMI_CSC_SCALE, HDMI_CSC_SCALE_CSCSCALE_MASK, csc_scale); in dw_hdmi_update_csc_coeffs()
660 static void hdmi_video_csc(struct dw_hdmi *hdmi) in hdmi_video_csc() argument
667 if (is_color_space_interpolation(hdmi)) in hdmi_video_csc()
669 else if (is_color_space_decimation(hdmi)) in hdmi_video_csc()
672 switch (hdmi_bus_fmt_color_depth(hdmi->hdmi_data.enc_out_bus_format)) { in hdmi_video_csc()
691 hdmi_write(hdmi, interpolation | decimation, HDMI_CSC_CFG); in hdmi_video_csc()
693 hdmi_mod(hdmi, HDMI_CSC_SCALE, HDMI_CSC_SCALE_CSC_COLORDE_PTH_MASK, in hdmi_video_csc()
696 dw_hdmi_update_csc_coeffs(hdmi); in hdmi_video_csc()
700 static void hdmi_enable_video_path(struct dw_hdmi *hdmi, bool audio) in hdmi_enable_video_path() argument
705 hdmi_write(hdmi, 12, HDMI_FC_CTRLDUR); in hdmi_enable_video_path()
706 hdmi_write(hdmi, 32, HDMI_FC_EXCTRLDUR); in hdmi_enable_video_path()
707 hdmi_write(hdmi, 1, HDMI_FC_EXCTRLSPAC); in hdmi_enable_video_path()
710 hdmi_write(hdmi, 0x0b, HDMI_FC_CH0PREAM); in hdmi_enable_video_path()
711 hdmi_write(hdmi, 0x16, HDMI_FC_CH1PREAM); in hdmi_enable_video_path()
712 hdmi_write(hdmi, 0x21, HDMI_FC_CH2PREAM); in hdmi_enable_video_path()
714 hdmi_write(hdmi, HDMI_MC_FLOWCTRL_FEED_THROUGH_OFF_CSC_BYPASS, in hdmi_enable_video_path()
720 hdmi_write(hdmi, clkdis, HDMI_MC_CLKDIS); in hdmi_enable_video_path()
723 hdmi_write(hdmi, clkdis, HDMI_MC_CLKDIS); in hdmi_enable_video_path()
726 if (is_color_space_conversion(hdmi)) { in hdmi_enable_video_path()
728 hdmi_write(hdmi, clkdis, HDMI_MC_CLKDIS); in hdmi_enable_video_path()
732 if (is_color_space_conversion(hdmi)) in hdmi_enable_video_path()
733 hdmi_write(hdmi, HDMI_MC_FLOWCTRL_FEED_THROUGH_OFF_CSC_IN_PATH, in hdmi_enable_video_path()
736 hdmi_write(hdmi, HDMI_MC_FLOWCTRL_FEED_THROUGH_OFF_CSC_BYPASS, in hdmi_enable_video_path()
741 hdmi_write(hdmi, clkdis, HDMI_MC_CLKDIS); in hdmi_enable_video_path()
746 static void hdmi_clear_overflow(struct dw_hdmi *hdmi) in hdmi_clear_overflow() argument
751 hdmi_write(hdmi, (u8)~HDMI_MC_SWRSTZ_TMDSSWRST_REQ, HDMI_MC_SWRSTZ); in hdmi_clear_overflow()
753 val = hdmi_read(hdmi, HDMI_FC_INVIDCONF); in hdmi_clear_overflow()
756 hdmi_write(hdmi, val, HDMI_FC_INVIDCONF); in hdmi_clear_overflow()
759 static void hdmi_audio_set_format(struct dw_hdmi *hdmi) in hdmi_audio_set_format() argument
761 hdmi_write(hdmi, HDMI_AUD_CONF0_I2S_SELECT | HDMI_AUD_CONF0_I2S_IN_EN_0, in hdmi_audio_set_format()
765 hdmi_write(hdmi, HDMI_AUD_CONF1_I2S_MODE_STANDARD_MODE | in hdmi_audio_set_format()
768 hdmi_write(hdmi, 0x00, HDMI_AUD_CONF2); in hdmi_audio_set_format()
771 static void hdmi_audio_fifo_reset(struct dw_hdmi *hdmi) in hdmi_audio_fifo_reset() argument
773 hdmi_write(hdmi, (u8)~HDMI_MC_SWRSTZ_II2SSWRST_REQ, HDMI_MC_SWRSTZ); in hdmi_audio_fifo_reset()
774 hdmi_write(hdmi, HDMI_AUD_CONF0_SW_AUDIO_FIFO_RST, HDMI_AUD_CONF0); in hdmi_audio_fifo_reset()
776 hdmi_write(hdmi, 0x00, HDMI_AUD_INT); in hdmi_audio_fifo_reset()
777 hdmi_write(hdmi, 0x00, HDMI_AUD_INT1); in hdmi_audio_fifo_reset()
780 static int hdmi_get_plug_in_status(struct dw_hdmi *hdmi) in hdmi_get_plug_in_status() argument
782 uint val = hdmi_read(hdmi, HDMI_PHY_STAT0) & HDMI_PHY_HPD; in hdmi_get_plug_in_status()
787 static int hdmi_ddc_wait_i2c_done(struct dw_hdmi *hdmi, int msec) in hdmi_ddc_wait_i2c_done() argument
794 val = hdmi_read(hdmi, HDMI_IH_I2CM_STAT0); in hdmi_ddc_wait_i2c_done()
796 hdmi_write(hdmi, val, HDMI_IH_I2CM_STAT0); in hdmi_ddc_wait_i2c_done()
806 static void hdmi_ddc_reset(struct dw_hdmi *hdmi) in hdmi_ddc_reset() argument
808 hdmi_mod(hdmi, HDMI_I2CM_SOFTRSTZ, HDMI_I2CM_SOFTRSTZ_MASK, 0); in hdmi_ddc_reset()
811 static int hdmi_read_edid(struct dw_hdmi *hdmi, int block, u8 *buff) in hdmi_read_edid() argument
818 if (CONFIG_IS_ENABLED(DM_I2C) && hdmi->ddc_bus) { in hdmi_read_edid()
821 edid_read_err = i2c_get_chip(hdmi->ddc_bus, in hdmi_read_edid()
831 hdmi_write(hdmi, hdmi->i2c_clk_high, HDMI_I2CM_SS_SCL_HCNT_0_ADDR); in hdmi_read_edid()
832 hdmi_write(hdmi, hdmi->i2c_clk_low, HDMI_I2CM_SS_SCL_LCNT_0_ADDR); in hdmi_read_edid()
833 hdmi_mod(hdmi, HDMI_I2CM_DIV, HDMI_I2CM_DIV_FAST_STD_MODE, in hdmi_read_edid()
836 hdmi_write(hdmi, HDMI_I2CM_SLAVE_DDC_ADDR, HDMI_I2CM_SLAVE); in hdmi_read_edid()
837 hdmi_write(hdmi, HDMI_I2CM_SEGADDR_DDC, HDMI_I2CM_SEGADDR); in hdmi_read_edid()
838 hdmi_write(hdmi, block >> 1, HDMI_I2CM_SEGPTR); in hdmi_read_edid()
844 hdmi_write(hdmi, shift + n, HDMI_I2CM_ADDRESS); in hdmi_read_edid()
847 hdmi_write(hdmi, HDMI_I2CM_OP_RD8, in hdmi_read_edid()
850 hdmi_write(hdmi, HDMI_I2CM_OP_RD8_EXT, in hdmi_read_edid()
853 if (hdmi_ddc_wait_i2c_done(hdmi, 10)) { in hdmi_read_edid()
854 hdmi_ddc_reset(hdmi); in hdmi_read_edid()
859 buff[n] = hdmi_read(hdmi, HDMI_I2CM_DATAI); in hdmi_read_edid()
904 int dw_hdmi_phy_cfg(struct dw_hdmi *hdmi, uint mpixelclock) in dw_hdmi_phy_cfg() argument
910 hdmi_phy_sel_data_en_pol(hdmi, 1); in dw_hdmi_phy_cfg()
911 hdmi_phy_sel_interface_control(hdmi, 0); in dw_hdmi_phy_cfg()
912 hdmi_phy_enable_tmds(hdmi, 0); in dw_hdmi_phy_cfg()
913 hdmi_phy_enable_power(hdmi, 0); in dw_hdmi_phy_cfg()
915 ret = hdmi_phy_configure(hdmi, mpixelclock); in dw_hdmi_phy_cfg()
925 int dw_hdmi_phy_wait_for_hpd(struct dw_hdmi *hdmi) in dw_hdmi_phy_wait_for_hpd() argument
931 if (hdmi_get_plug_in_status(hdmi)) in dw_hdmi_phy_wait_for_hpd()
939 void dw_hdmi_phy_init(struct dw_hdmi *hdmi) in dw_hdmi_phy_init() argument
942 hdmi_write(hdmi, HDMI_PHY_I2CM_INT_ADDR_DONE_POL, in dw_hdmi_phy_init()
946 hdmi_write(hdmi, HDMI_PHY_I2CM_CTLINT_ADDR_NAC_POL | in dw_hdmi_phy_init()
951 hdmi_write(hdmi, (u8)~HDMI_PHY_HPD, HDMI_PHY_MASK0); in dw_hdmi_phy_init()
954 hdmi_write(hdmi, HDMI_IH_PHY_STAT0_HPD, HDMI_IH_PHY_STAT0); in dw_hdmi_phy_init()
957 int dw_hdmi_read_edid(struct dw_hdmi *hdmi, u8 *buf, int buf_size) in dw_hdmi_read_edid() argument
966 ret = hdmi_read_edid(hdmi, 0, buf); in dw_hdmi_read_edid()
973 hdmi_read_edid(hdmi, 1, buf + HDMI_EDID_BLOCK_SIZE); in dw_hdmi_read_edid()
981 int dw_hdmi_enable(struct dw_hdmi *hdmi, const struct display_timing *edid) in dw_hdmi_enable() argument
989 hdmi_av_composer(hdmi, edid); in dw_hdmi_enable()
991 ret = hdmi->phy_set(hdmi, edid->pixelclock.typ); in dw_hdmi_enable()
995 hdmi_enable_video_path(hdmi, edid->hdmi_monitor); in dw_hdmi_enable()
998 hdmi_audio_fifo_reset(hdmi); in dw_hdmi_enable()
999 hdmi_audio_set_format(hdmi); in dw_hdmi_enable()
1000 hdmi_audio_set_samplerate(hdmi, edid->pixelclock.typ); in dw_hdmi_enable()
1003 hdmi_video_packetize(hdmi); in dw_hdmi_enable()
1004 hdmi_video_csc(hdmi); in dw_hdmi_enable()
1005 hdmi_video_sample(hdmi); in dw_hdmi_enable()
1007 hdmi_clear_overflow(hdmi); in dw_hdmi_enable()
1012 void dw_hdmi_init(struct dw_hdmi *hdmi) in dw_hdmi_init() argument
1027 if (hdmi->write_reg) in dw_hdmi_init()
1028 hdmi_write = hdmi->write_reg; in dw_hdmi_init()
1030 if (hdmi->read_reg) in dw_hdmi_init()
1031 hdmi_read = hdmi->read_reg; in dw_hdmi_init()
1033 hdmi_write(hdmi, ih_mute, HDMI_IH_MUTE); in dw_hdmi_init()
1036 hdmi_write(hdmi, ~0x04, HDMI_I2CM_INT); in dw_hdmi_init()
1039 hdmi_write(hdmi, ~0x44, HDMI_I2CM_CTLINT); in dw_hdmi_init()