From patchwork Mon Dec 17 02:52:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 10732683 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 80655184E for ; Mon, 17 Dec 2018 02:52:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 75EC329CDB for ; Mon, 17 Dec 2018 02:52:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A1A829CE3; Mon, 17 Dec 2018 02:52:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C7B429CF0 for ; Mon, 17 Dec 2018 02:52:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726285AbeLQCw3 (ORCPT ); Sun, 16 Dec 2018 21:52:29 -0500 Received: from rere.qmqm.pl ([91.227.64.183]:41399 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726287AbeLQCw3 (ORCPT ); Sun, 16 Dec 2018 21:52:29 -0500 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 43J5J606JszVB; Mon, 17 Dec 2018 03:51:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1545015062; bh=D8kXtGaFc4kxA/LxmicHHRoj9W79pKYyoZtNcg3qoXg=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=CQJw6gJQwHpYdpOd0UlfOt+f4m6f65nwt0P/PX1VUjpmFsJglolqZIcQaToAzKEHf tV48d33ONx0c+/0lwFHbVkKPvsdBvSRR1+3Vk0B1xPwEeiqTLVkAAMS8UWYyelo1d3 uIpHc7181yu6C72C26opNHnr2VAtjYlYjbucsXpnF+in5UesBoTK3yQaRu5epJ6xmQ MyYOArETsi3eU5qr/MhXKBGmyhxJcEJxDqGyfCBbQwqUDVLji+Sg30Az2SCOIvzatJ C760Oiw0+NjiZevowV7MgBGqDQU3r24VwutoxlU3HgvjV8L62NH8c7/RaTMEWT5+93 ltNHhVVsqPT1g== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.2 at mail Date: Mon, 17 Dec 2018 03:52:27 +0100 Message-Id: In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH 3/3] power: supply: bq25890: show max charge current/voltage as configured MIME-Version: 1.0 To: linux-pm@vger.kernel.org Cc: Sebastian Reichel , Laurentiu Palcu Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use firmware-provided limits for POWER_SUPPLY_*_MAX properties instead of chip max values. This will reflect the battery limits as those are the important ones. Signed-off-by: Michał Mirosław --- drivers/power/supply/bq25890_charger.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c index a8b2d939cfcd..f998738fa239 100644 --- a/drivers/power/supply/bq25890_charger.c +++ b/drivers/power/supply/bq25890_charger.c @@ -432,7 +432,7 @@ static int bq25890_power_supply_get_property(struct power_supply *psy, break; case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX: - val->intval = bq25890_tables[TBL_ICHG].rt.max; + val->intval = bq25890_find_val(bq->init_data.ichg, TBL_ICHG); break; case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE: @@ -450,7 +450,7 @@ static int bq25890_power_supply_get_property(struct power_supply *psy, break; case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX: - val->intval = bq25890_tables[TBL_VREG].rt.max; + val->intval = bq25890_find_val(bq->init_data.vreg, TBL_VREG); break; case POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT: