Commit 4c885c6b authored by Glen Lee's avatar Glen Lee Committed by Greg Kroah-Hartman

staging: wilc1000: remove spi speed control codes

This patch removes spi speed control codes. We are not using define SPEED to
specify speed of spi, it is not proper way of doing this. It will be
provided by the device tree.

The following functions and variable are removed.
MIN_SPEED, MAX_SPEED, SPEED
wilc_spi_set_max_speed
wilc_spi_max_bus_speed
wilc_spi_default_bus_speed
hif_set_max_bus_speed
hif_set_default_bus_speed
Signed-off-by: default avatarGlen Lee <glen.lee@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 49645e5c
...@@ -17,33 +17,6 @@ ...@@ -17,33 +17,6 @@
#define USE_SPI_DMA 0 /* johnny add */ #define USE_SPI_DMA 0 /* johnny add */
#ifdef WILC_ASIC_A0
#if defined(PLAT_PANDA_ES_OMAP4460)
#define MIN_SPEED 12000000
#define MAX_SPEED 24000000
#elif defined(PLAT_WMS8304)
#define MIN_SPEED 12000000
#define MAX_SPEED 24000000 /* 4000000 */
#elif defined(CUSTOMER_PLATFORM)
/*
TODO : define Clock speed under 48M.
*
* ex)
* #define MIN_SPEED 24000000
* #define MAX_SPEED 48000000
*/
#else
#define MIN_SPEED 24000000
#define MAX_SPEED 48000000
#endif
#else /* WILC_ASIC_A0 */
/* Limit clk to 6MHz on FPGA. */
#define MIN_SPEED 6000000
#define MAX_SPEED 6000000
#endif /* WILC_ASIC_A0 */
static u32 SPEED = MIN_SPEED;
static const struct wilc1000_ops wilc1000_spi_ops; static const struct wilc1000_ops wilc1000_spi_ops;
static int wilc_bus_probe(struct spi_device *spi) static int wilc_bus_probe(struct spi_device *spi)
...@@ -119,7 +92,6 @@ int wilc_spi_write(u8 *b, u32 len) ...@@ -119,7 +92,6 @@ int wilc_spi_write(u8 *b, u32 len)
struct spi_transfer tr = { struct spi_transfer tr = {
.tx_buf = b + (i * TXRX_PHASE_SIZE), .tx_buf = b + (i * TXRX_PHASE_SIZE),
.len = TXRX_PHASE_SIZE, .len = TXRX_PHASE_SIZE,
.speed_hz = SPEED,
.bits_per_word = 8, .bits_per_word = 8,
.delay_usecs = 0, .delay_usecs = 0,
}; };
...@@ -145,7 +117,6 @@ int wilc_spi_write(u8 *b, u32 len) ...@@ -145,7 +117,6 @@ int wilc_spi_write(u8 *b, u32 len)
struct spi_transfer tr = { struct spi_transfer tr = {
.tx_buf = b + (blk * TXRX_PHASE_SIZE), .tx_buf = b + (blk * TXRX_PHASE_SIZE),
.len = remainder, .len = remainder,
.speed_hz = SPEED,
.bits_per_word = 8, .bits_per_word = 8,
.delay_usecs = 0, .delay_usecs = 0,
}; };
...@@ -187,7 +158,6 @@ int wilc_spi_write(u8 *b, u32 len) ...@@ -187,7 +158,6 @@ int wilc_spi_write(u8 *b, u32 len)
struct spi_transfer tr = { struct spi_transfer tr = {
.tx_buf = b, .tx_buf = b,
.len = len, .len = len,
.speed_hz = SPEED,
.delay_usecs = 0, .delay_usecs = 0,
}; };
char *r_buffer = kzalloc(len, GFP_KERNEL); char *r_buffer = kzalloc(len, GFP_KERNEL);
...@@ -249,7 +219,6 @@ int wilc_spi_read(u8 *rb, u32 rlen) ...@@ -249,7 +219,6 @@ int wilc_spi_read(u8 *rb, u32 rlen)
struct spi_transfer tr = { struct spi_transfer tr = {
.rx_buf = rb + (i * TXRX_PHASE_SIZE), .rx_buf = rb + (i * TXRX_PHASE_SIZE),
.len = TXRX_PHASE_SIZE, .len = TXRX_PHASE_SIZE,
.speed_hz = SPEED,
.bits_per_word = 8, .bits_per_word = 8,
.delay_usecs = 0, .delay_usecs = 0,
}; };
...@@ -273,7 +242,6 @@ int wilc_spi_read(u8 *rb, u32 rlen) ...@@ -273,7 +242,6 @@ int wilc_spi_read(u8 *rb, u32 rlen)
struct spi_transfer tr = { struct spi_transfer tr = {
.rx_buf = rb + (blk * TXRX_PHASE_SIZE), .rx_buf = rb + (blk * TXRX_PHASE_SIZE),
.len = remainder, .len = remainder,
.speed_hz = SPEED,
.bits_per_word = 8, .bits_per_word = 8,
.delay_usecs = 0, .delay_usecs = 0,
}; };
...@@ -313,7 +281,6 @@ int wilc_spi_read(u8 *rb, u32 rlen) ...@@ -313,7 +281,6 @@ int wilc_spi_read(u8 *rb, u32 rlen)
struct spi_transfer tr = { struct spi_transfer tr = {
.rx_buf = rb, .rx_buf = rb,
.len = rlen, .len = rlen,
.speed_hz = SPEED,
.delay_usecs = 0, .delay_usecs = 0,
}; };
...@@ -359,7 +326,6 @@ int wilc_spi_write_read(u8 *wb, u8 *rb, u32 rlen) ...@@ -359,7 +326,6 @@ int wilc_spi_write_read(u8 *wb, u8 *rb, u32 rlen)
.rx_buf = rb, .rx_buf = rb,
.tx_buf = wb, .tx_buf = wb,
.len = rlen, .len = rlen,
.speed_hz = SPEED,
.bits_per_word = 8, .bits_per_word = 8,
.delay_usecs = 0, .delay_usecs = 0,
...@@ -384,11 +350,3 @@ int wilc_spi_write_read(u8 *wb, u8 *rb, u32 rlen) ...@@ -384,11 +350,3 @@ int wilc_spi_write_read(u8 *wb, u8 *rb, u32 rlen)
return ret; return ret;
} }
int wilc_spi_set_max_speed(void)
{
SPEED = MAX_SPEED;
PRINT_INFO(BUS_DBG, "@@@@@@@@@@@@ change SPI speed to %d @@@@@@@@@\n", SPEED);
return 1;
}
...@@ -7,6 +7,4 @@ int wilc_spi_init(void); ...@@ -7,6 +7,4 @@ int wilc_spi_init(void);
int wilc_spi_write(u8 *b, u32 len); int wilc_spi_write(u8 *b, u32 len);
int wilc_spi_read(u8 *rb, u32 rlen); int wilc_spi_read(u8 *rb, u32 rlen);
int wilc_spi_write_read(u8 *wb, u8 *rb, u32 rlen); int wilc_spi_write_read(u8 *wb, u8 *rb, u32 rlen);
int wilc_spi_set_max_speed(void);
#endif #endif
...@@ -793,15 +793,6 @@ static int _wilc_spi_init(struct wilc *wilc, wilc_debug_func func) ...@@ -793,15 +793,6 @@ static int _wilc_spi_init(struct wilc *wilc, wilc_debug_func func)
return 1; return 1;
} }
static void wilc_spi_max_bus_speed(void)
{
wilc_spi_set_max_speed();
}
static void wilc_spi_default_bus_speed(void)
{
}
static int wilc_spi_read_size(u32 *size) static int wilc_spi_read_size(u32 *size)
{ {
int ret; int ret;
...@@ -1036,6 +1027,4 @@ const struct wilc_hif_func wilc_hif_spi = { ...@@ -1036,6 +1027,4 @@ const struct wilc_hif_func wilc_hif_spi = {
.hif_block_tx_ext = _wilc_spi_write, .hif_block_tx_ext = _wilc_spi_write,
.hif_block_rx_ext = _wilc_spi_read, .hif_block_rx_ext = _wilc_spi_read,
.hif_sync_ext = wilc_spi_sync_ext, .hif_sync_ext = wilc_spi_sync_ext,
.hif_set_max_bus_speed = wilc_spi_max_bus_speed,
.hif_set_default_bus_speed = wilc_spi_default_bus_speed,
}; };
...@@ -251,8 +251,6 @@ struct wilc_hif_func { ...@@ -251,8 +251,6 @@ struct wilc_hif_func {
int (*hif_block_tx_ext)(u32, u8 *, u32); int (*hif_block_tx_ext)(u32, u8 *, u32);
int (*hif_block_rx_ext)(u32, u8 *, u32); int (*hif_block_rx_ext)(u32, u8 *, u32);
int (*hif_sync_ext)(int); int (*hif_sync_ext)(int);
void (*hif_set_max_bus_speed)(void);
void (*hif_set_default_bus_speed)(void);
int (*enable_interrupt)(struct wilc *nic); int (*enable_interrupt)(struct wilc *nic);
void (*disable_interrupt)(struct wilc *nic); void (*disable_interrupt)(struct wilc *nic);
}; };
......
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