help
          Raven, Navi, and newer family support for display engine
 
-config DRM_AMD_DC_HDCP
-       bool "Enable HDCP support in DC"
-       depends on DRM_AMD_DC
-       help
-         Choose this option if you want to support HDCP authentication.
-
 config DRM_AMD_DC_SI
        bool "AMD DC support for Southern Islands ASICs"
        depends on DRM_AMDGPU_SI
 
 subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/modules/power
 subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/dmub/inc
 
-ifdef CONFIG_DRM_AMD_DC_HDCP
 subdir-ccflags-y += -I$(FULL_AMD_DISPLAY_PATH)/modules/hdcp
-endif
 
 #TODO: remove when Timing Sync feature is complete
 subdir-ccflags-y += -DBUILD_FEATURE_TIMING_SYNC=0
 
 DAL_LIBS = amdgpu_dm dc        modules/freesync modules/color modules/info_packet modules/power dmub/src
 
-ifdef CONFIG_DRM_AMD_DC_HDCP
 DAL_LIBS += modules/hdcp
-endif
 
 AMD_DAL = $(addsuffix /Makefile, $(addprefix $(FULL_AMD_DISPLAY_PATH)/,$(DAL_LIBS)))
 
 
 AMDGPUDM += amdgpu_dm_services.o amdgpu_dm_helpers.o amdgpu_dm_pp_smu.o amdgpu_dm_psr.o
 endif
 
-ifdef CONFIG_DRM_AMD_DC_HDCP
 AMDGPUDM += amdgpu_dm_hdcp.o
-endif
 
 ifneq ($(CONFIG_DEBUG_FS),)
 AMDGPUDM += amdgpu_dm_crc.o amdgpu_dm_debugfs.o
 
 #include "amdgpu_dm.h"
 #include "amdgpu_dm_plane.h"
 #include "amdgpu_dm_crtc.h"
-#ifdef CONFIG_DRM_AMD_DC_HDCP
 #include "amdgpu_dm_hdcp.h"
 #include <drm/display/drm_hdcp_helper.h>
-#endif
 #include "amdgpu_pm.h"
 #include "amdgpu_atombios.h"
 
 static int amdgpu_dm_init(struct amdgpu_device *adev)
 {
        struct dc_init_data init_data;
-#ifdef CONFIG_DRM_AMD_DC_HDCP
        struct dc_callback_init init_params;
-#endif
        int r;
 
        adev->dm.ddev = adev_to_drm(adev);
 
        /* Zero all the fields */
        memset(&init_data, 0, sizeof(init_data));
-#ifdef CONFIG_DRM_AMD_DC_HDCP
        memset(&init_params, 0, sizeof(init_params));
-#endif
 
        mutex_init(&adev->dm.dpia_aux_lock);
        mutex_init(&adev->dm.dc_lock);
                        DRM_ERROR("amdgpu: failed to initialize vblank_workqueue.\n");
        }
 
-#ifdef CONFIG_DRM_AMD_DC_HDCP
        if (adev->dm.dc->caps.max_links > 0 && adev->family >= AMDGPU_FAMILY_RV) {
                adev->dm.hdcp_workqueue = hdcp_create_workqueue(adev, &init_params.cp_psp, adev->dm.dc);
 
 
                dc_init_callbacks(adev->dm.dc, &init_params);
        }
-#endif
 #if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
        adev->dm.secure_display_ctxs = amdgpu_dm_crtc_secure_display_create_contexts(adev);
        if (!adev->dm.secure_display_ctxs) {
                adev->dm.secure_display_ctxs = NULL;
        }
 #endif
