Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 349309
b: refs/heads/master
c: ef85e73
h: refs/heads/master
i:
  349307: 2a97863
v: v3
  • Loading branch information
Wei WANG authored and Samuel Ortiz committed Jan 27, 2013
1 parent c48b276 commit 7b10058
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 26 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d817ac4e181710cd02b582b759d3123ad2cfa8d8
refs/heads/master: ef85e736b1052d8c1e56990f0d08b6fce7cdbe41
30 changes: 5 additions & 25 deletions trunk/drivers/mmc/host/rtsx_pci_sdmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1060,26 +1060,6 @@ static int sd_wait_voltage_stable_2(struct realtek_pci_sdmmc *host)
return 0;
}

static int sd_change_bank_voltage(struct realtek_pci_sdmmc *host, u8 voltage)
{
struct rtsx_pcr *pcr = host->pcr;
int err;

if (voltage == SD_IO_3V3) {
err = rtsx_pci_write_phy_register(pcr, 0x08, 0x4FC0 | 0x24);
if (err < 0)
return err;
} else if (voltage == SD_IO_1V8) {
err = rtsx_pci_write_phy_register(pcr, 0x08, 0x4C40 | 0x24);
if (err < 0)
return err;
} else {
return -EINVAL;
}

return 0;
}

static int sdmmc_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios)
{
struct realtek_pci_sdmmc *host = mmc_priv(mmc);
Expand All @@ -1098,11 +1078,11 @@ static int sdmmc_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios)
rtsx_pci_start_run(pcr);

if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_330)
voltage = SD_IO_3V3;
voltage = OUTPUT_3V3;
else
voltage = SD_IO_1V8;
voltage = OUTPUT_1V8;

if (voltage == SD_IO_1V8) {
if (voltage == OUTPUT_1V8) {
err = rtsx_pci_write_register(pcr,
SD30_DRIVE_SEL, 0x07, DRIVER_TYPE_B);
if (err < 0)
Expand All @@ -1113,11 +1093,11 @@ static int sdmmc_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios)
goto out;
}

err = sd_change_bank_voltage(host, voltage);
err = rtsx_pci_switch_output_voltage(pcr, voltage);
if (err < 0)
goto out;

if (voltage == SD_IO_1V8) {
if (voltage == OUTPUT_1V8) {
err = sd_wait_voltage_stable_2(host);
if (err < 0)
goto out;
Expand Down

0 comments on commit 7b10058

Please sign in to comment.