#
# Copyright (C) 2015 MediaTek Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 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 the
# GNU General Public License for more details.
#

# Makefile generated by Mediatek
# fm support

ifeq ($(CONFIG_MTK_FMRADIO), y)

	FM_CHIP_MACRO := $(subst ",,$(CONFIG_MTK_FM_CHIP))
	FM_CHIP := $(subst _FM,,$(subst MT,mt,$(subst ",,$(CONFIG_MTK_FM_CHIP))))

ifeq ($(FM_CHIP), mt6625)
	FM_CHIP_MACRO := MT6627_FM
	FM_CHIP := mt6627
	subdir-ccflags-y += -DMT6625_FM
endif

$(warning FM_CHIP := $(FM_CHIP))
	WMT_INCLUDE_PATH := common_main
	FM_CHIP_PATH := $(FM_CHIP)/pub/$(FM_CHIP)
	subdir-ccflags-y += -D$(FM_CHIP_MACRO)
	subdir-ccflags-y += -I$(src)/inc \
					-I$(src)/$(FM_CHIP)/inc \
					-I$(src)/../common/$(WMT_INCLUDE_PATH)/include \
					-I$(src)/../common/$(WMT_INCLUDE_PATH)/linux/include

	obj-$(CONFIG_MTK_FMRADIO) += mtk_fm_drv.o
	$(FM_CHIP)-objs	:= core/fm_module.o \
					core/fm_main.o \
					core/fm_config.o \
					core/fm_rds_parser.o \
					core/fm_patch.o \
					core/fm_utils.o \
					core/fm_link.o \
					core/fm_eint.o \
					core/fm_cmd.o \
					$(FM_CHIP_PATH)_fm_lib.o \
					$(FM_CHIP_PATH)_fm_rds.o
	mtk_fm_drv-objs += $($(FM_CHIP)-objs)
$(warning $(mtk_fm_drv-objs))
	#obj-$(CONFIG_MTK_FMRADIO) += private/
endif

obj-y += dummy.o