-#ifdef CONFIG_DRM_AMD_DC_HDCP
        if (adev->dm.hdcp_workqueue) {
                hdcp_destroy(&adev->dev->kobj, adev->dm.hdcp_workqueue);
                adev->dm.hdcp_workqueue = NULL;
 
        if (adev->dm.dc)
                dc_deinit_callbacks(adev->dm.dc);
-#endif
 
        dc_dmub_srv_destroy(&adev->dm.dc->ctx->dmub_srv);
 
                aconnector->edid = NULL;
                kfree(aconnector->timing_requested);
                aconnector->timing_requested = NULL;
-#ifdef CONFIG_DRM_AMD_DC_HDCP
                /* Set CP to DESIRED if it was ENABLED, so we can re-enable it again on hotplug */
                if (connector->state->content_protection == DRM_MODE_CONTENT_PROTECTION_ENABLED)
                        connector->state->content_protection = DRM_MODE_CONTENT_PROTECTION_DESIRED;
-#endif
        }
 
        mutex_unlock(&dev->mode_config.mutex);
        struct drm_device *dev = connector->dev;
        enum dc_connection_type new_connection_type = dc_connection_none;
        struct amdgpu_device *adev = drm_to_adev(dev);
-#ifdef CONFIG_DRM_AMD_DC_HDCP
        struct dm_connector_state *dm_con_state = to_dm_connector_state(connector->state);
-#endif
        bool ret = false;
 
        if (adev->dm.disable_hpd_irq)
         */
        mutex_lock(&aconnector->hpd_lock);
 
-#ifdef CONFIG_DRM_AMD_DC_HDCP
        if (adev->dm.hdcp_workqueue) {
                hdcp_reset_display(adev->dm.hdcp_workqueue, aconnector->dc_link->link_index);
                dm_con_state->update_hdcp = true;
        }
-#endif
        if (aconnector->fake_enable)
                aconnector->fake_enable = false;
 
                        }
                }
        }
-#ifdef CONFIG_DRM_AMD_DC_HDCP
        if (hpd_irq_data.bytes.device_service_irq.bits.CP_IRQ) {
                if (adev->dm.hdcp_workqueue)
                        hdcp_handle_cpirq(adev->dm.hdcp_workqueue,  aconnector->base.index);
        }
-#endif
 
        if (dc_link->type != dc_connection_mst_branch)
                drm_dp_cec_irq(&aconnector->dm_dp_aux.aux);
                if (!aconnector->mst_root)
                        drm_connector_attach_vrr_capable_property(&aconnector->base);
 
-#ifdef CONFIG_DRM_AMD_DC_HDCP
                if (adev->dm.hdcp_workqueue)
                        drm_connector_attach_content_protection_property(&aconnector->base, true);
-#endif
        }
 }
 
        return false;
 }
 
-#ifdef CONFIG_DRM_AMD_DC_HDCP
 static bool is_content_protection_different(struct drm_crtc_state *new_crtc_state,
                                            struct drm_crtc_state *old_crtc_state,
                                            struct drm_connector_state *new_conn_state,
        pr_debug("[HDCP_DM] DESIRED->ENABLED %s :false\n", __func__);
        return false;
 }
-#endif
 
 static void remove_stream(struct amdgpu_device *adev,
                          struct amdgpu_crtc *acrtc,
                                acrtc->otg_inst = status->primary_otg_inst;
                }
        }
-#ifdef CONFIG_DRM_AMD_DC_HDCP
        for_each_oldnew_connector_in_state(state, connector, old_con_state, new_con_state, i) {
                struct dm_connector_state *dm_new_con_state = to_dm_connector_state(new_con_state);
                struct amdgpu_crtc *acrtc = to_amdgpu_crtc(dm_new_con_state->base.crtc);
                                new_con_state->hdcp_content_type, enable_encryption);
                }
        }
