From: Luan Arcanjo <luanic...@usp.br>

All dce command_table_helper's shares a copy-pasted collection
of copy-pasted functions, which are: phy_id_to_atom,
clock_source_id_to_atom_phy_clk_src_id, and engine_bp_to_atom.

This patch removes the multiple copy-pasted by moving them to
the command_table_helper.c and make the command_table_helper's
calls the functions implemented by the command_table_helper.c
instead.

The changes were not tested on actual hardware. I am only able
to verify that the changes keep the code compileable and do my
best to to look repeatedly if I am not actually changing any code.

This is the version 4 of the PATCH, fixed comments about
licence in the new files and the matches From email to
Signed-off-by email. Fixed comments about using
command_table_helper instead of creating a dce_common

Signed-off-by: Luan Icaro Pinto Arcanjo <luanic...@usp.br>
---
 .../display/dc/bios/command_table_helper.c    | 104 +++++++++++++++++
 .../display/dc/bios/command_table_helper.h    |   8 ++
 .../bios/dce110/command_table_helper_dce110.c | 104 -----------------
 .../dce112/command_table_helper2_dce112.c     | 106 +-----------------
 .../bios/dce112/command_table_helper_dce112.c | 104 -----------------
 .../bios/dce60/command_table_helper_dce60.c   | 104 -----------------
 .../bios/dce80/command_table_helper_dce80.c   | 104 -----------------
 7 files changed, 114 insertions(+), 520 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c 
b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c
index e317a3615147..91bc8a06e2cf 100644
--- a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c
+++ b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c
@@ -293,3 +293,107 @@ uint8_t dal_cmd_table_helper_encoder_id_to_atom(
                return ENCODER_OBJECT_ID_NONE;
        }
 }
