summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/rtl8411.c
diff options
context:
space:
mode:
authorRoger Tseng <rogerable@realtek.com>2013-02-04 15:45:58 +0800
committerSamuel Ortiz <sameo@linux.intel.com>2013-02-14 00:22:59 +0100
commit88a7ee37f3c5c73b000f7ba2000b27c5002a5286 (patch)
treecf73579f1eb6597ca8df1edc93597a7b0023869e /drivers/mfd/rtl8411.c
parent8ea402f5646e6e36c8cd0a62053ba8939204dceb (diff)
downloadlinux-88a7ee37f3c5c73b000f7ba2000b27c5002a5286.tar.gz
linux-88a7ee37f3c5c73b000f7ba2000b27c5002a5286.tar.bz2
linux-88a7ee37f3c5c73b000f7ba2000b27c5002a5286.zip
mfd: rtsx: Implement driving adjustment to device-dependent callbacks
Implement different ways of selecting driving capability(a necessary adjustment along with voltage change). It was origionally in device-independent mmc/host/rtsx_pci_sdmmc.c. Moving it here to support devices which may have a different way of adjustment. Signed-off-by: Roger Tseng <rogerable@realtek.com> Reviewed-by: Wei WANG <wei_wang@realsil.com.cn> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/rtl8411.c')
-rw-r--r--drivers/mfd/rtl8411.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/mfd/rtl8411.c b/drivers/mfd/rtl8411.c
index 3d3b4addf81a..2a2d31687b72 100644
--- a/drivers/mfd/rtl8411.c
+++ b/drivers/mfd/rtl8411.c
@@ -115,14 +115,24 @@ static int rtl8411_card_power_off(struct rtsx_pcr *pcr, int card)
static int rtl8411_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage)
{
u8 mask, val;
+ int err;
mask = (BPP_REG_TUNED18 << BPP_TUNED18_SHIFT_8411) | BPP_PAD_MASK;
- if (voltage == OUTPUT_3V3)
+ if (voltage == OUTPUT_3V3) {
+ err = rtsx_pci_write_register(pcr,
+ SD30_DRIVE_SEL, 0x07, DRIVER_TYPE_D);
+ if (err < 0)
+ return err;
val = (BPP_ASIC_3V3 << BPP_TUNED18_SHIFT_8411) | BPP_PAD_3V3;
- else if (voltage == OUTPUT_1V8)
+ } else if (voltage == OUTPUT_1V8) {
+ err = rtsx_pci_write_register(pcr,
+ SD30_DRIVE_SEL, 0x07, DRIVER_TYPE_B);
+ if (err < 0)
+ return err;
val = (BPP_ASIC_1V8 << BPP_TUNED18_SHIFT_8411) | BPP_PAD_1V8;
- else
+ } else {
return -EINVAL;
+ }
return rtsx_pci_write_register(pcr, LDO_CTL, mask, val);
}