-#endif
 
        /* Handle connector state changes */
        for_each_oldnew_connector_in_state(state, connector, old_con_state, new_con_state, i) {
 
        struct amdgpu_dm_backlight_caps backlight_caps[AMDGPU_DM_MAX_NUM_EDP];
 
        struct mod_freesync *freesync_module;
-#ifdef CONFIG_DRM_AMD_DC_HDCP
        struct hdcp_workqueue *hdcp_workqueue;
-#endif
 
        /**
         * @vblank_control_workqueue:
        uint8_t underscan_hborder;
        bool underscan_enable;
        bool freesync_capable;
-#ifdef CONFIG_DRM_AMD_DC_HDCP
        bool update_hdcp;
-#endif
        uint8_t abm_level;
        int vcpi_slots;
        uint64_t pbn;
 
        return 0;
 }
 
-#ifdef CONFIG_DRM_AMD_DC_HDCP
 /*
  * Returns the HDCP capability of the Display (1.4 for now).
  *
 
        return 0;
 }
-#endif
 
 /*
  * Returns whether the connected display is internal and not hotpluggable.
 DEFINE_SHOW_ATTRIBUTE(dmub_fw_state);
 DEFINE_SHOW_ATTRIBUTE(dmub_tracebuffer);
 DEFINE_SHOW_ATTRIBUTE(dp_lttpr_status);
-#ifdef CONFIG_DRM_AMD_DC_HDCP
 DEFINE_SHOW_ATTRIBUTE(hdcp_sink_capability);
-#endif
 DEFINE_SHOW_ATTRIBUTE(internal_display);
 DEFINE_SHOW_ATTRIBUTE(psr_capability);
 DEFINE_SHOW_ATTRIBUTE(dp_is_mst_connector);
                {"phy_settings", &dp_phy_settings_debugfs_fop},
                {"lttpr_status", &dp_lttpr_status_fops},
                {"test_pattern", &dp_phy_test_pattern_fops},
-#ifdef CONFIG_DRM_AMD_DC_HDCP
                {"hdcp_sink_capability", &hdcp_sink_capability_fops},
-#endif
                {"sdp_message", &sdp_message_fops},
                {"aux_dpcd_address", &dp_dpcd_address_debugfs_fops},
                {"aux_dpcd_size", &dp_dpcd_size_debugfs_fops},
                {"is_dpia_link", &is_dpia_link_fops}
 };
 
-#ifdef CONFIG_DRM_AMD_DC_HDCP
 static const struct {
        char *name;
        const struct file_operations *fops;
 } hdmi_debugfs_entries[] = {
                {"hdcp_sink_capability", &hdcp_sink_capability_fops}
 };
-#endif
+
 /*
  * Force YUV420 output if available from the given mode
  */
        connector->debugfs_dpcd_address = 0;
        connector->debugfs_dpcd_size = 0;
 
-#ifdef CONFIG_DRM_AMD_DC_HDCP
        if (connector->base.connector_type == DRM_MODE_CONNECTOR_HDMIA) {
                for (i = 0; i < ARRAY_SIZE(hdmi_debugfs_entries); i++) {
                        debugfs_create_file(hdmi_debugfs_entries[i].name,
                                            hdmi_debugfs_entries[i].fops);
                }
        }
-#endif
 }
 
 #ifdef CONFIG_DRM_AMD_SECURE_DISPLAY
 
 #include "amdgpu.h"
 #include "amdgpu_dm.h"
 #include "amdgpu_dm_mst_types.h"
-
-#ifdef CONFIG_DRM_AMD_DC_HDCP
 #include "amdgpu_dm_hdcp.h"
-#endif
 
 #include "dc.h"
 #include "dm_helpers.h"
                 * plugged back with same display index, its hdcp properties
                 * will be retrieved from hdcp_work within dm_dp_mst_get_modes
                 */
-#ifdef CONFIG_DRM_AMD_DC_HDCP
                if (aconnector->dc_sink && connector->state) {
                        struct drm_device *dev = connector->dev;
                        struct amdgpu_device *adev = drm_to_adev(dev);
                        connector->state->content_protection =
                        hdcp_w->content_protection[connector->index];
                }
