| .. | .. |
|---|
| 422 | 422 | |
|---|
| 423 | 423 | if (hdmi->bridge.dev) { |
|---|
| 424 | 424 | bool change; |
|---|
| 425 | + void *data = hdmi->plat_data->phy_data; |
|---|
| 425 | 426 | |
|---|
| 426 | 427 | change = drm_helper_hpd_irq_event(hdmi->bridge.dev); |
|---|
| 427 | 428 | |
|---|
| 428 | | - if (change && hdmi->cec_adap && |
|---|
| 429 | | - hdmi->cec_adap->devnode.registered) |
|---|
| 430 | | - cec_queue_pin_hpd_event(hdmi->cec_adap, |
|---|
| 431 | | - hdmi->hpd_state, |
|---|
| 432 | | - ktime_get()); |
|---|
| 429 | + if (change) { |
|---|
| 430 | + if (hdmi->plat_data->set_ddc_io) |
|---|
| 431 | + hdmi->plat_data->set_ddc_io(data, hdmi->hpd_state); |
|---|
| 432 | + if (hdmi->cec_adap->devnode.registered) |
|---|
| 433 | + cec_queue_pin_hpd_event(hdmi->cec_adap, |
|---|
| 434 | + hdmi->hpd_state, |
|---|
| 435 | + ktime_get()); |
|---|
| 436 | + } |
|---|
| 433 | 437 | drm_bridge_hpd_notify(&hdmi->bridge, status); |
|---|
| 434 | 438 | } |
|---|
| 435 | 439 | } |
|---|
| .. | .. |
|---|
| 535 | 539 | hdmi_writeb(hdmi, HDMI_IH_I2CM_STAT0_ERROR | HDMI_IH_I2CM_STAT0_DONE, |
|---|
| 536 | 540 | HDMI_IH_MUTE_I2CM_STAT0); |
|---|
| 537 | 541 | |
|---|
| 538 | | - /* set SDA high level holding time */ |
|---|
| 539 | | - hdmi_writeb(hdmi, 0x48, HDMI_I2CM_SDA_HOLD); |
|---|
| 540 | | - |
|---|
| 541 | | - dw_hdmi_i2c_set_divs(hdmi); |
|---|
| 542 | + /* Only configure when we use the internal I2C controller */ |
|---|
| 543 | + if (hdmi->i2c) { |
|---|
| 544 | + /* set SDA high level holding time */ |
|---|
| 545 | + hdmi_writeb(hdmi, 0x48, HDMI_I2CM_SDA_HOLD); |
|---|
| 546 | + dw_hdmi_i2c_set_divs(hdmi); |
|---|
| 547 | + } |
|---|
| 542 | 548 | } |
|---|
| 543 | 549 | |
|---|
| 544 | 550 | static bool dw_hdmi_i2c_unwedge(struct dw_hdmi *hdmi) |
|---|
| .. | .. |
|---|
| 643 | 649 | |
|---|
| 644 | 650 | while (retry > 0) { |
|---|
| 645 | 651 | if (!(hdmi_readb(hdmi, HDMI_PHY_STAT0) & HDMI_PHY_HPD)) { |
|---|
| 646 | | - void *data = hdmi->plat_data->phy_data; |
|---|
| 647 | | - |
|---|
| 648 | 652 | dev_dbg(hdmi->dev, "hdmi disconnect, stop ddc read\n"); |
|---|
| 649 | | - if (hdmi->plat_data->set_ddc_io) |
|---|
| 650 | | - hdmi->plat_data->set_ddc_io(data, false); |
|---|
| 651 | 653 | return -EPERM; |
|---|
| 652 | 654 | } |
|---|
| 653 | 655 | |
|---|
| .. | .. |
|---|
| 726 | 728 | |
|---|
| 727 | 729 | while (retry > 0) { |
|---|
| 728 | 730 | if (!(hdmi_readb(hdmi, HDMI_PHY_STAT0) & HDMI_PHY_HPD)) { |
|---|
| 729 | | - void *data = hdmi->plat_data->phy_data; |
|---|
| 730 | | - |
|---|
| 731 | 731 | dev_dbg(hdmi->dev, "hdmi disconnect, stop ddc write\n"); |
|---|
| 732 | | - if (hdmi->plat_data->set_ddc_io) |
|---|
| 733 | | - hdmi->plat_data->set_ddc_io(data, false); |
|---|
| 734 | 732 | return -EPERM; |
|---|
| 735 | 733 | } |
|---|
| 736 | 734 | |
|---|
| .. | .. |
|---|
| 775 | 773 | struct dw_hdmi *hdmi = i2c_get_adapdata(adap); |
|---|
| 776 | 774 | struct dw_hdmi_i2c *i2c = hdmi->i2c; |
|---|
| 777 | 775 | u8 addr = msgs[0].addr; |
|---|
| 778 | | - void *data = hdmi->plat_data->phy_data; |
|---|
| 779 | 776 | int i, ret = 0; |
|---|
| 780 | 777 | |
|---|
| 781 | 778 | if (addr == DDC_CI_ADDR) |
|---|
| .. | .. |
|---|
| 799 | 796 | } |
|---|
| 800 | 797 | |
|---|
| 801 | 798 | mutex_lock(&i2c->lock); |
|---|
| 802 | | - |
|---|
| 803 | | - if (hdmi->plat_data->set_ddc_io) |
|---|
| 804 | | - hdmi->plat_data->set_ddc_io(data, true); |
|---|
| 805 | 799 | |
|---|
| 806 | 800 | hdmi_writeb(hdmi, 0, HDMI_I2CM_SOFTRSTZ); |
|---|
| 807 | 801 | udelay(100); |
|---|
| .. | .. |
|---|
| 2328 | 2322 | |
|---|
| 2329 | 2323 | /* Dynamic Range and Mastering Infoframe is introduced in v2.11a. */ |
|---|
| 2330 | 2324 | if (hdmi->version < 0x211a) { |
|---|
| 2331 | | - DRM_ERROR("Not support DRM Infoframe\n"); |
|---|
| 2325 | + dev_dbg(hdmi->dev, "Not support DRM Infoframe\n"); |
|---|
| 2332 | 2326 | return; |
|---|
| 2333 | 2327 | } |
|---|
| 2334 | 2328 | |
|---|
| .. | .. |
|---|
| 2425 | 2419 | |
|---|
| 2426 | 2420 | vmode->previous_pixelclock = vmode->mpixelclock; |
|---|
| 2427 | 2421 | vmode->mpixelclock = mode->crtc_clock * 1000; |
|---|
| 2428 | | - if ((mode->flags & DRM_MODE_FLAG_3D_MASK) == |
|---|
| 2429 | | - DRM_MODE_FLAG_3D_FRAME_PACKING) |
|---|
| 2430 | | - vmode->mpixelclock *= 2; |
|---|
| 2431 | 2422 | dev_dbg(hdmi->dev, "final pixclk = %d\n", vmode->mpixelclock); |
|---|
| 2432 | 2423 | |
|---|
| 2433 | 2424 | vmode->previous_tmdsclock = vmode->mtmdsclock; |
|---|
| .. | .. |
|---|
| 3993 | 3984 | struct drm_bridge_state *old_state) |
|---|
| 3994 | 3985 | { |
|---|
| 3995 | 3986 | struct dw_hdmi *hdmi = bridge->driver_private; |
|---|
| 3996 | | - void *data = hdmi->plat_data->phy_data; |
|---|
| 3997 | 3987 | |
|---|
| 3998 | 3988 | mutex_lock(&hdmi->mutex); |
|---|
| 3999 | 3989 | hdmi->disabled = true; |
|---|
| .. | .. |
|---|
| 4004 | 3994 | if (hdmi->plat_data->dclk_set) |
|---|
| 4005 | 3995 | hdmi->plat_data->dclk_set(hdmi->plat_data->phy_data, false, 0); |
|---|
| 4006 | 3996 | mutex_unlock(&hdmi->mutex); |
|---|
| 4007 | | - |
|---|
| 4008 | | - mutex_lock(&hdmi->i2c->lock); |
|---|
| 4009 | | - if (hdmi->plat_data->set_ddc_io) |
|---|
| 4010 | | - hdmi->plat_data->set_ddc_io(data, false); |
|---|
| 4011 | | - mutex_unlock(&hdmi->i2c->lock); |
|---|
| 4012 | 3997 | } |
|---|
| 4013 | 3998 | |
|---|
| 4014 | 3999 | static void dw_hdmi_bridge_atomic_enable(struct drm_bridge *bridge, |
|---|
| .. | .. |
|---|
| 4338 | 4323 | * Even if we are using a separate i2c adapter doing this doesn't |
|---|
| 4339 | 4324 | * hurt. |
|---|
| 4340 | 4325 | */ |
|---|
| 4341 | | - if (hdmi->i2c) |
|---|
| 4342 | | - dw_hdmi_i2c_init(hdmi); |
|---|
| 4326 | + dw_hdmi_i2c_init(hdmi); |
|---|
| 4343 | 4327 | |
|---|
| 4344 | 4328 | if (hdmi->phy.ops->setup_hpd) |
|---|
| 4345 | 4329 | hdmi->phy.ops->setup_hpd(hdmi, hdmi->phy.data); |
|---|
| .. | .. |
|---|
| 5008 | 4992 | audio.get_eld = hdmi_audio_get_eld; |
|---|
| 5009 | 4993 | audio.write = hdmi_writeb; |
|---|
| 5010 | 4994 | audio.read = hdmi_readb; |
|---|
| 4995 | + audio.mod = hdmi_modb; |
|---|
| 5011 | 4996 | hdmi->enable_audio = dw_hdmi_i2s_audio_enable; |
|---|
| 5012 | 4997 | hdmi->disable_audio = dw_hdmi_i2s_audio_disable; |
|---|
| 5013 | 4998 | |
|---|
| .. | .. |
|---|
| 5227 | 5212 | pinctrl_pm_select_default_state(hdmi->dev); |
|---|
| 5228 | 5213 | mutex_lock(&hdmi->mutex); |
|---|
| 5229 | 5214 | dw_hdmi_reg_initial(hdmi); |
|---|
| 5230 | | - if (hdmi->i2c) |
|---|
| 5231 | | - dw_hdmi_i2c_init(hdmi); |
|---|
| 5215 | + dw_hdmi_i2c_init(hdmi); |
|---|
| 5232 | 5216 | if (hdmi->irq) |
|---|
| 5233 | 5217 | enable_irq(hdmi->irq); |
|---|
| 5234 | 5218 | /* |
|---|