From 1543e317f1da31b75942316931e8f491a8920811 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Thu, 04 Jan 2024 10:08:02 +0000
Subject: [PATCH] disable FB
---
kernel/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 54 +++++++++++++++++++-----------------------------------
1 files changed, 19 insertions(+), 35 deletions(-)
diff --git a/kernel/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/kernel/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index e3cce73..5d20a72 100644
--- a/kernel/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/kernel/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -422,14 +422,18 @@
if (hdmi->bridge.dev) {
bool change;
+ void *data = hdmi->plat_data->phy_data;
change = drm_helper_hpd_irq_event(hdmi->bridge.dev);
- if (change && hdmi->cec_adap &&
- hdmi->cec_adap->devnode.registered)
- cec_queue_pin_hpd_event(hdmi->cec_adap,
- hdmi->hpd_state,
- ktime_get());
+ if (change) {
+ if (hdmi->plat_data->set_ddc_io)
+ hdmi->plat_data->set_ddc_io(data, hdmi->hpd_state);
+ if (hdmi->cec_adap->devnode.registered)
+ cec_queue_pin_hpd_event(hdmi->cec_adap,
+ hdmi->hpd_state,
+ ktime_get());
+ }
drm_bridge_hpd_notify(&hdmi->bridge, status);
}
}
@@ -535,10 +539,12 @@
hdmi_writeb(hdmi, HDMI_IH_I2CM_STAT0_ERROR | HDMI_IH_I2CM_STAT0_DONE,
HDMI_IH_MUTE_I2CM_STAT0);
- /* set SDA high level holding time */
- hdmi_writeb(hdmi, 0x48, HDMI_I2CM_SDA_HOLD);
-
- dw_hdmi_i2c_set_divs(hdmi);
+ /* Only configure when we use the internal I2C controller */
+ if (hdmi->i2c) {
+ /* set SDA high level holding time */
+ hdmi_writeb(hdmi, 0x48, HDMI_I2CM_SDA_HOLD);
+ dw_hdmi_i2c_set_divs(hdmi);
+ }
}
static bool dw_hdmi_i2c_unwedge(struct dw_hdmi *hdmi)
@@ -643,11 +649,7 @@
while (retry > 0) {
if (!(hdmi_readb(hdmi, HDMI_PHY_STAT0) & HDMI_PHY_HPD)) {
- void *data = hdmi->plat_data->phy_data;
-
dev_dbg(hdmi->dev, "hdmi disconnect, stop ddc read\n");
- if (hdmi->plat_data->set_ddc_io)
- hdmi->plat_data->set_ddc_io(data, false);
return -EPERM;
}
@@ -726,11 +728,7 @@
while (retry > 0) {
if (!(hdmi_readb(hdmi, HDMI_PHY_STAT0) & HDMI_PHY_HPD)) {
- void *data = hdmi->plat_data->phy_data;
-
dev_dbg(hdmi->dev, "hdmi disconnect, stop ddc write\n");
- if (hdmi->plat_data->set_ddc_io)
- hdmi->plat_data->set_ddc_io(data, false);
return -EPERM;
}
@@ -775,7 +773,6 @@
struct dw_hdmi *hdmi = i2c_get_adapdata(adap);
struct dw_hdmi_i2c *i2c = hdmi->i2c;
u8 addr = msgs[0].addr;
- void *data = hdmi->plat_data->phy_data;
int i, ret = 0;
if (addr == DDC_CI_ADDR)
@@ -799,9 +796,6 @@
}
mutex_lock(&i2c->lock);
-
- if (hdmi->plat_data->set_ddc_io)
- hdmi->plat_data->set_ddc_io(data, true);
hdmi_writeb(hdmi, 0, HDMI_I2CM_SOFTRSTZ);
udelay(100);
@@ -2328,7 +2322,7 @@
/* Dynamic Range and Mastering Infoframe is introduced in v2.11a. */
if (hdmi->version < 0x211a) {
- DRM_ERROR("Not support DRM Infoframe\n");
+ dev_dbg(hdmi->dev, "Not support DRM Infoframe\n");
return;
}
@@ -2425,9 +2419,6 @@
vmode->previous_pixelclock = vmode->mpixelclock;
vmode->mpixelclock = mode->crtc_clock * 1000;
- if ((mode->flags & DRM_MODE_FLAG_3D_MASK) ==
- DRM_MODE_FLAG_3D_FRAME_PACKING)
- vmode->mpixelclock *= 2;
dev_dbg(hdmi->dev, "final pixclk = %d\n", vmode->mpixelclock);
vmode->previous_tmdsclock = vmode->mtmdsclock;
@@ -3993,7 +3984,6 @@
struct drm_bridge_state *old_state)
{
struct dw_hdmi *hdmi = bridge->driver_private;
- void *data = hdmi->plat_data->phy_data;
mutex_lock(&hdmi->mutex);
hdmi->disabled = true;
@@ -4004,11 +3994,6 @@
if (hdmi->plat_data->dclk_set)
hdmi->plat_data->dclk_set(hdmi->plat_data->phy_data, false, 0);
mutex_unlock(&hdmi->mutex);
-
- mutex_lock(&hdmi->i2c->lock);
- if (hdmi->plat_data->set_ddc_io)
- hdmi->plat_data->set_ddc_io(data, false);
- mutex_unlock(&hdmi->i2c->lock);
}
static void dw_hdmi_bridge_atomic_enable(struct drm_bridge *bridge,
@@ -4338,8 +4323,7 @@
* Even if we are using a separate i2c adapter doing this doesn't
* hurt.
*/
- if (hdmi->i2c)
- dw_hdmi_i2c_init(hdmi);
+ dw_hdmi_i2c_init(hdmi);
if (hdmi->phy.ops->setup_hpd)
hdmi->phy.ops->setup_hpd(hdmi, hdmi->phy.data);
@@ -5008,6 +4992,7 @@
audio.get_eld = hdmi_audio_get_eld;
audio.write = hdmi_writeb;
audio.read = hdmi_readb;
+ audio.mod = hdmi_modb;
hdmi->enable_audio = dw_hdmi_i2s_audio_enable;
hdmi->disable_audio = dw_hdmi_i2s_audio_disable;
@@ -5227,8 +5212,7 @@
pinctrl_pm_select_default_state(hdmi->dev);
mutex_lock(&hdmi->mutex);
dw_hdmi_reg_initial(hdmi);
- if (hdmi->i2c)
- dw_hdmi_i2c_init(hdmi);
+ dw_hdmi_i2c_init(hdmi);
if (hdmi->irq)
enable_irq(hdmi->irq);
/*
--
Gitblit v1.6.2