-#endif
 
                if (aconnector->dc_sink) {
                        amdgpu_dm_update_freesync_caps(
 
 DC_LIBS += dce60
 endif
 
-ifdef CONFIG_DRM_AMD_DC_HDCP
 DC_LIBS += hdcp
-endif
 
 AMD_DC = $(addsuffix /Makefile, $(addprefix $(FULL_AMD_DISPLAY_PATH)/dc/,$(DC_LIBS)))
 
 
 void dc_init_callbacks(struct dc *dc,
                const struct dc_callback_init *init_params)
 {
-#ifdef CONFIG_DRM_AMD_DC_HDCP
        dc->ctx->cp_psp = init_params->cp_psp;
-#endif
 }
 
 void dc_deinit_callbacks(struct dc *dc)
 {
-#ifdef CONFIG_DRM_AMD_DC_HDCP
        memset(&dc->ctx->cp_psp, 0, sizeof(dc->ctx->cp_psp));
-#endif
 }
 
 void dc_destroy(struct dc **dc)
 
 {
        return link_get_status(link);
 }
-#ifdef CONFIG_DRM_AMD_DC_HDCP
 
 /* return true if the connected receiver supports the hdcp version */
 bool dc_link_is_hdcp14(struct dc_link *link, enum signal_type signal)
 {
        return link_is_hdcp22(link, signal);
 }
-#endif
 
 void dc_link_clear_dprx_states(struct dc_link *link)
 {
 
 #include "dc_types.h"
 #include "grph_object_defs.h"
 #include "logger_types.h"
-#if defined(CONFIG_DRM_AMD_DC_HDCP)
-#include "hdcp_types.h"
-#endif
+#include "hdcp_msg_types.h"
 #include "gpio_types.h"
 #include "link_service_types.h"
 #include "grph_object_ctrl_defs.h"
 };
 
 struct dc_callback_init {
-#ifdef CONFIG_DRM_AMD_DC_HDCP
        struct cp_psp cp_psp;
-#else
-       uint8_t reserved;
-#endif
 };
 
 struct dc *dc_create(const struct dc_init_data *init_params);
        uint32_t dongle_max_pix_clk;
        unsigned short chip_caps;
        unsigned int dpcd_sink_count;
-#if defined(CONFIG_DRM_AMD_DC_HDCP)
        struct hdcp_caps hdcp_caps;
-#endif
        enum edp_revision edp_revision;
        union dpcd_sink_ext_caps dpcd_sink_ext_caps;
 
        size_t slave_address
 );
 
-#ifdef CONFIG_DRM_AMD_DC_HDCP
-
 /* return true if the connected receiver supports the hdcp version */
 bool dc_link_is_hdcp14(struct dc_link *link, enum signal_type signal);
 bool dc_link_is_hdcp22(struct dc_link *link, enum signal_type signal);
-#endif
 
 /* Notify DC about DP RX Interrupt (aka DP IRQ_HPD).
  *
 
 void dc_power_down_on_boot(struct dc *dc);
 
-#if defined(CONFIG_DRM_AMD_DC_HDCP)
 /*
  * HDCP Interfaces
  */
                enum signal_type signal,
                struct dc_link *link,
                struct hdcp_protection_message *message_info);
-#endif
 bool dc_is_dmcu_initialized(struct dc *dc);
 
 enum dc_status dc_set_clock(struct dc *dc, enum dc_clock_type clock_type, uint32_t clk_khz, uint32_t stepping);
 
 #include "grph_object_defs.h"
 #include "grph_object_ctrl_defs.h"
 
-#ifdef CONFIG_DRM_AMD_DC_HDCP
 #include "dm_cp_psp.h"
-#endif
 
 /* forward declarations */
 struct dc_plane_state;
        uint32_t dc_edp_id_count;
        uint64_t fbc_gpu_addr;
        struct dc_dmub_srv *dmub_srv;
-#ifdef CONFIG_DRM_AMD_DC_HDCP
        struct cp_psp cp_psp;
-#endif
        uint32_t *dcn_reg_offsets;
        uint32_t *nbio_reg_offsets;
 };
        struct dpcd_caps *dpcd_caps;
 };
 
-#if defined(CONFIG_DRM_AMD_DC_HDCP)
 union hdcp_rx_caps {
        struct {
                uint8_t version;
        union hdcp_rx_caps rx_caps;
        union hdcp_bcaps bcaps;
 };
-#endif
 
 /* DP MST stream allocation (payload bandwidth number) */
 struct link_mst_stream_allocation {
 
                HDMI_GC_SEND, 1,
                HDMI_NULL_SEND, 1);
 
-#if defined(CONFIG_DRM_AMD_DC_HDCP)
        /* Disable Audio Content Protection packet transmission */
        REG_UPDATE(HDMI_VBI_PACKET_CONTROL, HDMI_ACP_SEND, 0);
-#endif
 
        /* following belongs to audio */
        /* Enable Audio InfoFrame packet transmission. */
 
 
 #include "dm_services.h"
 #include "dm_helpers.h"
-#include "include/hdcp_types.h"
+#include "include/hdcp_msg_types.h"
 #include "include/signal_types.h"
 #include "core_types.h"
 #include "link.h"
 
 #include "clock_source.h"
 #include "audio.h"
 #include "dm_pp_smu.h"
-#ifdef CONFIG_DRM_AMD_DC_HDCP
 #include "dm_cp_psp.h"
-#endif
 #include "link_hwss.h"
 
 /********** DAL Core*********************/
 
 bool link_detect_connection_type(struct dc_link *link,
                enum dc_connection_type *type);
 const struct dc_link_status *link_get_status(const struct dc_link *link);
-#ifdef CONFIG_DRM_AMD_DC_HDCP
 /* return true if the connected receiver supports the hdcp version */
 bool link_is_hdcp14(struct dc_link *link, enum signal_type signal);
 bool link_is_hdcp22(struct dc_link *link, enum signal_type signal);
-#endif
 void link_clear_dprx_states(struct dc_link *link);
 bool link_reset_cur_dp_mst_topology(struct dc_link *link);
 uint32_t dp_link_bandwidth_kbps(
 
        link->local_sink = prev_sink;
 }
 
-#if defined(CONFIG_DRM_AMD_DC_HDCP)
 static void query_hdcp_capability(enum signal_type signal, struct dc_link *link)
 {
        struct hdcp_protection_message msg22;
        }
 
 }
-#endif // CONFIG_DRM_AMD_DC_HDCP
 static void read_current_link_settings_on_detect(struct dc_link *link)
 {
        union lane_count_set lane_count_set = {0};
                         * TODO debug why certain monitors don't like
                         *  two link trainings
                         */
-#if defined(CONFIG_DRM_AMD_DC_HDCP)
                        query_hdcp_capability(sink->sink_signal, link);
-#endif
                } else {
                        // If edid is the same, then discard new sink and revert back to original sink
                        if (same_edid) {
                                sink = prev_sink;
                                prev_sink = NULL;
                        }
-#if defined(CONFIG_DRM_AMD_DC_HDCP)
                        query_hdcp_capability(sink->sink_signal, link);
-#endif
                }
 
                /* HDMI-DVI Dongle */
                /* From Connected-to-Disconnected. */
                link->type = dc_connection_none;
                sink_caps.signal = SIGNAL_TYPE_NONE;
-#if defined(CONFIG_DRM_AMD_DC_HDCP)
                memset(&link->hdcp_caps, 0, sizeof(struct hdcp_caps));
