Commit 484a4d66 authored by Rui Miguel Silva's avatar Rui Miguel Silva Committed by Greg Kroah-Hartman

greybus: sdio: convert vdd kernel values to greybus

We need to convert vdd kernel values to greybus ones. And we get this by
shifting the kernel values by 8.
Signed-off-by: default avatarRui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 56c78715
......@@ -43,6 +43,9 @@ struct gb_sdio_host {
#define GB_SDIO_RSP_R1B (GB_SDIO_RSP_PRESENT | GB_SDIO_RSP_CRC | \
GB_SDIO_RSP_OPCODE | GB_SDIO_RSP_BUSY)
/* kernel vdd starts at 0x80 and we need to translate to greybus ones 0x01 */
#define GB_SDIO_VDD_SHIFT 8
static inline bool single_op(struct mmc_command *cmd)
{
uint32_t opcode = cmd->opcode;
......@@ -574,10 +577,14 @@ static void gb_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
u8 timing;
u8 signal_voltage;
u8 drv_type;
u32 vdd = 0;
mutex_lock(&host->lock);
request.clock = cpu_to_le32(ios->clock);
request.vdd = cpu_to_le32(1 << ios->vdd);
if (ios->vdd)
vdd = 1 << (ios->vdd - GB_SDIO_VDD_SHIFT);
request.vdd = cpu_to_le32(vdd);
request.bus_mode = (ios->bus_mode == MMC_BUSMODE_OPENDRAIN ?
GB_SDIO_BUSMODE_OPENDRAIN :
......
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