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 From 56cb3cc1872923b69fdeeb00362b7da4d6cf5590 Mon Sep 17 00:00:00 2001 From: Micky Ching Date: Wed, 18 Dec 2013 10:03:13 +0800 Subject: mfd: rtsx: Add support for card reader rtl8402 rtl8402 is much like rtl8411, so just add it to rtl8411.c Signed-off-by: Micky Ching Reviewed-by: Dan Carpenter Signed-off-by: Lee Jones --- drivers/mfd/rtsx_pcr.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/mfd/rtsx_pcr.h') diff --git a/drivers/mfd/rtsx_pcr.h b/drivers/mfd/rtsx_pcr.h index e9feadbfaf5c..07e4c2ebf05a 100644 --- a/drivers/mfd/rtsx_pcr.h +++ b/drivers/mfd/rtsx_pcr.h @@ -30,6 +30,7 @@ void rts5209_init_params(struct rtsx_pcr *pcr); void rts5229_init_params(struct rtsx_pcr *pcr); void rtl8411_init_params(struct rtsx_pcr *pcr); +void rtl8402_init_params(struct rtsx_pcr *pcr); void rts5227_init_params(struct rtsx_pcr *pcr); void rts5249_init_params(struct rtsx_pcr *pcr); void rtl8411b_init_params(struct rtsx_pcr *pcr); -- cgit v1.2.3