+
+uint8_t phy_id_to_atom(enum transmitter t)
+{
+       uint8_t atom_phy_id;
+
+       switch (t) {
+       case TRANSMITTER_UNIPHY_A:
+               atom_phy_id = ATOM_PHY_ID_UNIPHYA;
+               break;
+       case TRANSMITTER_UNIPHY_B:
+               atom_phy_id = ATOM_PHY_ID_UNIPHYB;
+               break;
+       case TRANSMITTER_UNIPHY_C:
+               atom_phy_id = ATOM_PHY_ID_UNIPHYC;
+               break;
+       case TRANSMITTER_UNIPHY_D:
+               atom_phy_id = ATOM_PHY_ID_UNIPHYD;
+               break;
+       case TRANSMITTER_UNIPHY_E:
+               atom_phy_id = ATOM_PHY_ID_UNIPHYE;
+               break;
+       case TRANSMITTER_UNIPHY_F:
+               atom_phy_id = ATOM_PHY_ID_UNIPHYF;
+               break;
+       case TRANSMITTER_UNIPHY_G:
+               atom_phy_id = ATOM_PHY_ID_UNIPHYG;
+               break;
+       default:
+               atom_phy_id = ATOM_PHY_ID_UNIPHYA;
+               break;
+       }
+       return atom_phy_id;
+}
+
+uint8_t clock_source_id_to_atom_phy_clk_src_id(
+               enum clock_source_id id)
+{
+       uint8_t atom_phy_clk_src_id = 0;
+
+       switch (id) {
+       case CLOCK_SOURCE_ID_PLL0:
+               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P0PLL;
+               break;
+       case CLOCK_SOURCE_ID_PLL1:
+               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P1PLL;
+               break;
+       case CLOCK_SOURCE_ID_PLL2:
+               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P2PLL;
+               break;
+       case CLOCK_SOURCE_ID_EXTERNAL:
+               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_REFCLK_SRC_EXT;
+               break;
+       default:
+               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P1PLL;
+               break;
+       }
+
+       return atom_phy_clk_src_id >> 2;
+}
+
+bool engine_bp_to_atom(enum engine_id id, uint32_t *atom_engine_id)
+{
+       bool result = false;
+
+       if (atom_engine_id != NULL)
+               switch (id) {
+               case ENGINE_ID_DIGA:
+                       *atom_engine_id = ASIC_INT_DIG1_ENCODER_ID;
+                       result = true;
+                       break;
+               case ENGINE_ID_DIGB:
+                       *atom_engine_id = ASIC_INT_DIG2_ENCODER_ID;
+                       result = true;
+                       break;
+               case ENGINE_ID_DIGC:
+                       *atom_engine_id = ASIC_INT_DIG3_ENCODER_ID;
+                       result = true;
+                       break;
+               case ENGINE_ID_DIGD:
+                       *atom_engine_id = ASIC_INT_DIG4_ENCODER_ID;
+                       result = true;
+                       break;
+               case ENGINE_ID_DIGE:
+                       *atom_engine_id = ASIC_INT_DIG5_ENCODER_ID;
+                       result = true;
+                       break;
+               case ENGINE_ID_DIGF:
+                       *atom_engine_id = ASIC_INT_DIG6_ENCODER_ID;
+                       result = true;
+                       break;
+               case ENGINE_ID_DIGG:
+                       *atom_engine_id = ASIC_INT_DIG7_ENCODER_ID;
+                       result = true;
+                       break;
+               case ENGINE_ID_DACA:
+                       *atom_engine_id = ASIC_INT_DAC1_ENCODER_ID;
+                       result = true;
+                       break;
+               default:
+                       break;
+               }
+
+       return result;
+}
diff --git a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h 
b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h
index dfd30aaf4032..547700e119a6 100644
--- a/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h
+++ b/drivers/gpu/drm/amd/display/dc/bios/command_table_helper.h
@@ -59,4 +59,12 @@ uint8_t dal_cmd_table_helper_transmitter_bp_to_atom(
 
 uint8_t dal_cmd_table_helper_encoder_id_to_atom(
        enum encoder_id id);
+
+uint8_t phy_id_to_atom(enum transmitter t);
+
+uint8_t clock_source_id_to_atom_phy_clk_src_id(
+               enum clock_source_id id);
+
+bool engine_bp_to_atom(enum engine_id id, uint32_t *atom_engine_id);
+
 #endif
diff --git 
a/drivers/gpu/drm/amd/display/dc/bios/dce110/command_table_helper_dce110.c 
b/drivers/gpu/drm/amd/display/dc/bios/dce110/command_table_helper_dce110.c
index 11bf247bb180..3099128223df 100644
--- a/drivers/gpu/drm/amd/display/dc/bios/dce110/command_table_helper_dce110.c
+++ b/drivers/gpu/drm/amd/display/dc/bios/dce110/command_table_helper_dce110.c
@@ -31,39 +31,6 @@
 
 #include "../command_table_helper.h"
 
-static uint8_t phy_id_to_atom(enum transmitter t)
-{
-       uint8_t atom_phy_id;
-
-       switch (t) {
-       case TRANSMITTER_UNIPHY_A:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYA;
-               break;
-       case TRANSMITTER_UNIPHY_B:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYB;
-               break;
-       case TRANSMITTER_UNIPHY_C:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYC;
-               break;
-       case TRANSMITTER_UNIPHY_D:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYD;
-               break;
-       case TRANSMITTER_UNIPHY_E:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYE;
-               break;
-       case TRANSMITTER_UNIPHY_F:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYF;
-               break;
-       case TRANSMITTER_UNIPHY_G:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYG;
-               break;
-       default:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYA;
-               break;
-       }
-       return atom_phy_id;
-}
-
 static uint8_t signal_type_to_atom_dig_mode(enum signal_type s)
 {
        uint8_t atom_dig_mode = ATOM_TRANSMITTER_DIGMODE_V5_DP;
@@ -94,32 +61,6 @@ static uint8_t signal_type_to_atom_dig_mode(enum signal_type 
s)
        return atom_dig_mode;
 }
 
-static uint8_t clock_source_id_to_atom_phy_clk_src_id(
-               enum clock_source_id id)
-{
-       uint8_t atom_phy_clk_src_id = 0;
-
-       switch (id) {
-       case CLOCK_SOURCE_ID_PLL0:
-               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P0PLL;
-               break;
-       case CLOCK_SOURCE_ID_PLL1:
-               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P1PLL;
-               break;
-       case CLOCK_SOURCE_ID_PLL2:
-               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P2PLL;
-               break;
-       case CLOCK_SOURCE_ID_EXTERNAL:
-               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_REFCLK_SRC_EXT;
-               break;
-       default:
-               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P1PLL;
-               break;
-       }
-
-       return atom_phy_clk_src_id >> 2;
-}
-
 static uint8_t hpd_sel_to_atom(enum hpd_source_id id)
 {
        uint8_t atom_hpd_sel = 0;
@@ -207,51 +148,6 @@ static bool clock_source_id_to_atom(
        return result;
 }
 
-static bool engine_bp_to_atom(enum engine_id id, uint32_t *atom_engine_id)
-{
-       bool result = false;
-
-       if (atom_engine_id != NULL)
-               switch (id) {
-               case ENGINE_ID_DIGA:
-                       *atom_engine_id = ASIC_INT_DIG1_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGB:
-                       *atom_engine_id = ASIC_INT_DIG2_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGC:
-                       *atom_engine_id = ASIC_INT_DIG3_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGD:
-                       *atom_engine_id = ASIC_INT_DIG4_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGE:
-                       *atom_engine_id = ASIC_INT_DIG5_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGF:
-                       *atom_engine_id = ASIC_INT_DIG6_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGG:
-                       *atom_engine_id = ASIC_INT_DIG7_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DACA:
-                       *atom_engine_id = ASIC_INT_DAC1_ENCODER_ID;
-                       result = true;
-                       break;
-               default:
-                       break;
-               }
-
-       return result;
-}
-
 static uint8_t encoder_action_to_atom(enum bp_encoder_control_action action)
 {
        uint8_t atom_action = 0;
diff --git 
a/drivers/gpu/drm/amd/display/dc/bios/dce112/command_table_helper2_dce112.c 
b/drivers/gpu/drm/amd/display/dc/bios/dce112/command_table_helper2_dce112.c
index 755b6e33140a..349f0e5d5856 100644
--- a/drivers/gpu/drm/amd/display/dc/bios/dce112/command_table_helper2_dce112.c
+++ b/drivers/gpu/drm/amd/display/dc/bios/dce112/command_table_helper2_dce112.c
@@ -29,40 +29,9 @@
 
 #include "include/bios_parser_types.h"
 
-#include "../command_table_helper2.h"
-
-static uint8_t phy_id_to_atom(enum transmitter t)
-{
-       uint8_t atom_phy_id;
+#include "../command_table_helper.h"
 
-       switch (t) {
-       case TRANSMITTER_UNIPHY_A:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYA;
-               break;
-       case TRANSMITTER_UNIPHY_B:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYB;
-               break;
-       case TRANSMITTER_UNIPHY_C:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYC;
-               break;
-       case TRANSMITTER_UNIPHY_D:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYD;
-               break;
-       case TRANSMITTER_UNIPHY_E:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYE;
-               break;
-       case TRANSMITTER_UNIPHY_F:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYF;
-               break;
-       case TRANSMITTER_UNIPHY_G:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYG;
-               break;
-       default:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYA;
-               break;
-       }
-       return atom_phy_id;
-}
+#include "../command_table_helper2.h"
 
 static uint8_t signal_type_to_atom_dig_mode(enum signal_type s)
 {
@@ -91,32 +60,6 @@ static uint8_t signal_type_to_atom_dig_mode(enum signal_type 
s)
        return atom_dig_mode;
 }
 
-static uint8_t clock_source_id_to_atom_phy_clk_src_id(
-               enum clock_source_id id)
-{
-       uint8_t atom_phy_clk_src_id = 0;
-
-       switch (id) {
-       case CLOCK_SOURCE_ID_PLL0:
-               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P0PLL;
-               break;
-       case CLOCK_SOURCE_ID_PLL1:
-               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P1PLL;
-               break;
-       case CLOCK_SOURCE_ID_PLL2:
-               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P2PLL;
-               break;
-       case CLOCK_SOURCE_ID_EXTERNAL:
-               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_REFCLK_SRC_EXT;
-               break;
-       default:
-               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P1PLL;
-               break;
-       }
-
-       return atom_phy_clk_src_id >> 2;
-}
-
 static uint8_t hpd_sel_to_atom(enum hpd_source_id id)
 {
        uint8_t atom_hpd_sel = 0;
@@ -209,51 +152,6 @@ static bool clock_source_id_to_atom(
        return result;
 }
 
-static bool engine_bp_to_atom(enum engine_id id, uint32_t *atom_engine_id)
-{
-       bool result = false;
-
-       if (atom_engine_id != NULL)
-               switch (id) {
-               case ENGINE_ID_DIGA:
-                       *atom_engine_id = ASIC_INT_DIG1_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGB:
-                       *atom_engine_id = ASIC_INT_DIG2_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGC:
-                       *atom_engine_id = ASIC_INT_DIG3_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGD:
-                       *atom_engine_id = ASIC_INT_DIG4_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGE:
-                       *atom_engine_id = ASIC_INT_DIG5_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGF:
-                       *atom_engine_id = ASIC_INT_DIG6_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGG:
-                       *atom_engine_id = ASIC_INT_DIG7_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DACA:
-                       *atom_engine_id = ASIC_INT_DAC1_ENCODER_ID;
-                       result = true;
-                       break;
-               default:
-                       break;
-               }
-
-       return result;
-}
-
 static uint8_t encoder_action_to_atom(enum bp_encoder_control_action action)
 {
        uint8_t atom_action = 0;
diff --git 
a/drivers/gpu/drm/amd/display/dc/bios/dce112/command_table_helper_dce112.c 
b/drivers/gpu/drm/amd/display/dc/bios/dce112/command_table_helper_dce112.c
index 06b4f7fa4a50..1a5fefcde8af 100644
--- a/drivers/gpu/drm/amd/display/dc/bios/dce112/command_table_helper_dce112.c
+++ b/drivers/gpu/drm/amd/display/dc/bios/dce112/command_table_helper_dce112.c
@@ -31,39 +31,6 @@
 
 #include "../command_table_helper.h"
 
-static uint8_t phy_id_to_atom(enum transmitter t)
-{
-       uint8_t atom_phy_id;
-
-       switch (t) {
-       case TRANSMITTER_UNIPHY_A:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYA;
-               break;
-       case TRANSMITTER_UNIPHY_B:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYB;
-               break;
-       case TRANSMITTER_UNIPHY_C:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYC;
-               break;
-       case TRANSMITTER_UNIPHY_D:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYD;
-               break;
-       case TRANSMITTER_UNIPHY_E:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYE;
-               break;
-       case TRANSMITTER_UNIPHY_F:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYF;
-               break;
-       case TRANSMITTER_UNIPHY_G:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYG;
-               break;
-       default:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYA;
-               break;
-       }
-       return atom_phy_id;
-}
-
 static uint8_t signal_type_to_atom_dig_mode(enum signal_type s)
 {
        uint8_t atom_dig_mode = ATOM_TRANSMITTER_DIGMODE_V6_DP;
@@ -91,32 +58,6 @@ static uint8_t signal_type_to_atom_dig_mode(enum signal_type 
s)
        return atom_dig_mode;
 }
 
-static uint8_t clock_source_id_to_atom_phy_clk_src_id(
-               enum clock_source_id id)
-{
-       uint8_t atom_phy_clk_src_id = 0;
-
-       switch (id) {
-       case CLOCK_SOURCE_ID_PLL0:
-               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P0PLL;
-               break;
-       case CLOCK_SOURCE_ID_PLL1:
-               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P1PLL;
-               break;
-       case CLOCK_SOURCE_ID_PLL2:
-               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P2PLL;
-               break;
-       case CLOCK_SOURCE_ID_EXTERNAL:
-               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_REFCLK_SRC_EXT;
-               break;
-       default:
-               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P1PLL;
-               break;
-       }
-
-       return atom_phy_clk_src_id >> 2;
-}
-
 static uint8_t hpd_sel_to_atom(enum hpd_source_id id)
 {
        uint8_t atom_hpd_sel = 0;
@@ -209,51 +150,6 @@ static bool clock_source_id_to_atom(
        return result;
 }
 
-static bool engine_bp_to_atom(enum engine_id id, uint32_t *atom_engine_id)
-{
-       bool result = false;
-
-       if (atom_engine_id != NULL)
-               switch (id) {
-               case ENGINE_ID_DIGA:
-                       *atom_engine_id = ASIC_INT_DIG1_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGB:
-                       *atom_engine_id = ASIC_INT_DIG2_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGC:
-                       *atom_engine_id = ASIC_INT_DIG3_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGD:
-                       *atom_engine_id = ASIC_INT_DIG4_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGE:
-                       *atom_engine_id = ASIC_INT_DIG5_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGF:
-                       *atom_engine_id = ASIC_INT_DIG6_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGG:
-                       *atom_engine_id = ASIC_INT_DIG7_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DACA:
-                       *atom_engine_id = ASIC_INT_DAC1_ENCODER_ID;
-                       result = true;
-                       break;
-               default:
-                       break;
-               }
-
-       return result;
-}
-
 static uint8_t encoder_action_to_atom(enum bp_encoder_control_action action)
 {
        uint8_t atom_action = 0;
diff --git 
a/drivers/gpu/drm/amd/display/dc/bios/dce60/command_table_helper_dce60.c 
b/drivers/gpu/drm/amd/display/dc/bios/dce60/command_table_helper_dce60.c
index 710221b4f5c5..01ccc803040c 100644
--- a/drivers/gpu/drm/amd/display/dc/bios/dce60/command_table_helper_dce60.c
+++ b/drivers/gpu/drm/amd/display/dc/bios/dce60/command_table_helper_dce60.c
@@ -58,51 +58,6 @@ static uint8_t encoder_action_to_atom(enum 
bp_encoder_control_action action)
        return atom_action;
 }
 
-static bool engine_bp_to_atom(enum engine_id id, uint32_t *atom_engine_id)
-{
-       bool result = false;
-
-       if (atom_engine_id != NULL)
-               switch (id) {
-               case ENGINE_ID_DIGA:
-                       *atom_engine_id = ASIC_INT_DIG1_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGB:
-                       *atom_engine_id = ASIC_INT_DIG2_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGC:
-                       *atom_engine_id = ASIC_INT_DIG3_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGD:
-                       *atom_engine_id = ASIC_INT_DIG4_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGE:
-                       *atom_engine_id = ASIC_INT_DIG5_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGF:
-                       *atom_engine_id = ASIC_INT_DIG6_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGG:
-                       *atom_engine_id = ASIC_INT_DIG7_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DACA:
-                       *atom_engine_id = ASIC_INT_DAC1_ENCODER_ID;
-                       result = true;
-                       break;
-               default:
-                       break;
-               }
-
-       return result;
-}
-
 static bool clock_source_id_to_atom(
        enum clock_source_id id,
        uint32_t *atom_pll_id)
@@ -149,32 +104,6 @@ static bool clock_source_id_to_atom(
        return result;
 }
 
-static uint8_t clock_source_id_to_atom_phy_clk_src_id(
-               enum clock_source_id id)
-{
-       uint8_t atom_phy_clk_src_id = 0;
-
-       switch (id) {
-       case CLOCK_SOURCE_ID_PLL0:
-               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P0PLL;
-               break;
-       case CLOCK_SOURCE_ID_PLL1:
-               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P1PLL;
-               break;
-       case CLOCK_SOURCE_ID_PLL2:
-               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P2PLL;
-               break;
-       case CLOCK_SOURCE_ID_EXTERNAL:
-               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_REFCLK_SRC_EXT;
-               break;
-       default:
-               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P1PLL;
-               break;
-       }
-
-       return atom_phy_clk_src_id >> 2;
-}
-
 static uint8_t signal_type_to_atom_dig_mode(enum signal_type s)
 {
        uint8_t atom_dig_mode = ATOM_TRANSMITTER_DIGMODE_V5_DP;
@@ -270,39 +199,6 @@ static uint8_t dig_encoder_sel_to_atom(enum engine_id id)
        return atom_dig_encoder_sel;
 }
 
-static uint8_t phy_id_to_atom(enum transmitter t)
-{
-       uint8_t atom_phy_id;
-
-       switch (t) {
-       case TRANSMITTER_UNIPHY_A:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYA;
-               break;
-       case TRANSMITTER_UNIPHY_B:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYB;
-               break;
-       case TRANSMITTER_UNIPHY_C:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYC;
-               break;
-       case TRANSMITTER_UNIPHY_D:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYD;
-               break;
-       case TRANSMITTER_UNIPHY_E:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYE;
-               break;
-       case TRANSMITTER_UNIPHY_F:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYF;
-               break;
-       case TRANSMITTER_UNIPHY_G:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYG;
-               break;
-       default:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYA;
-               break;
-       }
-       return atom_phy_id;
-}
-
 static uint8_t disp_power_gating_action_to_atom(
        enum bp_pipe_control_action action)
 {
diff --git 
a/drivers/gpu/drm/amd/display/dc/bios/dce80/command_table_helper_dce80.c 
b/drivers/gpu/drm/amd/display/dc/bios/dce80/command_table_helper_dce80.c
index 8b30b558cf1f..2ec5264536c7 100644
--- a/drivers/gpu/drm/amd/display/dc/bios/dce80/command_table_helper_dce80.c
+++ b/drivers/gpu/drm/amd/display/dc/bios/dce80/command_table_helper_dce80.c
@@ -58,51 +58,6 @@ static uint8_t encoder_action_to_atom(enum 
bp_encoder_control_action action)
        return atom_action;
 }
 
-static bool engine_bp_to_atom(enum engine_id id, uint32_t *atom_engine_id)
-{
-       bool result = false;
-
-       if (atom_engine_id != NULL)
-               switch (id) {
-               case ENGINE_ID_DIGA:
-                       *atom_engine_id = ASIC_INT_DIG1_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGB:
-                       *atom_engine_id = ASIC_INT_DIG2_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGC:
-                       *atom_engine_id = ASIC_INT_DIG3_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGD:
-                       *atom_engine_id = ASIC_INT_DIG4_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGE:
-                       *atom_engine_id = ASIC_INT_DIG5_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGF:
-                       *atom_engine_id = ASIC_INT_DIG6_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DIGG:
-                       *atom_engine_id = ASIC_INT_DIG7_ENCODER_ID;
-                       result = true;
-                       break;
-               case ENGINE_ID_DACA:
-                       *atom_engine_id = ASIC_INT_DAC1_ENCODER_ID;
-                       result = true;
-                       break;
-               default:
-                       break;
-               }
-
-       return result;
-}
-
 static bool clock_source_id_to_atom(
        enum clock_source_id id,
        uint32_t *atom_pll_id)
@@ -149,32 +104,6 @@ static bool clock_source_id_to_atom(
        return result;
 }
 
-static uint8_t clock_source_id_to_atom_phy_clk_src_id(
-               enum clock_source_id id)
-{
-       uint8_t atom_phy_clk_src_id = 0;
-
-       switch (id) {
-       case CLOCK_SOURCE_ID_PLL0:
-               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P0PLL;
-               break;
-       case CLOCK_SOURCE_ID_PLL1:
-               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P1PLL;
-               break;
-       case CLOCK_SOURCE_ID_PLL2:
-               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P2PLL;
-               break;
-       case CLOCK_SOURCE_ID_EXTERNAL:
-               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_REFCLK_SRC_EXT;
-               break;
-       default:
-               atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P1PLL;
-               break;
-       }
-
-       return atom_phy_clk_src_id >> 2;
-}
-
 static uint8_t signal_type_to_atom_dig_mode(enum signal_type s)
 {
        uint8_t atom_dig_mode = ATOM_TRANSMITTER_DIGMODE_V5_DP;
@@ -270,39 +199,6 @@ static uint8_t dig_encoder_sel_to_atom(enum engine_id id)
        return atom_dig_encoder_sel;
 }
 
-static uint8_t phy_id_to_atom(enum transmitter t)
-{
-       uint8_t atom_phy_id;
-
-       switch (t) {
-       case TRANSMITTER_UNIPHY_A:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYA;
-               break;
-       case TRANSMITTER_UNIPHY_B:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYB;
-               break;
-       case TRANSMITTER_UNIPHY_C:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYC;
-               break;
-       case TRANSMITTER_UNIPHY_D:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYD;
-               break;
-       case TRANSMITTER_UNIPHY_E:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYE;
-               break;
-       case TRANSMITTER_UNIPHY_F:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYF;
-               break;
-       case TRANSMITTER_UNIPHY_G:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYG;
-               break;
-       default:
-               atom_phy_id = ATOM_PHY_ID_UNIPHYA;
-               break;
-       }
-       return atom_phy_id;
-}
-
 static uint8_t disp_power_gating_action_to_atom(
        enum bp_pipe_control_action action)
 {
-- 
2.43.0

Reply via email to