#
# Copyright (c) 2009 NXP Semiconductors BV                                  
#                                                                           
# This program is free software; you can redistribute it and/or modify      
# it under the terms of the GNU General Public License as published by      
# the Free Software Foundation, using version 2 of the License.             
#                                                                           
# 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 the              
# GNU General Public License for more details.                              
#                                                                           
# You should have received a copy of the GNU General Public License         
# along with this program; if not, write to the Free Software               
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307       
# USA.                                                                      
#
# Filename: makefile hdmi84 component
#
DIR_LOCAL	= comps/hdmi84

#***********************************************************************
# Do not change the following include
#***********************************************************************
include $(_TMROOT)/sde/environment.mk

#-----------------------------------------------------------------------
# Diversity
#-----------------------------------------------------------------------

# If no diversity is needed, comment out the next few lines:
#include diversity.mk
#LIB_SUFFIX = $(_tmosal_DIVERSITY)


############### select your chip + platform here ###################

# TDA_TX := TDA19989
# TDA_TX := TDA19988
TDA_TX := TDA9984
# TDA_TX := TDA9983
# TDA_TX := TDA9981

# TDA_PLATFORM := ZOOMII
TDA_PLATFORM := OTHERS

############### features on demand #################################

TDA_HDCP := 0
# TDA_HDCP := TMFL_HDCP_SUPPORT
# TDA_CEC := TDA9950

# add this if INTERRUPT is wired, otherwise polling with timer is used
# LOCAL_CFLAGS += -DIRQ

# add this to get PC video format
LOCAL_CFLAGS += -DFORMAT_PC 

# add this to disable automatic set of input/output video resolution 
LOCAL_CFLAGS += -DUSER_SET_INPUT_OUTPUT

####################################################################

LOCAL_CFLAGS += -DFUNC_PTR=" " -DCONST_DAT="const " -DRAM_DAT=" "
LOCAL_CFLAGS += -DTDA_NAME=$(TDA_TX)
LOCAL_CFLAGS += -DTMFL_NO_RTOS 
LOCAL_CFLAGS += -DBRIGHTSIGN 
LOCAL_CFLAGS += -DSPDIF_ACLK_TO_CLOCK
LOCAL_CFLAGS += -DSTB225_HDMI_SPECIFIC
# LOCAL_CFLAGS += -DI2C_DBG

ifeq ($(TDA_PLATFORM),ZOOMII)
LOCAL_CFLAGS += -DZOOMII_PATCH
LOCAL_CFLAGS += -DTWL4030_HACK
LOCAL_CFLAGS += -DANDROID_DSS
LOCAL_CFLAGS += -DGUI_OVER_HDMI
endif

ifeq ($(TDA_TX),TDA19988)
LOCAL_CFLAGS += -DTMFL_TDA19988
TDA_TX       := TDA19989
endif

ifeq ($(TDA_TX),TDA19989)
LOCAL_CFLAGS += -DTMFL_TDA19989 -DTMFL_TDA9989
ifeq ($(TDA_HDCP),TMFL_HDCP_SUPPORT)
LOCAL_CFLAGS += -D$(TDA_HDCP)
else
LOCAL_CFLAGS += -DNO_HDCP
endif
endif

ifeq ($(TDA_TX),TDA9984)
LOCAL_CFLAGS += -DNO_HDCP -DTMFL_TDA9984
endif

ifeq ($(TDA_TX),TDA9981)
LOCAL_CFLAGS += -DTMFL_TDA9981_SUPPORT -DTMFL_RX_SENSE_ON
endif

########## devlib ##################################################

ifeq ($(TDA_TX),TDA19989)
TXSRC := src/comps/tmdlHdmiTx/src
TXCFG := src/comps/tmdlHdmiTx/cfg/TDA9989
CECSRC := src/comps/tmdlHdmiCEC/src
CECCFG := src/comps/tmdlHdmiCEC/cfg
endif

