| .. | .. |
|---|
| 20 | 20 | #include <linux/regmap.h> |
|---|
| 21 | 21 | |
|---|
| 22 | 22 | #include <drm/drm_of.h> |
|---|
| 23 | | -#include <drm/drmP.h> |
|---|
| 24 | 23 | #include <drm/drm_atomic_helper.h> |
|---|
| 25 | | -#include <drm/drm_crtc_helper.h> |
|---|
| 24 | +#include <drm/drm_probe_helper.h> |
|---|
| 26 | 25 | #include <drm/drm_edid.h> |
|---|
| 27 | 26 | #include <sound/hdmi-codec.h> |
|---|
| 28 | 27 | |
|---|
| .. | .. |
|---|
| 676 | 675 | union hdmi_infoframe frame; |
|---|
| 677 | 676 | int rc; |
|---|
| 678 | 677 | |
|---|
| 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); |
|---|
| 680 | 680 | |
|---|
| 681 | 681 | if (hdmi->hdmi_data.enc_out_format == HDMI_COLORSPACE_YUV444) |
|---|
| 682 | 682 | frame.avi.colorspace = HDMI_COLORSPACE_YUV444; |
|---|
| .. | .. |
|---|
| 1023 | 1023 | }; |
|---|
| 1024 | 1024 | |
|---|
| 1025 | 1025 | 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) |
|---|
| 1028 | 1028 | { |
|---|
| 1029 | 1029 | struct rk628_hdmi *hdmi = bridge_to_hdmi(bridge); |
|---|
| 1030 | 1030 | |
|---|
| .. | .. |
|---|
| 1047 | 1047 | rk628_hdmi_set_pwr_mode(hdmi, LOWER_PWR); |
|---|
| 1048 | 1048 | } |
|---|
| 1049 | 1049 | |
|---|
| 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) |
|---|
| 1051 | 1052 | { |
|---|
| 1052 | 1053 | struct rk628_hdmi *hdmi = bridge_to_hdmi(bridge); |
|---|
| 1053 | 1054 | struct drm_connector *connector = &hdmi->connector; |
|---|
| 1054 | 1055 | struct drm_device *drm = bridge->dev; |
|---|
| 1055 | 1056 | int ret; |
|---|
| 1057 | + |
|---|
| 1058 | + if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) |
|---|
| 1059 | + return 0; |
|---|
| 1056 | 1060 | |
|---|
| 1057 | 1061 | connector->polled = DRM_CONNECTOR_POLL_HPD; |
|---|
| 1058 | 1062 | |
|---|
| .. | .. |
|---|
| 1193 | 1197 | /* do nothing */ |
|---|
| 1194 | 1198 | } |
|---|
| 1195 | 1199 | |
|---|
| 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) |
|---|
| 1197 | 1202 | { |
|---|
| 1198 | 1203 | struct rk628_hdmi *hdmi = dev_get_drvdata(dev); |
|---|
| 1199 | 1204 | |
|---|
| .. | .. |
|---|
| 1238 | 1243 | static const struct hdmi_codec_ops audio_codec_ops = { |
|---|
| 1239 | 1244 | .hw_params = rk628_hdmi_audio_hw_params, |
|---|
| 1240 | 1245 | .audio_shutdown = rk628_hdmi_audio_shutdown, |
|---|
| 1241 | | - .digital_mute = rk628_hdmi_audio_digital_mute, |
|---|
| 1246 | + .mute_stream = rk628_hdmi_audio_mute, |
|---|
| 1242 | 1247 | .get_eld = rk628_hdmi_audio_get_eld, |
|---|
| 1248 | + .no_capture_mute = 1, |
|---|
| 1243 | 1249 | }; |
|---|
| 1244 | 1250 | |
|---|
| 1245 | 1251 | static int rk628_hdmi_audio_codec_init(struct rk628_hdmi *hdmi, |
|---|
| .. | .. |
|---|
| 1558 | 1564 | hdmi->extcon = devm_extcon_dev_allocate(hdmi->dev, rk628_hdmi_cable); |
|---|
| 1559 | 1565 | if (IS_ERR(hdmi->extcon)) { |
|---|
| 1560 | 1566 | dev_err(hdmi->dev, "allocate extcon failed\n"); |
|---|
| 1567 | + ret = PTR_ERR(hdmi->extcon); |
|---|
| 1561 | 1568 | goto fail; |
|---|
| 1562 | 1569 | } |
|---|
| 1563 | 1570 | |
|---|