From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750905AbdE0UMi (ORCPT ); Sat, 27 May 2017 16:12:38 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:33898 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750740AbdE0UMg (ORCPT ); Sat, 27 May 2017 16:12:36 -0400 MIME-Version: 1.0 In-Reply-To: References: <20170526110413.24836-1-enric.balletbo@collabora.com> <20170526110413.24836-2-enric.balletbo@collabora.com> From: Enric Balletbo Serra Date: Sat, 27 May 2017 22:12:35 +0200 Message-ID: Subject: Re: [PATCH v3 2/4] power: supply: core: add charging voltage/current battery info To: Liam Breck Cc: Enric Balletbo i Serra , Sebastian Reichel , Rob Herring , Mark Rutland , linux-pm@vger.kernel.org, "devicetree@vger.kernel.org" , linux-kernel , Liam Breck Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Liam, 2017-05-26 23:22 GMT+02:00 Liam Breck : > Hi Enric, > > I'll also incorporate these changes into v14 of my patchset. (See my prev msg.) > Perfect, thanks > > On Fri, May 26, 2017 at 4:04 AM, Enric Balletbo i Serra > wrote: >> Add the parameters to define the battery charging voltage and charging >> current. Charger driver can get this information from the struct >> power_supply_battery_info and apply the desired value. >> >> Signed-off-by: Enric Balletbo i Serra >> --- >> Changes since v2: >> - Requested by Sebastian Reichel >> - Move to its own patch and apply to simple-battery framework. >> Changes since v1: >> - Requested by Rob Herring >> - Rename ti,charge-* to charge-* to be standard properties. >> - Use unit suffixes as per bindings/property-units.txt >> >> drivers/power/supply/power_supply_core.c | 6 ++++++ >> include/linux/power_supply.h | 2 ++ >> 2 files changed, 8 insertions(+) >> >> diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c >> index 862fa8fc..a6857c2 100644 >> --- a/drivers/power/supply/power_supply_core.c >> +++ b/drivers/power/supply/power_supply_core.c >> @@ -530,6 +530,8 @@ int power_supply_get_battery_info(struct power_supply *psy, >> info->energy_full_design_uwh = -EINVAL; >> info->charge_full_design_uah = -EINVAL; >> info->voltage_min_design_uv = -EINVAL; >> + info->charge_voltage_uv = -EINVAL; >> + info->charge_current_ua = -EINVAL; >> >> if (!psy->of_node) { >> dev_warn(&psy->dev, "%s currently only supports devicetree\n", >> @@ -559,6 +561,10 @@ int power_supply_get_battery_info(struct power_supply *psy, >> &info->charge_full_design_uah); >> of_property_read_u32(battery_np, "voltage-min-design-microvolt", >> &info->voltage_min_design_uv); >> + of_property_read_u32(battery_np, "charge-voltage-microvolt", >> + &info->charge_voltage_uv); >> + of_property_read_u32(battery_np, "charge-current-microamp", >> + &info->charge_current_ua); >> >> return 0; >> } >> diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h >> index 8220f7b..3eea323 100644 >> --- a/include/linux/power_supply.h >> +++ b/include/linux/power_supply.h >> @@ -302,6 +302,8 @@ struct power_supply_battery_info { >> int energy_full_design_uwh; /* microWatt-hours */ >> int charge_full_design_uah; /* microAmp-hours */ >> int voltage_min_design_uv; /* microVolts */ >> + int charge_voltage_uv; /* microVolts */ >> + int charge_current_ua; /* microAmp */ >> }; >> >> extern struct atomic_notifier_head power_supply_notifier; >> -- >> 2.9.3 >>