@@ -213,7 +213,6 @@ static u32 dw_mci_prepare_command(struct mmc_host *mmc, struct mmc_command *cmd)
213213{
214214 struct mmc_data * data ;
215215 struct dw_mci_slot * slot = mmc_priv (mmc );
216- struct dw_mci * host = slot -> host ;
217216 const struct dw_mci_drv_data * drv_data = slot -> host -> drv_data ;
218217 u32 cmdr ;
219218 cmd -> error = - EINPROGRESS ;
@@ -230,7 +229,6 @@ static u32 dw_mci_prepare_command(struct mmc_host *mmc, struct mmc_command *cmd)
230229 cmdr |= SDMMC_CMD_PRV_DAT_WAIT ;
231230
232231 if (cmd -> opcode == SD_SWITCH_VOLTAGE ) {
233- u32 clk_en_a ;
234232
235233 /* Special bit makes CMD11 not die */
236234 cmdr |= SDMMC_CMD_VOLT_SWITCH ;
@@ -250,11 +248,6 @@ static u32 dw_mci_prepare_command(struct mmc_host *mmc, struct mmc_command *cmd)
250248 * ever called with a non-zero clock. That shouldn't happen
251249 * until the voltage change is all done.
252250 */
253- clk_en_a = mci_readl (host , CLKENA );
254- clk_en_a &= ~(SDMMC_CLKEN_LOW_PWR << slot -> id );
255- mci_writel (host , CLKENA , clk_en_a );
256- mci_send_cmd (slot , SDMMC_CMD_UPD_CLK |
257- SDMMC_CMD_PRV_DAT_WAIT , 0 );
258251 }
259252
260253 if (cmd -> flags & MMC_RSP_PRESENT ) {
@@ -870,7 +863,8 @@ static void dw_mci_setup_bus(struct dw_mci_slot *slot, bool force_clkinit)
870863
871864 /* enable clock; only low power if no SDIO */
872865 clk_en_a = SDMMC_CLKEN_ENABLE << slot -> id ;
873- if (!test_bit (DW_MMC_CARD_NO_LOW_PWR , & slot -> flags ))
866+ if (!test_bit (DW_MMC_CARD_NO_LOW_PWR , & slot -> flags )
867+ && (slot -> mmc -> index != 1 ))
874868 clk_en_a |= SDMMC_CLKEN_LOW_PWR << slot -> id ;
875869 mci_writel (host , CLKENA , clk_en_a );
876870
@@ -1024,6 +1018,9 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
10241018 else
10251019 regs &= ~((0x1 << slot -> id ) << 16 );
10261020
1021+ if (mmc -> index == 1 )
1022+ regs |= (0x1 << slot -> id );
1023+
10271024 mci_writel (slot -> host , UHS_REG , regs );
10281025 slot -> host -> timing = ios -> timing ;
10291026
@@ -1275,6 +1272,9 @@ static int dw_mci_execute_tuning(struct mmc_host *mmc, u32 opcode)
12751272
12761273 if (drv_data && drv_data -> execute_tuning )
12771274 err = drv_data -> execute_tuning (slot );
1275+ else
1276+ err = 0 ;
1277+
12781278 return err ;
12791279}
12801280
0 commit comments