# 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

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_DISABLE_2ND_DSP
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    
endif
#DEFINES += -DCC_AUD_ARM_POST

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_DEPOP

#DEFINES += -DCC_AUD_SX1_FEATURE
DEFINES += -DCC_AUD_LINE_OUT_ADJ
#DEFINES += -DCC_AUD_NEW_HP_VOL_TABLE
#DEFINES += -DCC_AUD_NEW_CV_TABLE
#DEFINES += -DCC_AUD_LINEOUT_VOL_MODE
#DEFINES += -DCC_AUD_NEW_POST_MULTI_VS_SUPPORT
#DEFINES += -DCC_AUD_7BAND_EQUALIZER
#DEFINES += -DCC_AUD_VOLUME_OFFSET
DEFINES += -DCC_MPEG_LEVEL_ADJ

#DEFINES += -DCC_AUD_ARM_SUPPORT
DEFINES += -DCC_DSP_SUPPORT_ARC
DEFINES += -DCC_AUD_HP_POLLING

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

ifeq "$(CAP_LOGO_SUPPORT)" "true"
DEFINES += -DCC_BOOT_VDEC_LOGO
endif

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_NEW_RECIPE_SPEC
DEFINES += -DCC_MAPLE_LOADER_UPGRADE_FLOW
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_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_4KBE_COMBINE_PARTTION
endif
DEFINES += -DCC_PowerCons_Ctrl
DEFINES += -DCC_FIXED_SIF_CLK_DIV
endif

#Tuner part CONFIG,Only for SCT
ifeq "$(CC_Sony_Maple_Drv)" "true"
ifeq "$(CC_SONYMAPLE_EXT_DEMOD)" "true"
DEFINES += -DCC_SONY_DISABLE_I2C_REPEATER
else 
#DEFINES += -DCC_SONY_DISABLE_I2C_REPEATER
endif
DEFINES += -DCC_SONYMAPLE_Dual_Drv
DEFINES += -DSYS_DVBS_SUPPORT
DEFINES += -DCC_SONY_DEMOD_TSOUTPUT_SERIAL
endif

#Tuner part CONFIG,CVT and later
DEFINES += -DCC_PROJECT_FOR_SONY
DEFINES += -DCC_TUNER_EQ_SCRIPT_US_MODEL
DEFINES += -DCC_SRV_RFDATA_SPEC_SUPPORT

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

#DEFINES += -DCC_DRAM_TUNING

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_TVD_SUPPORT_PEDESTAL
DEFINES += -DCC_TVD_SUPPORT_FORCE_NTSC_M
COMPANY = Sony

DRV_CUSTOM = Sakura_us

DEFINES += -DCC_ARM_GIC
DEFINES += -DCC_ARM_TIMER

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

ifeq "$(AUD_APROC_RENDER)" "true"
    DEFINES += -DCC_AUD_SAKURA_RENDER
endif
export DEFINES
export ASM_DEFINES
export BRDCST_IF
export COMPANY
export DRV_CUSTOM
export CC_INET_SUPPORT=y
