From 0da14eeba216932db2e4b8805ab58dae72e44a45 Mon Sep 17 00:00:00 2001 From: Micky Ching Date: Wed, 18 Dec 2013 10:03:12 +0800 Subject: 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 Reviewed-by: Dan Carpenter Signed-off-by: Lee Jones --- drivers/mfd/rtsx_pcr.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/mfd/rtsx_pcr.h') 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) #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 -- cgit v1.2.3