public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4] Improve Power Management in SMC911X driver.
Date: Thu, 17 Nov 2011 16:52:11 +0100	[thread overview]
Message-ID: <4EC52DAB.2010309@denx.de> (raw)
In-Reply-To: <1321364453-15835-1-git-send-email-bertrand.cachet@heig-vd.ch>

On 11/15/2011 02:40 PM, Bertrand Cachet wrote:
> From datasheet, when READY bit is set inside PM_CTRL register, it means that
> device is already in *normal* (D0) mode => it doesn't need to be wake-up.
> 
> With this patch, we only wake-up (writing on TEST_BYTE register) if PM_MODE
> bits of PM_CTRL register is in sleep (D1/D2) mode.
> 
> Signed-off-by: Bertrand Cachet <bertrand.cachet@heig-vd.ch>
> ---
>  v2: Improve code styling by grouping two narrow comments.
>  v3: Place versions information under scissors line.
>  v4: Use tabs instead of spaces (vimrc problem)
> 
>  drivers/net/smc911x.h |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/smc911x.h b/drivers/net/smc911x.h
> index 8ce08a9..a290073 100644
> --- a/drivers/net/smc911x.h
> +++ b/drivers/net/smc911x.h
> @@ -471,8 +471,11 @@ static void smc911x_reset(struct eth_device *dev)
>  {
>  	int timeout;
>  
> -	/* Take out of PM setting first */
> -	if (smc911x_reg_read(dev, PMT_CTRL) & PMT_CTRL_READY) {
> +	/*
> +	 *  Take out of PM setting first
> +	 *  Device is already wake up if PMT_CTRL_READY bit is set
> +	 */
> +	if ((smc911x_reg_read(dev, PMT_CTRL) & PMT_CTRL_READY) == 0) {
>  		/* Write to the bytetest will take out of powerdown */
>  		smc911x_reg_write(dev, BYTE_TEST, 0x0);

Agree, this is the correct behavior. However, checkpatch report errors
(due to leading white space instead of tabs in the comment you added):

ERROR: code indent should use tabs where possible
#29: FILE: drivers/net/smc911x.h:475:
+ ^I *  Take out of PM setting first$

WARNING: please, no space before tabs
#29: FILE: drivers/net/smc911x.h:475:
+ ^I *  Take out of PM setting first$

ERROR: code indent should use tabs where possible
#30: FILE: drivers/net/smc911x.h:476:
+ ^I *  Device is already wake up if PMT_CTRL_READY bit is set$

WARNING: please, no space before tabs
#30: FILE: drivers/net/smc911x.h:476:
+ ^I *  Device is already wake up if PMT_CTRL_READY bit is set$

total: 2 errors, 2 warnings, 13 lines checked

NOTE: whitespace errors detected, you may wish to use scripts/cleanpatch or
      scripts/cleanfile

Can you fix and repost (maybe setting me as CC, I will take care of your
patch).

Thanks,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

  reply	other threads:[~2011-11-17 15:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-15 13:40 [U-Boot] [PATCH v4] Improve Power Management in SMC911X driver Bertrand Cachet
2011-11-17 15:52 ` Stefano Babic [this message]
2011-11-17 16:21   ` Igor Grinberg
2011-11-17 16:43     ` Stefano Babic
2011-11-22  8:53 ` Stefano Babic

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=4EC52DAB.2010309@denx.de \
    --to=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    /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