diff options
author | Wei WANG <wei_wang@realsil.com.cn> | 2013-01-23 01:51:04 (GMT) |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-01-27 00:29:39 (GMT) |
commit | d817ac4e181710cd02b582b759d3123ad2cfa8d8 (patch) | |
tree | 1e4356b9baf0903293d9dc428a3b5badf8041015 /drivers/mfd/rts5209.c | |
parent | 00441b5e6b98ad6a50b5cb7f88d473e3ea1e0d75 (diff) | |
download | linux-d817ac4e181710cd02b582b759d3123ad2cfa8d8.tar.xz |
mfd: rtsx: Add output voltage switch hook
Different card reader has different method to switch output voltage,
add this callback to let the card reader implement its individual switch
function.
This is needed as rtl8411 has a specific switch output voltage procedure.
Signed-off-by: Wei WANG <wei_wang@realsil.com.cn>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/rts5209.c')
-rw-r--r-- | drivers/mfd/rts5209.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/mfd/rts5209.c b/drivers/mfd/rts5209.c index 283a4f1..ba74de8 100644 --- a/drivers/mfd/rts5209.c +++ b/drivers/mfd/rts5209.c @@ -144,6 +144,25 @@ static int rts5209_card_power_off(struct rtsx_pcr *pcr, int card) return rtsx_pci_send_cmd(pcr, 100); } +static int rts5209_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage) +{ + int err; + + if (voltage == OUTPUT_3V3) { + err = rtsx_pci_write_phy_register(pcr, 0x08, 0x4FC0 | 0x24); + if (err < 0) + return err; + } else if (voltage == OUTPUT_1V8) { + err = rtsx_pci_write_phy_register(pcr, 0x08, 0x4C40 | 0x24); + if (err < 0) + return err; + } else { + return -EINVAL; + } + + return 0; +} + static const struct pcr_ops rts5209_pcr_ops = { .extra_init_hw = rts5209_extra_init_hw, .optimize_phy = rts5209_optimize_phy, @@ -153,6 +172,7 @@ static const struct pcr_ops rts5209_pcr_ops = { .disable_auto_blink = rts5209_disable_auto_blink, .card_power_on = rts5209_card_power_on, .card_power_off = rts5209_card_power_off, + .switch_output_voltage = rts5209_switch_output_voltage, .cd_deglitch = NULL, }; |