public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Improve Power Management in SMC911X driver.
  2011-11-14  8:38 ` [U-Boot] Patch: Power Mangement with smc911x driver bertrand.cachet at heig-vd.ch
@ 2011-11-14  8:38   ` bertrand.cachet at heig-vd.ch
  2011-11-14 11:00     ` Igor Grinberg
  0 siblings, 1 reply; 6+ messages in thread
From: bertrand.cachet at heig-vd.ch @ 2011-11-14  8:38 UTC (permalink / raw)
  To: u-boot

From: Bertrand Cachet <bertrand.cachet@heig-vd.ch>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] Improve Power Management in SMC911X driver.
@ 2011-11-14  9:01 Bertrand Cachet
  0 siblings, 0 replies; 6+ messages in thread
From: Bertrand Cachet @ 2011-11-14  9:01 UTC (permalink / raw)
  To: u-boot



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] Improve Power Management in SMC911X driver.
  2011-11-14  8:38   ` [U-Boot] [PATCH] Improve Power Management in SMC911X driver bertrand.cachet at heig-vd.ch
@ 2011-11-14 11:00     ` Igor Grinberg
  0 siblings, 0 replies; 6+ messages in thread
From: Igor Grinberg @ 2011-11-14 11:00 UTC (permalink / raw)
  To: u-boot

Hi Bertrand,

On 11/14/11 10:38, bertrand.cachet at heig-vd.ch wrote:
> From: Bertrand Cachet <bertrand.cachet@heig-vd.ch>
> 
>>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 D1/D2 mode.
> 
> Signed-off-by: Bertrand Cachet <bertrand.cachet@heig-vd.ch>
> ---
>  drivers/net/smc911x.h |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/smc911x.h b/drivers/net/smc911x.h
> index 8ce08a9..258b9b6 100644
> --- a/drivers/net/smc911x.h
> +++ b/drivers/net/smc911x.h
> @@ -471,8 +471,10 @@ 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 */
> +  /*  If PMT_CTRL_READY bit is set to 1b => power management is 
> +      already ready */

The multi-line comments should look like this:
/*
 * blablabla
 */

> +	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);
>  

-- 
Regards,
Igor.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] Improve Power Management in SMC911X driver.
@ 2011-11-14 14:02 Bertrand Cachet
  2011-11-15  6:49 ` Igor Grinberg
  0 siblings, 1 reply; 6+ messages in thread
From: Bertrand Cachet @ 2011-11-14 14:02 UTC (permalink / raw)
  To: u-boot



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] Improve Power Management in SMC911X driver.
  2011-11-14 14:02 [U-Boot] [PATCH] Improve Power Management in SMC911X driver Bertrand Cachet
@ 2011-11-15  6:49 ` Igor Grinberg
  0 siblings, 0 replies; 6+ messages in thread
From: Igor Grinberg @ 2011-11-15  6:49 UTC (permalink / raw)
  To: u-boot

Hi Bertrand,

When you submit a new version of the same patch, you
should specify in the subject the version number and
in the body changes summary, just as example below:

for subject:
[PATCH v2] Improve Power Management in SMC911X driver

and for body see where it is placed:

On 11/14/11 16:02, 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 D1/D2 mode.
> 
> Signed-off-by: Bertrand Cachet <bertrand.cachet@heig-vd.ch>
> ---

v2 - fix multi-line comment style.

>  drivers/net/smc911x.h |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/smc911x.h b/drivers/net/smc911x.h
> index 8ce08a9..61f7669 100644
> --- a/drivers/net/smc911x.h
> +++ b/drivers/net/smc911x.h
> @@ -471,8 +471,12 @@ 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 */
> +	/*
> +	 *  If PMT_CTRL_READY bit is set to 1b => power management is 
> +	 *  already ready 
> +	 */

This still does not look good, because there is one line comment
and just after it a multi-line comment.
Isn't it makes sense to unify them into one multi-line comment?

> +	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);
>  

-- 
Regards,
Igor.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] Improve Power Management in SMC911X driver.
@ 2011-11-15  9:28 Bertrand Cachet
  0 siblings, 0 replies; 6+ messages in thread
From: Bertrand Cachet @ 2011-11-15  9:28 UTC (permalink / raw)
  To: u-boot



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-11-15  9:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-14 14:02 [U-Boot] [PATCH] Improve Power Management in SMC911X driver Bertrand Cachet
2011-11-15  6:49 ` Igor Grinberg
  -- strict thread matches above, loose matches on Subject: below --
2011-11-15  9:28 Bertrand Cachet
2011-11-14  9:01 Bertrand Cachet
     [not found] <Patches for SMSC LAN911X driver on UBoot and QEMU>
2011-11-14  8:38 ` [U-Boot] Patch: Power Mangement with smc911x driver bertrand.cachet at heig-vd.ch
2011-11-14  8:38   ` [U-Boot] [PATCH] Improve Power Management in SMC911X driver bertrand.cachet at heig-vd.ch
2011-11-14 11:00     ` Igor Grinberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox