# SPDX-License-Identifier: LGPL-2.1-only OR BSD-3-Clause */
##########################################################################
#
# This file is provided under a dual license.  When you use or
# distribute this software, you may choose to be licensed under
# version 2.1 of the GNU Lesser General Public License
# ("LGPLv2.1 License") or BSD License.
#
# LGPLv2.1 License
#
# Copyright(C) 2019 MediaTek Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html for more
# details.
#
# BSD LICENSE
#
# Copyright(C) 2019 MediaTek Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
#  * Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#  * Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in
#    the documentation and/or other materials provided with the
#    distribution.
#  * Neither the name of the copyright holder nor the names of its
#    contributors may be used to endorse or promote products derived
#    from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
###########################################################################


#DEFINES += -DCC_CLI_PERMISSION=CLI_SUPERVISOR

# Configure Crystal and Demod
#DEFINES += -DCC_SONYDEMOD_CXD2842
#DEFINES += -DSONY_DEMOD_CRYSTAL_41M

DEFINES += -DSUPPORT_USB30
ifeq "$(CDC_DUMP_SUPPORT)" "true"
DEFINES += -DCC_CDC_SUPPORT
endif
DEFINES += -DCC_CONFIG_IRRX_COMMON_DRIVER_DTV
DEFINES += -DDRV_IF_EU
DEFINES += -DCC_NAV_DEMOD_DVBT
DEFINES += -DCC_NAV_SCART
DEFINES += -DUSE_ATD_IF_DEMOD

#DEFINES += -DCC_SUPPORT_SIF_BYPASS
#export SUPPORT_SIF_BYPASS := yes
#DEFINES += -DCC_DVBT_SUPPORT

DEFINES += -DCC_USE_MTAL
#DEFINES += -DCC_SUPPORT_TVE
#DEFINES += -DCC_SUPPORT_TVE_CTRL_BY_DRIVER
#DEFINES += -DCC_SUPPORT_TVE_CTRL_BY_MW
DEFINES += -DCC_USB_SUPPORT_HUB
#DEFINES += -DCC_EXTERNAL_CI
#DEFINES += -DCC_INTERNAL_CI
ifeq "$(SYS_CI_SUPPORT)" "true"
    ifeq "$(EXTERNAL_CI_SUPPORT)" "true"
        DEFINES += -DCC_EXTERNAL_CI
    else
        DEFINES += -DCC_INTERNAL_CI
    endif
endif

# Smart Card
#ifndef SMC_SUPPORT
#    export SMC_SUPPORT := true
#endif

ifeq "$(SMC_SUPPORT)" "true"
    DEFINES += -DCC_SUPPORT_SMC
    DEFINES += -DSUPPORT_DUAL_SMC
    DEFINES += -DCC_SUPPORT_SMC_CLI
endif

DEFINES += -DCC_AUD_PWM_SAWLESS_PLL_EN
#DEFINES += -DCC_AUD_DVBT_SUPPORT
DEFINES += -DCC_AUD_ENABLE_PLAY_MUTE_CONTROL

#ifeq "$(AUD_SUPPORT_3_DECODER)" "1"
DEFINES += -DCC_MT5391_AUD_3_DECODER
DEFINES += -DCC_MT5391_AUD_MW_AUTO_CTRL
#endif

DEFINES += -DCC_AUD_4_DECODER_SUPPORT
DEFINES += -DCC_AUD_DATASRAM
DEFINES += -DCC_AUD_MIXSOUND_SUPPORT
DEFINES += -DCC_AUD_HDMI_PARSER_2_0_SUPPORT
DEFINES += -DCC_AUD_HDMI_PARSER_3_0_SUPPORT
DEFINES += -DCC_AUD_SUPPORT_DUAL_DSP
#DEFINES += -DCC_AUD_ARM_POST
DEFINES += -DS_AUD_FEATURE

DEFINES += -DCC_AUD_HP_DEPOP

DEFINES += -DCC_DSP_SUPPORT_ARC

ifeq "$(AV_RECORD_LIB)" "true"
DEFINES += -DCC_AUD_LINEIN_USE_DEC3
endif