-#endif
                /* When we unplug a passive DP-HDMI dongle connection, dongle_max_pix_clk
                 *  is not cleared. If we emulate a DP signal on this connection, it thinks
                 *  the dongle is still there and limits the number of modes we can emulate.
 {
        memset(&link->dprx_states, 0, sizeof(link->dprx_states));
 }
-#if defined(CONFIG_DRM_AMD_DC_HDCP)
 
 bool link_is_hdcp14(struct dc_link *link, enum signal_type signal)
 {
 
        return ret;
 }
-#endif // CONFIG_DRM_AMD_DC_HDCP
 
 const struct dc_link_status *link_get_status(const struct dc_link *link)
 {
 
        if (!i2c_success)
                DC_LOG_DEBUG("Set redriver failed");
 }
-#if defined(CONFIG_DRM_AMD_DC_HDCP)
 
 static void update_psp_stream_config(struct pipe_ctx *pipe_ctx, bool dpms_off)
 {
 
        cp_psp->funcs.update_stream_config(cp_psp->handle, &config);
 }
-#endif
 
 static void set_avmute(struct pipe_ctx *pipe_ctx, bool enable)
 {
 
        dc->hwss.disable_audio_stream(pipe_ctx);
 
-#if defined(CONFIG_DRM_AMD_DC_HDCP)
        update_psp_stream_config(pipe_ctx, true);
-#endif
        dc->hwss.blank_stream(pipe_ctx);
 
        if (pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST)
                                dc->hwss.enable_audio_stream(pipe_ctx);
                        }
 
-#if defined(CONFIG_DRM_AMD_DC_HDCP)
                        update_psp_stream_config(pipe_ctx, false);
-#endif
                        return;
                }
 
                                        !pipe_ctx->stream->timing.flags.DSC &&
                                        !pipe_ctx->next_odm_pipe) {
                        pipe_ctx->stream->dpms_off = false;
-#if defined(CONFIG_DRM_AMD_DC_HDCP)
                        update_psp_stream_config(pipe_ctx, false);
-#endif
                        return;
                }
 
 
                if (dc_is_dp_signal(pipe_ctx->stream->signal))
                        enable_stream_features(pipe_ctx);
-#if defined(CONFIG_DRM_AMD_DC_HDCP)
                update_psp_stream_config(pipe_ctx, false);
-#endif
 
                dc->hwss.enable_audio_stream(pipe_ctx);
 
 
                        msleep(delay_dp_power_up_in_ms);
                }
 
-#ifdef CONFIG_DRM_AMD_DC_HDCP
                if (panel_mode == DP_PANEL_MODE_EDP) {
                        struct cp_psp *cp_psp = &stream->ctx->cp_psp;
 
                                result = cp_psp->funcs.enable_assr(cp_psp->handle, link);
                        }
                }
-#endif
 
                dp_set_panel_mode(link, panel_mode);
 
 
--- /dev/null
+/*
+* Copyright 2019 Advanced Micro Devices, Inc.
+*
+* Permission is hereby granted, free of charge, to any person obtaining a
+* copy of this software and associated documentation files (the "Software"),
+* to deal in the Software without restriction, including without limitation
+* the rights to use, copy, modify, merge, publish, distribute, sublicense,
+* and/or sell copies of the Software, and to permit persons to whom the
+* Software is furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+* OTHER DEALINGS IN THE SOFTWARE.
+*
+* Authors: AMD
+*
+*/
+
+#ifndef __DC_HDCP_TYPES_H__
+#define __DC_HDCP_TYPES_H__
+
+enum hdcp_message_id {
+       HDCP_MESSAGE_ID_INVALID = -1,
+
+       /* HDCP 1.4 */
+
+       HDCP_MESSAGE_ID_READ_BKSV = 0,
+       /* HDMI is called Ri', DP is called R0' */
+       HDCP_MESSAGE_ID_READ_RI_R0,
+       HDCP_MESSAGE_ID_READ_PJ,
+       HDCP_MESSAGE_ID_WRITE_AKSV,
+       HDCP_MESSAGE_ID_WRITE_AINFO,
+       HDCP_MESSAGE_ID_WRITE_AN,
+       HDCP_MESSAGE_ID_READ_VH_X,
+       HDCP_MESSAGE_ID_READ_VH_0,
+       HDCP_MESSAGE_ID_READ_VH_1,
+       HDCP_MESSAGE_ID_READ_VH_2,
+       HDCP_MESSAGE_ID_READ_VH_3,
+       HDCP_MESSAGE_ID_READ_VH_4,
+       HDCP_MESSAGE_ID_READ_BCAPS,
+       HDCP_MESSAGE_ID_READ_BSTATUS,
+       HDCP_MESSAGE_ID_READ_KSV_FIFO,
+       HDCP_MESSAGE_ID_READ_BINFO,
+
+       /* HDCP 2.2 */
+
+       HDCP_MESSAGE_ID_HDCP2VERSION,
+       HDCP_MESSAGE_ID_RX_CAPS,
+       HDCP_MESSAGE_ID_WRITE_AKE_INIT,
+       HDCP_MESSAGE_ID_READ_AKE_SEND_CERT,
+       HDCP_MESSAGE_ID_WRITE_AKE_NO_STORED_KM,
+       HDCP_MESSAGE_ID_WRITE_AKE_STORED_KM,
+       HDCP_MESSAGE_ID_READ_AKE_SEND_H_PRIME,
+       HDCP_MESSAGE_ID_READ_AKE_SEND_PAIRING_INFO,
+       HDCP_MESSAGE_ID_WRITE_LC_INIT,
+       HDCP_MESSAGE_ID_READ_LC_SEND_L_PRIME,
+       HDCP_MESSAGE_ID_WRITE_SKE_SEND_EKS,
+       HDCP_MESSAGE_ID_READ_REPEATER_AUTH_SEND_RECEIVERID_LIST,
+       HDCP_MESSAGE_ID_WRITE_REPEATER_AUTH_SEND_ACK,
+       HDCP_MESSAGE_ID_WRITE_REPEATER_AUTH_STREAM_MANAGE,
+       HDCP_MESSAGE_ID_READ_REPEATER_AUTH_STREAM_READY,
+       HDCP_MESSAGE_ID_READ_RXSTATUS,
+       HDCP_MESSAGE_ID_WRITE_CONTENT_STREAM_TYPE,
+
+       HDCP_MESSAGE_ID_MAX
+};
+
+enum hdcp_version {
+       HDCP_Unknown = 0,
+       HDCP_VERSION_14,
+       HDCP_VERSION_22,
+};
+
+enum hdcp_link {
+       HDCP_LINK_PRIMARY,
+       HDCP_LINK_SECONDARY
+};
+
+enum hdcp_message_status {
+       HDCP_MESSAGE_SUCCESS,
+       HDCP_MESSAGE_FAILURE,
+       HDCP_MESSAGE_UNSUPPORTED
+};
+
+struct hdcp_protection_message {
+       enum hdcp_version version;
+       /* relevant only for DVI */
+       enum hdcp_link link;
+       enum hdcp_message_id msg_id;
+       uint32_t length;
+       uint8_t max_retries;
+       uint8_t *data;
+       enum hdcp_message_status status;
+};
+
+#endif
 
