/*
* Change data bus width and DDR mode of a host.
*/
-void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width, int ddr)
+void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width,
+ unsigned int ddr)
{
host->ios.bus_width = width;
- host->ios.ddr = ddr ? MMC_DDR_MODE : MMC_SDR_MODE;
+ host->ios.ddr = ddr;
mmc_set_ios(host);
}
*/
void mmc_set_bus_width(struct mmc_host *host, unsigned int width)
{
- mmc_set_bus_width_ddr(host, width, 0);
+ mmc_set_bus_width_ddr(host, width, MMC_SDR_MODE);
}
/**
void mmc_set_clock(struct mmc_host *host, unsigned int hz);
void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode);
void mmc_set_bus_width(struct mmc_host *host, unsigned int width);
-void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width, int ddr);
+void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width,
+ unsigned int ddr);
u32 mmc_select_voltage(struct mmc_host *host, u32 ocr);
void mmc_set_timing(struct mmc_host *host, unsigned int timing);
struct mmc_card *oldcard)
{
struct mmc_card *card;
- int err, ddr = 0;
+ int err, ddr = MMC_SDR_MODE;
u32 cid[4];
unsigned int max_dtr;
if (mmc_card_highspeed(card)) {
if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_8V)
&& (host->caps & (MMC_CAP_1_8V_DDR)))
- ddr = 1;
+ ddr = MMC_1_8V_DDR_MODE;
else if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_2V)
&& (host->caps & (MMC_CAP_1_2V_DDR)))
- ddr = 1;
+ ddr = MMC_1_2V_DDR_MODE;
}
/*
unsigned char ddr; /* dual data rate used */
#define MMC_SDR_MODE 0
-#define MMC_DDR_MODE 1
+#define MMC_1_2V_DDR_MODE 1
+#define MMC_1_8V_DDR_MODE 2
};
struct mmc_host_ops {