hc
2024-05-10 61598093bbdd283a7edc367d900f223070ead8d2
kernel/drivers/gpu/drm/zte/zx_hdmi.c
....@@ -1,11 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright 2016 Linaro Ltd.
34 * Copyright 2016 ZTE Corporation.
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License version 2 as
7
- * published by the Free Software Foundation.
8
- *
95 */
106
117 #include <linux/clk.h>
....@@ -20,10 +16,11 @@
2016 #include <linux/of_device.h>
2117
2218 #include <drm/drm_atomic_helper.h>
23
-#include <drm/drm_crtc_helper.h>
2419 #include <drm/drm_edid.h>
2520 #include <drm/drm_of.h>
26
-#include <drm/drmP.h>
21
+#include <drm/drm_probe_helper.h>
22
+#include <drm/drm_print.h>
23
+#include <drm/drm_simple_kms_helper.h>
2724
2825 #include <sound/hdmi-codec.h>
2926
....@@ -125,7 +122,9 @@
125122 union hdmi_infoframe frame;
126123 int ret;
127124
128
- ret = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi, mode, false);
125
+ ret = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi,
126
+ &hdmi->connector,
127
+ mode);
129128 if (ret) {
130129 DRM_DEV_ERROR(hdmi->dev, "failed to get avi infoframe: %d\n",
131130 ret);
....@@ -256,10 +255,6 @@
256255 .mode_set = zx_hdmi_encoder_mode_set,
257256 };
258257
259
-static const struct drm_encoder_funcs zx_hdmi_encoder_funcs = {
260
- .destroy = drm_encoder_cleanup,
261
-};
262
-
263258 static int zx_hdmi_connector_get_modes(struct drm_connector *connector)
264259 {
265260 struct zx_hdmi *hdmi = to_zx_hdmi(connector);
....@@ -315,14 +310,15 @@
315310
316311 encoder->possible_crtcs = VOU_CRTC_MASK;
317312
318
- drm_encoder_init(drm, encoder, &zx_hdmi_encoder_funcs,
319
- DRM_MODE_ENCODER_TMDS, NULL);
313
+ drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_TMDS);
320314 drm_encoder_helper_add(encoder, &zx_hdmi_encoder_helper_funcs);
321315
322316 hdmi->connector.polled = DRM_CONNECTOR_POLL_HPD;
323317
324
- drm_connector_init(drm, &hdmi->connector, &zx_hdmi_connector_funcs,
325
- DRM_MODE_CONNECTOR_HDMIA);
318
+ drm_connector_init_with_ddc(drm, &hdmi->connector,
319
+ &zx_hdmi_connector_funcs,
320
+ DRM_MODE_CONNECTOR_HDMIA,
321
+ &hdmi->ddc->adap);
326322 drm_connector_helper_add(&hdmi->connector,
327323 &zx_hdmi_connector_helper_funcs);
328324
....@@ -443,8 +439,8 @@
443439 return zx_hdmi_infoframe_trans(hdmi, &frame, FSEL_AUDIO);
444440 }
445441
446
-static int zx_hdmi_audio_digital_mute(struct device *dev, void *data,
447
- bool enable)
442
+static int zx_hdmi_audio_mute(struct device *dev, void *data,
443
+ bool enable, int direction)
448444 {
449445 struct zx_hdmi *hdmi = dev_get_drvdata(dev);
450446
....@@ -472,8 +468,9 @@
472468 .audio_startup = zx_hdmi_audio_startup,
473469 .hw_params = zx_hdmi_audio_hw_params,
474470 .audio_shutdown = zx_hdmi_audio_shutdown,
475
- .digital_mute = zx_hdmi_audio_digital_mute,
471
+ .mute_stream = zx_hdmi_audio_mute,
476472 .get_eld = zx_hdmi_audio_get_eld,
473
+ .no_capture_mute = 1,
477474 };
478475
479476 static struct hdmi_codec_pdata zx_hdmi_codec_pdata = {