Commit 10ed1938 authored by Rui Miguel Silva's avatar Rui Miguel Silva Committed by Greg Kroah-Hartman

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: default avatarRui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 1ec5843e
......@@ -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 @@ static int gb_sdio_transfer(struct gb_sdio_host *host, struct mmc_data *data)
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,
......
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