linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: linux-kernel@vger.kernel.org
Cc: cbou@mail.ru,
	Paer-Olof Haakansson <par-olof.hakansson@stericsson.com>,
	Robert Marklund <robert.marklund@stericsson.com>
Subject: Re: [PATCH 01/18] power: ab8500_charger: Rename the power_loss function
Date: Thu, 3 Jan 2013 11:55:13 +0000	[thread overview]
Message-ID: <20130103115513.GC21994@gmail.com> (raw)
In-Reply-To: <1355412102-14265-2-git-send-email-lee.jones@linaro.org>

Hi Anton,

Poke for the patch-set.

On Thu, 13 Dec 2012, Lee Jones wrote:

> From: Paer-Olof Haakansson <par-olof.hakansson@stericsson.com>
> 
> Rename the ab8500_power_loss_handling function to a more
> descriptive name ab8500_enable_disable_sw_fallback
> 
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Robert Marklund <robert.marklund@stericsson.com>
> Reviewed-by: Par-Olof HAKANSSON <par-olof.hakansson@stericsson.com>
> Reviewed-by: Karl KOMIEROWSKI <karl.komierowski@stericsson.com>
> Tested-by: Par-Olof HAKANSSON <par-olof.hakansson@stericsson.com>
> ---
>  drivers/power/ab8500_charger.c |   23 +++++++++++------------
>  1 file changed, 11 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/power/ab8500_charger.c b/drivers/power/ab8500_charger.c
> index 2ddface..d6e1792 100644
> --- a/drivers/power/ab8500_charger.c
> +++ b/drivers/power/ab8500_charger.c
> @@ -270,20 +270,19 @@ static enum power_supply_property ab8500_charger_usb_props[] = {
>  	POWER_SUPPLY_PROP_CURRENT_NOW,
>  };
>  
> -/**
> - * ab8500_power_loss_handling - set how we handle powerloss.
> - * @di:		pointer to the ab8500_charger structure
> - *
> - * Magic nummbers are from STE HW department.
> +/*
> + * Function for enabling and disabling sw fallback mode
> + * should always be disabled when no charger is connected.
>   */
> -static void ab8500_power_loss_handling(struct ab8500_charger *di)
> +static void ab8500_enable_disable_sw_fallback(struct ab8500_charger *di,
> +		bool fallback)
>  {
>  	u8 reg;
>  	int ret;
>  
> -	dev_dbg(di->dev, "Autopower : %d\n", di->autopower);
> +	dev_dbg(di->dev, "SW Fallback: %d\n", fallback);
>  
> -	/* read the autopower register */
> +	/* read the register containing fallback bit */
>  	ret = abx500_get_register_interruptible(di->dev, 0x15, 0x00, &reg);
>  	if (ret) {
>  		dev_err(di->dev, "%d write failed\n", __LINE__);
> @@ -297,12 +296,12 @@ static void ab8500_power_loss_handling(struct ab8500_charger *di)
>  		return;
>  	}
>  
> -	if (di->autopower)
> +	if (fallback)
>  		reg |= 0x8;
>  	else
>  		reg &= ~0x8;
>  
> -	/* write back the changed value to autopower reg */
> +	/* write back the changed fallback bit value to register */
>  	ret = abx500_set_register_interruptible(di->dev, 0x15, 0x00, reg);
>  	if (ret) {
>  		dev_err(di->dev, "%d write failed\n", __LINE__);
> @@ -332,12 +331,12 @@ static void ab8500_power_supply_changed(struct ab8500_charger *di,
>  		    !di->ac.charger_connected &&
>  		    di->autopower) {
>  			di->autopower = false;
> -			ab8500_power_loss_handling(di);
> +			ab8500_enable_disable_sw_fallback(di, false);
>  		} else if (!di->autopower &&
>  			   (di->ac.charger_connected ||
>  			    di->usb.charger_connected)) {
>  			di->autopower = true;
> -			ab8500_power_loss_handling(di);
> +			ab8500_enable_disable_sw_fallback(di, true);
>  		}
>  	}
>  	power_supply_changed(psy);
> -- 
> 1.7.9.5
> 

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2013-01-03 11:55 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-13 15:21 [PATCH 00/18] AB8500 battery management series upgrade Lee Jones
2012-12-13 15:21 ` [PATCH 01/18] power: ab8500_charger: Rename the power_loss function Lee Jones
2013-01-03 11:55   ` Lee Jones [this message]
2012-12-13 15:21 ` [PATCH 02/18] power: ab8500_bm: Skip first CCEOC irq for instant current Lee Jones
2012-12-13 15:21 ` [PATCH 03/18] power: ab8500_charger: Detect removed charger Lee Jones
2012-12-13 15:21 ` [PATCH 04/18] power: ab8500_fg: flush sync on suspend Lee Jones
2012-12-13 15:21 ` [PATCH 05/18] power: ab8500_fg: usleep_range instead of short msleep Lee Jones
2012-12-13 15:21 ` [PATCH 06/18] power: ab8500_charger: Handle gpadc errors Lee Jones
2012-12-13 15:21 ` [PATCH 07/18] power: ab8500_bm: Recharge condition not optimal for battery Lee Jones
2012-12-13 15:21 ` [PATCH 08/18] power: ab8500_fg: balance IRQ enable Lee Jones
2012-12-13 15:21 ` [PATCH 09/18] power: ab8500_btemp: Ignore false btemp low interrupt Lee Jones
2012-12-13 15:21 ` [PATCH 10/18] power: ab8500_bm: Adds support for Car/Travel Adapters Lee Jones
2012-12-13 15:21 ` [PATCH 11/18] power: ab8500_fg: Round capacity output Lee Jones
2012-12-13 15:21 ` [PATCH 12/18] power: ab8500_btemp: remove superfluous BTEMP thermal comp Lee Jones
2012-12-13 15:21 ` [PATCH 13/18] power: ab8500_fg: Added support for BATT_OVV Lee Jones
2012-12-13 15:21 ` [PATCH 14/18] power: pm2301: Add pm2301 charger Lee Jones
2012-12-13 15:21 ` [PATCH 15/18] power: ab8500_fg: Add sysfs interfaces for capacity Lee Jones
2012-12-13 15:21 ` [PATCH 16/18] power: ab8500_charger: remove unused defines Lee Jones
2012-12-13 15:21 ` [PATCH 17/18] power: ab8500_charger: Adds support for legacy USB chargers Lee Jones
2012-12-13 15:21 ` [PATCH 18/18] Power: ab8500_fg: Overflow in current calculation Lee Jones
2013-01-05 21:20 ` [PATCH 00/18] AB8500 battery management series upgrade Anton Vorontsov
2013-01-07  9:30   ` Lee Jones
  -- strict thread matches above, loose matches on Subject: below --
2013-01-11 13:12 Lee Jones
2013-01-11 13:12 ` [PATCH 01/18] power: ab8500_charger: Rename the power_loss function Lee Jones

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=20130103115513.GC21994@gmail.com \
    --to=lee.jones@linaro.org \
    --cc=cbou@mail.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=par-olof.hakansson@stericsson.com \
    --cc=robert.marklund@stericsson.com \
    /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;
as well as URLs for NNTP newsgroup(s).