#
# Dolby tech. license
#
ifeq "$(AUD_DOLBY_SUPPORT)" "NON"
DEFINES += -DCC_AUD_DOLBY_SUPPORT_AAC
endif
ifeq "$(AUD_DOLBY_SUPPORT)" "MS10"
DEFINES += -DCC_AUD_DOLBY_SUPPORT_DDC
DEFINES += -DCC_AUD_DOLBY_SUPPORT_DDT
endif
ifeq "$(AUD_DOLBY_SUPPORT)" "DCV"
DEFINES += -DCC_AUD_DOLBY_SUPPORT_DDP
DEFINES += -DCC_AUD_DOLBY_SUPPORT_AAC
endif
ifeq "$(AUD_DOLBY_SUPPORT)" "DD"
DEFINES += -DCC_AUD_DOLBY_SUPPORT_DD
DEFINES += -DCC_AUD_DOLBY_SUPPORT_AAC
endif
ifeq "$(AUD_DOLBY_SUPPORT)" "DP"
DEFINES += -DCC_AUD_DOLBY_SUPPORT_DDT
endif
ifeq "$(AUD_DOLBY_SUPPORT)" "DDCO"
DEFINES += -DCC_AUD_DOLBY_SUPPORT_DDCO
DEFINES += -DCC_AUD_DOLBY_SUPPORT_AAC
endif
ifeq "$(AUD_DOLBY_SUPPORT)" "DCV+DDCO"
DEFINES += -DCC_AUD_DOLBY_SUPPORT_DDP
DEFINES += -DCC_AUD_DOLBY_SUPPORT_DDCO
DEFINES += -DCC_AUD_DOLBY_SUPPORT_AAC
endif
ifeq "$(AUD_DOLBY_SUPPORT)" "DD+DDCO"
DEFINES += -DCC_AUD_DOLBY_SUPPORT_DD
DEFINES += -DCC_AUD_DOLBY_SUPPORT_DDCO
DEFINES += -DCC_AUD_DOLBY_SUPPORT_AAC
endif
ifeq "$(AUD_DOLBY_SUPPORT)" "DD+DP"
DEFINES += -DCC_AUD_DOLBY_SUPPORT_DDT
DEFINES += -DCC_AUD_DOLBY_SUPPORT_DD
endif

DEFINES += -DCC_AUD_NCSTOOL_SUPPORT
DEFINES += -DCC_AUD_DSP_SUPPORT_MIXSOUND_MEMPLAY
DEFINES += -DCC_AUD_DATA_UPLOAD_SUPPORT
DEFINES += -DCC_AUD_SUPPORT_MS10
DEFINES += -DCC_AUD_SUPPORT_SPDIF_V20

#DEFINES += -DCC_AUDIO_EU_PWM_OUTPUT_AUXDEC
DEFINES += -DCC_AUD_ENABLE_INTERNAL_LDO
#DEFINES += -DCC_AUD_MP3ENC_FAKEDATA_SUPPORT
DEFINES += -DCC_AUD_SUPPORT_NEW_TUNNEL_MODE

#DEFINES += -DCC_SUPPORT_OD
#DEFINES += -DCC_FBM_SUPPORT_DMXPID
#DEFINES += -DCC_MEM_MID_DISABLE
DEFINES += -DCC_FBM_SUPPORT_SRS

DEFINES += -DCC_MAPLE_TWO_WORLD_IR
ifeq "$(MAPLE_DRV_CUST)" "true"
DEFINES += -DCC_MAPLE_IR_DRV
DEFINES += -DCC_MAPLE_CUST_DRV
DEFINES += -DCC_SAKURA_CUST_DRV
#DEFINES += -DCC_MAPLE_LOADER_UPGRADE_FLOW_DEBUG
DEFINES += -DCC_MAPLE_LOADER_UPGRADE_FLOW
DEFINES += -DCC_MAPLE_LOADER_UPGRADE_NEW_RECIPE_SPEC
ifeq "$(MAPLE_LOADER_UPGRADE_VERSION_CTRL_FLOW)" "true"
DEFINES += -DCC_MAPLE_LOADER_UPGRADE_VERSION_CTRL_FLOW
endif
DEFINES += -DCC_UPGRADING_DYNAMIC_LOGO_SUPPORT
DEFINES += -DCC_BL_DETFLOW_IN_UPG
DEFINES += -DCC_LDR_ATOMIC_MODE_SUPPORT
DEFINES += -DCC_MAPLE_BE_LOADER_BOOT_FLOW
DEFINES += -DCC_EEP2EMMC_DUAL_BANK_SUPPORT
DEFINES += -DCC_EMMC_ERASE_SIZE_ALIGNMENT_1M
DEFINES += -DCC_SONY_GAMMA
DEFINES += -DCC_PANEL_FROM_FLASH
#DEFINES += -DCC_MODEL_DETECT_SUPPORT
DEFINES += -DPanel_ID_ERROR_DETECT
DEFINES += -DSONY_LOADER_POWER_SEQ
DEFINES += -DCC_FBM_SUPPORT_BEIC
ifeq "$(SAKURA_4K)" "true"
DEFINES += -DCC_4K_MODEL
DEFINES += -DCC_BYPASS_MJC
DEFINES += -DCC_BYPASS_OSD
DEFINES += -DCC_SUPPORT_4KBE
DEFINES += -DCC_4KBE_COMBINE_PARTTION
DEFINES += -DCC_COMBINE_4K_2K
endif
DEFINES += -DCC_PowerCons_Ctrl
DEFINES += -DCC_FIXED_SIF_CLK_DIV
endif

