edid->width_cm, edid->height_cm);
dp->sink_has_audio = drm_detect_monitor_audio(edid);
-@@ -279,7 +282,8 @@ static int cdn_dp_connector_mode_valid(s
- struct drm_display_mode *mode)
+@@ -280,7 +283,8 @@ cdn_dp_connector_mode_valid(struct drm_c
+ struct drm_display_mode *mode)
{
struct cdn_dp_device *dp = connector_to_dp(connector);
- struct drm_display_info *display_info = &dp->connector.display_info;
u32 requested, actual, rate, sink_max, source_max = 0;
u8 lanes, bpc;
-@@ -305,7 +309,7 @@ static int cdn_dp_connector_mode_valid(s
+@@ -306,7 +310,7 @@ cdn_dp_connector_mode_valid(struct drm_c
sink_max = drm_dp_max_lane_count(dp->dpcd);
lanes = min(source_max, sink_max);
sink_max = drm_dp_max_link_rate(dp->dpcd);
rate = min(source_max, sink_max);
-@@ -315,7 +319,7 @@ static int cdn_dp_connector_mode_valid(s
+@@ -316,7 +320,7 @@ cdn_dp_connector_mode_valid(struct drm_c
actual = actual * 8 / 10;
if (requested > actual) {
"requested=%d, actual=%d, clock=%d\n",
requested, actual, mode->clock);
return MODE_CLOCK_HIGH;
-@@ -335,28 +339,29 @@ static int cdn_dp_firmware_init(struct c
+@@ -336,28 +340,29 @@ static int cdn_dp_firmware_init(struct c
const u32 *iram_data, *dram_data;
const struct firmware *fw = dp->fw;
const struct cdn_firmware_header *hdr;
}
static int cdn_dp_get_sink_capability(struct cdn_dp_device *dp)
-@@ -366,28 +371,29 @@ static int cdn_dp_get_sink_capability(st
+@@ -367,28 +372,29 @@ static int cdn_dp_get_sink_capability(st
if (!cdn_dp_check_sink_connection(dp))
return -ENODEV;
ret);
goto err_phy;
}
-@@ -397,28 +403,28 @@ static int cdn_dp_enable_phy(struct cdn_
+@@ -398,28 +404,28 @@ static int cdn_dp_enable_phy(struct cdn_
ret = cdn_dp_grf_write(dp, GRF_SOC_CON26,
DPTX_HPD_SEL_MASK | DPTX_HPD_SEL);
if (ret) {
ret);
goto err_power_on;
}
-@@ -428,7 +434,7 @@ static int cdn_dp_enable_phy(struct cdn_
+@@ -429,7 +435,7 @@ static int cdn_dp_enable_phy(struct cdn_
err_power_on:
if (phy_power_off(port->phy))
else
port->phy_enabled = false;
-@@ -446,7 +452,8 @@ static int cdn_dp_disable_phy(struct cdn
+@@ -447,7 +453,8 @@ static int cdn_dp_disable_phy(struct cdn
if (port->phy_enabled) {
ret = phy_power_off(port->phy);
if (ret) {
return ret;
}
}
-@@ -470,16 +477,16 @@ static int cdn_dp_disable(struct cdn_dp_
+@@ -471,16 +478,16 @@ static int cdn_dp_disable(struct cdn_dp_
ret = cdn_dp_grf_write(dp, GRF_SOC_CON26,
DPTX_HPD_SEL_MASK | DPTX_HPD_DEL);
if (ret) {
if (!dp->connected) {
kfree(dp->edid);
dp->edid = NULL;
-@@ -492,11 +499,11 @@ static int cdn_dp_enable(struct cdn_dp_d
+@@ -493,11 +500,11 @@ static int cdn_dp_enable(struct cdn_dp_d
{
int ret, i, lanes;
struct cdn_dp_port *port;
return -ENODEV;
}
-@@ -509,7 +516,7 @@ static int cdn_dp_enable(struct cdn_dp_d
+@@ -510,7 +517,7 @@ static int cdn_dp_enable(struct cdn_dp_d
ret = cdn_dp_firmware_init(dp);
if (ret) {
goto err_clk_disable;
}
-@@ -543,8 +550,9 @@ static void cdn_dp_encoder_mode_set(stru
+@@ -544,8 +551,9 @@ static void cdn_dp_encoder_mode_set(stru
struct drm_display_mode *adjusted)
{
struct cdn_dp_device *dp = encoder_to_dp(encoder);
switch (display_info->bpc) {
case 10:
-@@ -562,7 +570,7 @@ static void cdn_dp_encoder_mode_set(stru
+@@ -563,7 +571,7 @@ static void cdn_dp_encoder_mode_set(stru
video->v_sync_polarity = !!(mode->flags & DRM_MODE_FLAG_NVSYNC);
video->h_sync_polarity = !!(mode->flags & DRM_MODE_FLAG_NHSYNC);
}
static bool cdn_dp_check_link_status(struct cdn_dp_device *dp)
-@@ -571,11 +579,11 @@ static bool cdn_dp_check_link_status(str
+@@ -572,11 +580,11 @@ static bool cdn_dp_check_link_status(str
struct cdn_dp_port *port = cdn_dp_connected_port(dp);
u8 sink_lanes = drm_dp_max_lane_count(dp->dpcd);
DRM_ERROR("Failed to get link status\n");
return false;
}
-@@ -587,15 +595,16 @@ static bool cdn_dp_check_link_status(str
+@@ -588,15 +596,16 @@ static bool cdn_dp_check_link_status(str
static void cdn_dp_encoder_enable(struct drm_encoder *encoder)
{
struct cdn_dp_device *dp = encoder_to_dp(encoder);
(ret) ? "LIT" : "BIG");
if (ret)
val = DP_SEL_VOP_LIT | (DP_SEL_VOP_LIT << 16);
-@@ -610,33 +619,33 @@ static void cdn_dp_encoder_enable(struct
+@@ -611,33 +620,33 @@ static void cdn_dp_encoder_enable(struct
ret = cdn_dp_enable(dp);
if (ret) {
goto out;
}
out:
-@@ -652,7 +661,8 @@ static void cdn_dp_encoder_disable(struc
+@@ -653,7 +662,8 @@ static void cdn_dp_encoder_disable(struc
if (dp->active) {
ret = cdn_dp_disable(dp);
if (ret) {
ret);
}
}
-@@ -696,7 +706,7 @@ static const struct drm_encoder_funcs cd
+@@ -697,7 +707,7 @@ static const struct drm_encoder_funcs cd
static int cdn_dp_parse_dt(struct cdn_dp_device *dp)
{
struct device_node *np = dev->of_node;
struct platform_device *pdev = to_platform_device(dev);
struct resource *res;
-@@ -708,10 +718,10 @@ static int cdn_dp_parse_dt(struct cdn_dp
+@@ -709,10 +719,10 @@ static int cdn_dp_parse_dt(struct cdn_dp
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
}
dp->core_clk = devm_clk_get(dev, "core-clk");
-@@ -726,10 +736,10 @@ static int cdn_dp_parse_dt(struct cdn_dp
+@@ -727,10 +737,10 @@ static int cdn_dp_parse_dt(struct cdn_dp
return PTR_ERR(dp->pclk);
}
}
dp->grf_clk = devm_clk_get(dev, "grf");
-@@ -738,10 +748,10 @@ static int cdn_dp_parse_dt(struct cdn_dp
+@@ -739,10 +749,10 @@ static int cdn_dp_parse_dt(struct cdn_dp
return PTR_ERR(dp->grf_clk);
}
}
dp->dptx_rst = devm_reset_control_get(dev, "dptx");
-@@ -796,7 +806,7 @@ static int cdn_dp_audio_hw_params(struct
+@@ -797,7 +807,7 @@ static int cdn_dp_audio_hw_params(struct
goto out;
}
if (!ret)
dp->audio_info = audio;
-@@ -814,7 +824,7 @@ static void cdn_dp_audio_shutdown(struct
+@@ -815,7 +825,7 @@ static void cdn_dp_audio_shutdown(struct
if (!dp->active)
goto out;
if (!ret)
dp->audio_info.format = AFMT_UNUSED;
out:
-@@ -833,7 +843,7 @@ static int cdn_dp_audio_digital_mute(str
+@@ -834,7 +844,7 @@ static int cdn_dp_audio_digital_mute(str
goto out;
}
out:
mutex_unlock(&dp->lock);
-@@ -845,7 +855,8 @@ static int cdn_dp_audio_get_eld(struct d
+@@ -846,7 +856,8 @@ static int cdn_dp_audio_get_eld(struct d
{
struct cdn_dp_device *dp = dev_get_drvdata(dev);
return 0;
}
-@@ -879,6 +890,7 @@ static int cdn_dp_request_firmware(struc
+@@ -880,6 +891,7 @@ static int cdn_dp_request_firmware(struc
int ret;
unsigned long timeout = jiffies + msecs_to_jiffies(CDN_FW_TIMEOUT_MS);
unsigned long sleep = 1000;
WARN_ON(!mutex_is_locked(&dp->lock));
-@@ -889,13 +901,13 @@ static int cdn_dp_request_firmware(struc
+@@ -890,13 +902,13 @@ static int cdn_dp_request_firmware(struc
mutex_unlock(&dp->lock);
while (time_before(jiffies, timeout)) {
"failed to request firmware: %d\n", ret);
goto out;
}
-@@ -905,7 +917,7 @@ static int cdn_dp_request_firmware(struc
+@@ -906,7 +918,7 @@ static int cdn_dp_request_firmware(struc
goto out;
}
ret = -ETIMEDOUT;
out:
mutex_lock(&dp->lock);
-@@ -916,8 +928,9 @@ static void cdn_dp_pd_event_work(struct
+@@ -917,8 +929,9 @@ static void cdn_dp_pd_event_work(struct
{
struct cdn_dp_device *dp = container_of(work, struct cdn_dp_device,
event_work);
int ret;
-@@ -934,44 +947,45 @@ static void cdn_dp_pd_event_work(struct
+@@ -935,44 +948,45 @@ static void cdn_dp_pd_event_work(struct
/* Not connected, notify userspace to disable the block */
if (!cdn_dp_connected_port(dp)) {
"Failed to config video %d\n",
ret);
}
-@@ -1040,7 +1054,7 @@ static int cdn_dp_bind(struct device *de
+@@ -1041,7 +1055,7 @@ static int cdn_dp_bind(struct device *de
drm_encoder_helper_add(encoder, &cdn_dp_encoder_helper_funcs);
connector->polled = DRM_CONNECTOR_POLL_HPD;
connector->dpms = DRM_MODE_DPMS_OFF;
-@@ -1064,7 +1078,7 @@ static int cdn_dp_bind(struct device *de
+@@ -1065,7 +1079,7 @@ static int cdn_dp_bind(struct device *de
port = dp->port[i];
port->event_nb.notifier_call = cdn_dp_pd_event;
EXTCON_DISP_DP,
&port->event_nb);
if (ret) {
-@@ -1091,7 +1105,7 @@ static void cdn_dp_unbind(struct device
+@@ -1092,7 +1106,7 @@ static void cdn_dp_unbind(struct device
{
struct cdn_dp_device *dp = dev_get_drvdata(dev);
struct drm_encoder *encoder = &dp->encoder;
cancel_work_sync(&dp->event_work);
cdn_dp_encoder_disable(encoder);
-@@ -1151,7 +1165,7 @@ static int cdn_dp_probe(struct platform_
+@@ -1152,7 +1166,7 @@ static int cdn_dp_probe(struct platform_
dp = devm_kzalloc(dev, sizeof(*dp), GFP_KERNEL);
if (!dp)
return -ENOMEM;
match = of_match_node(cdn_dp_dt_ids, pdev->dev.of_node);
dp_data = (struct cdn_dp_data *)match->data;
-@@ -1196,7 +1210,7 @@ static int cdn_dp_remove(struct platform
+@@ -1197,7 +1211,7 @@ static int cdn_dp_remove(struct platform
struct cdn_dp_device *dp = platform_get_drvdata(pdev);
platform_device_unregister(dp->audio_pdev);
component_del(&pdev->dev, &cdn_dp_component_ops);
return 0;
-@@ -1206,7 +1220,7 @@ static void cdn_dp_shutdown(struct platf
+@@ -1207,7 +1221,7 @@ static void cdn_dp_shutdown(struct platf
{
struct cdn_dp_device *dp = platform_get_drvdata(pdev);
#define encoder_to_dp(c) \
container_of(c, struct cdn_dp_device, encoder)
-@@ -283,7 +283,7 @@ static int cdn_dp_connector_mode_valid(s
+@@ -284,7 +284,7 @@ cdn_dp_connector_mode_valid(struct drm_c
{
struct cdn_dp_device *dp = connector_to_dp(connector);
struct drm_display_info *display_info =
u32 requested, actual, rate, sink_max, source_max = 0;
u8 lanes, bpc;
-@@ -379,7 +379,7 @@ static int cdn_dp_get_sink_capability(st
+@@ -380,7 +380,7 @@ static int cdn_dp_get_sink_capability(st
}
kfree(dp->edid);
cdns_mhdp_get_edid_block, &dp->mhdp);
return 0;
}
-@@ -485,8 +485,8 @@ static int cdn_dp_disable(struct cdn_dp_
+@@ -486,8 +486,8 @@ static int cdn_dp_disable(struct cdn_dp_
cdns_mhdp_set_firmware_active(&dp->mhdp, false);
cdn_dp_clk_disable(dp);
dp->active = false;
if (!dp->connected) {
kfree(dp->edid);
dp->edid = NULL;
-@@ -551,7 +551,7 @@ static void cdn_dp_encoder_mode_set(stru
+@@ -552,7 +552,7 @@ static void cdn_dp_encoder_mode_set(stru
{
struct cdn_dp_device *dp = encoder_to_dp(encoder);
struct drm_display_info *display_info =
struct video_info *video = &dp->mhdp.video_info;
switch (display_info->bpc) {
-@@ -579,7 +579,7 @@ static bool cdn_dp_check_link_status(str
+@@ -580,7 +580,7 @@ static bool cdn_dp_check_link_status(str
struct cdn_dp_port *port = cdn_dp_connected_port(dp);
u8 sink_lanes = drm_dp_max_lane_count(dp->dpcd);
return false;
if (cdns_mhdp_dpcd_read(&dp->mhdp, DP_LANE0_1_STATUS, link_status,
-@@ -808,7 +808,7 @@ static int cdn_dp_audio_hw_params(struct
+@@ -809,7 +809,7 @@ static int cdn_dp_audio_hw_params(struct
ret = cdns_mhdp_audio_config(&dp->mhdp, &audio);
if (!ret)
out:
mutex_unlock(&dp->lock);
-@@ -824,9 +824,9 @@ static void cdn_dp_audio_shutdown(struct
+@@ -825,9 +825,9 @@ static void cdn_dp_audio_shutdown(struct
if (!dp->active)
goto out;
out:
mutex_unlock(&dp->lock);
}
-@@ -855,8 +855,8 @@ static int cdn_dp_audio_get_eld(struct d
+@@ -856,8 +856,8 @@ static int cdn_dp_audio_get_eld(struct d
{
struct cdn_dp_device *dp = dev_get_drvdata(dev);
return 0;
}
-@@ -878,11 +878,11 @@ static int cdn_dp_audio_codec_init(struc
+@@ -879,11 +879,11 @@ static int cdn_dp_audio_codec_init(struc
.max_i2s_channels = 8,
};
}
static int cdn_dp_request_firmware(struct cdn_dp_device *dp)
-@@ -928,7 +928,7 @@ static void cdn_dp_pd_event_work(struct
+@@ -929,7 +929,7 @@ static void cdn_dp_pd_event_work(struct
{
struct cdn_dp_device *dp = container_of(work, struct cdn_dp_device,
event_work);
enum drm_connector_status old_status;
struct device *dev = dp->mhdp.dev;
-@@ -966,8 +966,8 @@ static void cdn_dp_pd_event_work(struct
+@@ -967,8 +967,8 @@ static void cdn_dp_pd_event_work(struct
/* Enabled and connected with a sink, re-train if requested */
} else if (!cdn_dp_check_link_status(dp)) {
struct drm_display_mode *mode = &dp->mhdp.mode;
DRM_DEV_INFO(dev, "Connected with sink. Re-train link\n");
-@@ -980,8 +980,8 @@ static void cdn_dp_pd_event_work(struct
+@@ -981,8 +981,8 @@ static void cdn_dp_pd_event_work(struct
/* If training result is changed, update the video config */
if (mode->clock &&
ret = cdns_mhdp_config_video(&dp->mhdp);
if (ret) {
dp->connected = false;
-@@ -1054,7 +1054,7 @@ static int cdn_dp_bind(struct device *de
+@@ -1055,7 +1055,7 @@ static int cdn_dp_bind(struct device *de
drm_encoder_helper_add(encoder, &cdn_dp_encoder_helper_funcs);
connector->polled = DRM_CONNECTOR_POLL_HPD;
connector->dpms = DRM_MODE_DPMS_OFF;
-@@ -1105,7 +1105,7 @@ static void cdn_dp_unbind(struct device
+@@ -1106,7 +1106,7 @@ static void cdn_dp_unbind(struct device
{
struct cdn_dp_device *dp = dev_get_drvdata(dev);
struct drm_encoder *encoder = &dp->encoder;
cancel_work_sync(&dp->event_work);
cdn_dp_encoder_disable(encoder);
-@@ -1209,7 +1209,7 @@ static int cdn_dp_remove(struct platform
+@@ -1210,7 +1210,7 @@ static int cdn_dp_remove(struct platform
{
struct cdn_dp_device *dp = platform_get_drvdata(pdev);