########################################################################### ###
#@File		Makefile
#@Title
#@Copyright	Copyright (c) Innosilicon Technology Ltd. All Rights Reserved
#@Description
#@License	Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# 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.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) 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; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS 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.
### ###########################################################################

INNODPU_INCLUDE := \
	-I$(INNOGPU_PRO_PATH)/innodpu \
	-I$(INNOGPU_PRO_PATH)/innodpu/pdp0 \
	-I$(INNOGPU_PRO_PATH)/innodpu/connector \
	-I$(INNOGPU_PRO_PATH)/innodpu/connector/chip \
        -I$(INNOGPU_PRO_PATH)/innogpu/osfunc \
	-I$(INNOGPU_PRO_PATH)/innogpu/pcie \
#	-I$(INNOGPU_PRO_PATH)/innodpu/db9000 

INNODPU_OBJS := \
	innodpu_compatibility.o \
	innodpu_dpu.o \
	innodpu_audio_api.o \
	innodpu_drm_drv.o \
	innodpu_drm_pm.o \
	innodpu_drm_fb.o \
	innodpu_drm_gem.o \
	innodpu_drm_modeset.o \
	innodpu_print.o \
	innodpu_drm_debugfs.o \
	innodpu_module_param.o \
#	g0_soc_innodpu_dp.o \
#	g1_soc_innodpu_dp.o \
#	g0_soc_innodpu_audio.o \
#	g1_soc_innodpu_audio.o \


# connector
INNODPU_OBJS += \
	connector/innodpu_parse_edid.o \
	connector/innodpu_connector.o \
	connector/innodpu_dp.o \
	connector/innodpu_dp_audio_api.o \
	connector/innodpu_dp_common.o \
	connector/innodpu_hdmi.o \
	connector/innodpu_hdmi_audio_api.o \
	connector/innodpu_hdmi_common.o \
	connector/innodpu_i2c.o  \
	connector/chip/genfunc/genv1_soc_hdmi_clk.o \
	connector/chip/genfunc/genv2_soc_hdmi_clk.o \
	connector/chip/g0_soc_dp.o \
	connector/chip/g0_soc_hdmi.o \
	connector/chip/g0m_soc_dp.o \
	connector/chip/g0m_soc_vga.o \
	connector/chip/g1_soc_dp.o \
	connector/chip/g1_soc_hdmi.o \
	connector/chip/g1p_soc_hdmi.o \
	connector/chip/g1p_soc_dp.o \
	connector/chip/g0m_soc_hdmi.o \
	connector/innodpu_hdmi_debugfs.o \
	connector/innodpu_dp_debugfs.o \
	connector/innodpu_vga_debugfs.o \
	connector/innodpu_vga.o \
	connector/chip/g1p_soc_vga.o \
	connector/innodpu_vkms.o \
	#connector/innodpu_lvds.o \
	connector/chip/g0_soc_lvds.o

# pdp0
INNODPU_OBJS += \
	pdp0/pdp0_crtc.o \
	pdp0/pdp0_drv.o \
	pdp0/pdp0_hw.o \
	pdp0/pdp0_common.o \
	pdp0/pdp0_plane.o \
	pdp0/chip/g0_pdp0_hw.o \
	pdp0/chip/g0m_pdp0_hw.o \
	pdp0/chip/g1p_pdp0_hw.o \
	pdp0/chip/g1_pdp0_hw.o


INNODPU_OBJS := $(addprefix innodpu/, $(INNODPU_OBJS))

ifeq ($(CONFIG_DRM_INNO_DPU),y)
  ifeq ($(SEPARATE_BUILD),y)
    innodpu-y := $(INNODPU_OBJS)
    obj-m += innodpu.o
  else
    INNODPU = $(INNODPU_OBJS)
  endif
endif
