public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: micky_ching@realsil.com.cn
Cc: sameo@linux.intel.com, devel@linuxdriverproject.org,
	linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org,
	wei_wang@realsil.com.cn, rogerable@realtek.com
Subject: Re: [PATCH v2 2/3] mfd: rtsx: add card reader rtl8402
Date: Tue, 3 Dec 2013 10:45:07 +0000	[thread overview]
Message-ID: <20131203104507.GL11828@lee--X1> (raw)
In-Reply-To: <39b168dd315f3b2645d92af29e5ad71789853317.1386051860.git.micky_ching@realsil.com.cn>

> 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

  reply	other threads:[~2013-12-03 10:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-03  9:26 [PATCH v2 0/3] mfd: rtsx: decrease driver size and add new device micky_ching
2013-12-03  9:26 ` [PATCH v2 1/3] mfd: rtsx: reduce code duplication in rtl8411 micky_ching
2013-12-03 10:55   ` Lee Jones
2013-12-03  9:26 ` [PATCH v2 2/3] mfd: rtsx: add card reader rtl8402 micky_ching
2013-12-03 10:45   ` Lee Jones [this message]
2013-12-03 11:02     ` micky
2013-12-03  9:26 ` [PATCH v2 3/3] mfd: rtsx: prevent 'used uninitialised' warnings micky_ching
2013-12-03 10:40   ` Lee Jones
2013-12-03 10:40     ` Lee Jones
2013-12-03 11:03       ` micky
2013-12-03 11:28         ` Lee Jones
2013-12-03 10:54     ` micky
2013-12-03 11:01       ` Lee Jones
2013-12-03 11:07         ` micky
2013-12-03 11:04       ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131203104507.GL11828@lee--X1 \
    --to=lee.jones@linaro.org \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=micky_ching@realsil.com.cn \
    --cc=rogerable@realtek.com \
    --cc=sameo@linux.intel.com \
    --cc=wei_wang@realsil.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox