MLK-24427-3: drm: mhdp: Backporting code change from linux-nxp
Backporting code change from linux-nxp code base. -Rename cdns-mhdp-common.h to cdns-mhdp.h -Remove drm_dp_link_power_up/down functions. -Remove cdns-mhdp-cbs.h -Replace struct drm_dp_link with variable rate and num_lanes. Signed-off-by: Sandor Yu <Sandor.yu@nxp.com> Reviewed-by: Robby Cai <robby.cai@nxp.com>5.4-rM2-2.2.x-imx-squashed
parent
e809dab899
commit
110d5c01d3
|
@ -9,14 +9,15 @@
|
|||
* (at your option) any later version.
|
||||
*
|
||||
*/
|
||||
#include <drm/bridge/cdns-mhdp-common.h>
|
||||
#include <drm/bridge/cdns-mhdp.h>
|
||||
#include <drm/drm_atomic_helper.h>
|
||||
#include <drm/drm_crtc_helper.h>
|
||||
#include <drm/drm_edid.h>
|
||||
#include <drm/drm_encoder_slave.h>
|
||||
#include <drm/drm_of.h>
|
||||
#include <drm/drm_probe_helper.h>
|
||||
#include <drm/drmP.h>
|
||||
#include <drm/drm_vblank.h>
|
||||
#include <drm/drm_print.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/irq.h>
|
||||
|
@ -113,8 +114,6 @@ static void dp_pixel_clk_reset(struct cdns_mhdp_device *mhdp)
|
|||
static void cdns_dp_mode_set(struct cdns_mhdp_device *mhdp)
|
||||
{
|
||||
u32 lane_mapping = mhdp->lane_mapping;
|
||||
struct drm_dp_link *link = &mhdp->dp.link;
|
||||
char linkid[6];
|
||||
int ret;
|
||||
|
||||
cdns_mhdp_plat_call(mhdp, pclk_rate);
|
||||
|
@ -124,35 +123,20 @@ static void cdns_dp_mode_set(struct cdns_mhdp_device *mhdp)
|
|||
|
||||
dp_pixel_clk_reset(mhdp);
|
||||
|
||||
ret = drm_dp_downstream_id(&mhdp->dp.aux, linkid);
|
||||
/* Get DP Caps */
|
||||
ret = drm_dp_dpcd_read(&mhdp->dp.aux, DP_DPCD_REV, mhdp->dp.dpcd,
|
||||
DP_RECEIVER_CAP_SIZE);
|
||||
if (ret < 0) {
|
||||
DRM_INFO("Failed to Get DP link ID: %d\n", ret);
|
||||
DRM_ERROR("Failed to get caps %d\n", ret);
|
||||
return;
|
||||
}
|
||||
DRM_INFO("DP link id: %s, 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n",
|
||||
linkid, linkid[0], linkid[1], linkid[2], linkid[3], linkid[4],
|
||||
linkid[5]);
|
||||
|
||||
/* Check dp link */
|
||||
ret = drm_dp_link_probe(&mhdp->dp.aux, link);
|
||||
if (ret < 0) {
|
||||
DRM_INFO("Failed to probe DP link: %d\n", ret);
|
||||
return;
|
||||
}
|
||||
DRM_INFO("DP revision: 0x%x\n", link->revision);
|
||||
DRM_INFO("DP rate: %d Mbps\n", link->rate);
|
||||
DRM_INFO("DP number of lanes: %d\n", link->num_lanes);
|
||||
DRM_INFO("DP capabilities: 0x%lx\n", link->capabilities);
|
||||
mhdp->dp.rate = drm_dp_max_link_rate(mhdp->dp.dpcd);
|
||||
mhdp->dp.num_lanes = drm_dp_max_lane_count(mhdp->dp.dpcd);
|
||||
|
||||
/* check the max link rate */
|
||||
if (link->rate > CDNS_DP_MAX_LINK_RATE)
|
||||
link->rate = CDNS_DP_MAX_LINK_RATE;
|
||||
|
||||
drm_dp_link_power_up(&mhdp->dp.aux, link);
|
||||
if (ret < 0) {
|
||||
DRM_INFO("Failed to power DP link: %d\n", ret);
|
||||
return;
|
||||
}
|
||||
if (mhdp->dp.rate > CDNS_DP_MAX_LINK_RATE)
|
||||
mhdp->dp.rate = CDNS_DP_MAX_LINK_RATE;
|
||||
|
||||
/* Initialize link rate/num_lanes as panel max link rate/max_num_lanes */
|
||||
cdns_mhdp_plat_call(mhdp, phy_set);
|
||||
|
@ -334,8 +318,6 @@ static void cdn_dp_bridge_enable(struct drm_bridge *bridge)
|
|||
struct cdns_mhdp_device *mhdp = bridge->driver_private;
|
||||
int ret;
|
||||
|
||||
drm_dp_link_power_up(&mhdp->dp.aux, &mhdp->dp.link);
|
||||
|
||||
/* Link trainning */
|
||||
ret = cdns_mhdp_train_link(mhdp);
|
||||
if (ret) {
|
||||
|
@ -376,12 +358,12 @@ static void hotplug_work_func(struct work_struct *work)
|
|||
if (connector->status == connector_status_connected) {
|
||||
/* Cable connedted */
|
||||
DRM_INFO("HDMI/DP Cable Plug In\n");
|
||||
/* force mode set to recovery weston DP video display */
|
||||
mhdp->force_mode_set = true;
|
||||
enable_irq(mhdp->irq[IRQ_OUT]);
|
||||
} else if (connector->status == connector_status_disconnected) {
|
||||
/* Cable Disconnedted */
|
||||
DRM_INFO("HDMI/DP Cable Plug Out\n");
|
||||
/* force mode set for cable replugin to recovery DP video modes */
|
||||
mhdp->force_mode_set = true;
|
||||
enable_irq(mhdp->irq[IRQ_IN]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,14 +9,15 @@
|
|||
* (at your option) any later version.
|
||||
*
|
||||
*/
|
||||
#include <drm/bridge/cdns-mhdp-common.h>
|
||||
#include <drm/bridge/cdns-mhdp.h>
|
||||
#include <drm/drm_atomic_helper.h>
|
||||
#include <drm/drm_edid.h>
|
||||
#include <drm/drm_encoder_slave.h>
|
||||
#include <drm/drm_of.h>
|
||||
#include <drm/drm_probe_helper.h>
|
||||
#include <drm/drm_print.h>
|
||||
#include <drm/drm_scdc_helper.h>
|
||||
#include <drm/drmP.h>
|
||||
#include <drm/drm_vblank.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/hdmi.h>
|
||||
|
@ -481,12 +482,13 @@ static void hotplug_work_func(struct work_struct *work)
|
|||
|
||||
if (connector->status == connector_status_connected) {
|
||||
DRM_INFO("HDMI Cable Plug In\n");
|
||||
/* force mode set to recovery weston HDMI2.0 video modes */
|
||||
mhdp->force_mode_set = true;
|
||||
enable_irq(mhdp->irq[IRQ_OUT]);
|
||||
} else if (connector->status == connector_status_disconnected) {
|
||||
/* Cable Disconnedted */
|
||||
DRM_INFO("HDMI Cable Plug Out\n");
|
||||
/* force mode set for cable replugin to recovery HDMI2.0 video modes */
|
||||
mhdp->force_mode_set = true;
|
||||
enable_irq(mhdp->irq[IRQ_IN]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,10 +14,11 @@
|
|||
*/
|
||||
#include <linux/clk.h>
|
||||
#include <linux/reset.h>
|
||||
#include <drm/bridge/cdns-mhdp-common.h>
|
||||
#include <drm/bridge/cdns-mhdp.h>
|
||||
#include <sound/hdmi-codec.h>
|
||||
#include <drm/drm_of.h>
|
||||
#include <drm/drmP.h>
|
||||
#include <drm/drm_vblank.h>
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
#define CDNS_DP_SPDIF_CLK 200000000
|
||||
|
||||
|
@ -151,7 +152,7 @@ static void cdns_mhdp_audio_config_i2s(struct cdns_mhdp_device *mhdp,
|
|||
u32 transmission_type = 0; /* not required for L-PCM */
|
||||
|
||||
if (numofchannels == 2) {
|
||||
if (mhdp->dp.link.num_lanes == 1)
|
||||
if (mhdp->dp.num_lanes == 1)
|
||||
sub_pckt_num = 2;
|
||||
else
|
||||
sub_pckt_num = 4;
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include <linux/workqueue.h>
|
||||
#include <linux/kthread.h>
|
||||
#include <linux/freezer.h>
|
||||
#include <drm/bridge/cdns-mhdp-common.h>
|
||||
#include <drm/bridge/cdns-mhdp.h>
|
||||
|
||||
#define CEC_NAME "cdns-mhdp-cec"
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include <asm/unaligned.h>
|
||||
|
||||
#include <drm/bridge/cdns-mhdp-common.h>
|
||||
#include <drm/bridge/cdns-mhdp.h>
|
||||
#include <drm/drm_modes.h>
|
||||
#include <drm/drm_print.h>
|
||||
#include <linux/regmap.h>
|
||||
|
@ -180,7 +180,7 @@ bool cdns_mhdp_check_alive(struct cdns_mhdp_device *mhdp)
|
|||
}
|
||||
EXPORT_SYMBOL(cdns_mhdp_check_alive);
|
||||
|
||||
int cdns_mhdp_mailbox_read(struct cdns_mhdp_device *mhdp)
|
||||
static int mhdp_mailbox_read(struct cdns_mhdp_device *mhdp)
|
||||
{
|
||||
int val, ret;
|
||||
|
||||
|
@ -192,9 +192,8 @@ int cdns_mhdp_mailbox_read(struct cdns_mhdp_device *mhdp)
|
|||
|
||||
return cdns_mhdp_bus_read(mhdp, MAILBOX0_RD_DATA) & 0xff;
|
||||
}
|
||||
EXPORT_SYMBOL(cdns_mhdp_mailbox_read);
|
||||
|
||||
static int cdp_dp_mailbox_write(struct cdns_mhdp_device *mhdp, u8 val)
|
||||
static int mhdp_mailbox_write(struct cdns_mhdp_device *mhdp, u8 val)
|
||||
{
|
||||
int ret, full;
|
||||
|
||||
|
@ -219,7 +218,7 @@ int cdns_mhdp_mailbox_validate_receive(struct cdns_mhdp_device *mhdp,
|
|||
|
||||
/* read the header of the message */
|
||||
for (i = 0; i < 4; i++) {
|
||||
ret = cdns_mhdp_mailbox_read(mhdp);
|
||||
ret = mhdp_mailbox_read(mhdp);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@ -235,7 +234,7 @@ int cdns_mhdp_mailbox_validate_receive(struct cdns_mhdp_device *mhdp,
|
|||
* clear the mailbox by reading its contents.
|
||||
*/
|
||||
for (i = 0; i < mbox_size; i++)
|
||||
if (cdns_mhdp_mailbox_read(mhdp) < 0)
|
||||
if (mhdp_mailbox_read(mhdp) < 0)
|
||||
break;
|
||||
|
||||
return -EINVAL;
|
||||
|
@ -252,7 +251,7 @@ int cdns_mhdp_mailbox_read_receive(struct cdns_mhdp_device *mhdp,
|
|||
int ret;
|
||||
|
||||
for (i = 0; i < buff_size; i++) {
|
||||
ret = cdns_mhdp_mailbox_read(mhdp);
|
||||
ret = mhdp_mailbox_read(mhdp);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@ -274,13 +273,13 @@ int cdns_mhdp_mailbox_send(struct cdns_mhdp_device *mhdp, u8 module_id,
|
|||
put_unaligned_be16(size, header + 2);
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
ret = cdp_dp_mailbox_write(mhdp, header[i]);
|
||||
ret = mhdp_mailbox_write(mhdp, header[i]);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
for (i = 0; i < size; i++) {
|
||||
ret = cdp_dp_mailbox_write(mhdp, message[i]);
|
||||
ret = mhdp_mailbox_write(mhdp, message[i]);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
@ -416,14 +415,14 @@ int cdns_mhdp_set_firmware_active(struct cdns_mhdp_device *mhdp, bool enable)
|
|||
msg[4] = enable ? FW_ACTIVE : FW_STANDBY;
|
||||
|
||||
for (i = 0; i < sizeof(msg); i++) {
|
||||
ret = cdp_dp_mailbox_write(mhdp, msg[i]);
|
||||
ret = mhdp_mailbox_write(mhdp, msg[i]);
|
||||
if (ret)
|
||||
goto err_set_firmware_active;
|
||||
}
|
||||
|
||||
/* read the firmware state */
|
||||
for (i = 0; i < sizeof(msg); i++) {
|
||||
ret = cdns_mhdp_mailbox_read(mhdp);
|
||||
ret = mhdp_mailbox_read(mhdp);
|
||||
if (ret < 0)
|
||||
goto err_set_firmware_active;
|
||||
|
||||
|
@ -444,8 +443,8 @@ int cdns_mhdp_set_host_cap(struct cdns_mhdp_device *mhdp)
|
|||
u8 msg[8];
|
||||
int ret;
|
||||
|
||||
msg[0] = drm_dp_link_rate_to_bw_code(mhdp->dp.link.rate);
|
||||
msg[1] = mhdp->dp.link.num_lanes | SCRAMBLER_EN;
|
||||
msg[0] = drm_dp_link_rate_to_bw_code(mhdp->dp.rate);
|
||||
msg[1] = mhdp->dp.num_lanes | SCRAMBLER_EN;
|
||||
msg[2] = VOLTAGE_LEVEL_2;
|
||||
msg[3] = PRE_EMPHASIS_LEVEL_3;
|
||||
msg[4] = PTS1 | PTS2 | PTS3 | PTS4;
|
||||
|
@ -580,7 +579,7 @@ int cdns_mhdp_set_video_status(struct cdns_mhdp_device *mhdp, int active)
|
|||
}
|
||||
EXPORT_SYMBOL(cdns_mhdp_set_video_status);
|
||||
|
||||
static int cdns_mhdp_get_msa_misc(struct video_info *video,
|
||||
static int mhdp_get_msa_misc(struct video_info *video,
|
||||
struct drm_display_mode *mode)
|
||||
{
|
||||
u32 msa_misc;
|
||||
|
@ -601,7 +600,7 @@ static int cdns_mhdp_get_msa_misc(struct video_info *video,
|
|||
case YCBCR_4_2_0:
|
||||
val[0] = 5;
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
switch (video->color_depth) {
|
||||
case 6:
|
||||
|
@ -619,7 +618,7 @@ static int cdns_mhdp_get_msa_misc(struct video_info *video,
|
|||
case 16:
|
||||
val[1] = 4;
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
msa_misc = 2 * val[0] + 32 * val[1] +
|
||||
((video->color_fmt == Y_ONLY) ? (1 << 14) : 0);
|
||||
|
@ -639,7 +638,7 @@ int cdns_mhdp_config_video(struct cdns_mhdp_device *mhdp)
|
|||
bit_per_pix = (video->color_fmt == YCBCR_4_2_2) ?
|
||||
(video->color_depth * 2) : (video->color_depth * 3);
|
||||
|
||||
link_rate = mhdp->dp.link.rate / 1000;
|
||||
link_rate = mhdp->dp.rate / 1000;
|
||||
|
||||
ret = cdns_mhdp_reg_write(mhdp, BND_HSYNC2VSYNC, VIF_BYPASS_INTERLACE);
|
||||
if (ret)
|
||||
|
@ -659,13 +658,13 @@ int cdns_mhdp_config_video(struct cdns_mhdp_device *mhdp)
|
|||
do {
|
||||
tu_size_reg += 2;
|
||||
symbol = (u64) tu_size_reg * mode->clock * bit_per_pix;
|
||||
do_div(symbol, mhdp->dp.link.num_lanes * link_rate * 8);
|
||||
do_div(symbol, mhdp->dp.num_lanes * link_rate * 8);
|
||||
rem = do_div(symbol, 1000);
|
||||
if (tu_size_reg > 64) {
|
||||
ret = -EINVAL;
|
||||
DRM_DEV_ERROR(mhdp->dev,
|
||||
"tu error, clk:%d, lanes:%d, rate:%d\n",
|
||||
mode->clock, mhdp->dp.link.num_lanes,
|
||||
mode->clock, mhdp->dp.num_lanes,
|
||||
link_rate);
|
||||
goto err_config_video;
|
||||
}
|
||||
|
@ -680,7 +679,7 @@ int cdns_mhdp_config_video(struct cdns_mhdp_device *mhdp)
|
|||
|
||||
/* set the FIFO Buffer size */
|
||||
val = div_u64(mode->clock * (symbol + 1), 1000) + link_rate;
|
||||
val /= (mhdp->dp.link.num_lanes * link_rate);
|
||||
val /= (mhdp->dp.num_lanes * link_rate);
|
||||
val = div_u64(8 * (symbol + 1), bit_per_pix) - val;
|
||||
val += 2;
|
||||
ret = cdns_mhdp_reg_write(mhdp, DP_VC_TABLE(15), val);
|
||||
|
@ -701,7 +700,7 @@ int cdns_mhdp_config_video(struct cdns_mhdp_device *mhdp)
|
|||
case 16:
|
||||
val = BCS_16;
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
val += video->color_fmt << 8;
|
||||
ret = cdns_mhdp_reg_write(mhdp, DP_FRAMER_PXL_REPR, val);
|
||||
|
@ -748,7 +747,7 @@ int cdns_mhdp_config_video(struct cdns_mhdp_device *mhdp)
|
|||
if (ret)
|
||||
goto err_config_video;
|
||||
|
||||
val = cdns_mhdp_get_msa_misc(video, mode);
|
||||
val = mhdp_get_msa_misc(video, mode);
|
||||
ret = cdns_mhdp_reg_write(mhdp, MSA_MISC, val);
|
||||
if (ret)
|
||||
goto err_config_video;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <asm/unaligned.h>
|
||||
#include <drm/bridge/cdns-mhdp-common.h>
|
||||
#include <drm/bridge/cdns-mhdp.h>
|
||||
#include <drm/drm_print.h>
|
||||
#include <linux/io.h>
|
||||
|
||||
|
@ -155,8 +155,8 @@ static int cdns_mhdp_get_training_status(struct cdns_mhdp_device *mhdp)
|
|||
if (ret)
|
||||
goto err_get_training_status;
|
||||
|
||||
mhdp->dp.link.rate = drm_dp_bw_code_to_link_rate(status[0]);
|
||||
mhdp->dp.link.num_lanes = status[1];
|
||||
mhdp->dp.rate = drm_dp_bw_code_to_link_rate(status[0]);
|
||||
mhdp->dp.num_lanes = status[1];
|
||||
|
||||
err_get_training_status:
|
||||
if (ret)
|
||||
|
@ -183,8 +183,8 @@ int cdns_mhdp_train_link(struct cdns_mhdp_device *mhdp)
|
|||
return ret;
|
||||
}
|
||||
|
||||
DRM_DEV_DEBUG_KMS(mhdp->dev, "rate:0x%x, lanes:%d\n", mhdp->dp.link.rate,
|
||||
mhdp->dp.link.num_lanes);
|
||||
DRM_DEV_DEBUG_KMS(mhdp->dev, "rate:0x%x, lanes:%d\n", mhdp->dp.rate,
|
||||
mhdp->dp.num_lanes);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(cdns_mhdp_train_link);
|
||||
|
|
|
@ -7,9 +7,10 @@
|
|||
* (at your option) any later version.
|
||||
*/
|
||||
|
||||
#include <drm/drmP.h>
|
||||
#include <drm/drm_vblank.h>
|
||||
#include <drm/drm_print.h>
|
||||
#include <linux/io.h>
|
||||
#include <drm/bridge/cdns-mhdp-common.h>
|
||||
#include <drm/bridge/cdns-mhdp.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
void cdns_mhdp_infoframe_set(struct cdns_mhdp_device *mhdp,
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include <linux/clk.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <drm/drm_dp_helper.h>
|
||||
#include <drm/bridge/cdns-mhdp-common.h>
|
||||
#include <drm/bridge/cdns-mhdp.h>
|
||||
#include "cdns-mhdp-phy.h"
|
||||
|
||||
enum dp_link_rate {
|
||||
|
@ -137,7 +137,7 @@ static void dp_aux_cfg(struct cdns_mhdp_device *mhdp)
|
|||
static void dp_phy_pma_cmn_cfg_24mhz(struct cdns_mhdp_device *mhdp)
|
||||
{
|
||||
int k;
|
||||
u32 num_lanes = mhdp->dp.link.num_lanes;
|
||||
u32 num_lanes = mhdp->dp.num_lanes;
|
||||
u16 val;
|
||||
|
||||
val = cdns_phy_reg_read(mhdp, PHY_PMA_CMN_CTRL1);
|
||||
|
@ -157,8 +157,8 @@ static void dp_phy_pma_cmn_cfg_24mhz(struct cdns_mhdp_device *mhdp)
|
|||
/* Valid for 24 MHz only */
|
||||
static void dp_phy_pma_cmn_pll0_24mhz(struct cdns_mhdp_device *mhdp)
|
||||
{
|
||||
u32 num_lanes = mhdp->dp.link.num_lanes;
|
||||
u32 link_rate = mhdp->dp.link.rate;
|
||||
u32 num_lanes = mhdp->dp.num_lanes;
|
||||
u32 link_rate = mhdp->dp.rate;
|
||||
u16 val;
|
||||
int index, i, k;
|
||||
|
||||
|
@ -228,7 +228,7 @@ static void dp_phy_pma_cmn_pll0_24mhz(struct cdns_mhdp_device *mhdp)
|
|||
/* PMA common configuration for 27MHz */
|
||||
static void dp_phy_pma_cmn_cfg_27mhz(struct cdns_mhdp_device *mhdp)
|
||||
{
|
||||
u32 num_lanes = mhdp->dp.link.num_lanes;
|
||||
u32 num_lanes = mhdp->dp.num_lanes;
|
||||
u16 val;
|
||||
int k;
|
||||
|
||||
|
@ -279,8 +279,8 @@ static void dp_phy_pma_cmn_cfg_27mhz(struct cdns_mhdp_device *mhdp)
|
|||
|
||||
static void dp_phy_pma_cmn_pll0_27mhz(struct cdns_mhdp_device *mhdp)
|
||||
{
|
||||
u32 num_lanes = mhdp->dp.link.num_lanes;
|
||||
u32 link_rate = mhdp->dp.link.rate;
|
||||
u32 num_lanes = mhdp->dp.num_lanes;
|
||||
u32 link_rate = mhdp->dp.rate;
|
||||
u16 val;
|
||||
int index, i, k;
|
||||
|
||||
|
@ -324,6 +324,10 @@ static void dp_phy_pma_cmn_pll0_27mhz(struct cdns_mhdp_device *mhdp)
|
|||
|
||||
/* DP PHY PLL 27MHz configuration */
|
||||
index = link_rate_index(link_rate);
|
||||
if (index < 0) {
|
||||
dev_err(mhdp->dev, "wrong link rate index\n");
|
||||
return;
|
||||
}
|
||||
for (i = 0; i < ARRAY_SIZE(phy_pll_27m_cfg); i++)
|
||||
cdns_phy_reg_write(mhdp, phy_pll_27m_cfg[i].addr, phy_pll_27m_cfg[i].val[index]);
|
||||
|
||||
|
|
|
@ -10,7 +10,8 @@
|
|||
*
|
||||
*/
|
||||
#include <drm/drm_of.h>
|
||||
#include <drm/drmP.h>
|
||||
#include <drm/drm_vblank.h>
|
||||
#include <drm/drm_print.h>
|
||||
#include <drm/drm_crtc_helper.h>
|
||||
#include <linux/io.h>
|
||||
#include <drm/drm_edid.h>
|
||||
|
@ -18,7 +19,7 @@
|
|||
#include <drm/drm_atomic.h>
|
||||
#include <linux/io.h>
|
||||
|
||||
#include <drm/bridge/cdns-mhdp-common.h>
|
||||
#include <drm/bridge/cdns-mhdp.h>
|
||||
#include "cdns-mhdp-phy.h"
|
||||
|
||||
/* HDMI TX clock control settings */
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#ifndef CDNS_MHDP_IMX_H_
|
||||
#define CDNS_MHDP_IMX_H_
|
||||
|
||||
#include <drm/bridge/cdns-mhdp-common.h>
|
||||
#include <drm/bridge/cdns-mhdp.h>
|
||||
#include <drm/drm_encoder_slave.h>
|
||||
|
||||
|
||||
|
|
|
@ -10,7 +10,8 @@
|
|||
#include <linux/firmware.h>
|
||||
#include <linux/pm_domain.h>
|
||||
#include <linux/clk.h>
|
||||
#include <drm/drmP.h>
|
||||
#include <drm/drm_vblank.h>
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
#include "cdns-mhdp-imx.h"
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <linux/platform_device.h>
|
||||
#include <linux/component.h>
|
||||
#include <drm/drm_of.h>
|
||||
#include <drm/drmP.h>
|
||||
#include <drm/drm_vblank.h>
|
||||
#include <drm/drm_crtc_helper.h>
|
||||
#include <drm/drm_encoder_slave.h>
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
*/
|
||||
#include <linux/clk.h>
|
||||
#include <drm/drmP.h>
|
||||
#include <drm/drm_vblank.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_address.h>
|
||||
#include <linux/of_device.h>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#ifndef _CDN_DP_PHY_H
|
||||
#define _CDN_DP_PHY_H
|
||||
|
||||
#include <drm/bridge/cdns-mhdp-common.h>
|
||||
#include <drm/bridge/cdns-mhdp.h>
|
||||
|
||||
#define CMN_SSM_BIAS_TMR 0x0022
|
||||
#define CMN_PLLSM0_PLLEN_TMR 0x0029
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Cadence MHDP DP bridge callbacks.
|
||||
*
|
||||
* Copyright: 2018 Cadence Design Systems, Inc.
|
||||
*
|
||||
* Author: Piotr Sroka <piotrs@cadence.com>
|
||||
*/
|
||||
|
||||
#ifndef CDNS_MHDP_CBS_H
|
||||
#define CDNS_MHDP_CBS_H
|
||||
|
||||
#include <drm/drm_bridge.h>
|
||||
|
||||
struct cdns_mhdp_mst_cbs_funcs {
|
||||
struct drm_encoder *(*create_mst_encoder)(void *priv_data,
|
||||
struct drm_bridge *bridge);
|
||||
void (*destroy_mst_encoder)(void *priv_data, struct drm_bridge *bridge);
|
||||
};
|
||||
|
||||
struct cdns_mhdp_mst_cbs {
|
||||
struct cdns_mhdp_mst_cbs_funcs funcs;
|
||||
void *priv_data;
|
||||
};
|
||||
|
||||
int mhdp_bridge_attach_mst_cbs(struct drm_bridge *bridge,
|
||||
struct cdns_mhdp_mst_cbs *cbs);
|
||||
|
||||
#endif
|
|
@ -13,10 +13,9 @@
|
|||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef CDNS_MHDP_COMMON_H_
|
||||
#define CDNS_MHDP_COMMON_H_
|
||||
#ifndef CDNS_MHDP_H_
|
||||
#define CDNS_MHDP_H_
|
||||
|
||||
#include <drm/bridge/cdns-mhdp-cbs.h>
|
||||
#include <drm/drm_bridge.h>
|
||||
#include <drm/drm_connector.h>
|
||||
#include <drm/drm_dp_helper.h>
|
||||
|
@ -698,11 +697,12 @@ struct cdns_mhdp_device {
|
|||
|
||||
union {
|
||||
struct _dp_data {
|
||||
struct drm_dp_link link;
|
||||
u8 dpcd[DP_RECEIVER_CAP_SIZE];
|
||||
u32 rate;
|
||||
u8 num_lanes;
|
||||
struct drm_dp_aux aux;
|
||||
struct cdns_mhdp_host host;
|
||||
struct cdns_mhdp_sink sink;
|
||||
struct cdns_mhdp_mst_cbs cbs;
|
||||
bool is_mst;
|
||||
bool can_mst;
|
||||
} dp;
|
||||
|
@ -727,7 +727,6 @@ int cdns_mhdp_set_firmware_active(struct cdns_mhdp_device *mhdp, bool enable);
|
|||
int cdns_mhdp_set_host_cap(struct cdns_mhdp_device *mhdp);
|
||||
int cdns_mhdp_event_config(struct cdns_mhdp_device *mhdp);
|
||||
u32 cdns_mhdp_get_event(struct cdns_mhdp_device *mhdp);
|
||||
int cdns_mhdp_get_hpd_status(struct cdns_mhdp_device *mhdp);
|
||||
int cdns_mhdp_dpcd_write(struct cdns_mhdp_device *mhdp, u32 addr, u8 value);
|
||||
int cdns_mhdp_dpcd_read(struct cdns_mhdp_device *mhdp,
|
||||
u32 addr, u8 *data, u16 len);
|
||||
|
@ -789,6 +788,7 @@ int cdns_hdmi_bind(struct platform_device *pdev,
|
|||
void cdns_hdmi_set_sample_rate(struct cdns_mhdp_device *mhdp, unsigned int rate);
|
||||
void cdns_hdmi_audio_enable(struct cdns_mhdp_device *mhdp);
|
||||
void cdns_hdmi_audio_disable(struct cdns_mhdp_device *mhdp);
|
||||
|
||||
/* DP */
|
||||
int cdns_dp_probe(struct platform_device *pdev,
|
||||
struct cdns_mhdp_device *mhdp);
|
||||
|
@ -803,4 +803,4 @@ int cdns_mhdp_register_cec_driver(struct device *dev);
|
|||
int cdns_mhdp_unregister_cec_driver(struct device *dev);
|
||||
#endif
|
||||
|
||||
#endif /* CDNS_MHDP_COMMON_H_ */
|
||||
#endif /* CDNS_MHDP_H_ */
|
Loading…
Reference in New Issue