The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Samuel Ortiz <sameo@linux.intel.com>
To: wei_wang@realsil.com.cn
Cc: devel@linuxdriverproject.org, linux-kernel@vger.kernel.org,
	gregkh@linuxfoundation.org, rogerable@realtek.com
Subject: Re: [PATCH v2 1/5] mfd:rtsx: Read vendor setting from config space
Date: Tue, 20 Aug 2013 02:48:20 +0200	[thread overview]
Message-ID: <20130820004820.GA13324@zurbaran> (raw)
In-Reply-To: <8f0f23e3076558f517aea7851500ca5112f9050d.1373953200.git.wei_wang@realsil.com.cn>

Hi Wei,

On Wed, Jul 17, 2013 at 04:09:51PM +0800, wei_wang@realsil.com.cn wrote:
> diff --git a/drivers/mfd/rtl8411.c b/drivers/mfd/rtl8411.c
> index c436bf2..1fbb978 100644
> --- a/drivers/mfd/rtl8411.c
> +++ b/drivers/mfd/rtl8411.c
> @@ -1,6 +1,6 @@
>  /* Driver for Realtek PCI-Express card reader
>   *
> - * Copyright(c) 2009 Realtek Semiconductor Corp. All rights reserved.
> + * Copyright(c) 2009-2013 Realtek Semiconductor Corp. All rights reserved.
>   *
>   * This program is free software; you can redistribute it and/or modify it
>   * under the terms of the GNU General Public License as published by the
> @@ -17,7 +17,7 @@
>   *
>   * Author:
>   *   Wei WANG <wei_wang@realsil.com.cn>
> - *   No. 450, Shenhu Road, Suzhou Industry Park, Suzhou, China
> + *   Roger Tseng <rogerable@realtek.com>
>   */
Please do not mix actual code with copyright changes. Remove those
chunks from this patch, and submit a separate patch for them.


>  
>  #include <linux/module.h>
> @@ -47,19 +47,70 @@ static int rtl8411b_is_qfn48(struct rtsx_pcr *pcr)
>  		return 0;
>  }
>  
> +static void rtl8411_init_settings(struct rtsx_pcr *pcr)
> +{
> +	u32 reg1;
> +	u8 reg3;
> +
> +	rtsx_pci_read_config_dword(pcr, PCR_SETTING_REG1, &reg1);
> +	dev_dbg(&(pcr->pci->dev), "Cfg 0x%x: 0x%x\n", PCR_SETTING_REG1, reg1);
> +
> +	if (rtsx_vendor_setting_valid(reg1)) {
A more readable construct would be:

if (!rtsx_vendor_setting_valid(reg1))
	return;

pcr->aspm_en = rtsx_reg_to_aspm(reg1);
[...]


> @@ -385,6 +438,12 @@ void rtl8411_init_params(struct rtsx_pcr *pcr)
>  	pcr->num_slots = 2;
>  	pcr->ops = &rtl8411_pcr_ops;
>  
> +	pcr->flags = 0;
> +	pcr->card_drive_sel = 0x55;
> +	pcr->sd30_drive_sel_1v8 = 0x03;
> +	pcr->sd30_drive_sel_3v3 = 0x01;
> +	pcr->aspm_en = 0x02;
Those values seem to be repeated for many SKUs, could we please have a
definition instead of hardcoded values ?


> @@ -747,6 +753,7 @@ struct pcr_ops {
>  						u8 voltage);
>  	unsigned int	(*cd_deglitch)(struct rtsx_pcr *pcr);
>  	int		(*conv_clk_and_div_n)(int clk, int dir);
> +	void		(*init_settings)(struct rtsx_pcr *pcr);
init_settings is a bit too generic I believe. What you're doing is
fetching vendor settings, so what about fetch_vendor_settings instead ?

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

  parent reply	other threads:[~2013-08-20  0:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-17  8:09 [PATCH v2 0/5] mfd:rtsx: MFD patches for Realtek cardreader wei_wang
2013-07-17  8:09 ` [PATCH v2 1/5] mfd:rtsx: Read vendor setting from config space wei_wang
2013-07-17 11:24   ` Dan Carpenter
2013-08-20  0:48   ` Samuel Ortiz [this message]
2013-07-17  8:09 ` [PATCH v2 2/5] mfd:rtsx: Add shutdown callback in rtsx_pci_driver wei_wang
2013-07-17  8:09 ` [PATCH v2 3/5] mfd:rtsx: Move some actions from rtsx_pci_init_hw to individual extra_init_hw wei_wang
2013-07-17  8:09 ` [PATCH v2 4/5] mfd:rtsx: Clear hardware PFM mode in rtl8411b wei_wang
2013-07-17  8:09 ` [PATCH v2 5/5] mfd:rtsx: Configure to enter a deeper power-saving mode in S3 wei_wang

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=20130820004820.GA13324@zurbaran \
    --to=sameo@linux.intel.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rogerable@realtek.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