2014-08-31 17:17:04 -06:00
|
|
|
greybus-y := core.o \
|
|
|
|
debugfs.o \
|
2015-11-03 10:03:22 -07:00
|
|
|
hd.o \
|
2014-10-01 20:54:16 -06:00
|
|
|
manifest.o \
|
2016-04-23 10:47:24 -06:00
|
|
|
module.o \
|
2014-12-19 15:56:30 -07:00
|
|
|
interface.o \
|
2014-12-12 15:10:16 -07:00
|
|
|
bundle.o \
|
2014-10-01 20:54:14 -06:00
|
|
|
connection.o \
|
2015-06-22 05:12:26 -06:00
|
|
|
control.o \
|
2015-07-03 05:30:29 -06:00
|
|
|
svc.o \
|
2016-01-20 23:51:49 -07:00
|
|
|
svc_watchdog.o \
|
2016-06-05 07:03:26 -06:00
|
|
|
operation.o \
|
|
|
|
timesync.o \
|
|
|
|
timesync_platform.o
|
2014-12-24 14:01:43 -07:00
|
|
|
|
2016-05-19 09:52:39 -06:00
|
|
|
gb-gbphy-y := gbphy.o
|
2014-08-11 01:30:45 -06:00
|
|
|
|
2015-01-21 03:40:41 -07:00
|
|
|
# Prefix all modules with gb-
|
|
|
|
gb-vibrator-y := vibrator.o
|
2015-11-12 08:35:59 -07:00
|
|
|
gb-power-supply-y := power_supply.o
|
2016-06-24 15:41:36 -06:00
|
|
|
gb-log-y := log.o
|
2015-03-31 01:51:59 -06:00
|
|
|
gb-loopback-y := loopback.o
|
2015-08-14 06:58:19 -06:00
|
|
|
gb-light-y := light.o
|
2015-05-08 07:50:17 -06:00
|
|
|
gb-raw-y := raw.o
|
2015-11-04 21:46:14 -07:00
|
|
|
gb-hid-y := hid.o
|
2015-01-21 03:40:41 -07:00
|
|
|
gb-es2-y := es2.o
|
2015-12-30 14:38:33 -07:00
|
|
|
gb-arche-y := arche-platform.o arche-apb-ctrl.o
|
2016-03-29 12:01:42 -06:00
|
|
|
gb-audio-module-y := audio_module.o audio_topology.o
|
|
|
|
gb-audio-codec-y := audio_codec.o
|
2016-01-13 14:07:46 -07:00
|
|
|
gb-audio-gb-y := audio_gb.o
|
2016-01-13 14:07:47 -07:00
|
|
|
gb-audio-apbridgea-y := audio_apbridgea.o
|
2016-01-13 14:07:48 -07:00
|
|
|
gb-audio-manager-y += audio_manager.o
|
|
|
|
gb-audio-manager-y += audio_manager_module.o
|
2016-06-09 05:04:35 -06:00
|
|
|
gb-bootrom-y := bootrom.o
|
2015-12-14 18:18:06 -07:00
|
|
|
gb-camera-y := camera.o
|
2016-06-30 09:54:00 -06:00
|
|
|
gb-firmware-y := fw-core.o fw-download.o fw-management.o authentication.o
|
2016-05-14 12:12:19 -06:00
|
|
|
gb-spilib-y := spilib.o
|
2016-05-09 06:45:09 -06:00
|
|
|
gb-sdio-y := sdio.o
|
2016-05-09 06:45:11 -06:00
|
|
|
gb-uart-y := uart.o
|
2016-05-09 06:45:08 -06:00
|
|
|
gb-pwm-y := pwm.o
|
2016-05-09 06:45:06 -06:00
|
|
|
gb-gpio-y := gpio.o
|
2016-05-09 06:45:07 -06:00
|
|
|
gb-i2c-y := i2c.o
|
2016-05-09 06:45:12 -06:00
|
|
|
gb-usb-y := usb.o
|
2016-05-14 12:12:20 -06:00
|
|
|
gb-spi-y := spi.o
|
2015-01-21 03:40:41 -07:00
|
|
|
|
2014-08-11 01:30:45 -06:00
|
|
|
obj-m += greybus.o
|
2016-05-19 09:52:39 -06:00
|
|
|
obj-m += gb-gbphy.o
|
2015-01-14 18:08:00 -07:00
|
|
|
obj-m += gb-vibrator.o
|
2015-11-12 08:35:59 -07:00
|
|
|
obj-m += gb-power-supply.o
|
2016-06-24 15:41:36 -06:00
|
|
|
obj-m += gb-log.o
|
2015-03-31 01:51:59 -06:00
|
|
|
obj-m += gb-loopback.o
|
2015-08-14 06:58:19 -06:00
|
|
|
obj-m += gb-light.o
|
2015-11-04 21:46:14 -07:00
|
|
|
obj-m += gb-hid.o
|
2015-05-08 07:50:17 -06:00
|
|
|
obj-m += gb-raw.o
|
2015-01-20 19:24:15 -07:00
|
|
|
obj-m += gb-es2.o
|
2016-02-15 14:58:21 -07:00
|
|
|
ifeq ($(CONFIG_USB_HSIC_USB3613),y)
|
|
|
|
obj-m += gb-arche.o
|
|
|
|
endif
|
2016-01-25 21:13:15 -07:00
|
|
|
ifeq ($(CONFIG_ARCH_MSM8994),y)
|
2016-04-21 10:44:02 -06:00
|
|
|
obj-m += gb-audio-codec.o
|
|
|
|
obj-m += gb-audio-module.o
|
2016-01-25 21:13:15 -07:00
|
|
|
obj-m += gb-camera.o
|
|
|
|
endif
|
2016-01-13 14:07:46 -07:00
|
|
|
obj-m += gb-audio-gb.o
|
2016-01-13 14:07:47 -07:00
|
|
|
obj-m += gb-audio-apbridgea.o
|
2016-01-13 14:07:48 -07:00
|
|
|
obj-m += gb-audio-manager.o
|
2016-06-09 05:04:35 -06:00
|
|
|
obj-m += gb-bootrom.o
|
2016-04-25 22:50:49 -06:00
|
|
|
obj-m += gb-firmware.o
|
2016-05-14 12:12:19 -06:00
|
|
|
obj-m += gb-spilib.o
|
2016-05-09 06:45:09 -06:00
|
|
|
obj-m += gb-sdio.o
|
2016-05-09 06:45:11 -06:00
|
|
|
obj-m += gb-uart.o
|
2016-05-09 06:45:08 -06:00
|
|
|
obj-m += gb-pwm.o
|
2016-05-09 06:45:06 -06:00
|
|
|
obj-m += gb-gpio.o
|
2016-05-09 06:45:07 -06:00
|
|
|
obj-m += gb-i2c.o
|
2016-05-09 06:45:12 -06:00
|
|
|
obj-m += gb-usb.o
|
2016-05-14 12:12:20 -06:00
|
|
|
obj-m += gb-spi.o
|
2014-08-11 01:30:45 -06:00
|
|
|
|
|
|
|
KERNELVER ?= $(shell uname -r)
|
|
|
|
KERNELDIR ?= /lib/modules/$(KERNELVER)/build
|
2015-05-07 18:00:50 -06:00
|
|
|
INSTALL_MOD_PATH ?= /..
|
2014-08-11 01:30:45 -06:00
|
|
|
PWD := $(shell pwd)
|
|
|
|
|
2015-05-13 11:59:00 -06:00
|
|
|
# kernel config option that shall be enable
|
2016-01-13 07:39:55 -07:00
|
|
|
CONFIG_OPTIONS_ENABLE := POWER_SUPPLY PWM SYSFS SPI USB SND_SOC MMC LEDS_CLASS INPUT
|
2015-05-13 11:59:00 -06:00
|
|
|
|
|
|
|
# kernel config option that shall be disable
|
|
|
|
CONFIG_OPTIONS_DISABLE :=
|
|
|
|
|
|
|
|
# this only run in kbuild part of the makefile
|
|
|
|
ifneq ($(KERNELRELEASE),)
|
2015-08-14 06:58:18 -06:00
|
|
|
# This function returns the argument version if current kernel version is minor
|
|
|
|
# than the passed version, return 1 if equal or the current kernel version if it
|
|
|
|
# is greater than argument version.
|
2015-08-15 17:48:03 -06:00
|
|
|
kvers_cmp=$(shell [ "$(KERNELVERSION)" = "$(1)" ] && echo 1 || printf "$(1)\n$(KERNELVERSION)" | sort -V | tail -1)
|
2015-08-14 06:58:18 -06:00
|
|
|
|
|
|
|
ifneq ($(call kvers_cmp,"3.19.0"),3.19.0)
|
|
|
|
CONFIG_OPTIONS_ENABLE += LEDS_CLASS_FLASH
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(call kvers_cmp,"4.2.0"),4.2.0)
|
|
|
|
CONFIG_OPTIONS_ENABLE += V4L2_FLASH_LED_CLASS
|
|
|
|
endif
|
|
|
|
|
2015-05-13 11:59:00 -06:00
|
|
|
$(foreach opt,$(CONFIG_OPTIONS_ENABLE),$(if $(CONFIG_$(opt)),, \
|
|
|
|
$(error CONFIG_$(opt) is disabled in the kernel configuration and must be enable \
|
|
|
|
to continue compilation)))
|
|
|
|
$(foreach opt,$(CONFIG_OPTIONS_DISABLE),$(if $(filter m y, $(CONFIG_$(opt))), \
|
|
|
|
$(error CONFIG_$(opt) is enabled in the kernel configuration and must be disable \
|
|
|
|
to continue compilation),))
|
|
|
|
endif
|
|
|
|
|
2014-11-19 20:09:53 -07:00
|
|
|
# add -Wall to try to catch everything we can.
|
2015-07-02 22:27:12 -06:00
|
|
|
ccflags-y := -Wall
|
2014-11-19 20:09:53 -07:00
|
|
|
|
2015-09-18 09:38:45 -06:00
|
|
|
# needed for trace events
|
|
|
|
ccflags-y += -I$(src)
|
|
|
|
|
2016-01-13 14:07:48 -07:00
|
|
|
GB_AUDIO_MANAGER_SYSFS ?= true
|
|
|
|
ifeq ($(GB_AUDIO_MANAGER_SYSFS),true)
|
|
|
|
gb-audio-manager-y += audio_manager_sysfs.o
|
|
|
|
ccflags-y += -DGB_AUDIO_MANAGER_SYSFS
|
|
|
|
endif
|
|
|
|
|
2015-12-17 23:32:03 -07:00
|
|
|
all: module
|
2015-12-15 13:46:22 -07:00
|
|
|
|
|
|
|
tools::
|
|
|
|
$(MAKE) -C tools KERNELDIR=$(realpath $(KERNELDIR))
|
2014-08-11 01:30:45 -06:00
|
|
|
|
|
|
|
module:
|
|
|
|
$(MAKE) -C $(KERNELDIR) M=$(PWD)
|
|
|
|
|
2014-09-13 13:39:23 -06:00
|
|
|
check:
|
|
|
|
$(MAKE) -C $(KERNELDIR) M=$(PWD) C=2 CF="-D__CHECK_ENDIAN__"
|
|
|
|
|
2014-08-11 01:30:45 -06:00
|
|
|
clean:
|
|
|
|
rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c
|
|
|
|
rm -f Module.markers Module.symvers modules.order
|
|
|
|
rm -rf .tmp_versions Modules.symvers
|
2015-12-15 13:46:22 -07:00
|
|
|
$(MAKE) -C tools clean
|
2014-08-11 01:30:45 -06:00
|
|
|
|
|
|
|
coccicheck:
|
|
|
|
$(MAKE) -C $(KERNELDIR) M=$(PWD) coccicheck
|
|
|
|
|
2015-01-14 15:55:24 -07:00
|
|
|
install: module
|
2015-05-07 18:00:50 -06:00
|
|
|
mkdir -p $(INSTALL_MOD_PATH)/lib/modules/$(KERNELVER)/kernel/drivers/greybus/
|
|
|
|
cp -f *.ko $(INSTALL_MOD_PATH)/lib/modules/$(KERNELVER)/kernel/drivers/greybus/
|
|
|
|
depmod -b $(INSTALL_MOD_PATH) -a $(KERNELVER)
|