Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1604179

Re: [PATCH 09/15] power: supply: bq24190_charger: Add voltage_max_design prop to battery

From Sebastian Reichel <sre@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 09/15] power: supply: bq24190_charger: Add voltage_max_design prop to battery
Date 2017-03-20 06:20 +0100
Message-ID <tmXTz-8lw-7@gated-at.bofh.it> (permalink)
References <tlWPT-4pa-5@gated-at.bofh.it> <tlWZA-4Iy-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi,

On Fri, Mar 17, 2017 at 10:55:21AM +0100, Hans de Goede wrote:
> When combined with an external fuel-gauge, upower needs voltage_max_design
> as it internally does all its calculations in Watts and converts the
> charge_foo properties from A to Watts by using voltage_max_design.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Assuming, that my comment on patch 14 works POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN
is required in the fuel-gauge driver instead. As far as I understand
it the charger voltage was too high for your device anyways, so that
you capped it at 4.3V. So I assume, that you can just provide it via
device properties.

-- Sebastian

>  drivers/power/supply/bq24190_charger.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/power/supply/bq24190_charger.c b/drivers/power/supply/bq24190_charger.c
> index 9fe69a5..82cb33d 100644
> --- a/drivers/power/supply/bq24190_charger.c
> +++ b/drivers/power/supply/bq24190_charger.c
> @@ -1103,6 +1103,13 @@ static int bq24190_battery_get_property(struct power_supply *psy,
>  		val->intval = POWER_SUPPLY_TECHNOLOGY_UNKNOWN;
>  		ret = 0;
>  		break;
> +	case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN:
> +		/*
> +		 * Report charger configured voltage as max design voltage,
> +		 * not entirely correct, but userspace needs something here.
> +		 */
> +		ret = bq24190_charger_get_voltage(bdi, val);
> +		break;
>  	case POWER_SUPPLY_PROP_TEMP_ALERT_MAX:
>  		ret = bq24190_battery_get_temp_alert_max(bdi, val);
>  		break;
> @@ -1169,6 +1176,7 @@ static enum power_supply_property bq24190_battery_properties[] = {
>  	POWER_SUPPLY_PROP_HEALTH,
>  	POWER_SUPPLY_PROP_ONLINE,
>  	POWER_SUPPLY_PROP_TECHNOLOGY,
> +	POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN,
>  	POWER_SUPPLY_PROP_TEMP_ALERT_MAX,
>  	POWER_SUPPLY_PROP_SCOPE,
>  	/* Begin of extended battery properties */
> @@ -1186,7 +1194,7 @@ static const struct power_supply_desc bq24190_battery_desc = {
>  	.name			= "bq24190-battery",
>  	.type			= POWER_SUPPLY_TYPE_BATTERY,
>  	.properties		= bq24190_battery_properties,
> -	.num_properties		= 6,
> +	.num_properties		= 7,
>  	.get_property		= bq24190_battery_get_property,
>  	.set_property		= bq24190_battery_set_property,
>  	.property_is_writeable	= bq24190_battery_property_is_writeable,
> -- 
> 2.9.3
> 

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/15] Add Intel Cherry Trail Whiskey Cove PMIC support Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:00 +0100
  [PATCH 02/15] ACPI / PMIC: Add opregion driver for Intel CHT Whiskey Cove PMIC Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:00 +0100
  [PATCH 14/15] power: supply: Add driver for Cherry Trail Whiskey Cove PMIC Fuel Gauge Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:00 +0100
    Re: [PATCH 14/15] power: supply: Add driver for Cherry Trail  Whiskey Cove PMIC Fuel Gauge Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-03-17 19:00 +0100
      Re: [PATCH 14/15] power: supply: Add driver for Cherry Trail Whiskey  Cove PMIC Fuel Gauge Hans de Goede <hdegoede@redhat.com> - 2017-03-22 18:10 +0100
    Re: [PATCH 14/15] power: supply: Add driver for Cherry Trail Whiskey  Cove PMIC Fuel Gauge Sebastian Reichel <sre@kernel.org> - 2017-03-20 06:10 +0100
  [PATCH 13/15] i2c: core: Allow drivers to specify index for irq to get from of / ACPI Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:00 +0100
    Re: [PATCH 13/15] i2c: core: Allow drivers to specify index for irq  to get from of / ACPI Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-03-17 18:50 +0100
    Re: [PATCH 13/15] i2c: core: Allow drivers to specify index for irq  to get from of / ACPI kbuild test robot <lkp@intel.com> - 2017-03-20 10:40 +0100
  [PATCH 01/15] mfd: Add Cherry Trail Whiskey Cove PMIC driver Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:00 +0100
    Re: [PATCH 01/15] mfd: Add Cherry Trail Whiskey Cove PMIC driver Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-03-17 18:20 +0100
      Re: [PATCH 01/15] mfd: Add Cherry Trail Whiskey Cove PMIC driver Lee Jones <lee.jones@linaro.org> - 2017-03-20 11:50 +0100
        Re: [PATCH 01/15] mfd: Add Cherry Trail Whiskey Cove PMIC driver Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-03-20 14:00 +0100
  [PATCH 15/15] i2c-cht-wc: Add Intel Cherry Trail Whiskey Cove SMBUS controller driver Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:00 +0100
    Re: [PATCH 15/15] i2c-cht-wc: Add Intel Cherry Trail Whiskey Cove  SMBUS controller driver Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-03-17 19:30 +0100
      Re: [PATCH 15/15] i2c-cht-wc: Add Intel Cherry Trail Whiskey Cove  SMBUS controller driver Hans de Goede <hdegoede@redhat.com> - 2017-03-23 15:00 +0100
  [PATCH 11/15] i2c: core: Allow getting ACPI info by index Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:00 +0100
    Re: [PATCH 11/15] i2c: core: Allow getting ACPI info by index Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-03-17 18:40 +0100
  [PATCH 10/15] power: supply: bq24190_charger: Use extcon to determine ilimit, 5v boost Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:00 +0100
    Re: [PATCH 10/15] power: supply: bq24190_charger: Use extcon to  determine ilimit, 5v boost Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-03-17 18:40 +0100
      Re: [PATCH 10/15] power: supply: bq24190_charger: Use extcon to  determine ilimit, 5v boost Hans de Goede <hdegoede@redhat.com> - 2017-03-20 23:40 +0100
    Re: [PATCH 10/15] power: supply: bq24190_charger: Use extcon to  determine ilimit, 5v boost Sebastian Reichel <sre@kernel.org> - 2017-03-20 06:00 +0100
  [PATCH 12/15] i2c: core: Add new i2c_acpi_new_device helper function Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:00 +0100
    Re: [PATCH 12/15] i2c: core: Add new i2c_acpi_new_device helper  function Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-03-17 18:50 +0100
      Re: [PATCH 12/15] i2c: core: Add new i2c_acpi_new_device helper  function Hans de Goede <hdegoede@redhat.com> - 2017-03-22 17:00 +0100
  [PATCH 04/15] power: supply: bq24190_charger: Add no_register_reset pdata flag Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:10 +0100
    Re: [PATCH 04/15] power: supply: bq24190_charger: Add  no_register_reset pdata flag Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-03-17 18:30 +0100
  [PATCH 07/15] power: supply: bq24190_charger: Add support for bq24192[i] Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:10 +0100
  [PATCH 05/15] power: supply: bq24190_charger: Limit charging voltage to 4.3V Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:10 +0100
  [PATCH 09/15] power: supply: bq24190_charger: Add voltage_max_design prop to battery Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:10 +0100
    Re: [PATCH 09/15] power: supply: bq24190_charger: Add  voltage_max_design prop to battery Sebastian Reichel <sre@kernel.org> - 2017-03-20 06:20 +0100
  [PATCH 06/15] power: supply: bq24190_charger: Use i2c-core irq-mapping code Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:10 +0100
    Re: [PATCH 06/15] power: supply: bq24190_charger: Use i2c-core  irq-mapping code Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-03-17 18:30 +0100
      Re: [PATCH 06/15] power: supply: bq24190_charger: Use i2c-core  irq-mapping code Sebastian Reichel <sre@kernel.org> - 2017-03-20 05:50 +0100
  [PATCH 08/15] power: supply: bq24190_charger: Add support for external fuel gauge Hans de Goede <hdegoede@redhat.com> - 2017-03-17 11:10 +0100

csiph-web