lkml.org 
[lkml]   [2013]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v2 2/3] mfd: rtsx: add card reader rtl8402
    > 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: Lee Jones <lee.jones@linaro.org>

    I have never signed this patch off.

    These tags actually 'mean' something. Please don't apply them willy-nilly!

    > Signed-off-by: Micky Ching <micky_ching@realsil.com.cn>
    > ---
    > drivers/mfd/rtl8411.c | 33 +++++++++++++++++++++++++++++++++
    > drivers/mfd/rtsx_pcr.c | 5 +++++
    > drivers/mfd/rtsx_pcr.h | 1 +
    > 3 files changed, 39 insertions(+)
    >
    > diff --git a/drivers/mfd/rtl8411.c b/drivers/mfd/rtl8411.c
    > index c9eab9d..4b377e3 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);
    > +}
    > +

    I opposed this on last submission.

    Please find a better way to do it.

    Ideally, I'd like to see one function for this kind of thing. The
    information required to ensure this is carried out correctly on each
    differing platform can be passed in via a struct instead.

    <snip>

    --
    Lee Jones
    Linaro STMicroelectronics Landing Team Lead
    Linaro.org │ Open source software for ARM SoCs
    Follow Linaro: Facebook | Twitter | Blog
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2013-12-03 12:01    [W:2.491 / U:0.596 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site