+++ /dev/null
-/*
-* Copyright 2019 Advanced Micro Devices, Inc.
-*
-* Permission is hereby granted, free of charge, to any person obtaining a
-* copy of this software and associated documentation files (the "Software"),
-* to deal in the Software without restriction, including without limitation
-* the rights to use, copy, modify, merge, publish, distribute, sublicense,
-* and/or sell copies of the Software, and to permit persons to whom the
-* Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in
-* all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
-* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-* OTHER DEALINGS IN THE SOFTWARE.
-*
-* Authors: AMD
-*
-*/
-
-#ifndef __DC_HDCP_TYPES_H__
-#define __DC_HDCP_TYPES_H__
-
-enum hdcp_message_id {
-       HDCP_MESSAGE_ID_INVALID = -1,
-
-       /* HDCP 1.4 */
-
-       HDCP_MESSAGE_ID_READ_BKSV = 0,
-       /* HDMI is called Ri', DP is called R0' */
-       HDCP_MESSAGE_ID_READ_RI_R0,
-       HDCP_MESSAGE_ID_READ_PJ,
-       HDCP_MESSAGE_ID_WRITE_AKSV,
-       HDCP_MESSAGE_ID_WRITE_AINFO,
-       HDCP_MESSAGE_ID_WRITE_AN,
-       HDCP_MESSAGE_ID_READ_VH_X,
-       HDCP_MESSAGE_ID_READ_VH_0,
-       HDCP_MESSAGE_ID_READ_VH_1,
-       HDCP_MESSAGE_ID_READ_VH_2,
-       HDCP_MESSAGE_ID_READ_VH_3,
-       HDCP_MESSAGE_ID_READ_VH_4,
-       HDCP_MESSAGE_ID_READ_BCAPS,
-       HDCP_MESSAGE_ID_READ_BSTATUS,
-       HDCP_MESSAGE_ID_READ_KSV_FIFO,
-       HDCP_MESSAGE_ID_READ_BINFO,
-
-       /* HDCP 2.2 */
-
-       HDCP_MESSAGE_ID_HDCP2VERSION,
-       HDCP_MESSAGE_ID_RX_CAPS,
-       HDCP_MESSAGE_ID_WRITE_AKE_INIT,
-       HDCP_MESSAGE_ID_READ_AKE_SEND_CERT,
-       HDCP_MESSAGE_ID_WRITE_AKE_NO_STORED_KM,
-       HDCP_MESSAGE_ID_WRITE_AKE_STORED_KM,
-       HDCP_MESSAGE_ID_READ_AKE_SEND_H_PRIME,
-       HDCP_MESSAGE_ID_READ_AKE_SEND_PAIRING_INFO,
-       HDCP_MESSAGE_ID_WRITE_LC_INIT,
-       HDCP_MESSAGE_ID_READ_LC_SEND_L_PRIME,
-       HDCP_MESSAGE_ID_WRITE_SKE_SEND_EKS,
-       HDCP_MESSAGE_ID_READ_REPEATER_AUTH_SEND_RECEIVERID_LIST,
-       HDCP_MESSAGE_ID_WRITE_REPEATER_AUTH_SEND_ACK,
-       HDCP_MESSAGE_ID_WRITE_REPEATER_AUTH_STREAM_MANAGE,
-       HDCP_MESSAGE_ID_READ_REPEATER_AUTH_STREAM_READY,
-       HDCP_MESSAGE_ID_READ_RXSTATUS,
-       HDCP_MESSAGE_ID_WRITE_CONTENT_STREAM_TYPE,
-
-       HDCP_MESSAGE_ID_MAX
-};
-
-enum hdcp_version {
-       HDCP_Unknown = 0,
-       HDCP_VERSION_14,
-       HDCP_VERSION_22,
-};
-
-enum hdcp_link {
-       HDCP_LINK_PRIMARY,
-       HDCP_LINK_SECONDARY
-};
-
-enum hdcp_message_status {
-       HDCP_MESSAGE_SUCCESS,
-       HDCP_MESSAGE_FAILURE,
-       HDCP_MESSAGE_UNSUPPORTED
-};
-
-struct hdcp_protection_message {
-       enum hdcp_version version;
-       /* relevant only for DVI */
-       enum hdcp_link link;
-       enum hdcp_message_id msg_id;
-       uint32_t length;
-       uint8_t max_retries;
-       uint8_t *data;
-       enum hdcp_message_status status;
-};
-
-#endif
 
 #ifndef MOD_HDCP_LOG_H_
 #define MOD_HDCP_LOG_H_
 
-#ifdef CONFIG_DRM_AMD_DC_HDCP
 #define HDCP_LOG_ERR(hdcp, ...) DRM_DEBUG_KMS(__VA_ARGS__)
 #define HDCP_LOG_VER(hdcp, ...) DRM_DEBUG_KMS(__VA_ARGS__)
 #define HDCP_LOG_FSM(hdcp, ...) DRM_DEBUG_KMS(__VA_ARGS__)
 #define HDCP_LOG_TOP(hdcp, ...) pr_debug("[HDCP_TOP]:"__VA_ARGS__)
 #define HDCP_LOG_DDC(hdcp, ...) pr_debug("[HDCP_DDC]:"__VA_ARGS__)
-#endif
 
 /* default logs */
 #define HDCP_ERROR_TRACE(hdcp, status) \