diff options
author | Micky Ching <micky_ching@realsil.com.cn> | 2013-12-17 21:03:12 -0500 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2014-01-21 03:28:11 -0500 |
commit | 0da14eeba216932db2e4b8805ab58dae72e44a45 (patch) | |
tree | ca2b65702d6d2057787533da70358ece2dc62ed3 /drivers/mfd/rtsx_pcr.h | |
parent | c1ec8fc308bb8171c76b5bed7f4028b6290e53f9 (diff) |
mfd: rtsx: Add set pull control macro and simplify rtl8411
Add set pull control macro to reduce code for setting pull control, and
use a common init function to reduce code for rtl8411.c. So this patch
is used to just simplify code.
Signed-off-by: Micky Ching <micky_ching@realsil.com.cn>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/rtsx_pcr.h')
-rw-r--r-- | drivers/mfd/rtsx_pcr.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mfd/rtsx_pcr.h b/drivers/mfd/rtsx_pcr.h index 947e79b05ceb..e9feadbfaf5c 100644 --- a/drivers/mfd/rtsx_pcr.h +++ b/drivers/mfd/rtsx_pcr.h | |||
@@ -63,4 +63,12 @@ static inline u8 map_sd_drive(int idx) | |||
63 | #define rtl8411_reg_to_sd30_drive_sel_3v3(reg) (((reg) >> 5) & 0x07) | 63 | #define rtl8411_reg_to_sd30_drive_sel_3v3(reg) (((reg) >> 5) & 0x07) |
64 | #define rtl8411b_reg_to_sd30_drive_sel_3v3(reg) ((reg) & 0x03) | 64 | #define rtl8411b_reg_to_sd30_drive_sel_3v3(reg) ((reg) & 0x03) |
65 | 65 | ||
66 | #define set_pull_ctrl_tables(pcr, __device) \ | ||
67 | do { \ | ||
68 | pcr->sd_pull_ctl_enable_tbl = __device##_sd_pull_ctl_enable_tbl; \ | ||
69 | pcr->sd_pull_ctl_disable_tbl = __device##_sd_pull_ctl_disable_tbl; \ | ||
70 | pcr->ms_pull_ctl_enable_tbl = __device##_ms_pull_ctl_enable_tbl; \ | ||
71 | pcr->ms_pull_ctl_disable_tbl = __device##_ms_pull_ctl_disable_tbl; \ | ||
72 | } while (0) | ||
73 | |||
66 | #endif | 74 | #endif |