Skip to content

Commit 77d02aa

Browse files
quytranpzzkartben
authored andcommitted
drivers: sdhc: Update timeout unit to us for event wait
r_sdhi_wait_for_event requires input timeout as us but the current implemetation using timeout_ms instead Signed-off-by: Quy Tran <[email protected]>
1 parent 19ef611 commit 77d02aa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/sdhc/sdhc_renesas_ra.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,19 @@ static int sdhc_ra_card_busy(const struct device *dev)
126126
}
127127

128128
static int sdhi_command_send_wait(sdhi_instance_ctrl_t *p_ctrl, uint32_t command, uint32_t argument,
129-
uint32_t timeout)
129+
uint32_t timeout_ms)
130130
{
131131
/* Verify the device is not busy. */
132132
r_sdhi_wait_for_device(p_ctrl);
133133

134+
/* Convert timeout to us */
135+
uint32_t timeout_us = timeout_ms * 1000U;
136+
134137
/* Send the command. */
135138
r_sdhi_command_send_no_wait(p_ctrl, command, argument);
136139

137140
/* Wait for end of response, error or timeout */
138-
return r_sdhi_wait_for_event(p_ctrl, SDHI_PRV_RESPONSE_BIT, timeout);
141+
return r_sdhi_wait_for_event(p_ctrl, SDHI_PRV_RESPONSE_BIT, timeout_us);
139142
}
140143

141144
static int sdhc_ra_send_cmd(struct sdhc_ra_priv *priv, struct sdmmc_ra_command *ra_cmd, int retries)

0 commit comments

Comments
 (0)