* [PATCH 0/3] mfd: rtsx: Decrease driver size and add new device
@ 2013-11-15 8:34 micky_ching
2013-11-15 8:34 ` [PATCH 1/3] mfd: rtsx: reduce code duplication in rtl8411 micky_ching
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: micky_ching @ 2013-11-15 8:34 UTC (permalink / raw)
To: sameo; +Cc: devel, linux-kernel, gregkh, wei_wang, rogerable, Micky Ching
From: Micky Ching <micky_ching@realsil.com.cn>
With the recent added support request of yet another device, the
burden of duplicated code was becoming a little messy. To rectify is,
we init rtl8411-like chips to 8411 param first, then modify the
different values according each chip.
Lee Jones (2):
mfd: rtsx: reduce code duplication in rtl8411
mfd: rtsx: Prevent 'used uninitialised' warnings
Micky Ching (1):
mfd: rtsx: add card reader rtl8402
drivers/mfd/rtl8411.c | 111 +++++++++++++++++++++++-------------------------
drivers/mfd/rtsx_pcr.c | 9 ++--
drivers/mfd/rtsx_pcr.h | 9 +++-
3 files changed, 65 insertions(+), 64 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] mfd: rtsx: reduce code duplication in rtl8411
2013-11-15 8:34 [PATCH 0/3] mfd: rtsx: Decrease driver size and add new device micky_ching
@ 2013-11-15 8:34 ` micky_ching
2013-11-15 14:58 ` Lee Jones
2013-11-15 8:34 ` [PATCH 2/3] mfd: rtsx: add card reader rtl8402 micky_ching
2013-11-15 8:34 ` [PATCH 3/3] mfd: rtsx: Prevent 'used uninitialised' warnings micky_ching
2 siblings, 1 reply; 7+ messages in thread
From: micky_ching @ 2013-11-15 8:34 UTC (permalink / raw)
To: sameo
Cc: devel, linux-kernel, gregkh, wei_wang, rogerable, Lee Jones,
Micky Ching
From: Lee Jones <lee.jones@linaro.org>
in order to remove duplicated code in rtl8411, we make 8411 as the base
init params, and other like-8411 chips will just change the different
value with 8411, this can save some source code.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Micky Ching <micky_ching@realsil.com.cn>
---
drivers/mfd/rtl8411.c | 76 +++++++++++++-----------------------------------
drivers/mfd/rtsx_pcr.c | 7 ++---
drivers/mfd/rtsx_pcr.h | 9 +++++-
3 files changed, 31 insertions(+), 61 deletions(-)
diff --git a/drivers/mfd/rtl8411.c b/drivers/mfd/rtl8411.c
index 5280135..4de1045 100644
--- a/drivers/mfd/rtl8411.c
+++ b/drivers/mfd/rtl8411.c
@@ -279,7 +279,7 @@ static int rtl8411_conv_clk_and_div_n(int input, int dir)
return output;
}
-static const struct pcr_ops rtl8411_pcr_ops = {
+static struct pcr_ops rtl8411_pcr_ops = {
.fetch_vendor_settings = rtl8411_fetch_vendor_settings,
.extra_init_hw = rtl8411_extra_init_hw,
.optimize_phy = NULL,
@@ -295,22 +295,6 @@ static const struct pcr_ops rtl8411_pcr_ops = {
.force_power_down = rtl8411_force_power_down,
};
-static const struct pcr_ops rtl8411b_pcr_ops = {
- .fetch_vendor_settings = rtl8411b_fetch_vendor_settings,
- .extra_init_hw = rtl8411b_extra_init_hw,
- .optimize_phy = NULL,
- .turn_on_led = rtl8411_turn_on_led,
- .turn_off_led = rtl8411_turn_off_led,
- .enable_auto_blink = rtl8411_enable_auto_blink,
- .disable_auto_blink = rtl8411_disable_auto_blink,
- .card_power_on = rtl8411_card_power_on,
- .card_power_off = rtl8411_card_power_off,
- .switch_output_voltage = rtl8411_switch_output_voltage,
- .cd_deglitch = rtl8411_cd_deglitch,
- .conv_clk_and_div_n = rtl8411_conv_clk_and_div_n,
- .force_power_down = rtl8411_force_power_down,
-};
-
/* SD Pull Control Enable:
* SD_DAT[3:0] ==> pull up
* SD_CD ==> pull up
@@ -441,11 +425,10 @@ static const u32 rtl8411b_qfn48_ms_pull_ctl_disable_tbl[] = {
0,
};
-void rtl8411_init_params(struct rtsx_pcr *pcr)
+void rtl8411_init_base_params(struct rtsx_pcr *pcr)
{
pcr->extra_caps = EXTRA_CAPS_SD_SDR50 | EXTRA_CAPS_SD_SDR104;
pcr->num_slots = 2;
- pcr->ops = &rtl8411_pcr_ops;
pcr->flags = 0;
pcr->card_drive_sel = RTL8411_CARD_DRIVE_DEFAULT;
@@ -456,45 +439,28 @@ void rtl8411_init_params(struct rtsx_pcr *pcr)
pcr->rx_initial_phase = SET_CLOCK_PHASE(4, 3, 10);
pcr->ic_version = rtl8411_get_ic_version(pcr);
- pcr->sd_pull_ctl_enable_tbl = rtl8411_sd_pull_ctl_enable_tbl;
- pcr->sd_pull_ctl_disable_tbl = rtl8411_sd_pull_ctl_disable_tbl;
- pcr->ms_pull_ctl_enable_tbl = rtl8411_ms_pull_ctl_enable_tbl;
- pcr->ms_pull_ctl_disable_tbl = rtl8411_ms_pull_ctl_disable_tbl;
}
-void rtl8411b_init_params(struct rtsx_pcr *pcr)
+void rtl8411_init_params(struct rtsx_pcr *pcr)
{
- pcr->extra_caps = EXTRA_CAPS_SD_SDR50 | EXTRA_CAPS_SD_SDR104;
- pcr->num_slots = 2;
- pcr->ops = &rtl8411b_pcr_ops;
-
- pcr->flags = 0;
- pcr->card_drive_sel = RTL8411_CARD_DRIVE_DEFAULT;
- pcr->sd30_drive_sel_1v8 = DRIVER_TYPE_B;
- pcr->sd30_drive_sel_3v3 = DRIVER_TYPE_D;
- pcr->aspm_en = ASPM_L1_EN;
- pcr->tx_initial_phase = SET_CLOCK_PHASE(23, 7, 14);
- pcr->rx_initial_phase = SET_CLOCK_PHASE(4, 3, 10);
-
- pcr->ic_version = rtl8411_get_ic_version(pcr);
+ /* rtl8411 params */
+ rtl8411_init_base_params(pcr);
+ set_pull_ctrl_tables(rtl8411);
+
+ /* different with rtl8411 */
+ switch (PCI_PID(pcr)) {
+ case 0x5287:
+ rtl8411_pcr_ops.fetch_vendor_settings =
+ rtl8411b_fetch_vendor_settings;
+ rtl8411_pcr_ops.extra_init_hw = rtl8411b_extra_init_hw;
+
+ if (rtl8411b_is_qfn48(pcr))
+ set_pull_ctrl_tables(rtl8411b_qfn48);
+ else
+ set_pull_ctrl_tables(rtl8411b_qfn64);
- if (rtl8411b_is_qfn48(pcr)) {
- pcr->sd_pull_ctl_enable_tbl =
- rtl8411b_qfn48_sd_pull_ctl_enable_tbl;
- pcr->sd_pull_ctl_disable_tbl =
- rtl8411b_qfn48_sd_pull_ctl_disable_tbl;
- pcr->ms_pull_ctl_enable_tbl =
- rtl8411b_qfn48_ms_pull_ctl_enable_tbl;
- pcr->ms_pull_ctl_disable_tbl =
- rtl8411b_qfn48_ms_pull_ctl_disable_tbl;
- } else {
- pcr->sd_pull_ctl_enable_tbl =
- rtl8411b_qfn64_sd_pull_ctl_enable_tbl;
- pcr->sd_pull_ctl_disable_tbl =
- rtl8411b_qfn64_sd_pull_ctl_disable_tbl;
- pcr->ms_pull_ctl_enable_tbl =
- rtl8411b_qfn64_ms_pull_ctl_enable_tbl;
- pcr->ms_pull_ctl_disable_tbl =
- rtl8411b_qfn64_ms_pull_ctl_disable_tbl;
+ break;
}
+
+ pcr->ops = &rtl8411_pcr_ops;
}
diff --git a/drivers/mfd/rtsx_pcr.c b/drivers/mfd/rtsx_pcr.c
index 11e20af..ecc6852 100644
--- a/drivers/mfd/rtsx_pcr.c
+++ b/drivers/mfd/rtsx_pcr.c
@@ -1046,10 +1046,6 @@ static int rtsx_pci_init_chip(struct rtsx_pcr *pcr)
rts5229_init_params(pcr);
break;
- case 0x5289:
- rtl8411_init_params(pcr);
- break;
-
case 0x5227:
rts5227_init_params(pcr);
break;
@@ -1059,7 +1055,8 @@ static int rtsx_pci_init_chip(struct rtsx_pcr *pcr)
break;
case 0x5287:
- rtl8411b_init_params(pcr);
+ case 0x5289:
+ rtl8411_init_params(pcr);
break;
}
diff --git a/drivers/mfd/rtsx_pcr.h b/drivers/mfd/rtsx_pcr.h
index 947e79b..dd435d7 100644
--- a/drivers/mfd/rtsx_pcr.h
+++ b/drivers/mfd/rtsx_pcr.h
@@ -32,7 +32,6 @@ void rts5229_init_params(struct rtsx_pcr *pcr);
void rtl8411_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);
static inline u8 map_sd_drive(int idx)
{
@@ -63,4 +62,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(__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
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] mfd: rtsx: add card reader rtl8402
2013-11-15 8:34 [PATCH 0/3] mfd: rtsx: Decrease driver size and add new device micky_ching
2013-11-15 8:34 ` [PATCH 1/3] mfd: rtsx: reduce code duplication in rtl8411 micky_ching
@ 2013-11-15 8:34 ` micky_ching
2013-11-15 16:22 ` Lee Jones
2013-11-15 8:34 ` [PATCH 3/3] mfd: rtsx: Prevent 'used uninitialised' warnings micky_ching
2 siblings, 1 reply; 7+ messages in thread
From: micky_ching @ 2013-11-15 8:34 UTC (permalink / raw)
To: sameo; +Cc: devel, linux-kernel, gregkh, wei_wang, rogerable, Micky Ching
From: Micky Ching <micky_ching@realsil.com.cn>
Add card reader rtl8042, rtl8402 is much like rtl8411, so just add it to
rtl8411.c
Signed-off-by: Micky Ching <micky_ching@realsil.com.cn>
---
drivers/mfd/rtl8411.c | 29 +++++++++++++++++++++++++++++
drivers/mfd/rtsx_pcr.c | 2 ++
2 files changed, 31 insertions(+)
diff --git a/drivers/mfd/rtl8411.c b/drivers/mfd/rtl8411.c
index 4de1045..8e4b546 100644
--- a/drivers/mfd/rtl8411.c
+++ b/drivers/mfd/rtl8411.c
@@ -216,6 +216,31 @@ static int rtl8411_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage)
return rtsx_pci_write_register(pcr, LDO_CTL, mask, val);
}
+static int rtl8402_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage)
+{
+ u8 mask, val;
+ int err;
+
+ mask = (BPP_REG_TUNED18 << BPP_TUNED18_SHIFT_8402) | BPP_PAD_MASK;
+ if (voltage == OUTPUT_3V3) {
+ err = rtsx_pci_write_register(pcr,
+ SD30_DRIVE_SEL, 0x07, pcr->sd30_drive_sel_3v3);
+ if (err < 0)
+ return err;
+ val = (BPP_ASIC_3V3 << BPP_TUNED18_SHIFT_8402) | BPP_PAD_3V3;
+ } else if (voltage == OUTPUT_1V8) {
+ err = rtsx_pci_write_register(pcr,
+ SD30_DRIVE_SEL, 0x07, pcr->sd30_drive_sel_1v8);
+ if (err < 0)
+ return err;
+ val = (BPP_ASIC_2V0 << BPP_TUNED18_SHIFT_8402) | BPP_PAD_1V8;
+ } else {
+ return -EINVAL;
+ }
+
+ return rtsx_pci_write_register(pcr, LDO_CTL, mask, val);
+}
+
static unsigned int rtl8411_cd_deglitch(struct rtsx_pcr *pcr)
{
unsigned int card_exist;
@@ -460,6 +485,10 @@ void rtl8411_init_params(struct rtsx_pcr *pcr)
set_pull_ctrl_tables(rtl8411b_qfn64);
break;
+ case 0x5286:
+ rtl8411_pcr_ops.switch_output_voltage =
+ rtl8402_switch_output_voltage;
+ break;
}
pcr->ops = &rtl8411_pcr_ops;
diff --git a/drivers/mfd/rtsx_pcr.c b/drivers/mfd/rtsx_pcr.c
index ecc6852..865d209 100644
--- a/drivers/mfd/rtsx_pcr.c
+++ b/drivers/mfd/rtsx_pcr.c
@@ -57,6 +57,7 @@ static DEFINE_PCI_DEVICE_TABLE(rtsx_pci_ids) = {
{ PCI_DEVICE(0x10EC, 0x5227), PCI_CLASS_OTHERS << 16, 0xFF0000 },
{ PCI_DEVICE(0x10EC, 0x5249), PCI_CLASS_OTHERS << 16, 0xFF0000 },
{ PCI_DEVICE(0x10EC, 0x5287), PCI_CLASS_OTHERS << 16, 0xFF0000 },
+ { PCI_DEVICE(0x10EC, 0x5286), PCI_CLASS_OTHERS << 16, 0xFF0000 },
{ 0, }
};
@@ -1056,6 +1057,7 @@ static int rtsx_pci_init_chip(struct rtsx_pcr *pcr)
case 0x5287:
case 0x5289:
+ case 0x5286:
rtl8411_init_params(pcr);
break;
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] mfd: rtsx: Prevent 'used uninitialised' warnings
2013-11-15 8:34 [PATCH 0/3] mfd: rtsx: Decrease driver size and add new device micky_ching
2013-11-15 8:34 ` [PATCH 1/3] mfd: rtsx: reduce code duplication in rtl8411 micky_ching
2013-11-15 8:34 ` [PATCH 2/3] mfd: rtsx: add card reader rtl8402 micky_ching
@ 2013-11-15 8:34 ` micky_ching
2013-11-15 15:02 ` Lee Jones
2 siblings, 1 reply; 7+ messages in thread
From: micky_ching @ 2013-11-15 8:34 UTC (permalink / raw)
To: sameo
Cc: devel, linux-kernel, gregkh, wei_wang, rogerable, Lee Jones,
Micky Ching
From: Lee Jones <lee.jones@linaro.org>
drivers/mfd/rtl8411.c: In function ^[-F¡rtl8411_fetch_vendor_settings¢:^[-A
drivers/mfd/rtl8411.c:58:7: warning: ^[-F¡reg1¢ is used uninitialized in this function [-Wuninitialized]^[-A
drivers/mfd/rtl8411.c: In function ^[-F¡rtl8411b_fetch_vendor_settings¢:^[-A
drivers/mfd/rtl8411.c:79:7: warning: ^[-F¡reg¢ is used uninitialized in this function [-Wuninitialized]^[-A
drivers/mfd/rtl8411.c: In function ^[-F¡rtl8411_fetch_vendor_settings¢:^[-A
drivers/mfd/rtl8411.c:69:26: warning: ^[-F¡reg3¢ may be used uninitialized in this function [-Wuninitialized]^[-A
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Micky Ching <micky_ching@realsil.com.cn>
---
drivers/mfd/rtl8411.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/mfd/rtl8411.c b/drivers/mfd/rtl8411.c
index 8e4b546..948b5c7 100644
--- a/drivers/mfd/rtl8411.c
+++ b/drivers/mfd/rtl8411.c
@@ -49,8 +49,8 @@ static int rtl8411b_is_qfn48(struct rtsx_pcr *pcr)
static void rtl8411_fetch_vendor_settings(struct rtsx_pcr *pcr)
{
- u32 reg1;
- u8 reg3;
+ u32 reg1 = 0;
+ u8 reg3 = 0;
rtsx_pci_read_config_dword(pcr, PCR_SETTING_REG1, ®1);
dev_dbg(&(pcr->pci->dev), "Cfg 0x%x: 0x%x\n", PCR_SETTING_REG1, reg1);
@@ -71,7 +71,7 @@ static void rtl8411_fetch_vendor_settings(struct rtsx_pcr *pcr)
static void rtl8411b_fetch_vendor_settings(struct rtsx_pcr *pcr)
{
- u32 reg;
+ u32 reg = 0;
rtsx_pci_read_config_dword(pcr, PCR_SETTING_REG1, ®);
dev_dbg(&(pcr->pci->dev), "Cfg 0x%x: 0x%x\n", PCR_SETTING_REG1, reg);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] mfd: rtsx: reduce code duplication in rtl8411
2013-11-15 8:34 ` [PATCH 1/3] mfd: rtsx: reduce code duplication in rtl8411 micky_ching
@ 2013-11-15 14:58 ` Lee Jones
0 siblings, 0 replies; 7+ messages in thread
From: Lee Jones @ 2013-11-15 14:58 UTC (permalink / raw)
To: micky_ching; +Cc: sameo, devel, linux-kernel, gregkh, wei_wang, rogerable
> From: Lee Jones <lee.jones@linaro.org>
>
> in order to remove duplicated code in rtl8411, we make 8411 as the base
> init params, and other like-8411 chips will just change the different
> value with 8411, this can save some source code.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Micky Ching <micky_ching@realsil.com.cn>
It's not good etiquette to send patches 'From:' and 'Signed-off-by:' a
person when they are neither from or signed-off by that person.
It's much better practice to reply to the original patches with
comments placed directly under the code you wish to reference.
<snip>
> -void rtl8411b_init_params(struct rtsx_pcr *pcr)
> +void rtl8411_init_params(struct rtsx_pcr *pcr)
> {
> - pcr->extra_caps = EXTRA_CAPS_SD_SDR50 | EXTRA_CAPS_SD_SDR104;
> - pcr->num_slots = 2;
> - pcr->ops = &rtl8411b_pcr_ops;
> -
> - pcr->flags = 0;
> - pcr->card_drive_sel = RTL8411_CARD_DRIVE_DEFAULT;
> - pcr->sd30_drive_sel_1v8 = DRIVER_TYPE_B;
> - pcr->sd30_drive_sel_3v3 = DRIVER_TYPE_D;
> - pcr->aspm_en = ASPM_L1_EN;
> - pcr->tx_initial_phase = SET_CLOCK_PHASE(23, 7, 14);
> - pcr->rx_initial_phase = SET_CLOCK_PHASE(4, 3, 10);
So what happened to these?
> - pcr->ic_version = rtl8411_get_ic_version(pcr);
> + /* rtl8411 params */
> + rtl8411_init_base_params(pcr);
> + set_pull_ctrl_tables(rtl8411);
> +
> + /* different with rtl8411 */
> + switch (PCI_PID(pcr)) {
> + case 0x5287:
> + rtl8411_pcr_ops.fetch_vendor_settings =
> + rtl8411b_fetch_vendor_settings;
> + rtl8411_pcr_ops.extra_init_hw = rtl8411b_extra_init_hw;
> +
> + if (rtl8411b_is_qfn48(pcr))
> + set_pull_ctrl_tables(rtl8411b_qfn48);
> + else
> + set_pull_ctrl_tables(rtl8411b_qfn64);
I'm not a big fan of this.
<snip>
> diff --git a/drivers/mfd/rtsx_pcr.c b/drivers/mfd/rtsx_pcr.c
> index 11e20af..ecc6852 100644
> --- a/drivers/mfd/rtsx_pcr.c
> +++ b/drivers/mfd/rtsx_pcr.c
> @@ -1046,10 +1046,6 @@ static int rtsx_pci_init_chip(struct rtsx_pcr *pcr)
> rts5229_init_params(pcr);
> break;
>
> - case 0x5289:
> - rtl8411_init_params(pcr);
> - break;
> -
> case 0x5227:
> rts5227_init_params(pcr);
> break;
> @@ -1059,7 +1055,8 @@ static int rtsx_pci_init_chip(struct rtsx_pcr *pcr)
> break;
>
> case 0x5287:
> - rtl8411b_init_params(pcr);
> + case 0x5289:
> + rtl8411_init_params(pcr);
> break;
> }
I see where you're going with this, but my personal opinion is that it
looks neater and more readable set out as two separate init functions.
> diff --git a/drivers/mfd/rtsx_pcr.h b/drivers/mfd/rtsx_pcr.h
> index 947e79b..dd435d7 100644
> --- a/drivers/mfd/rtsx_pcr.h
> +++ b/drivers/mfd/rtsx_pcr.h
> @@ -32,7 +32,6 @@ void rts5229_init_params(struct rtsx_pcr *pcr);
> void rtl8411_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);
>
> static inline u8 map_sd_drive(int idx)
> {
> @@ -63,4 +62,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(__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)
Great spot Micky. I'll fix this up and resend.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] mfd: rtsx: Prevent 'used uninitialised' warnings
2013-11-15 8:34 ` [PATCH 3/3] mfd: rtsx: Prevent 'used uninitialised' warnings micky_ching
@ 2013-11-15 15:02 ` Lee Jones
0 siblings, 0 replies; 7+ messages in thread
From: Lee Jones @ 2013-11-15 15:02 UTC (permalink / raw)
To: micky_ching; +Cc: sameo, devel, linux-kernel, gregkh, wei_wang, rogerable
On Fri, 15 Nov 2013, micky_ching@realsil.com.cn wrote:
> From: Lee Jones <lee.jones@linaro.org>
>
> drivers/mfd/rtl8411.c: In function ^[-F¡rtl8411_fetch_vendor_settings¢:^[-A
> drivers/mfd/rtl8411.c:58:7: warning: ^[-F¡reg1¢ is used uninitialized in this function [-Wuninitialized]^[-A
> drivers/mfd/rtl8411.c: In function ^[-F¡rtl8411b_fetch_vendor_settings¢:^[-A
> drivers/mfd/rtl8411.c:79:7: warning: ^[-F¡reg¢ is used uninitialized in this function [-Wuninitialized]^[-A
> drivers/mfd/rtl8411.c: In function ^[-F¡rtl8411_fetch_vendor_settings¢:^[-A
> drivers/mfd/rtl8411.c:69:26: warning: ^[-F¡reg3¢ may be used uninitialized in this function [-Wuninitialized]^[-A
Something wrong with your email client here.
Using `git send-mail` is preferable.
Please read:
Documentation/email-clients.txt
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Micky Ching <micky_ching@realsil.com.cn>
All you need to do with this patch is reply to the one I sent with an
Acked-by, Reviewed-by or Tested-by.
Please read:
Documentation/SubmittingPatches
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] mfd: rtsx: add card reader rtl8402
2013-11-15 8:34 ` [PATCH 2/3] mfd: rtsx: add card reader rtl8402 micky_ching
@ 2013-11-15 16:22 ` Lee Jones
0 siblings, 0 replies; 7+ messages in thread
From: Lee Jones @ 2013-11-15 16:22 UTC (permalink / raw)
To: micky_ching; +Cc: sameo, devel, linux-kernel, gregkh, wei_wang, rogerable
On Fri, 15 Nov 2013, micky_ching@realsil.com.cn wrote:
> From: Micky Ching <micky_ching@realsil.com.cn>
>
> Add card reader rtl8042, rtl8402 is much like rtl8411, so just add it to
> rtl8411.c
>
> Signed-off-by: Micky Ching <micky_ching@realsil.com.cn>
> ---
> drivers/mfd/rtl8411.c | 29 +++++++++++++++++++++++++++++
> drivers/mfd/rtsx_pcr.c | 2 ++
> 2 files changed, 31 insertions(+)
Looks like you left me off of the addressee list for this and the
cover letter.
> diff --git a/drivers/mfd/rtl8411.c b/drivers/mfd/rtl8411.c
> index 4de1045..8e4b546 100644
> --- a/drivers/mfd/rtl8411.c
> +++ b/drivers/mfd/rtl8411.c
> @@ -216,6 +216,31 @@ static int rtl8411_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage)
> return rtsx_pci_write_register(pcr, LDO_CTL, mask, val);
> }
>
> +static int rtl8402_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage)
> +{
> + u8 mask, val;
> + int err;
> +
> + mask = (BPP_REG_TUNED18 << BPP_TUNED18_SHIFT_8402) | BPP_PAD_MASK;
> + if (voltage == OUTPUT_3V3) {
> + err = rtsx_pci_write_register(pcr,
> + SD30_DRIVE_SEL, 0x07, pcr->sd30_drive_sel_3v3);
> + if (err < 0)
> + return err;
> + val = (BPP_ASIC_3V3 << BPP_TUNED18_SHIFT_8402) | BPP_PAD_3V3;
> + } else if (voltage == OUTPUT_1V8) {
> + err = rtsx_pci_write_register(pcr,
> + SD30_DRIVE_SEL, 0x07, pcr->sd30_drive_sel_1v8);
> + if (err < 0)
> + return err;
> + val = (BPP_ASIC_2V0 << BPP_TUNED18_SHIFT_8402) | BPP_PAD_1V8;
> + } else {
> + return -EINVAL;
> + }
> +
> + return rtsx_pci_write_register(pcr, LDO_CTL, mask, val);
> +}
> +
> static unsigned int rtl8411_cd_deglitch(struct rtsx_pcr *pcr)
> {
> unsigned int card_exist;
> @@ -460,6 +485,10 @@ void rtl8411_init_params(struct rtsx_pcr *pcr)
> set_pull_ctrl_tables(rtl8411b_qfn64);
>
> break;
> + case 0x5286:
> + rtl8411_pcr_ops.switch_output_voltage =
> + rtl8402_switch_output_voltage;
> + break;
> }
>
> pcr->ops = &rtl8411_pcr_ops;
> diff --git a/drivers/mfd/rtsx_pcr.c b/drivers/mfd/rtsx_pcr.c
> index ecc6852..865d209 100644
> --- a/drivers/mfd/rtsx_pcr.c
> +++ b/drivers/mfd/rtsx_pcr.c
> @@ -57,6 +57,7 @@ static DEFINE_PCI_DEVICE_TABLE(rtsx_pci_ids) = {
> { PCI_DEVICE(0x10EC, 0x5227), PCI_CLASS_OTHERS << 16, 0xFF0000 },
> { PCI_DEVICE(0x10EC, 0x5249), PCI_CLASS_OTHERS << 16, 0xFF0000 },
> { PCI_DEVICE(0x10EC, 0x5287), PCI_CLASS_OTHERS << 16, 0xFF0000 },
> + { PCI_DEVICE(0x10EC, 0x5286), PCI_CLASS_OTHERS << 16, 0xFF0000 },
> { 0, }
> };
>
> @@ -1056,6 +1057,7 @@ static int rtsx_pci_init_chip(struct rtsx_pcr *pcr)
>
> case 0x5287:
> case 0x5289:
> + case 0x5286:
> rtl8411_init_params(pcr);
> break;
> }
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-11-15 16:22 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-15 8:34 [PATCH 0/3] mfd: rtsx: Decrease driver size and add new device micky_ching
2013-11-15 8:34 ` [PATCH 1/3] mfd: rtsx: reduce code duplication in rtl8411 micky_ching
2013-11-15 14:58 ` Lee Jones
2013-11-15 8:34 ` [PATCH 2/3] mfd: rtsx: add card reader rtl8402 micky_ching
2013-11-15 16:22 ` Lee Jones
2013-11-15 8:34 ` [PATCH 3/3] mfd: rtsx: Prevent 'used uninitialised' warnings micky_ching
2013-11-15 15:02 ` Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).