#For US FE config
DEFINES += -DCC_PROJECT_FOR_SONY
DEFINES += -DCC_TUNER_EQ_SCRIPT_US_MODEL
DEFINES += -DCC_SRV_RFDATA_SPEC_SUPPORT
DEFINES += -DCC_DEMOD_REMAP_ENABLE

DEFINES += -DCC_FRONTEND_MULTIPATH

#DEFINES += -DCC_DRAM_TUNING

DEFINES += -DCC_SAKURA_LED_ILLUMINATION
DEFINES += -DCC_LED_PWM_MODE
DEFINES += -DCC_Factory2K12

ASM_DEFINES +=

ifndef BRDCST_IF
BRDCST_IF=5890DVBTC_VDRTuner_P_atdeu
endif

ifeq "$(findstring VDRTuner,$(BRDCST_IF))" "VDRTuner"
ifndef CUST_TUNER
export CUST_TUNER := Si2157
endif
endif
#DEFINES += -DCC_TVE_SUPPORT_CGMSA
#DEFINES += -DCC_TVD_SUPPORT_FORCE_EU
DEFINES += -DCC_TVD_SUPPORT_PEDESTAL
DEFINES += -DCC_TVD_SUPPORT_FORCE_NTSC_M

COMPANY = Sony

DRV_CUSTOM = Trinity_us

DEFINES += -DCC_ARM_GIC
DEFINES += -DCC_ARM_TIMER

DEFINES += -DNAV_CONFIG_FILE=\"config/nav_config_Oryx_m1v1.h\"

#Porting Sakura drv config to Trinity

#ifeq "$(SORTING)" "true"
#DEFINES += -DCC_MSDC_ENABLE
#DEFINES += -DCC_MSDC_SDMMC_TEST
#DEFINES += -DCC_SORTING_SUPPORT
#endif 

ifeq "$(AUD_APROC_RENDER)" "true"
    DEFINES += -DCC_AUD_ARM_SUPPORT
    DEFINES += -DCC_AUD_ARM11_SUPPORT
    DEFINES += -DCC_AUD_ARM_RENDER
    ifeq "$(APROC_ENLARGE_DRAM)" "true"    
        DEFINES += -DCC_AUD_DISABLE_2ND_DSP
        DEFINES += -DCC_AUD_ENLARGE_APROC_DRAM
    endif
    DEFINES += -DCC_AUD_SAKURA_RENDER

endif

#DEFINES += -DCC_AUD_DSP_EU_MODEL

DEFINES += -DCC_AUD_WAFFLE_OVM_SUPPORT
DEFINES += -DCC_AUD_OVM_FORCE_MONO_SUPPORT
DEFINES += -DCC_AUD_SONY_2K15_OVM_GAIN
DEFINES += -DCC_SUPPORT_96K_AOUT

DEFINES += -DCC_AUD_HP_POLLING

DEFINES += -DCC_AUD_LINE_OUT_ADJ
DEFINES += -DCC_MPEG_LEVEL_ADJ
export DEFINES
export ASM_DEFINES
export BRDCST_IF
export COMPANY
export DRV_CUSTOM

ifeq "$(SONY_PKG_TYPE_EXTENSION)" "true"
DEFINES += -DSONY_PKG_TYPE_EXTENSION -DPKG_TYPE_MAX=$(PKG_TYPE_MAX)
endif
ifeq "$(SONY_PKG_VERSION_EXTENSION)" "true"
DEFINES += -DCC_SONY_PKG_VERSION_EXTENSION
endif

