From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751539AbdEPGd4 (ORCPT ); Tue, 16 May 2017 02:33:56 -0400 Received: from mail.free-electrons.com ([62.4.15.54]:38672 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751027AbdEPGdz (ORCPT ); Tue, 16 May 2017 02:33:55 -0400 Subject: Re: [PATCH 1/4] power: supply: axp20x_battery: add support for DT battery To: Chen-Yu Tsai References: <20170511134221.5569-1-quentin.schulz@free-electrons.com> <20170511134221.5569-2-quentin.schulz@free-electrons.com> Cc: Sebastian Reichel , Rob Herring , Mark Rutland , "open list:THERMAL" , devicetree , linux-kernel , Liam Breck , Thomas Petazzoni , linux-sunxi From: Quentin Schulz Message-ID: Date: Tue, 16 May 2017 08:33:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Chen-Yu, On 16/05/2017 07:18, Chen-Yu Tsai wrote: > On Thu, May 11, 2017 at 9:42 PM, Quentin Schulz > wrote: >> This adds support in X-Powers AXP20X and AXP22X battery driver for a >> fixed battery in DT. >> >> It will take the minimum supported voltage by the battery as defined in >> the battery DT node and set the V_OFF register to this value, telling >> the system to shut down if the supplied power is below this value. >> >> Signed-off-by: Quentin Schulz >> --- >> drivers/power/supply/axp20x_battery.c | 10 ++++++++++ >> 1 file changed, 10 insertions(+) >> >> diff --git a/drivers/power/supply/axp20x_battery.c b/drivers/power/supply/axp20x_battery.c >> index 5d29b2eab8fc..66f530541735 100644 >> --- a/drivers/power/supply/axp20x_battery.c >> +++ b/drivers/power/supply/axp20x_battery.c >> @@ -433,6 +433,7 @@ static int axp20x_power_probe(struct platform_device *pdev) >> { >> struct axp20x_batt_ps *axp20x_batt; >> struct power_supply_config psy_cfg = {}; >> + struct power_supply_battery_info info; >> >> if (!of_device_is_available(pdev->dev.of_node)) >> return -ENODEV; >> @@ -484,6 +485,15 @@ static int axp20x_power_probe(struct platform_device *pdev) >> return PTR_ERR(axp20x_batt->batt); >> } >> >> + if (!power_supply_get_battery_info(axp20x_batt->batt, &info)) { > > This is not in -next. It would help if you mention any requisite patches. > I started working on this when next-20170503 was the latest and forgot to rebase before sending the patch series. It was actually in both next-20170502 and 20170503 but not in more recent ones. Liam told me in a private message he's soon sending a new version of his patch series, so I'll be waiting for the patches to reappear in next. Thanks, Quentin > ChenYu > >> + int vmin = info.voltage_min_design_uv; >> + >> + if (vmin > 0 && axp20x_set_voltage_min_design(axp20x_batt, >> + vmin)) >> + dev_err(&pdev->dev, >> + "couldn't set voltage_min_design\n"); >> + } >> + >> return 0; >> } >> >> -- >> 2.11.0 >> -- Quentin Schulz, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com