From ef0cc0ec8d80a18c83aec41321ebeba639cfa09a Mon Sep 17 00:00:00 2001 From: Rui Miguel Silva Date: Thu, 2 Jul 2015 19:11:30 +0100 Subject: [PATCH] greybus: sdio: split cmd_flags to there meaning Instead of using values in the command cmd_flags field use the real flags in a bit mask. Signed-off-by: Rui Miguel Silva Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/greybus_protocols.h | 9 +++++---- drivers/staging/greybus/sdio.c | 8 ++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/staging/greybus/greybus_protocols.h b/drivers/staging/greybus/greybus_protocols.h index 6f8c15ea3900..498f6e9f44d2 100644 --- a/drivers/staging/greybus/greybus_protocols.h +++ b/drivers/staging/greybus/greybus_protocols.h @@ -769,10 +769,11 @@ struct gb_sdio_command_request { __u8 cmd; __u8 cmd_flags; #define GB_SDIO_RSP_NONE 0x00 -#define GB_SDIO_RSP_R1_R5_R6_R7 0x01 -#define GB_SDIO_RSP_R1B 0x02 -#define GB_SDIO_RSP_R2 0x03 -#define GB_SDIO_RSP_R3_R4 0x04 +#define GB_SDIO_RSP_PRESENT 0x01 +#define GB_SDIO_RSP_136 0x02 +#define GB_SDIO_RSP_CRC 0x04 +#define GB_SDIO_RSP_BUSY 0x08 +#define GB_SDIO_RSP_OPCODE 0x10 __u8 cmd_type; #define GB_SDIO_CMD_AC 0x00 diff --git a/drivers/staging/greybus/sdio.c b/drivers/staging/greybus/sdio.c index f028e14fc918..e842cae7a5bd 100644 --- a/drivers/staging/greybus/sdio.c +++ b/drivers/staging/greybus/sdio.c @@ -38,6 +38,14 @@ static struct workqueue_struct *gb_sdio_mrq_workqueue; /* Define get_version() routine */ define_get_version(gb_sdio_host, SDIO); +#define GB_SDIO_RSP_R1_R5_R6_R7 (GB_SDIO_RSP_PRESENT | GB_SDIO_RSP_CRC | \ + GB_SDIO_RSP_OPCODE) +#define GB_SDIO_RSP_R3_R4 (GB_SDIO_RSP_PRESENT) +#define GB_SDIO_RSP_R2 (GB_SDIO_RSP_PRESENT | GB_SDIO_RSP_CRC | \ + GB_SDIO_RSP_136) +#define GB_SDIO_RSP_R1B (GB_SDIO_RSP_PRESENT | GB_SDIO_RSP_CRC | \ + GB_SDIO_RSP_OPCODE | GB_SDIO_RSP_BUSY) + static void _gb_sdio_set_host_caps(struct gb_sdio_host *host, u32 r) { u32 caps = 0;