diff --git a/devices/ccat/Kbuild.in b/devices/ccat/Kbuild.in index cd828256..1ee8dbca 100644 --- a/devices/ccat/Kbuild.in +++ b/devices/ccat/Kbuild.in @@ -34,14 +34,18 @@ TOPDIR := $(src)/../.. ifeq (@ENABLE_CCAT@,1) - EC_CCAT_OBJ := \ - gpio.o \ + obj-m += ec_ccat.o + + ec_ccat-objs := \ module.o \ netdev.o \ sram.o \ update.o - obj-m += ec_ccat.o - ec_ccat-objs := $(EC_CCAT_OBJ) + +ifdef CONFIG_GPIO + ec_ccat-objs += gpio.o +endif + CFLAGS_ccat_main-ethercat.o = -DREV=$(REV) endif diff --git a/devices/ccat/module.c b/devices/ccat/module.c index b946597c..126014c9 100644 --- a/devices/ccat/module.c +++ b/devices/ccat/module.c @@ -54,7 +54,9 @@ static const struct ccat_driver *const drivers[] = { ð_dma_driver, /* load Ethernet MAC/EtherCAT Master driver with DMA support from netdev.c */ #endif ð_eim_driver, /* load Ethernet MAC/EtherCAT Master driver without DMA support from */ +#ifdef CONFIG_GPIO &gpio_driver, /* load GPIO driver from gpio.c */ +#endif &sram_driver, /* load SRAM driver from sram.c */ &update_driver, /* load Update driver from update.c */ }; diff --git a/devices/ccat/module.h b/devices/ccat/module.h index 529334d3..f2a6aa13 100644 --- a/devices/ccat/module.h +++ b/devices/ccat/module.h @@ -37,10 +37,13 @@ extern const struct ccat_driver eth_eim_driver; extern const struct ccat_driver eth_dma_driver; +#ifdef CONFIG_GPIO extern const struct ccat_driver gpio_driver; +#endif extern const struct ccat_driver sram_driver; extern const struct ccat_driver update_driver; + /** * CCAT function type identifiers (u16) */