Commit 49645e5c authored by Glen Lee's avatar Glen Lee Committed by Greg Kroah-Hartman

staging: wilc1000: remove sdio speed control codes

This patch removes spi speed control related functions and variable. We cannot
get exact clock what we need in this way and it can causes some problem in host
side by setting the clock, so remove the codes.
Speed control codes in spi also will removed in next patch, so it's ok to
remove functions in linux_wlan.c and wilc_wlan.c which also not used anymore.

The Following functions and varialbe are removed.
MAX_SPEED, sdio_default_speed
wilc_bus_set_default_speed
wilc_bus_set_max_speed
linux_sdio_set_speed
linux_sdio_get_speed
wilc_sdio_set_max_speed
wilc_sdio_set_default_speed
Signed-off-by: default avatarGlen Lee <glen.lee@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e17bc4c4
......@@ -733,12 +733,6 @@ void wilc1000_wlan_deinit(struct net_device *dev)
if (wl->initialized) {
netdev_info(dev, "Deinitializing wilc1000...\n");
#if defined(PLAT_ALLWINNER_A20) || defined(PLAT_ALLWINNER_A23) || defined(PLAT_ALLWINNER_A31)
PRINT_D(INIT_DBG, "skip wilc_bus_set_default_speed\n");
#else
wilc_bus_set_default_speed();
#endif
PRINT_D(INIT_DBG, "Disabling IRQ\n");
if (!wl->dev_irq_num &&
wl->ops->disable_interrupt) {
......@@ -929,8 +923,6 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)
goto _fail_irq_enable_;
}
wilc_bus_set_max_speed();
if (wilc_wlan_cfg_get(1, WID_FIRMWARE_VERSION, 1, 0)) {
int size;
char Firmware_ver[20];
......
......@@ -11,19 +11,7 @@
#define SDIO_MODALIAS "wilc1000_sdio"
#if defined(CUSTOMER_PLATFORM)
/* TODO : User have to stable bus clock as user's environment. */
#ifdef MAX_BUS_SPEED
#define MAX_SPEED MAX_BUS_SPEED
#else
#define MAX_SPEED 50000000
#endif
#else
#define MAX_SPEED (6 * 1000000) /* Max 50M */
#endif
static struct sdio_func *wilc_sdio_func;
static unsigned int sdio_default_speed;
#define SDIO_VENDOR_ID_WILC 0x0296
#define SDIO_DEVICE_ID_WILC 0x5347
......@@ -177,49 +165,9 @@ void wilc_sdio_disable_interrupt(struct wilc *dev)
PRINT_D(INIT_DBG, "wilc_sdio_disable_interrupt OUT\n");
}
static int linux_sdio_set_speed(int speed)
{
struct mmc_ios ios;
struct sdio_func *func = container_of(wilc_dev->dev, struct sdio_func, dev);
sdio_claim_host(func);
memcpy((void *)&ios, (void *)&func->card->host->ios, sizeof(struct mmc_ios));
func->card->host->ios.clock = speed;
ios.clock = speed;
func->card->host->ops->set_ios(func->card->host, &ios);
sdio_release_host(func);
PRINT_INFO(INIT_DBG, "@@@@@@@@@@@@ change SDIO speed to %d @@@@@@@@@\n", speed);
return 1;
}
static int linux_sdio_get_speed(void)
{
struct sdio_func *func = container_of(wilc_dev->dev, struct sdio_func, dev);
return func->card->host->ios.clock;
}
int wilc_sdio_init(void)
{
/**
* TODO :
**/
sdio_default_speed = linux_sdio_get_speed();
return 1;
}
int wilc_sdio_set_max_speed(void)
{
return linux_sdio_set_speed(MAX_SPEED);
}
int wilc_sdio_set_default_speed(void)
{
return linux_sdio_set_speed(sdio_default_speed);
}
MODULE_LICENSE("GPL");
......@@ -6,6 +6,3 @@ int wilc_sdio_cmd53(sdio_cmd53_t *cmd);
int wilc_sdio_enable_interrupt(struct wilc *);
void wilc_sdio_disable_interrupt(struct wilc *);
int wilc_sdio_set_max_speed(void);
int wilc_sdio_set_default_speed(void);
......@@ -610,16 +610,6 @@ static int sdio_init(struct wilc *wilc, wilc_debug_func func)
return 0;
}
static void sdio_set_max_speed(void)
{
wilc_sdio_set_max_speed();
}
static void sdio_set_default_speed(void)
{
wilc_sdio_set_default_speed();
}
static int sdio_read_size(u32 *size)
{
......@@ -927,8 +917,6 @@ const struct wilc_hif_func wilc_hif_sdio = {
.hif_block_tx_ext = sdio_write,
.hif_block_rx_ext = sdio_read,
.hif_sync_ext = sdio_sync_ext,
.hif_set_max_bus_speed = sdio_set_max_speed,
.hif_set_default_bus_speed = sdio_set_default_speed,
.enable_interrupt = wilc_sdio_enable_interrupt,
.disable_interrupt = wilc_sdio_disable_interrupt,
};
......
......@@ -1575,16 +1575,6 @@ int wilc_wlan_cfg_get_val(u32 wid, u8 *buffer, u32 buffer_size)
return ret;
}
void wilc_bus_set_max_speed(void)
{
g_wlan.hif_func.hif_set_max_bus_speed();
}
void wilc_bus_set_default_speed(void)
{
g_wlan.hif_func.hif_set_default_bus_speed();
}
static u32 init_chip(struct net_device *dev)
{
u32 chipid;
......
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