mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
drm/rockchip: rk618: adapt to kernel-5.10
Signed-off-by: Damon Ding <damon.ding@rock-chips.com> Change-Id: I59afe9495a7ba9418afe48d6e26c6e98a871e699
This commit is contained in:
@@ -11,13 +11,14 @@
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/mfd/rk618.h>
|
||||
|
||||
#include <drm/drmP.h>
|
||||
#include <drm/drm_drv.h>
|
||||
#include <drm/drm_of.h>
|
||||
#include <drm/drm_atomic.h>
|
||||
#include <drm/drm_crtc_helper.h>
|
||||
#include <drm/drm_atomic_helper.h>
|
||||
#include <drm/drm_mipi_dsi.h>
|
||||
#include <drm/drm_panel.h>
|
||||
#include <drm/drm_probe_helper.h>
|
||||
|
||||
#include <video/of_display_timing.h>
|
||||
#include <video/mipi_display.h>
|
||||
@@ -736,7 +737,7 @@ static int rk618_dsi_connector_get_modes(struct drm_connector *connector)
|
||||
{
|
||||
struct rk618_dsi *dsi = connector_to_dsi(connector);
|
||||
|
||||
return drm_panel_get_modes(dsi->panel);
|
||||
return drm_panel_get_modes(dsi->panel, connector);
|
||||
}
|
||||
|
||||
static const struct drm_connector_helper_funcs
|
||||
@@ -753,9 +754,6 @@ rk618_dsi_connector_detect(struct drm_connector *connector, bool force)
|
||||
|
||||
static void rk618_dsi_connector_destroy(struct drm_connector *connector)
|
||||
{
|
||||
struct rk618_dsi *dsi = connector_to_dsi(connector);
|
||||
|
||||
drm_panel_detach(dsi->panel);
|
||||
drm_connector_cleanup(connector);
|
||||
}
|
||||
|
||||
@@ -793,8 +791,8 @@ static void rk618_dsi_bridge_disable(struct drm_bridge *bridge)
|
||||
}
|
||||
|
||||
static void rk618_dsi_bridge_mode_set(struct drm_bridge *bridge,
|
||||
struct drm_display_mode *mode,
|
||||
struct drm_display_mode *adj)
|
||||
const struct drm_display_mode *mode,
|
||||
const struct drm_display_mode *adj)
|
||||
{
|
||||
struct rk618_dsi *dsi = bridge_to_dsi(bridge);
|
||||
|
||||
@@ -804,7 +802,8 @@ static void rk618_dsi_bridge_mode_set(struct drm_bridge *bridge,
|
||||
drm_mode_copy(&dsi->mode, adj);
|
||||
}
|
||||
|
||||
static int rk618_dsi_bridge_attach(struct drm_bridge *bridge)
|
||||
static int rk618_dsi_bridge_attach(struct drm_bridge *bridge,
|
||||
enum drm_bridge_attach_flags flags)
|
||||
{
|
||||
struct rk618_dsi *dsi = bridge_to_dsi(bridge);
|
||||
struct drm_connector *connector = &dsi->connector;
|
||||
@@ -821,11 +820,6 @@ static int rk618_dsi_bridge_attach(struct drm_bridge *bridge)
|
||||
drm_connector_helper_add(connector, &rk618_dsi_connector_helper_funcs);
|
||||
drm_connector_attach_encoder(connector, bridge->encoder);
|
||||
|
||||
ret = drm_panel_attach(dsi->panel, connector);
|
||||
if (ret) {
|
||||
dev_err(dsi->dev, "Failed to attach panel\n");
|
||||
return ret;
|
||||
}
|
||||
dsi->sub_dev.connector = &dsi->connector;
|
||||
dsi->sub_dev.of_node = dsi->dev->of_node;
|
||||
rockchip_drm_register_sub_dev(&dsi->sub_dev);
|
||||
|
||||
@@ -21,10 +21,11 @@
|
||||
#endif
|
||||
|
||||
#include <drm/drm_of.h>
|
||||
#include <drm/drmP.h>
|
||||
#include <drm/drm_drv.h>
|
||||
#include <drm/drm_atomic_helper.h>
|
||||
#include <drm/drm_crtc_helper.h>
|
||||
#include <drm/drm_edid.h>
|
||||
#include <drm/drm_probe_helper.h>
|
||||
|
||||
#include <sound/hdmi-codec.h>
|
||||
|
||||
@@ -722,7 +723,7 @@ static int rk618_hdmi_config_video_avi(struct rk618_hdmi *hdmi,
|
||||
union hdmi_infoframe frame;
|
||||
int rc;
|
||||
|
||||
rc = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi, mode, false);
|
||||
rc = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi, &hdmi->connector, mode);
|
||||
|
||||
if (hdmi->hdmi_data.enc_out_format == HDMI_COLORSPACE_YUV444)
|
||||
frame.avi.colorspace = HDMI_COLORSPACE_YUV444;
|
||||
@@ -1031,8 +1032,8 @@ rk618_hdmi_connector_helper_funcs = {
|
||||
};
|
||||
|
||||
static void rk618_hdmi_bridge_mode_set(struct drm_bridge *bridge,
|
||||
struct drm_display_mode *mode,
|
||||
struct drm_display_mode *adj_mode)
|
||||
const struct drm_display_mode *mode,
|
||||
const struct drm_display_mode *adj_mode)
|
||||
{
|
||||
struct rk618_hdmi *hdmi = bridge_to_hdmi(bridge);
|
||||
|
||||
@@ -1065,7 +1066,8 @@ static void rk618_hdmi_bridge_disable(struct drm_bridge *bridge)
|
||||
clk_disable_unprepare(hdmi->clock);
|
||||
}
|
||||
|
||||
static int rk618_hdmi_bridge_attach(struct drm_bridge *bridge)
|
||||
static int rk618_hdmi_bridge_attach(struct drm_bridge *bridge,
|
||||
enum drm_bridge_attach_flags flags)
|
||||
{
|
||||
struct rk618_hdmi *hdmi = bridge_to_hdmi(bridge);
|
||||
struct device *dev = hdmi->dev;
|
||||
@@ -1105,7 +1107,7 @@ static int rk618_hdmi_bridge_attach(struct drm_bridge *bridge)
|
||||
if (!hdmi->bridge)
|
||||
return -EPROBE_DEFER;
|
||||
|
||||
ret = drm_bridge_attach(bridge->encoder, hdmi->bridge, bridge);
|
||||
ret = drm_bridge_attach(bridge->encoder, hdmi->bridge, bridge, 0);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to attach bridge\n");
|
||||
return ret;
|
||||
@@ -1234,7 +1236,7 @@ static void rk618_hdmi_audio_shutdown(struct device *dev, void *d)
|
||||
/* do nothing */
|
||||
}
|
||||
|
||||
static int rk618_hdmi_audio_digital_mute(struct device *dev, void *d, bool mute)
|
||||
static int rk618_hdmi_audio_mute_stream(struct device *dev, void *d, bool mute, int direction)
|
||||
{
|
||||
struct rk618_hdmi *hdmi = dev_get_drvdata(dev);
|
||||
|
||||
@@ -1279,7 +1281,7 @@ static int rk618_hdmi_audio_get_eld(struct device *dev, void *d,
|
||||
static const struct hdmi_codec_ops audio_codec_ops = {
|
||||
.hw_params = rk618_hdmi_audio_hw_params,
|
||||
.audio_shutdown = rk618_hdmi_audio_shutdown,
|
||||
.digital_mute = rk618_hdmi_audio_digital_mute,
|
||||
.mute_stream = rk618_hdmi_audio_mute_stream,
|
||||
.get_eld = rk618_hdmi_audio_get_eld,
|
||||
};
|
||||
|
||||
|
||||
@@ -12,12 +12,13 @@
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/mfd/rk618.h>
|
||||
|
||||
#include <drm/drmP.h>
|
||||
#include <drm/drm_drv.h>
|
||||
#include <drm/drm_of.h>
|
||||
#include <drm/drm_atomic.h>
|
||||
#include <drm/drm_crtc_helper.h>
|
||||
#include <drm/drm_atomic_helper.h>
|
||||
#include <drm/drm_panel.h>
|
||||
#include <drm/drm_probe_helper.h>
|
||||
|
||||
#include <video/of_display_timing.h>
|
||||
#include <video/videomode.h>
|
||||
@@ -70,7 +71,7 @@ static int rk618_lvds_connector_get_modes(struct drm_connector *connector)
|
||||
u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24;
|
||||
int num_modes = 0;
|
||||
|
||||
num_modes = drm_panel_get_modes(lvds->panel);
|
||||
num_modes = drm_panel_get_modes(lvds->panel, connector);
|
||||
|
||||
if (info->num_bus_formats)
|
||||
lvds->bus_format = info->bus_formats[0];
|
||||
@@ -97,9 +98,6 @@ rk618_lvds_connector_detect(struct drm_connector *connector, bool force)
|
||||
|
||||
static void rk618_lvds_connector_destroy(struct drm_connector *connector)
|
||||
{
|
||||
struct rk618_lvds *lvds = connector_to_lvds(connector);
|
||||
|
||||
drm_panel_detach(lvds->panel);
|
||||
drm_connector_cleanup(connector);
|
||||
}
|
||||
|
||||
@@ -167,7 +165,8 @@ static void rk618_lvds_bridge_disable(struct drm_bridge *bridge)
|
||||
clk_disable_unprepare(lvds->clock);
|
||||
}
|
||||
|
||||
static int rk618_lvds_bridge_attach(struct drm_bridge *bridge)
|
||||
static int rk618_lvds_bridge_attach(struct drm_bridge *bridge,
|
||||
enum drm_bridge_attach_flags flags)
|
||||
{
|
||||
struct rk618_lvds *lvds = bridge_to_lvds(bridge);
|
||||
struct drm_connector *connector = &lvds->connector;
|
||||
@@ -184,12 +183,6 @@ static int rk618_lvds_bridge_attach(struct drm_bridge *bridge)
|
||||
drm_connector_helper_add(connector, &rk618_lvds_connector_helper_funcs);
|
||||
drm_connector_attach_encoder(connector, bridge->encoder);
|
||||
|
||||
ret = drm_panel_attach(lvds->panel, connector);
|
||||
if (ret) {
|
||||
dev_err(lvds->dev, "Failed to attach panel\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
lvds->sub_dev.connector = &lvds->connector;
|
||||
lvds->sub_dev.of_node = lvds->dev->of_node;
|
||||
rockchip_drm_register_sub_dev(&lvds->sub_dev);
|
||||
|
||||
@@ -13,12 +13,13 @@
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/mfd/rk618.h>
|
||||
|
||||
#include <drm/drmP.h>
|
||||
#include <drm/drm_drv.h>
|
||||
#include <drm/drm_of.h>
|
||||
#include <drm/drm_atomic.h>
|
||||
#include <drm/drm_crtc_helper.h>
|
||||
#include <drm/drm_atomic_helper.h>
|
||||
#include <drm/drm_panel.h>
|
||||
#include <drm/drm_probe_helper.h>
|
||||
|
||||
#include <video/videomode.h>
|
||||
|
||||
@@ -64,7 +65,7 @@ static int rk618_rgb_connector_get_modes(struct drm_connector *connector)
|
||||
u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24;
|
||||
int num_modes = 0;
|
||||
|
||||
num_modes = drm_panel_get_modes(rgb->panel);
|
||||
num_modes = drm_panel_get_modes(rgb->panel, connector);
|
||||
|
||||
if (info->num_bus_formats)
|
||||
rgb->bus_format = info->bus_formats[0];
|
||||
@@ -91,9 +92,6 @@ rk618_rgb_connector_detect(struct drm_connector *connector, bool force)
|
||||
|
||||
static void rk618_rgb_connector_destroy(struct drm_connector *connector)
|
||||
{
|
||||
struct rk618_rgb *rgb = connector_to_rgb(connector);
|
||||
|
||||
drm_panel_detach(rgb->panel);
|
||||
drm_connector_cleanup(connector);
|
||||
}
|
||||
|
||||
@@ -161,7 +159,8 @@ static void rk618_rgb_bridge_disable(struct drm_bridge *bridge)
|
||||
clk_disable_unprepare(rgb->clock);
|
||||
}
|
||||
|
||||
static int rk618_rgb_bridge_attach(struct drm_bridge *bridge)
|
||||
static int rk618_rgb_bridge_attach(struct drm_bridge *bridge,
|
||||
enum drm_bridge_attach_flags flags)
|
||||
{
|
||||
struct rk618_rgb *rgb = bridge_to_rgb(bridge);
|
||||
struct device *dev = rgb->dev;
|
||||
@@ -181,13 +180,12 @@ static int rk618_rgb_bridge_attach(struct drm_bridge *bridge)
|
||||
drm_connector_helper_add(connector,
|
||||
&rk618_rgb_connector_helper_funcs);
|
||||
drm_connector_attach_encoder(connector, bridge->encoder);
|
||||
drm_panel_attach(rgb->panel, connector);
|
||||
|
||||
rgb->sub_dev.connector = &rgb->connector;
|
||||
rgb->sub_dev.of_node = rgb->dev->of_node;
|
||||
rockchip_drm_register_sub_dev(&rgb->sub_dev);
|
||||
} else {
|
||||
ret = drm_bridge_attach(bridge->encoder, rgb->bridge, bridge);
|
||||
ret = drm_bridge_attach(bridge->encoder, rgb->bridge, bridge, 0);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to attach bridge\n");
|
||||
return ret;
|
||||
|
||||
@@ -265,8 +265,8 @@ static void rk618_scaler_bridge_disable(struct drm_bridge *bridge)
|
||||
}
|
||||
|
||||
static void rk618_scaler_bridge_mode_set(struct drm_bridge *bridge,
|
||||
struct drm_display_mode *mode,
|
||||
struct drm_display_mode *adjusted)
|
||||
const struct drm_display_mode *mode,
|
||||
const struct drm_display_mode *adjusted)
|
||||
{
|
||||
struct rk618_scaler *scl = bridge_to_scaler(bridge);
|
||||
struct drm_connector *connector;
|
||||
@@ -285,7 +285,7 @@ static void rk618_scaler_bridge_mode_set(struct drm_bridge *bridge,
|
||||
if (connector->connector_type == DRM_MODE_CONNECTOR_HDMIA)
|
||||
continue;
|
||||
|
||||
if (connector->encoder_ids[0] != bridge->encoder->base.id)
|
||||
if (!drm_connector_has_possible_encoder(connector, bridge->encoder))
|
||||
continue;
|
||||
|
||||
list_for_each_entry(mode, &connector->modes, head) {
|
||||
@@ -310,7 +310,8 @@ static void rk618_scaler_bridge_mode_set(struct drm_bridge *bridge,
|
||||
dclk_rate, sclk_rate);
|
||||
}
|
||||
|
||||
static int rk618_scaler_bridge_attach(struct drm_bridge *bridge)
|
||||
static int rk618_scaler_bridge_attach(struct drm_bridge *bridge,
|
||||
enum drm_bridge_attach_flags flags)
|
||||
{
|
||||
struct rk618_scaler *scl = bridge_to_scaler(bridge);
|
||||
struct device *dev = scl->dev;
|
||||
@@ -331,7 +332,7 @@ static int rk618_scaler_bridge_attach(struct drm_bridge *bridge)
|
||||
if (!scl->bridge)
|
||||
return -EPROBE_DEFER;
|
||||
|
||||
ret = drm_bridge_attach(bridge->encoder, scl->bridge, bridge);
|
||||
ret = drm_bridge_attach(bridge->encoder, scl->bridge, bridge, 0);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to attach bridge\n");
|
||||
return ret;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <linux/regmap.h>
|
||||
|
||||
#include <drm/drm_of.h>
|
||||
#include <drm/drmP.h>
|
||||
#include <drm/drm_drv.h>
|
||||
#include <video/videomode.h>
|
||||
|
||||
#define RK618_VIF0_REG0 0x0000
|
||||
@@ -145,15 +145,16 @@ static void rk618_vif_bridge_disable(struct drm_bridge *bridge)
|
||||
}
|
||||
|
||||
static void rk618_vif_bridge_mode_set(struct drm_bridge *bridge,
|
||||
struct drm_display_mode *mode,
|
||||
struct drm_display_mode *adjusted)
|
||||
const struct drm_display_mode *mode,
|
||||
const struct drm_display_mode *adjusted)
|
||||
{
|
||||
struct rk618_vif *vif = bridge_to_vif(bridge);
|
||||
|
||||
drm_mode_copy(&vif->mode, adjusted);
|
||||
}
|
||||
|
||||
static int rk618_vif_bridge_attach(struct drm_bridge *bridge)
|
||||
static int rk618_vif_bridge_attach(struct drm_bridge *bridge,
|
||||
enum drm_bridge_attach_flags flags)
|
||||
{
|
||||
struct rk618_vif *vif = bridge_to_vif(bridge);
|
||||
struct device *dev = vif->dev;
|
||||
@@ -174,7 +175,7 @@ static int rk618_vif_bridge_attach(struct drm_bridge *bridge)
|
||||
if (!vif->bridge)
|
||||
return -EPROBE_DEFER;
|
||||
|
||||
ret = drm_bridge_attach(bridge->encoder, vif->bridge, bridge);
|
||||
ret = drm_bridge_attach(bridge->encoder, vif->bridge, bridge, 0);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to attach bridge\n");
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user