forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-09 244b2c5ca8b14627e4a17755e5922221e121c771
kernel/drivers/gpu/drm/rockchip/rk628/rk628_hdmi.c
....@@ -20,9 +20,8 @@
2020 #include <linux/regmap.h>
2121
2222 #include <drm/drm_of.h>
23
-#include <drm/drmP.h>
2423 #include <drm/drm_atomic_helper.h>
25
-#include <drm/drm_crtc_helper.h>
24
+#include <drm/drm_probe_helper.h>
2625 #include <drm/drm_edid.h>
2726 #include <sound/hdmi-codec.h>
2827
....@@ -676,7 +675,8 @@
676675 union hdmi_infoframe frame;
677676 int rc;
678677
679
- rc = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi, mode, false);
678
+ rc = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi,
679
+ &hdmi->connector, mode);
680680
681681 if (hdmi->hdmi_data.enc_out_format == HDMI_COLORSPACE_YUV444)
682682 frame.avi.colorspace = HDMI_COLORSPACE_YUV444;
....@@ -1023,8 +1023,8 @@
10231023 };
10241024
10251025 static void rk628_hdmi_bridge_mode_set(struct drm_bridge *bridge,
1026
- struct drm_display_mode *mode,
1027
- struct drm_display_mode *adj_mode)
1026
+ const struct drm_display_mode *mode,
1027
+ const struct drm_display_mode *adj_mode)
10281028 {
10291029 struct rk628_hdmi *hdmi = bridge_to_hdmi(bridge);
10301030
....@@ -1047,12 +1047,16 @@
10471047 rk628_hdmi_set_pwr_mode(hdmi, LOWER_PWR);
10481048 }
10491049
1050
-static int rk628_hdmi_bridge_attach(struct drm_bridge *bridge)
1050
+static int rk628_hdmi_bridge_attach(struct drm_bridge *bridge,
1051
+ enum drm_bridge_attach_flags flags)
10511052 {
10521053 struct rk628_hdmi *hdmi = bridge_to_hdmi(bridge);
10531054 struct drm_connector *connector = &hdmi->connector;
10541055 struct drm_device *drm = bridge->dev;
10551056 int ret;
1057
+
1058
+ if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
1059
+ return 0;
10561060
10571061 connector->polled = DRM_CONNECTOR_POLL_HPD;
10581062
....@@ -1193,7 +1197,8 @@
11931197 /* do nothing */
11941198 }
11951199
1196
-static int rk628_hdmi_audio_digital_mute(struct device *dev, void *d, bool mute)
1200
+static int rk628_hdmi_audio_mute(struct device *dev, void *d, bool mute,
1201
+ int direction)
11971202 {
11981203 struct rk628_hdmi *hdmi = dev_get_drvdata(dev);
11991204
....@@ -1238,8 +1243,9 @@
12381243 static const struct hdmi_codec_ops audio_codec_ops = {
12391244 .hw_params = rk628_hdmi_audio_hw_params,
12401245 .audio_shutdown = rk628_hdmi_audio_shutdown,
1241
- .digital_mute = rk628_hdmi_audio_digital_mute,
1246
+ .mute_stream = rk628_hdmi_audio_mute,
12421247 .get_eld = rk628_hdmi_audio_get_eld,
1248
+ .no_capture_mute = 1,
12431249 };
12441250
12451251 static int rk628_hdmi_audio_codec_init(struct rk628_hdmi *hdmi,
....@@ -1558,6 +1564,7 @@
15581564 hdmi->extcon = devm_extcon_dev_allocate(hdmi->dev, rk628_hdmi_cable);
15591565 if (IS_ERR(hdmi->extcon)) {
15601566 dev_err(hdmi->dev, "allocate extcon failed\n");
1567
+ ret = PTR_ERR(hdmi->extcon);
15611568 goto fail;
15621569 }
15631570