#
# Makefile for the Linux Kernel IPS specific device drivers.
#
# KBUILD_EXTRA_SYMBOLS += $(srctree)/Module.symvers
# export KBUILD_EXTRA_SYMBOLS
drm_src = /drivers/gpu/drm

ifneq ($(CONFIG_HOBOT_CHIP_J6X),)
ccflags-y += -I $(srctree)$(drm_src)
ccflags-$(CONFIG_HOBOT_DRM_IDU) += -I $(srctree)/../hobot-drivers/ide/
ccflags-$(CONFIG_HOBOT_DRM_IDU) += -I $(srctree)/../hobot-drivers/ide/idu
ccflags-$(CONFIG_HOBOT_DRM_IDU) += -I $(srctree)/../hobot-drivers/ide/idu/hardware/
ccflags-$(CONFIG_HOBOT_DRM_MIPI_CSI_TX) += -I $(srctree)/../hobot-drivers/ide/mipi-csi-tx
ccflags-$(CONFIG_HOBOT_DRM_MIPI_CSI_TX) += -I $(srctree)/../hobot-drivers/ide/mipi-csi-tx/hardware
ccflags-$(CONFIG_HOBOT_DRM_MIPI_DSI) += -I $(srctree)/../hobot-drivers/ide/mipi-dsi
ccflags-$(CONFIG_HOBOT_DRM_MIPI_DSI) += -I $(srctree)/../hobot-drivers/ide/mipi-dsi/hardware
ccflags-$(CONFIG_HOBOT_DRM_MIPI_DPHY) += -I $(srctree)/../hobot-drivers/ide/mipi-tx-dphy
ccflags-$(CONFIG_HOBOT_DRM_MIPI_DPHY) += -I $(srctree)/../hobot-drivers/ide/mipi-tx-dphy/hardware
ccflags-$(CONFIG_HOBOT_DRM_IDU) += -I $(srctree)/../hobot-drivers/camsys/cam_subsys
ifneq ($(CONFIG_HOBOT_IDE_WRAPPER),)
ccflags-y += -I $(srctree)/../hobot-drivers/ide/ide
ccflags-y += -I $(srctree)/../hobot-drivers/ide/ide/hardware
endif
ccflags-y += -I $(srctree)/../hobot-drivers/osal/linux/inc

endif

ifneq ($(CONFIG_HOBOT_CHIP_J5),)
ccflags-y += -I $(srctree)/drivers/gpu/drm/hobot
ccflags-$(CONFIG_HOBOT_DRM_IDU) += -I $(srctree)/drivers/gpu/drm/hobot/idu
ccflags-$(CONFIG_HOBOT_DRM_IDU) += -I $(srctree)/drivers/gpu/drm/hobot/idu/hardware/
ccflags-$(CONFIG_HOBOT_DRM_MIPI_CSI_TX) += -I $(srctree)/drivers/gpu/drm/hobot/mipi-csi-tx
ccflags-$(CONFIG_HOBOT_DRM_MIPI_CSI_TX) += -I $(srctree)/drivers/gpu/drm/hobot/mipi-csi-tx/hardware
ccflags-$(CONFIG_HOBOT_DRM_MIPI_DSI) += -I $(srctree)/drivers/gpu/drm/hobot/mipi-dsi
ccflags-$(CONFIG_HOBOT_DRM_MIPI_DSI) += -I $(srctree)/drivers/gpu/drm/hobot/mipi-dsi/hardware
ccflags-$(CONFIG_HOBOT_DRM_MIPI_DPHY) += -I $(srctree)/drivers/gpu/drm/hobot/mipi-tx-dphy
ccflags-$(CONFIG_HOBOT_DRM_MIPI_DPHY) += -I $(srctree)/drivers/gpu/drm/hobot/mipi-tx-dphy/hardware
ifneq ($(CONFIG_HOBOT_IDE_WRAPPER),)
ccflags-y += -I $(srctree)/drivers/gpu/drm/hobot/ide
ccflags-y += -I $(srctree)/drivers/gpu/drm/hobot/ide/hardware
endif
ccflags-y += -I $(srctree)/drivers/media/platform/hobot/osal/linux/inc
endif

hobot_idu_drm-y := \
		hb_ide_drv.o \
		hb_idu_gem.o \
		hb_idu_fb.o \
		hb_idu_plane.o \
		hb_idu_crtc.o

hobot_idu_drm-$(CONFIG_HOBOT_DISPLAY_WRITEBACK) += hb_idu_writeback.o

hobot_idu_drm-$(CONFIG_HOBOT_DRM_IDU) += \
		idu/hb_idu_drv.o \
		idu/hb_idu_hw.o \
		idu/hb_idu_debug.o \
		idu/hardware/hb_idu_hardware.o

hobot_idu_drm-$(CONFIG_HOBOT_DRM_MIPI_CSI_TX) += \
		mipi-csi-tx/hb_mipi_csi_tx_drv.o \
		mipi-csi-tx/hb_mipi_csi_device_ops.o \
		mipi-csi-tx/hb_mipi_csi_device_debug.o

hobot_idu_drm-$(CONFIG_HOBOT_DRM_MIPI_DSI) += \
		mipi-dsi/hb_mipi_dsi_host_drv.o \
		mipi-dsi/hb_mipi_dsi_host_ops.o \
		mipi-dsi/hb_mipi_dsi_host_hsi.o \
		mipi-dsi/hb_mipi_dsi_host_debug.o

hobot_idu_drm-$(CONFIG_HOBOT_DRM_MIPI_DPHY) += \
		mipi-tx-dphy/hb_mipi_tx_dphy_drv.o \
		mipi-tx-dphy/hb_mipi_tx_dphy_ops.o \
		mipi-tx-dphy/hb_mipi_tx_dphy_debug.o

hobot_idu_drm-$(CONFIG_HOBOT_DRM_MIPI_CSI_PANEL) += \
		hobot-panel/hb_mipi_csi_host_panel.o \
		hobot-panel/hb_mipi_serial_utility.o

obj-$(CONFIG_HOBOT_DRM_MIPI_DSI_PANEL)	+= \
		hobot-panel/hb_mipi_dsi_panel.o

obj-$(CONFIG_DRM_HOBOT) += hobot_idu_drm.o

hobot_ide_wrapper-y :=  \
		ide/hb_ide_wrapper_drv.o \
		ide/hardware/hb_ide_wrapper_hardware.o

obj-$(CONFIG_HOBOT_IDE_WRAPPER) += hobot_ide_wrapper.o

KDIR=${srctree}
default:
	CROSS_COMPILE=${CROSS_COMPILE} make ARCH=${ARCH} -C $(KDIR) M=$(PWD) modules

clean:
	CROSS_COMPILE=${CROSS_COMPILE} make ARCH=${ARCH} -C $(KDIR) M=$(PWD) clean

ifeq ($(CONFIG_HOBOT_GCOV_AVIO),y)
GCOV_PROFILE := y
endif
