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>
This commit is contained in:
Micky Ching
2013-12-18 10:03:12 +08:00
committed by Lee Jones
parent c1ec8fc308
commit 0da14eeba2
2 changed files with 21 additions and 40 deletions

View File

@@ -63,4 +63,12 @@ static inline u8 map_sd_drive(int idx)
#define rtl8411_reg_to_sd30_drive_sel_3v3(reg) (((reg) >> 5) & 0x07)
#define rtl8411b_reg_to_sd30_drive_sel_3v3(reg) ((reg) & 0x03)
#define set_pull_ctrl_tables(pcr, __device) \
do { \
pcr->sd_pull_ctl_enable_tbl = __device##_sd_pull_ctl_enable_tbl; \
pcr->sd_pull_ctl_disable_tbl = __device##_sd_pull_ctl_disable_tbl; \
pcr->ms_pull_ctl_enable_tbl = __device##_ms_pull_ctl_enable_tbl; \
pcr->ms_pull_ctl_disable_tbl = __device##_ms_pull_ctl_disable_tbl; \
} while (0)
#endif