greybus: sdio: send data block details at command request
If SDIO request include data to be transfer send details (data blocks and block size) in command request, as it seems some controllers need this info prior to set the registers correctly. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
1ec5843ee9
commit
10ed193876
@ -1088,6 +1088,8 @@ struct gb_sdio_command_request {
|
||||
#define GB_SDIO_CMD_BCR 0x03
|
||||
|
||||
__le32 cmd_arg;
|
||||
__le16 data_blocks;
|
||||
__le16 data_blksz;
|
||||
} __packed;
|
||||
|
||||
struct gb_sdio_command_response {
|
||||
|
@ -373,8 +373,9 @@ out:
|
||||
|
||||
static int gb_sdio_command(struct gb_sdio_host *host, struct mmc_command *cmd)
|
||||
{
|
||||
struct gb_sdio_command_request request;
|
||||
struct gb_sdio_command_request request = {0};
|
||||
struct gb_sdio_command_response response;
|
||||
struct mmc_data *data = host->mrq->data;
|
||||
u8 cmd_flags;
|
||||
u8 cmd_type;
|
||||
int i;
|
||||
@ -427,6 +428,11 @@ static int gb_sdio_command(struct gb_sdio_host *host, struct mmc_command *cmd)
|
||||
request.cmd_flags = cmd_flags;
|
||||
request.cmd_type = cmd_type;
|
||||
request.cmd_arg = cpu_to_le32(cmd->arg);
|
||||
/* some controllers need to know at command time data details */
|
||||
if (data) {
|
||||
request.data_blocks = cpu_to_le16(data->blocks);
|
||||
request.data_blksz = cpu_to_le16(data->blksz);
|
||||
}
|
||||
|
||||
ret = gb_operation_sync(host->connection, GB_SDIO_TYPE_COMMAND,
|
||||
&request, sizeof(request), &response,
|
||||
|
Loading…
x
Reference in New Issue
Block a user