Loading drivers/mmc/core/core.c +24 −14 Original line number Diff line number Diff line Loading @@ -1672,11 +1672,33 @@ int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage) } int mmc_host_set_uhs_voltage(struct mmc_host *host) { u32 clock; /* * During a signal voltage level switch, the clock must be gated * for 5 ms according to the SD spec */ clock = host->ios.clock; host->ios.clock = 0; mmc_set_ios(host); if (mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180)) return -EAGAIN; /* Keep clock gated for at least 10 ms, though spec only says 5 ms */ mmc_delay(10); host->ios.clock = clock; mmc_set_ios(host); return 0; } int mmc_set_uhs_voltage(struct mmc_host *host, u32 ocr) { struct mmc_command cmd = {}; int err = 0; u32 clock; /* * If we cannot switch voltages, return failure so the caller Loading Loading @@ -1708,15 +1730,8 @@ int mmc_set_uhs_voltage(struct mmc_host *host, u32 ocr) err = -EAGAIN; goto power_cycle; } /* * During a signal voltage level switch, the clock must be gated * for 5 ms according to the SD spec */ clock = host->ios.clock; host->ios.clock = 0; mmc_set_ios(host); if (mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180)) { if (mmc_host_set_uhs_voltage(host)) { /* * Voltages may not have been switched, but we've already * sent CMD11, so a power cycle is required anyway Loading @@ -1725,11 +1740,6 @@ int mmc_set_uhs_voltage(struct mmc_host *host, u32 ocr) goto power_cycle; } /* Keep clock gated for at least 10 ms, though spec only says 5 ms */ mmc_delay(10); host->ios.clock = clock; mmc_set_ios(host); /* Wait for at least 1 ms according to spec */ mmc_delay(1); Loading drivers/mmc/core/core.h +1 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode); void mmc_set_bus_width(struct mmc_host *host, unsigned int width); u32 mmc_select_voltage(struct mmc_host *host, u32 ocr); int mmc_set_uhs_voltage(struct mmc_host *host, u32 ocr); int mmc_host_set_uhs_voltage(struct mmc_host *host); int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage); void mmc_set_timing(struct mmc_host *host, unsigned int timing); void mmc_set_driver_type(struct mmc_host *host, unsigned int drv_type); Loading Loading
drivers/mmc/core/core.c +24 −14 Original line number Diff line number Diff line Loading @@ -1672,11 +1672,33 @@ int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage) } int mmc_host_set_uhs_voltage(struct mmc_host *host) { u32 clock; /* * During a signal voltage level switch, the clock must be gated * for 5 ms according to the SD spec */ clock = host->ios.clock; host->ios.clock = 0; mmc_set_ios(host); if (mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180)) return -EAGAIN; /* Keep clock gated for at least 10 ms, though spec only says 5 ms */ mmc_delay(10); host->ios.clock = clock; mmc_set_ios(host); return 0; } int mmc_set_uhs_voltage(struct mmc_host *host, u32 ocr) { struct mmc_command cmd = {}; int err = 0; u32 clock; /* * If we cannot switch voltages, return failure so the caller Loading Loading @@ -1708,15 +1730,8 @@ int mmc_set_uhs_voltage(struct mmc_host *host, u32 ocr) err = -EAGAIN; goto power_cycle; } /* * During a signal voltage level switch, the clock must be gated * for 5 ms according to the SD spec */ clock = host->ios.clock; host->ios.clock = 0; mmc_set_ios(host); if (mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180)) { if (mmc_host_set_uhs_voltage(host)) { /* * Voltages may not have been switched, but we've already * sent CMD11, so a power cycle is required anyway Loading @@ -1725,11 +1740,6 @@ int mmc_set_uhs_voltage(struct mmc_host *host, u32 ocr) goto power_cycle; } /* Keep clock gated for at least 10 ms, though spec only says 5 ms */ mmc_delay(10); host->ios.clock = clock; mmc_set_ios(host); /* Wait for at least 1 ms according to spec */ mmc_delay(1); Loading
drivers/mmc/core/core.h +1 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode); void mmc_set_bus_width(struct mmc_host *host, unsigned int width); u32 mmc_select_voltage(struct mmc_host *host, u32 ocr); int mmc_set_uhs_voltage(struct mmc_host *host, u32 ocr); int mmc_host_set_uhs_voltage(struct mmc_host *host); int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage); void mmc_set_timing(struct mmc_host *host, unsigned int timing); void mmc_set_driver_type(struct mmc_host *host, unsigned int drv_type); Loading