]> git.karo-electronics.de Git - karo-tx-linux.git/blob - drivers/staging/greybus/Makefile
greybus: audio: Add Audio Manager
[karo-tx-linux.git] / drivers / staging / greybus / Makefile
1 greybus-y :=    core.o          \
2                 debugfs.o       \
3                 hd.o            \
4                 manifest.o      \
5                 interface.o     \
6                 bundle.o        \
7                 connection.o    \
8                 protocol.o      \
9                 control.o       \
10                 svc.o           \
11                 firmware.o      \
12                 operation.o
13
14 gb-phy-y :=     gpbridge.o      \
15                 sdio.o  \
16                 uart.o  \
17                 pwm.o   \
18                 gpio.o  \
19                 i2c.o   \
20                 spi.o   \
21                 usb.o
22
23 # Prefix all modules with gb-
24 gb-vibrator-y := vibrator.o
25 gb-power-supply-y := power_supply.o
26 gb-loopback-y := loopback.o
27 gb-light-y := light.o
28 gb-raw-y := raw.o
29 gb-hid-y := hid.o
30 gb-es2-y := es2.o
31 gb-arche-y := arche-platform.o arche-apb-ctrl.o
32 gb-audio-codec-y := audio_codec.o
33 gb-audio-gb-y := audio_gb.o
34 gb-audio-apbridgea-y := audio_apbridgea.o
35 gb-audio-manager-y += audio_manager.o
36 gb-audio-manager-y += audio_manager_module.o
37 gb-camera-y := camera.o
38
39 obj-m += greybus.o
40 obj-m += gb-phy.o
41 obj-m += gb-vibrator.o
42 obj-m += gb-power-supply.o
43 obj-m += gb-loopback.o
44 obj-m += gb-light.o
45 obj-m += gb-hid.o
46 obj-m += gb-raw.o
47 obj-m += gb-es2.o
48 obj-m += gb-arche.o
49 obj-m += gb-audio-codec.o
50 obj-m += gb-camera.o
51 obj-m += gb-audio-gb.o
52 obj-m += gb-audio-apbridgea.o
53 obj-m += gb-audio-manager.o
54
55 KERNELVER               ?= $(shell uname -r)
56 KERNELDIR               ?= /lib/modules/$(KERNELVER)/build
57 INSTALL_MOD_PATH        ?= /..
58 PWD                     := $(shell pwd)
59
60 # kernel config option that shall be enable
61 CONFIG_OPTIONS_ENABLE := POWER_SUPPLY PWM SYSFS SPI USB SND_SOC MMC LEDS_CLASS INPUT
62
63 # kernel config option that shall be disable
64 CONFIG_OPTIONS_DISABLE :=
65
66 # this only run in kbuild part of the makefile
67 ifneq ($(KERNELRELEASE),)
68 # This function returns the argument version if current kernel version is minor
69 # than the passed version, return 1 if equal or the current kernel version if it
70 # is greater than argument version.
71 kvers_cmp=$(shell [ "$(KERNELVERSION)" = "$(1)" ] && echo 1 || printf "$(1)\n$(KERNELVERSION)" | sort -V | tail -1)
72
73 ifneq ($(call kvers_cmp,"3.19.0"),3.19.0)
74     CONFIG_OPTIONS_ENABLE += LEDS_CLASS_FLASH
75 endif
76
77 ifneq ($(call kvers_cmp,"4.2.0"),4.2.0)
78     CONFIG_OPTIONS_ENABLE += V4L2_FLASH_LED_CLASS
79 endif
80
81 $(foreach opt,$(CONFIG_OPTIONS_ENABLE),$(if $(CONFIG_$(opt)),, \
82      $(error CONFIG_$(opt) is disabled in the kernel configuration and must be enable \
83      to continue compilation)))
84 $(foreach opt,$(CONFIG_OPTIONS_DISABLE),$(if $(filter m y, $(CONFIG_$(opt))), \
85      $(error CONFIG_$(opt) is enabled in the kernel configuration and must be disable \
86      to continue compilation),))
87 endif
88
89 # add -Wall to try to catch everything we can.
90 ccflags-y := -Wall
91
92 # needed for trace events
93 ccflags-y += -I$(src)
94
95 GB_AUDIO_MANAGER_SYSFS ?= true
96 ifeq ($(GB_AUDIO_MANAGER_SYSFS),true)
97 gb-audio-manager-y += audio_manager_sysfs.o
98 ccflags-y += -DGB_AUDIO_MANAGER_SYSFS
99 endif
100
101 all: module
102
103 tools::
104         $(MAKE) -C tools KERNELDIR=$(realpath $(KERNELDIR))
105
106 module:
107         $(MAKE) -C $(KERNELDIR) M=$(PWD)
108
109 check:
110         $(MAKE) -C $(KERNELDIR) M=$(PWD) C=2 CF="-D__CHECK_ENDIAN__"
111
112 clean:
113         rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c
114         rm -f Module.markers Module.symvers modules.order
115         rm -rf .tmp_versions Modules.symvers
116         $(MAKE) -C tools clean
117
118 coccicheck:
119         $(MAKE) -C $(KERNELDIR) M=$(PWD) coccicheck
120
121 install: module
122         mkdir -p $(INSTALL_MOD_PATH)/lib/modules/$(KERNELVER)/kernel/drivers/greybus/
123         cp -f *.ko $(INSTALL_MOD_PATH)/lib/modules/$(KERNELVER)/kernel/drivers/greybus/
124         depmod -b $(INSTALL_MOD_PATH) -a $(KERNELVER)