Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: usdhi6rol0: Implement card_busy function

When switching card voltage to UHS voltage the mmc framework tries to
check the card busy signal, meaning the card pulling DAT0 line low,
before the switch is made. Drivers that does not implement the card_busy
function will manage to do the switch anyway, but the framework will
print a warning about not being able to verify the voltage signal.

Implement card_busy function.

Signed-off-by: Mårten Lindahl <marten.lindahl@axis.com>
Link: https://lore.kernel.org/r/20210816142314.1168-1-marten.lindahl@axis.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Mårten Lindahl and committed by
Ulf Hansson
4850c225 f4ff24f8

+10
+10
drivers/mmc/host/usdhi6rol0.c
··· 1186 1186 return ret; 1187 1187 } 1188 1188 1189 + static int usdhi6_card_busy(struct mmc_host *mmc) 1190 + { 1191 + struct usdhi6_host *host = mmc_priv(mmc); 1192 + u32 tmp = usdhi6_read(host, USDHI6_SD_INFO2); 1193 + 1194 + /* Card is busy if it is pulling dat[0] low */ 1195 + return !(tmp & USDHI6_SD_INFO2_SDDAT0); 1196 + } 1197 + 1189 1198 static const struct mmc_host_ops usdhi6_ops = { 1190 1199 .request = usdhi6_request, 1191 1200 .set_ios = usdhi6_set_ios, ··· 1202 1193 .get_ro = usdhi6_get_ro, 1203 1194 .enable_sdio_irq = usdhi6_enable_sdio_irq, 1204 1195 .start_signal_voltage_switch = usdhi6_sig_volt_switch, 1196 + .card_busy = usdhi6_card_busy, 1205 1197 }; 1206 1198 1207 1199 /* State machine handlers */