17 gb-gpbridge-y
:= gpbridge.o
19 # Prefix all modules with gb-
20 gb-vibrator-y
:= vibrator.o
21 gb-power-supply-y
:= power_supply.o
22 gb-loopback-y
:= loopback.o
27 gb-arche-y
:= arche-platform.o arche-apb-ctrl.o
28 gb-audio-module-y
:= audio_module.o audio_topology.o
29 gb-audio-codec-y
:= audio_codec.o
30 gb-audio-gb-y
:= audio_gb.o
31 gb-audio-apbridgea-y
:= audio_apbridgea.o
32 gb-audio-manager-y
+= audio_manager.o
33 gb-audio-manager-y
+= audio_manager_module.o
34 gb-camera-y
:= camera.o
35 gb-firmware-y
:= fw-core.o fw-download.o fw-management.o
36 gb-spilib-y
:= spilib.o
46 obj-m
+= gb-gpbridge.o
47 obj-m
+= gb-vibrator.o
48 obj-m
+= gb-power-supply.o
49 obj-m
+= gb-loopback.o
54 ifeq ($(CONFIG_USB_HSIC_USB3613
),y
)
57 ifeq ($(CONFIG_ARCH_MSM8994
),y
)
58 obj-m
+= gb-audio-codec.o
59 obj-m
+= gb-audio-module.o
62 obj-m
+= gb-audio-gb.o
63 obj-m
+= gb-audio-apbridgea.o
64 obj-m
+= gb-audio-manager.o
65 obj-m
+= gb-firmware.o
75 KERNELVER ?
= $(shell uname
-r
)
76 KERNELDIR ?
= /lib
/modules
/$(KERNELVER
)/build
77 INSTALL_MOD_PATH ?
= /..
80 # kernel config option that shall be enable
81 CONFIG_OPTIONS_ENABLE
:= POWER_SUPPLY PWM SYSFS SPI USB SND_SOC MMC LEDS_CLASS INPUT
83 # kernel config option that shall be disable
84 CONFIG_OPTIONS_DISABLE
:=
86 # this only run in kbuild part of the makefile
87 ifneq ($(KERNELRELEASE
),)
88 # This function returns the argument version if current kernel version is minor
89 # than the passed version, return 1 if equal or the current kernel version if it
90 # is greater than argument version.
91 kvers_cmp
=$(shell [ "$(KERNELVERSION)" = "$(1)" ] && echo
1 || printf
"$(1)\n$(KERNELVERSION)" |
sort -V | tail
-1)
93 ifneq ($(call kvers_cmp
,"3.19.0"),3.19.0)
94 CONFIG_OPTIONS_ENABLE
+= LEDS_CLASS_FLASH
97 ifneq ($(call kvers_cmp
,"4.2.0"),4.2.0)
98 CONFIG_OPTIONS_ENABLE
+= V4L2_FLASH_LED_CLASS
101 $(foreach opt
,$(CONFIG_OPTIONS_ENABLE
),$(if
$(CONFIG_
$(opt
)),, \
102 $(error CONFIG_
$(opt
) is disabled in the kernel configuration and must be enable \
103 to continue compilation
)))
104 $(foreach opt
,$(CONFIG_OPTIONS_DISABLE
),$(if
$(filter m y
, $(CONFIG_
$(opt
))), \
105 $(error CONFIG_
$(opt
) is enabled in the kernel configuration and must be disable \
106 to continue compilation
),))
109 # add -Wall to try to catch everything we can.
112 # needed for trace events
113 ccflags-y
+= -I
$(src
)
115 GB_AUDIO_MANAGER_SYSFS ?
= true
116 ifeq ($(GB_AUDIO_MANAGER_SYSFS
),true
)
117 gb-audio-manager-y
+= audio_manager_sysfs.o
118 ccflags-y
+= -DGB_AUDIO_MANAGER_SYSFS
124 $(MAKE
) -C tools KERNELDIR
=$(realpath
$(KERNELDIR
))
127 $(MAKE
) -C
$(KERNELDIR
) M
=$(PWD
)
130 $(MAKE
) -C
$(KERNELDIR
) M
=$(PWD
) C
=2 CF
="-D__CHECK_ENDIAN__"
133 rm -f
*.o
*~ core .depend .
*.cmd
*.ko
*.mod.c
134 rm -f Module.markers Module.symvers modules.order
135 rm -rf .tmp_versions Modules.symvers
136 $(MAKE
) -C tools
clean
139 $(MAKE
) -C
$(KERNELDIR
) M
=$(PWD
) coccicheck
142 mkdir
-p
$(INSTALL_MOD_PATH
)/lib
/modules
/$(KERNELVER
)/kernel
/drivers
/greybus
/
143 cp
-f
*.ko
$(INSTALL_MOD_PATH
)/lib
/modules
/$(KERNELVER
)/kernel
/drivers
/greybus
/
144 depmod
-b
$(INSTALL_MOD_PATH
) -a
$(KERNELVER
)