From patchwork Mon Dec 17 19:28:16 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: 10734177 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 A6C1514E5 for ; Mon, 17 Dec 2018 19:28:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B10D29727 for ; Mon, 17 Dec 2018 19:28:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F2D129937; Mon, 17 Dec 2018 19:28:19 +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 4538129727 for ; Mon, 17 Dec 2018 19:28:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727155AbeLQT2S (ORCPT ); Mon, 17 Dec 2018 14:28:18 -0500 Received: from rere.qmqm.pl ([91.227.64.183]:33378 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727887AbeLQT2S (ORCPT ); Mon, 17 Dec 2018 14:28:18 -0500 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 43JWP56wbXz9F; Mon, 17 Dec 2018 20:26:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1545074810; bh=d+ZxgTSnz8hxfQBL8XM92LV/6Kkl7F7CRxrstqHjUsQ=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=IPMQsgGHUgAQ+5W5OsGUznznuYvLdWcMmG5BZR8DmdVR//XnkGxH8nwm3ojBas+6k 9ODqZnCzMiE8SDUaWeIDQewA49Bbx4m0hL1y3EfEbZ8vABUdTG3KMKXpyQJ5TwAz3h xlx7NTH6bxyejAy3S6VoWDC593ZglUTp++4WISbRndgZHgWGgm+T9smp4ENjEALOPa 1y9hnv55JwgZ+MeDEYFJPPI/lHO1HYw6ZrMJmMBTnxu41/HMWYp2zIkFWkYT8jwWr/ atpXin0B8jlYl+7BZkWCGiQ0Rivq5sO2D0CG1WrbyxBae8xwa9YvCIu3i79LNJH949 u8E7JE3NmB3zQ== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.2 at mail Date: Mon, 17 Dec 2018 20:28:16 +0100 Message-Id: <8759633facb15e014d93dac6a1ece4627c70c54a.1545074364.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v2 2/2] power: supply: bq25890: show max charge current/voltage as configured MIME-Version: 1.0 To: linux-pm@vger.kernel.org Cc: Sebastian Reichel , Angus Ainslie (Purism) , Krzysztof Kozlowski 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 --- v2: rebased onto v4.20-rc7 --- 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 3f6fb49c956c..66991e6f75d9 100644 --- a/drivers/power/supply/bq25890_charger.c +++ b/drivers/power/supply/bq25890_charger.c @@ -436,7 +436,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: @@ -454,7 +454,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: