Commit 9abc44ba authored by Ajay Singh's avatar Ajay Singh Committed by Greg Kroah-Hartman

staging: wilc1000: fix TODO to compile spi and sdio components in single module

Changes to compile module component along with SPI and SDIO module.
Previously 'wilc1000.ko' used to generate along with wilc-spi.ko or
wilc1000-sdio.ko module. After these changes only wilc1000-spi.ko or
wilc1000-sdio.ko modules are required for SPI and SDIO respectively.
These changes are done to address below TODO item.

- make SPI and SDIO components coexist in one build
Signed-off-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2408898e
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
obj-$(CONFIG_WILC1000) += wilc1000.o
ccflags-y += -DFIRMWARE_1002=\"atmel/wilc1002_firmware.bin\" \ ccflags-y += -DFIRMWARE_1002=\"atmel/wilc1002_firmware.bin\" \
-DFIRMWARE_1003=\"atmel/wilc1003_firmware.bin\" -DFIRMWARE_1003=\"atmel/wilc1003_firmware.bin\"
...@@ -12,7 +11,9 @@ wilc1000-objs := wilc_wfi_cfgoperations.o linux_wlan.o linux_mon.o \ ...@@ -12,7 +11,9 @@ wilc1000-objs := wilc_wfi_cfgoperations.o linux_wlan.o linux_mon.o \
wilc_wlan.o wilc_wlan.o
obj-$(CONFIG_WILC1000_SDIO) += wilc1000-sdio.o obj-$(CONFIG_WILC1000_SDIO) += wilc1000-sdio.o
wilc1000-sdio-objs += $(wilc1000-objs)
wilc1000-sdio-objs += wilc_sdio.o wilc1000-sdio-objs += wilc_sdio.o
obj-$(CONFIG_WILC1000_SPI) += wilc1000-spi.o obj-$(CONFIG_WILC1000_SPI) += wilc1000-spi.o
wilc1000-spi-objs += $(wilc1000-objs)
wilc1000-spi-objs += wilc_spi.o wilc1000-spi-objs += wilc_spi.o
TODO: TODO:
- rework comments and function headers(also coding style) - rework comments and function headers(also coding style)
- make spi and sdio components coexist in one build
- support soft-ap and p2p mode - support soft-ap and p2p mode
- support resume/suspend function - support resume/suspend function
...@@ -1033,8 +1033,8 @@ void wilc_netdev_cleanup(struct wilc *wilc) ...@@ -1033,8 +1033,8 @@ void wilc_netdev_cleanup(struct wilc *wilc)
} }
kfree(wilc); kfree(wilc);
wilc_debugfs_remove();
} }
EXPORT_SYMBOL_GPL(wilc_netdev_cleanup);
static const struct net_device_ops wilc_netdev_ops = { static const struct net_device_ops wilc_netdev_ops = {
.ndo_init = mac_init_fn, .ndo_init = mac_init_fn,
...@@ -1057,6 +1057,7 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type, ...@@ -1057,6 +1057,7 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type,
if (!wl) if (!wl)
return -ENOMEM; return -ENOMEM;
wilc_debugfs_init();
*wilc = wl; *wilc = wl;
wl->io_type = io_type; wl->io_type = io_type;
wl->hif_func = ops; wl->hif_func = ops;
...@@ -1118,6 +1119,3 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type, ...@@ -1118,6 +1119,3 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type,
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(wilc_netdev_init);
MODULE_LICENSE("GPL");
...@@ -28,7 +28,6 @@ static struct dentry *wilc_dir; ...@@ -28,7 +28,6 @@ static struct dentry *wilc_dir;
#define DBG_LEVEL_ALL (DEBUG | INFO | WRN | ERR) #define DBG_LEVEL_ALL (DEBUG | INFO | WRN | ERR)
static atomic_t WILC_DEBUG_LEVEL = ATOMIC_INIT(ERR); static atomic_t WILC_DEBUG_LEVEL = ATOMIC_INIT(ERR);
EXPORT_SYMBOL_GPL(WILC_DEBUG_LEVEL);
/* /*
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
...@@ -105,7 +104,7 @@ static struct wilc_debugfs_info_t debugfs_info[] = { ...@@ -105,7 +104,7 @@ static struct wilc_debugfs_info_t debugfs_info[] = {
}, },
}; };
static int __init wilc_debugfs_init(void) int wilc_debugfs_init(void)
{ {
int i; int i;
struct wilc_debugfs_info_t *info; struct wilc_debugfs_info_t *info;
...@@ -121,12 +120,10 @@ static int __init wilc_debugfs_init(void) ...@@ -121,12 +120,10 @@ static int __init wilc_debugfs_init(void)
} }
return 0; return 0;
} }
module_init(wilc_debugfs_init);
static void __exit wilc_debugfs_remove(void) void wilc_debugfs_remove(void)
{ {
debugfs_remove_recursive(wilc_dir); debugfs_remove_recursive(wilc_dir);
} }
module_exit(wilc_debugfs_remove);
#endif #endif
...@@ -407,7 +407,6 @@ void chip_allow_sleep(struct wilc *wilc) ...@@ -407,7 +407,6 @@ void chip_allow_sleep(struct wilc *wilc)
wilc->hif_func->hif_write_reg(wilc, 0xf0, reg & ~BIT(0)); wilc->hif_func->hif_write_reg(wilc, 0xf0, reg & ~BIT(0));
wilc->hif_func->hif_write_reg(wilc, 0xfa, 0); wilc->hif_func->hif_write_reg(wilc, 0xfa, 0);
} }
EXPORT_SYMBOL_GPL(chip_allow_sleep);
void chip_wakeup(struct wilc *wilc) void chip_wakeup(struct wilc *wilc)
{ {
...@@ -462,7 +461,6 @@ void chip_wakeup(struct wilc *wilc) ...@@ -462,7 +461,6 @@ void chip_wakeup(struct wilc *wilc)
} }
chip_ps_state = CHIP_WAKEDUP; chip_ps_state = CHIP_WAKEDUP;
} }
EXPORT_SYMBOL_GPL(chip_wakeup);
void wilc_chip_sleep_manually(struct wilc *wilc) void wilc_chip_sleep_manually(struct wilc *wilc)
{ {
...@@ -476,7 +474,6 @@ void wilc_chip_sleep_manually(struct wilc *wilc) ...@@ -476,7 +474,6 @@ void wilc_chip_sleep_manually(struct wilc *wilc)
chip_ps_state = CHIP_SLEEPING_MANUAL; chip_ps_state = CHIP_SLEEPING_MANUAL;
release_bus(wilc, RELEASE_ONLY); release_bus(wilc, RELEASE_ONLY);
} }
EXPORT_SYMBOL_GPL(wilc_chip_sleep_manually);
void host_wakeup_notify(struct wilc *wilc) void host_wakeup_notify(struct wilc *wilc)
{ {
...@@ -484,7 +481,6 @@ void host_wakeup_notify(struct wilc *wilc) ...@@ -484,7 +481,6 @@ void host_wakeup_notify(struct wilc *wilc)
wilc->hif_func->hif_write_reg(wilc, 0x10b0, 1); wilc->hif_func->hif_write_reg(wilc, 0x10b0, 1);
release_bus(wilc, RELEASE_ONLY); release_bus(wilc, RELEASE_ONLY);
} }
EXPORT_SYMBOL_GPL(host_wakeup_notify);
void host_sleep_notify(struct wilc *wilc) void host_sleep_notify(struct wilc *wilc)
{ {
...@@ -492,7 +488,6 @@ void host_sleep_notify(struct wilc *wilc) ...@@ -492,7 +488,6 @@ void host_sleep_notify(struct wilc *wilc)
wilc->hif_func->hif_write_reg(wilc, 0x10ac, 1); wilc->hif_func->hif_write_reg(wilc, 0x10ac, 1);
release_bus(wilc, RELEASE_ONLY); release_bus(wilc, RELEASE_ONLY);
} }
EXPORT_SYMBOL_GPL(host_sleep_notify);
int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
{ {
...@@ -869,7 +864,6 @@ void wilc_handle_isr(struct wilc *wilc) ...@@ -869,7 +864,6 @@ void wilc_handle_isr(struct wilc *wilc)
release_bus(wilc, RELEASE_ALLOW_SLEEP); release_bus(wilc, RELEASE_ALLOW_SLEEP);
} }
EXPORT_SYMBOL_GPL(wilc_handle_isr);
int wilc_wlan_firmware_download(struct wilc *wilc, const u8 *buffer, int wilc_wlan_firmware_download(struct wilc *wilc, const u8 *buffer,
u32 buffer_size) u32 buffer_size)
......
...@@ -835,4 +835,6 @@ struct wilc; ...@@ -835,4 +835,6 @@ struct wilc;
int wilc_wlan_init(struct net_device *dev); int wilc_wlan_init(struct net_device *dev);
u32 wilc_get_chipid(struct wilc *wilc, bool update); u32 wilc_get_chipid(struct wilc *wilc, bool update);
int wilc_debugfs_init(void);
void wilc_debugfs_remove(void);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment