Commit bfee6a23 authored by Tobin C. Harding's avatar Tobin C. Harding Committed by Greg Kroah-Hartman

staging: ks7010: create reg_status_type enum type

SDIO header currently defines unused constants READ_STATUS_BUSY and
WRITE_STATUS_IDLE. There are reciprocal constants that are used
READ_STATUS_IDLE and WRITE_STATUS_BUSY. We can roll these into a
single enumeration type and remove the two that are unused.

Add enumeration type containing IDLE/BUSY pair that are currently used
within the SDIO source. Change source to use new enum types.
Signed-off-by: default avatarTobin C. Harding <me@tobin.cc>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4330887f
......@@ -295,7 +295,7 @@ static int write_to_device(struct ks_wlan_private *priv, unsigned char *buffer,
return ret;
}
rw_data = WRITE_STATUS_BUSY;
rw_data = REG_STATUS_BUSY;
ret = ks7010_sdio_write(priv, WRITE_STATUS, &rw_data, sizeof(rw_data));
if (ret) {
DPRINTK(1, " error : WRITE_STATUS=%02X\n", rw_data);
......@@ -415,7 +415,7 @@ static void ks_wlan_hw_rx(struct ks_wlan_private *priv, uint16_t size)
rx_buffer->data, 32);
#endif
/* rx_status update */
read_status = READ_STATUS_IDLE;
read_status = REG_STATUS_IDLE;
ret = ks7010_sdio_write(priv, READ_STATUS, &read_status,
sizeof(read_status));
if (ret)
......@@ -431,7 +431,7 @@ static void ks_wlan_hw_rx(struct ks_wlan_private *priv, uint16_t size)
inc_rxqtail(priv);
/* read status update */
read_status = READ_STATUS_IDLE;
read_status = REG_STATUS_IDLE;
ret = ks7010_sdio_write(priv, READ_STATUS, &read_status,
sizeof(read_status));
if (ret)
......
......@@ -22,10 +22,13 @@
/* Older sources suggest earlier versions were named 7910 or 79xx */
#define SDIO_DEVICE_ID_KS_7010 0x7910
/* Read Status Register */
/* Read/Write Status Register */
#define READ_STATUS 0x000000
#define READ_STATUS_BUSY 0
#define READ_STATUS_IDLE 1
#define WRITE_STATUS 0x00000C
enum reg_status_type {
REG_STATUS_BUSY,
REG_STATUS_IDLE
};
/* Read Index Register */
#define READ_INDEX 0x000004
......@@ -33,11 +36,6 @@
/* Read Data Size Register */
#define READ_DATA_SIZE 0x000008
/* Write Status Register */
#define WRITE_STATUS 0x00000C
#define WRITE_STATUS_BUSY 0
#define WRITE_STATUS_IDLE 1
/* Write Index Register */
#define WRITE_INDEX 0x000010
......
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