ifeq ($(TDA_TX),TDA9984)
TXSRC := src/comps/tmdlHdmiTx/src
TXCFG := src/comps/tmdlHdmiTx/cfg/TDA9984
CECSRC := src/comps/tmdlHdmiCEC/src
CECCFG := src/comps/tmdlHdmiCEC/cfg
endif

ifeq ($(TDA_TX),TDA9983)
TXSRC := src/comps/tmdlTDA9983/src
TXCFG := src/comps/tmdlTDA9983/cfg
endif

ifeq ($(TDA_TX),TDA9981)
TXSRC := src/comps/tmdlTDA9983/src
TXCFG := src/comps/tmdlTDA9983/cfg
endif

########## board service layer #####################################

ifeq ($(TDA_TX),TDA19989)
BSL := src/comps/tmbslTDA9989/src
endif

ifeq ($(TDA_TX),TDA9984)
BSL := src/comps/tmbslTDA9984/src
endif

ifeq ($(TDA_TX),TDA9983)
BSL := src/comps/tmbslTDA9983/src
endif

ifeq ($(TDA_TX),TDA9981)
BSL := src/comps/tmbslTDA9983/src
endif

####################################################################

#-----------------------------------------------------------------------
# Source environment variables
#-----------------------------------------------------------------------
C_SOURCES = \
    src/tda998x.c \

# NXP comps
ifeq ($(TDA_TX),TDA19989)
C_SOURCES += $(TXSRC)/tmdlHdmiTx.c
C_SOURCES += $(TXSRC)/tmdlHdmiTx_local.c
C_SOURCES += $(TXCFG)/tmdlHdmiTx_Linux.c
C_SOURCES += $(BSL)/tmbslTDA9989_local.c
C_SOURCES += $(BSL)/tmbslTDA9989_InOut.c
C_SOURCES += $(BSL)/tmbslTDA9989_HDCP.c
C_SOURCES += $(BSL)/tmbslTDA9989_State.c
C_SOURCES += $(BSL)/tmbslTDA9989_Misc.c
C_SOURCES += $(BSL)/tmbslTDA9989_Edid.c
#hdmicec-objs += $(CECSRC)/tmdlHdmiCEC.c
#hdmicec-objs += $(CECSRC)/tmdlHdmiCEC_local.c
#hdmicec-objs += $(CECCFG)/tmdlHdmiCEC_Linux.c
endif

ifeq ($(TDA_TX),TDA9984)
C_SOURCES += $(TXSRC)/tmdlHdmiTx.c
C_SOURCES += $(TXSRC)/tmdlHdmiTx_local.c
C_SOURCES += $(TXCFG)/tmdlHdmiTx_Linux.c
C_SOURCES += $(BSL)/tmbslTDA9984_local.c 
C_SOURCES += $(BSL)/tmbslTDA9984_InOut.c
C_SOURCES += $(BSL)/tmbslTDA9984_HDCP.c
C_SOURCES += $(BSL)/tmbslTDA9984_State.c
C_SOURCES += $(BSL)/tmbslTDA9984_Misc.c
C_SOURCES += $(BSL)/tmbslTDA9984_Edid.c
#hdmicec-objs += $(CECSRC)/tmdlHdmiCEC.c
#hdmicec-objs += $(CECSRC)/tmdlHdmiCEC_local.c
#hdmicec-objs += $(CECCFG)/tmdlHdmiCEC_Linux.c
endif

ifeq ($(TDA_TX),TDA9983)
C_SOURCES += $(BSL)/tmbslHdmiTx_2.c
C_SOURCES += $(BSL)/tmbslHdmiTx_1.c
C_SOURCES += $(BSL)/tmbslHdmiTx_local.c
C_SOURCES += $(TXSRC)/tmdlHdmiTx.c
C_SOURCES += $(TXCFG)/tmdlHdmiTx_Linux.c
endif

