From f6c024ddc39f647226529ea30d9e8c96ee207d96 Mon Sep 17 00:00:00 2001 From: Shengjiu Wang Date: Thu, 1 Mar 2018 11:34:24 +0800 Subject: [PATCH] MLK-17639-1: hdp: enable HDMI ARC with common API Define __ARC_CONFIG__ to enable HDMI ARC Signed-off-by: Shengjiu Wang Reviewed-by: Sandor Yu --- .../imx/hdp/API_AFE_ss28fdsoi_kiran_hdmitx.c | 9 ++++-- .../gpu/drm/imx/hdp/API_AFE_t28hpc_hdmitx.c | 31 ++++--------------- 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/drivers/gpu/drm/imx/hdp/API_AFE_ss28fdsoi_kiran_hdmitx.c b/drivers/gpu/drm/imx/hdp/API_AFE_ss28fdsoi_kiran_hdmitx.c index 49087ef8a82c..88bc8215b6a6 100644 --- a/drivers/gpu/drm/imx/hdp/API_AFE_ss28fdsoi_kiran_hdmitx.c +++ b/drivers/gpu/drm/imx/hdp/API_AFE_ss28fdsoi_kiran_hdmitx.c @@ -48,6 +48,7 @@ #include #include "API_AFE_ss28fdsoi_kiran_hdmitx.h" #include "ss28fdsoi_hdmitx_table.h" +#include "imx-hdp.h" static int inside(u32 value, u32 left_sharp_corner, u32 right_sharp_corner) { @@ -578,6 +579,8 @@ int phy_cfg_hdp_ss28fdsoi(state_struct *state, int num_lanes, } +#define __ARC_CONFIG__ + int hdmi_tx_kiran_power_configuration_seq(state_struct *state, int num_lanes) { /* Configure the power state. */ @@ -586,9 +589,9 @@ int hdmi_tx_kiran_power_configuration_seq(state_struct *state, int num_lanes) while (!(Afe_read(state, 0xC008) & (1 << 6))) ; #ifdef __ARC_CONFIG__ - arc_power_up(state); - arc_calibrate(state); - arc_config(state); + imx_arc_power_up(state); + imx_arc_calibrate(state); + imx_arc_config(state); #endif /* PHY_DP_MODE_CTL */ diff --git a/drivers/gpu/drm/imx/hdp/API_AFE_t28hpc_hdmitx.c b/drivers/gpu/drm/imx/hdp/API_AFE_t28hpc_hdmitx.c index bc2ce2a93efe..9b99bf1f5a60 100644 --- a/drivers/gpu/drm/imx/hdp/API_AFE_t28hpc_hdmitx.c +++ b/drivers/gpu/drm/imx/hdp/API_AFE_t28hpc_hdmitx.c @@ -46,6 +46,7 @@ #include #include "API_AFE_t28hpc_hdmitx.h" +#include "imx-hdp.h" static char inside(u32 value, u32 left_sharp_corner, u32 right_sharp_corner) @@ -57,27 +58,6 @@ static char inside(u32 value, u32 left_sharp_corner, return true; } -void aux_cfg_t28hpc(state_struct *state) -{ - Afe_write(state, 0x5025, 0x0001); - - Afe_write(state, 0x5024, 36); - - Afe_write(state, 0x5021, 0x0100); - Afe_write(state, 0x5021, 0x0300); - Afe_write(state, 0x5026, 0x0000); - Afe_write(state, 0x5020, 0x2008); - Afe_write(state, 0x5020, 0x2018); - Afe_write(state, 0x5020, 0xA018); - Afe_write(state, 0x5021, 0x030C); - Afe_write(state, 0x5029, 0x0000); - Afe_write(state, 0x5027, 0x4001); - Afe_write(state, 0x5020, 0xA098); - Afe_write(state, 0x5020, 0xA198); - Afe_write(state, 0x5021, 0x030D); - Afe_write(state, 0x5021, 0x030F); -} - int phy_cfg_t28hpc(state_struct *state, int num_lanes, VIC_MODES vicMode, int bpp, VIC_PXL_ENCODING_FORMAT format, bool pixel_clk_from_phy) { @@ -1820,11 +1800,12 @@ int phy_cfg_t28hpc(state_struct *state, int num_lanes, VIC_MODES vicMode, int bp /* register PHY_HDP_MODE_CTL */ Afe_write(state, 0xC008, 0x0004); - aux_cfg_t28hpc(state); return character_freq_khz; } +#define __ARC_CONFIG__ + int hdmi_tx_t28hpc_power_config_seq(state_struct *state, int num_lanes) { unsigned char k; @@ -1841,9 +1822,9 @@ int hdmi_tx_t28hpc_power_config_seq(state_struct *state, int num_lanes) ; #ifdef __ARC_CONFIG__ - arc_power_up(state); - arc_calibrate(state); - arc_config(state); + imx_arc_power_up(state); + imx_arc_calibrate(state); + imx_arc_config(state); #endif /* PHY_DP_MODE_CTL */ -- 2.17.1