ifeq ($(TDA_TX),TDA9981)
C_SOURCES += $(BSL)/tmbslHdmiTx_2.c
C_SOURCES += $(BSL)/tmbslHdmiTx_1.c
C_SOURCES += $(BSL)/tmbslHdmiTx_local.c
C_SOURCES += $(TXSRC)/tmdlHdmiTx.c
C_SOURCES += $(TXCFG)/tmdlHdmiTx_Linux.c
endif

#-----------------------------------------------------------------------
# Required components
#-----------------------------------------------------------------------
REQUIRES = \

# By default all components required for C compilation must be linked in:
LIBS = $(REQUIRES)

# KMODULE_INCLUDED_COMPS to be defined if the component represents a kernel module.
# A list of other components included in this kernel module.
KMODULE_INCLUDED_COMPS = \

#-----------------------------------------------------------------------
# Directory where the 3rdparty includes are stored
#-----------------------------------------------------------------------
DIR_INCLUDE = \

#-----------------------------------------------------------------------
# local CFLAGS
#-----------------------------------------------------------------------

ifeq ($(TDA_TX),TDA19989)
LOCAL_CFLAGS += -Isrc/comps/tmbslHdmiTx/inc
LOCAL_CFLAGS += -Isrc/comps/tmdlHdmiTx/src
LOCAL_CFLAGS += -Isrc/comps/tmdlHdmiTx/cfg
LOCAL_CFLAGS += -Isrc/comps/tmdlHdmiTx/inc
LOCAL_CFLAGS += -Isrc/comps/tmbslTDA9989/inc
LOCAL_CFLAGS += -Isrc/comps/tmbslTDA9989/src
LOCAL_CFLAGS += -Isrc/comps/tmdlHdmiCEC/inc
LOCAL_CFLAGS += -Isrc/comps/tmdlHdmiCEC/src
LOCAL_CFLAGS += -Isrc/comps/tmdlHdmiCEC/cfg
endif

ifeq ($(TDA_TX),TDA9984)
LOCAL_CFLAGS += -Isrc/comps/tmbslHdmiTx/inc
LOCAL_CFLAGS += -Isrc/comps/tmdlHdmiTx/src
LOCAL_CFLAGS += -Isrc/comps/tmdlHdmiTx/cfg
LOCAL_CFLAGS += -Isrc/comps/tmdlHdmiTx/inc
LOCAL_CFLAGS += -Isrc/comps/tmbslTDA9984/inc
LOCAL_CFLAGS += -Isrc/comps/tmbslTDA9984/src
LOCAL_CFLAGS += -Isrc/comps/tmdlHdmiCEC/inc
LOCAL_CFLAGS += -Isrc/comps/tmdlHdmiCEC/src
LOCAL_CFLAGS += -Isrc/comps/tmdlHdmiCEC/cfg
endif

ifeq ($(TDA_TX),TDA9983)
LOCAL_CFLAGS += -Isrc/comps/tmbslTDA9983/inc
LOCAL_CFLAGS += -Isrc/comps/tmdlTDA9983/inc
LOCAL_CFLAGS += -Isrc/comps/tmdlTDA9983/src
LOCAL_CFLAGS += -Isrc/comps/tmdlTDA9983/cfg
endif

ifeq ($(TDA_TX),TDA9981)
LOCAL_CFLAGS += -Isrc/comps/tmbslTDA9983/inc
LOCAL_CFLAGS += -Isrc/comps/tmdlTDA9983/inc
LOCAL_CFLAGS += -Isrc/comps/tmdlTDA9983/src
LOCAL_CFLAGS += -Isrc/comps/tmdlTDA9983/cfg
endif

#***********************************************************************
# Exported Symbols
#***********************************************************************
EXPORTS = true

#***********************************************************************
# Do not change this
#***********************************************************************
all: configuration lib

#***********************************************************************
# Do not change the following include
#***********************************************************************
ifneq ($(DIR_CONFIG),_)
include $(DIR_SDE)/$(DIR_CONFIG)/makelib.mk
endif
