From patchwork Tue Mar 24 08:28:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vaittinen, Matti" X-Patchwork-Id: 212503 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00A91C41621 for ; Tue, 24 Mar 2020 08:28:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D00A92080C for ; Tue, 24 Mar 2020 08:28:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726231AbgCXI2Y (ORCPT ); Tue, 24 Mar 2020 04:28:24 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:40535 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726190AbgCXI2Y (ORCPT ); Tue, 24 Mar 2020 04:28:24 -0400 Received: by mail-lf1-f65.google.com with SMTP id j17so12459901lfe.7; Tue, 24 Mar 2020 01:28:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=kRJg84VU9tp6u6sQPu2G+yAX+4Ye9aKZ4f3szcmB6vE=; b=ueMOHo0BAHnbYXpUe4LEiO2S3DCcjy75XpBqWcMtqaTq7W7HYxSNRktG3IIDYcnkDg 78DF0nTr7zrL948ytcuc/ZVwY9SLy8ERH00DDYn83Sk0izLzqXgPtpcnCcrZ7SBMw4vQ DhuEXMyzWwD+SNzmZ5nv/2uKGk3F1jsUWRUBV09AWYQAx2oX/9NOohgZtL2FC16jzrMO d8i8FWrldN4N9kWBXQNEo4d/YCyyu3w199w2yzIjGa3hXeaMHbBO7lC96kRTgfKEPTT3 Bl+tE9O79AXlz5xWYoapxosP7jRjvU5MArtVC5wJoUOW0yfCs0b+37R8r9ty/zZHI+SE MYdA== X-Gm-Message-State: ANhLgQ2yhfmUpShp+455L0Vm2Ez0VoWYKUUFentmxI9kzR4EQSYIic2t Ai/4x7i00WDLRdUhFh0RmXo= X-Google-Smtp-Source: ADFU+vtI4InlVmw+OQgIHWxu3hpikd74MhMKUAVtY0A9WnHehR88WKu5TGH1ZxrtwYh2HzGuviBr5g== X-Received: by 2002:a05:6512:2012:: with SMTP id a18mr4616022lfb.208.1585038500978; Tue, 24 Mar 2020 01:28:20 -0700 (PDT) Received: from localhost.localdomain (dc7t7ryyyyyyyyyyyyybt-3.rev.dnainternet.fi. [2001:14ba:16e1:b700::3]) by smtp.gmail.com with ESMTPSA id r2sm9362176lfn.92.2020.03.24.01.28.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2020 01:28:20 -0700 (PDT) Date: Tue, 24 Mar 2020 10:28:12 +0200 From: Matti Vaittinen To: matti.vaittinen@fi.rohmeurope.com, mazziesaccount@gmail.com Cc: Greg Kroah-Hartman , Linus Walleij , Mikko Mutanen , Markus Laine , Andrew Morton , Andy Shevchenko , Andy Shevchenko , Ard Biesheuvel , Borislav Petkov , Brendan Higgins , Changbin Du , Dan Williams , David Gow , "David S. Miller" , devicetree@vger.kernel.org, Gary Hook , Herbert Xu , Krzysztof Kozlowski , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Mark Rutland , Masahiro Yamada , Masami Hiramatsu , Matti Vaittinen , Mikhail Zaslonko , Randy Dunlap , Rob Herring , Sebastian Reichel , Shuah Khan , Tal Gilboa , Thomas Gleixner , Uwe =?iso-8859-1?q?Kleine-K=F6nig?= , Vincenzo Frascino , Vladimir Oltean , Mark Brown , Liam Girdwood Subject: [PATCH v6 02/10] dt_bindings: ROHM BD99954 Charger Message-ID: <7a977e37124324a33b202ac6ffaa128b40044076.1584977512.git.matti.vaittinen@fi.rohmeurope.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The ROHM BD99954 is a Battery Management LSI for 1-4 cell Lithium-Ion secondary battery. Intended to be used in space-constraint equipment such as Low profile Notebook PC, Tablets and other applications. BD99954 provides a Dual-source Battery Charger, two port BC1.2 detection and a Battery Monitor. Document the DT bindings for BD99954 Signed-off-by: Matti Vaittinen Reviewed-by: Rob Herring --- .../bindings/power/supply/rohm,bd99954.yaml | 155 ++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/supply/rohm,bd99954.yaml diff --git a/Documentation/devicetree/bindings/power/supply/rohm,bd99954.yaml b/Documentation/devicetree/bindings/power/supply/rohm,bd99954.yaml new file mode 100644 index 000000000000..7e0f73a898c7 --- /dev/null +++ b/Documentation/devicetree/bindings/power/supply/rohm,bd99954.yaml @@ -0,0 +1,155 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/power/supply/rohm,bd99954.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ROHM BD99954 Battery charger + +maintainers: + - Matti Vaittinen + - Markus Laine + - Mikko Mutanen + +description: | + The ROHM BD99954 is a Battery Management LSI for 1-4 cell Lithium-Ion + secondary battery intended to be used in space-constraint equipment such + as Low profile Notebook PC, Tablets and other applications. BD99954 + provides a Dual-source Battery Charger, two port BC1.2 detection and a + Battery Monitor. + + +properties: + compatible: + const: rohm,bd99954 +# +# The battery charging profile of BD99954. +# +# Curve (1) represents charging current. +# Curve (2) represents battery voltage. +# +# The BD99954 data sheet divides charging to three phases. +# a) Trickle-charge with constant current (8). +# b) pre-charge with constant current (6) +# c) fast-charge with: +# First a constant current (5) phase (CC) +# Then constant voltage (CV) phase (after the battery voltage has reached +# target level - until charging current has dropped to termination +# level (7) +# +# V ^ ^ I +# . . +# . . +# (4)- -.- - - - - - - - - - - - - - +++++++++++++++++++++++++++. +# . / . +# . ++++++/++ - - - - - - - - - - - - -.- - (5) +# . + / + . +# . + - -- . +# . + - + . +# . +.- -: . +# . .+ +` . +# . .- + | `/ . +# . .." + .: . +# . -" + -- . +# . (2) ..." + | :- . +# . ..."" + -: . +# (3)- -.-.""- - - - -+++++++++ - - - - - - -.:- - - - - - - - - .- - (6) +# . + `:. . +# . + | -: . +# . + -: . +# . + .. . +# . (1) + | "+++- - - -.- - (7) +# -++++++++++++++- - - - - - - - - - - - - - - - - + - - - .- - (8) +# . + - +# -------------------------------------------------+++++++++--> +# | | | CC | CV | +# | --trickle-- | -pre- | ---------fast----------- | +# +# The charger uses the following battery properties +# - trickle-charge-current-microamp: +# Current used at trickle-charge phase (8 in above chart) +# minimum: 64000 +# maximum: 1024000 +# multipleOf: 64000 +# - precharge-current-microamp: +# Current used at pre-charge phase (6 in above chart) +# minimum: 64000 +# maximum: 1024000 +# multipleOf: 64000 +# - constant-charge-current-max-microamp +# Current used at fast charge constant current phase (5 in above chart) +# minimum: 64000 +# maximum: 1024000 +# multipleOf: 64000 +# - constant-charge-voltage-max-microvolt +# The constant voltage used in fast charging phase (4 in above chart) +# minimum: 2560000 +# maximum: 19200000 +# multipleOf: 16000 +# - precharge-upper-limit-microvolt +# charging mode is changed from trickle charging to pre-charging +# when battery voltage exceeds this limit voltage (3 in above chart) +# minimum: 2048000 +# maximum: 19200000 +# multipleOf: 64000 +# - re-charge-voltage-microvolt +# minimum: 2560000 +# maximum: 19200000 +# multipleOf: 16000 +# re-charging is automatically started when battry has been discharging +# to the point where the battery voltage drops below this limit +# - over-voltage-threshold-microvolt +# battery is expected to be faulty if battery voltage exceeds this limit. +# Charger will then enter to a "battery faulty" -state +# minimum: 2560000 +# maximum: 19200000 +# multipleOf: 16000 +# - charge-term-current-microamp +# minimum: 0 +# maximum: 1024000 +# multipleOf: 64000 +# a charge cycle terminates when the battery voltage is above recharge +# threshold, and the current is below this setting (7 in above chart) +# See also Documentation/devicetree/bindings/power/supply/battery.txt + + monitored-battery: + description: + phandle of battery characteristics devicetree node + + rohm,vsys-regulation-microvolt: + description: system specific lower limit for system voltage. + minimum: 2560000 + maximum: 19200000 + multipleOf: 64000 + + rohm,vbus-input-current-limit-microamp: + description: system specific VBUS input current limit (in microamps). + minimum: 32000 + maximum: 16352000 + multipleOf: 32000 + + rohm,vcc-input-current-limit-microamp: + description: system specific VCC/VACP input current limit (in microamps). + minimum: 32000 + maximum: 16352000 + multipleOf: 32000 + +required: + - compatible + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + charger@9 { + compatible = "rohm,bd99954"; + monitored-battery = <&battery>; + reg = <0x9>; + interrupt-parent = <&gpio1>; + interrupts = <29 8>; + rohm,vsys-regulation-microvolt = <8960000>; + rohm,vbus-input-current-limit-microamp = <1472000>; + rohm,vcc-input-current-limit-microamp = <1472000>; + }; + }; From patchwork Tue Mar 24 08:30:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vaittinen, Matti" X-Patchwork-Id: 212502 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BDAC3C4332B for ; Tue, 24 Mar 2020 08:30:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9913120724 for ; Tue, 24 Mar 2020 08:30:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726413AbgCXIa0 (ORCPT ); Tue, 24 Mar 2020 04:30:26 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:40683 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726190AbgCXIaZ (ORCPT ); Tue, 24 Mar 2020 04:30:25 -0400 Received: by mail-lf1-f66.google.com with SMTP id j17so12464525lfe.7; Tue, 24 Mar 2020 01:30:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=nDkpzkIbHTHFB2KCsxpJEeEEt/VOed+TnbNFIK439eQ=; b=dC/fK7UpMaoLl49AOGL8zX9WJQHOsEfbd7/vTFClNRGBebRV+jyXw1NGRYDS5yGqYR OFKdwVMSLjyWBzq8KQWQeevw02b6qxgxaO810puBHDwz3z6QYI0Rlu44luDSZ7EZKqSL gpdAorde7O9Z8KZhvPtX97hH53PmlkW3AfRBI6hXH1o0WAve9zfvJ96KGmkaFD7FMvoz chdQf8Oc3F7Y9kFLLxcYY5XiEdsQaTBdQfDokzCMVPLiALbWnUJoGpGs78ffLLtRfK6y ZsMc2sYB91TLKIEdQACamQSBQ5qvvIIosb/njqSN/QI0BUv1BI4t7t50Q6hLxduOudI8 lvtw== X-Gm-Message-State: ANhLgQ0Pbw6Pi5JgsTBRD+6879godhJQTilgVeeAoJ32YDl68pNN8K5E D8b+og818Mzj0Auq5QFO5z4= X-Google-Smtp-Source: ADFU+vsx7NUPh9C/1NXHGhim/MCrK/kf/RNGLXfz0W6+ce3Vf4Bkp5rXKwurGaSKu6soRXQ1tcxiTw== X-Received: by 2002:a19:c511:: with SMTP id w17mr15035497lfe.119.1585038622782; Tue, 24 Mar 2020 01:30:22 -0700 (PDT) Received: from localhost.localdomain (dc7t7ryyyyyyyyyyyyybt-3.rev.dnainternet.fi. [2001:14ba:16e1:b700::3]) by smtp.gmail.com with ESMTPSA id q8sm2870119ljj.77.2020.03.24.01.30.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2020 01:30:22 -0700 (PDT) Date: Tue, 24 Mar 2020 10:30:14 +0200 From: Matti Vaittinen To: matti.vaittinen@fi.rohmeurope.com, mazziesaccount@gmail.com Cc: Greg Kroah-Hartman , Linus Walleij , Mikko Mutanen , Markus Laine , Andrew Morton , Andy Shevchenko , Andy Shevchenko , Ard Biesheuvel , Borislav Petkov , Brendan Higgins , Changbin Du , Dan Williams , David Gow , "David S. Miller" , devicetree@vger.kernel.org, Gary Hook , Herbert Xu , Krzysztof Kozlowski , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Mark Rutland , Masahiro Yamada , Masami Hiramatsu , Matti Vaittinen , Mikhail Zaslonko , Randy Dunlap , Rob Herring , Sebastian Reichel , Shuah Khan , Tal Gilboa , Thomas Gleixner , Uwe =?iso-8859-1?q?Kleine-K=F6nig?= , Vincenzo Frascino , Vladimir Oltean , Mark Brown , Liam Girdwood Subject: [PATCH v6 05/10] power: supply: bd70528: rename linear_range to avoid collision Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Follow-up patches in this series will add a generic struct linear_range. Rename bd70528 internal struct to avoid collision. Signed-off-by: Matti Vaittinen --- drivers/power/supply/bd70528-charger.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/power/supply/bd70528-charger.c b/drivers/power/supply/bd70528-charger.c index b8e1ec106627..3b820110ecfa 100644 --- a/drivers/power/supply/bd70528-charger.c +++ b/drivers/power/supply/bd70528-charger.c @@ -335,14 +335,14 @@ static int bd70528_get_present(struct bd70528_psy *bdpsy, int *val) return 0; } -struct linear_range { +struct bd70528_linear_range { int min; int step; int vals; int low_sel; }; -static const struct linear_range current_limit_ranges[] = { +static const struct bd70528_linear_range current_limit_ranges[] = { { .min = 5, .step = 1, @@ -374,7 +374,7 @@ static const struct linear_range current_limit_ranges[] = { * voltage for low temperatures. The driver currently only reads * the charge current at room temperature. We do set both though. */ -static const struct linear_range warm_charge_curr[] = { +static const struct bd70528_linear_range warm_charge_curr[] = { { .min = 10, .step = 10, @@ -398,7 +398,7 @@ static const struct linear_range warm_charge_curr[] = { #define MAX_WARM_CHG_CURR_SEL 0x1f #define MIN_CHG_CURR_SEL 0x0 -static int find_value_for_selector_low(const struct linear_range *r, +static int find_value_for_selector_low(const struct bd70528_linear_range *r, int selectors, unsigned int sel, unsigned int *val) { @@ -420,7 +420,7 @@ static int find_value_for_selector_low(const struct linear_range *r, * I guess it is enough if we use voltage/current which is closest (below) * the requested? */ -static int find_selector_for_value_low(const struct linear_range *r, +static int find_selector_for_value_low(const struct bd70528_linear_range *r, int selectors, unsigned int val, unsigned int *sel, bool *found) { From patchwork Tue Mar 24 08:31:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vaittinen, Matti" X-Patchwork-Id: 212501 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B590C41621 for ; Tue, 24 Mar 2020 08:32:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2E20F208E4 for ; Tue, 24 Mar 2020 08:32:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727124AbgCXIcA (ORCPT ); Tue, 24 Mar 2020 04:32:00 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:40748 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726091AbgCXIcA (ORCPT ); Tue, 24 Mar 2020 04:32:00 -0400 Received: by mail-lj1-f195.google.com with SMTP id 19so17598091ljj.7; Tue, 24 Mar 2020 01:31:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=2K08FJcoLeZWjAYlC6fWPluhTTZxEk5E+fKIcES5b4s=; b=LpmqVg2dSJ7tRikx9Jx7qq+RSlONgJL1+/qdoyKssoFcgA9NUJ2H4242JrWF9/FGEI 7YgfqwXADb2FmBPQU6Z9jIZOcPyguHFtMPmcW15vKn2BFrCWsoLDceYeWAUVdS0jMG3B BNBzEk/6YIJH829JDS9bvOd308hiEOZQqO2ifVcgPrquuCuzR9fvVjVIBGXwaV4GXh/X ra5mHXMP5DIakPef1vSk7MePD+K1iqEim/nA5PlYHBiCuLwrxLoz3gbZ9Ml/yBzaZbq5 kmMzZD+/Azp8puOaBCaseCj6bejMzLojG2F/E7x9UN5MYdsxg5stdK6rcw5znSUzCWB6 cO4g== X-Gm-Message-State: ANhLgQ0ue9wqPioUc7whixKvEFaixheDBX94k2zfZcQlzl5C8+m1hyYV SxtTjSW4F8nacJIvuEui9bM= X-Google-Smtp-Source: ADFU+vtik0yQhc1Fh/MHKsd9VQbQKeAVjTUT1imHTy5+oJ06BW5CRMJJ35Hai2gm5Y4p6PIN+23S8Q== X-Received: by 2002:a2e:8612:: with SMTP id a18mr3585407lji.250.1585038717427; Tue, 24 Mar 2020 01:31:57 -0700 (PDT) Received: from localhost.localdomain (dc7t7ryyyyyyyyyyyyybt-3.rev.dnainternet.fi. [2001:14ba:16e1:b700::3]) by smtp.gmail.com with ESMTPSA id q20sm1120908ljj.66.2020.03.24.01.31.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2020 01:31:56 -0700 (PDT) Date: Tue, 24 Mar 2020 10:31:49 +0200 From: Matti Vaittinen To: matti.vaittinen@fi.rohmeurope.com, mazziesaccount@gmail.com Cc: Greg Kroah-Hartman , Linus Walleij , Mikko Mutanen , Markus Laine , Andrew Morton , Andy Shevchenko , Andy Shevchenko , Ard Biesheuvel , Borislav Petkov , Brendan Higgins , Changbin Du , Dan Williams , David Gow , "David S. Miller" , devicetree@vger.kernel.org, Gary Hook , Herbert Xu , Krzysztof Kozlowski , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Mark Rutland , Masahiro Yamada , Masami Hiramatsu , Matti Vaittinen , Mikhail Zaslonko , Randy Dunlap , Rob Herring , Sebastian Reichel , Shuah Khan , Tal Gilboa , Thomas Gleixner , Uwe =?iso-8859-1?q?Kleine-K=F6nig?= , Vincenzo Frascino , Vladimir Oltean , Mark Brown , Liam Girdwood Subject: [PATCH v6 08/10] power: supply: add battery parameters Message-ID: <4a9dc957163a5ef4ce73dd7e38a1ab6f11b324c2.1584977512.git.matti.vaittinen@fi.rohmeurope.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Add parsing of new device-tree battery bindings. - trickle-charge-current-microamp - precharge-upper-limit-microvolt - re-charge-voltage-microvolt - over-voltage-threshold-microvolt Signed-off-by: Matti Vaittinen --- drivers/power/supply/power_supply_core.c | 8 ++++++++ include/linux/power_supply.h | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c index 1a9a9fae73d3..02b37fe6061c 100644 --- a/drivers/power/supply/power_supply_core.c +++ b/drivers/power/supply/power_supply_core.c @@ -620,10 +620,18 @@ int power_supply_get_battery_info(struct power_supply *psy, &info->voltage_min_design_uv); of_property_read_u32(battery_np, "voltage-max-design-microvolt", &info->voltage_max_design_uv); + of_property_read_u32(battery_np, "trickle-charge-current-microamp", + &info->tricklecharge_current_ua); of_property_read_u32(battery_np, "precharge-current-microamp", &info->precharge_current_ua); + of_property_read_u32(battery_np, "precharge-upper-limit-microvolt", + &info->precharge_voltage_max_uv); of_property_read_u32(battery_np, "charge-term-current-microamp", &info->charge_term_current_ua); + of_property_read_u32(battery_np, "re-charge-voltage-microvolt", + &info->charge_restart_voltage_uv); + of_property_read_u32(battery_np, "over-voltage-threshold-microvolt", + &info->overvoltage_limit_uv); of_property_read_u32(battery_np, "constant-charge-current-max-microamp", &info->constant_charge_current_max_ua); of_property_read_u32(battery_np, "constant-charge-voltage-max-microvolt", diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index dcd5a71e6c67..d01322d1ab52 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -346,8 +346,12 @@ struct power_supply_battery_info { int charge_full_design_uah; /* microAmp-hours */ int voltage_min_design_uv; /* microVolts */ int voltage_max_design_uv; /* microVolts */ + int tricklecharge_current_ua; /* microAmps */ int precharge_current_ua; /* microAmps */ + int precharge_voltage_max_uv; /* microVolts */ int charge_term_current_ua; /* microAmps */ + int charge_restart_voltage_uv; /* microVolts */ + int overvoltage_limit_uv; /* microVolts */ int constant_charge_current_max_ua; /* microAmps */ int constant_charge_voltage_max_uv; /* microVolts */ int factory_internal_resistance_uohm; /* microOhms */ From patchwork Tue Mar 24 08:32:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vaittinen, Matti" X-Patchwork-Id: 212500 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D11E2C41621 for ; Tue, 24 Mar 2020 08:32:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B3E0D20724 for ; Tue, 24 Mar 2020 08:32:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727071AbgCXIcz (ORCPT ); Tue, 24 Mar 2020 04:32:55 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:39258 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726091AbgCXIcz (ORCPT ); Tue, 24 Mar 2020 04:32:55 -0400 Received: by mail-lf1-f68.google.com with SMTP id j15so12467306lfk.6; Tue, 24 Mar 2020 01:32:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=IjEhO5KyVk/mLcThJc5nXrYak70vFV8lM7HnSm/e624=; b=iSfp+yokQFXJu02saPFgRFF5uu1zAUJUfM+mrHxAJ5YBhX6H3dip6pxhCtEh+9leN+ tihKJX8C5g0uRtDcJ7yjONen/Y//0v3nK3/UJoiFut1/jOZNC4f5XuGMxjsF1lLoFXAj I7t3Nq5h8/p95xWbd1iEPjFORPw43IkhkPQr02TNLlypYnLmxIzWwyiONHRLbBW4YKKh 0uMW8Ixi2sFiGmnzJ8qWYFqMjoUmLSqPeawroX08LM38/Q65S4tAPhcnggq4eslWvGHc PlFyISkiQgfqsjozYi//1iKO7SduXCdM+amVCzdKJl6mx4szLj3M3VXpofmxyvkk5xQ+ fibw== X-Gm-Message-State: ANhLgQ3qj/An1UFdw3yMR6GxNyMndwAKfvKoy2YjrVFVwQUDIPrDp1IQ c1POUQ12epENh1HJ/tV+wqk= X-Google-Smtp-Source: ADFU+vuC45OXgiz6TjtQcTQMN3L5NES8EFGGHuoS2ueBD2YrdjSO5K8ew9zzfTU1QU/wwYGsXD/iBQ== X-Received: by 2002:a19:41c5:: with SMTP id o188mr4980992lfa.52.1585038771993; Tue, 24 Mar 2020 01:32:51 -0700 (PDT) Received: from localhost.localdomain (dc7t7ryyyyyyyyyyyyybt-3.rev.dnainternet.fi. [2001:14ba:16e1:b700::3]) by smtp.gmail.com with ESMTPSA id g21sm9431033lfh.12.2020.03.24.01.32.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2020 01:32:51 -0700 (PDT) Date: Tue, 24 Mar 2020 10:32:43 +0200 From: Matti Vaittinen To: matti.vaittinen@fi.rohmeurope.com, mazziesaccount@gmail.com Cc: Greg Kroah-Hartman , Linus Walleij , Mikko Mutanen , Markus Laine , Andrew Morton , Andy Shevchenko , Andy Shevchenko , Ard Biesheuvel , Borislav Petkov , Brendan Higgins , Changbin Du , Dan Williams , David Gow , "David S. Miller" , devicetree@vger.kernel.org, Gary Hook , Herbert Xu , Krzysztof Kozlowski , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Mark Rutland , Masahiro Yamada , Masami Hiramatsu , Matti Vaittinen , Mikhail Zaslonko , Randy Dunlap , Rob Herring , Sebastian Reichel , Shuah Khan , Tal Gilboa , Thomas Gleixner , Uwe =?iso-8859-1?q?Kleine-K=F6nig?= , Vincenzo Frascino , Vladimir Oltean , Mark Brown , Liam Girdwood Subject: [PATCH v6 10/10] power: supply: Fix Kconfig help text indentiation Message-ID: <4301575089b89ff8953d5c94613c17cfd33bfdbf.1584977512.git.matti.vaittinen@fi.rohmeurope.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Indent the help text as explained in Documentation/process/coding-style.rst --- I just learned the help text in Kconfigs should be indented by two spaces. I fixed this for BD99954 as suggested by Randy and decided that I could do this for few other entries as well while I was at it anyways. Signed-off-by: Matti Vaittinen --- drivers/power/supply/Kconfig | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig index af96d7fa56b1..f606ba069e4e 100644 --- a/drivers/power/supply/Kconfig +++ b/drivers/power/supply/Kconfig @@ -415,7 +415,7 @@ config CHARGER_PCF50633 tristate "NXP PCF50633 MBC" depends on MFD_PCF50633 help - Say Y to include support for NXP PCF50633 Main Battery Charger. + Say Y to include support for NXP PCF50633 Main Battery Charger. config BATTERY_RX51 tristate "Nokia RX-51 (N900) battery driver" @@ -609,15 +609,15 @@ config CHARGER_TPS65090 tristate "TPS65090 battery charger driver" depends on MFD_TPS65090 help - Say Y here to enable support for battery charging with TPS65090 - PMIC chips. + Say Y here to enable support for battery charging with TPS65090 + PMIC chips. config CHARGER_TPS65217 tristate "TPS65217 battery charger driver" depends on MFD_TPS65217 help - Say Y here to enable support for battery charging with TPS65217 - PMIC chips. + Say Y here to enable support for battery charging with TPS65217 + PMIC chips. config BATTERY_GAUGE_LTC2941 tristate "LTC2941/LTC2943 Battery Gauge Driver" @@ -671,16 +671,16 @@ config CHARGER_SC2731 tristate "Spreadtrum SC2731 charger driver" depends on MFD_SC27XX_PMIC || COMPILE_TEST help - Say Y here to enable support for battery charging with SC2731 - PMIC chips. + Say Y here to enable support for battery charging with SC2731 + PMIC chips. config FUEL_GAUGE_SC27XX tristate "Spreadtrum SC27XX fuel gauge driver" depends on MFD_SC27XX_PMIC || COMPILE_TEST depends on IIO help - Say Y here to enable support for fuel gauge with SC27XX - PMIC chips. + Say Y here to enable support for fuel gauge with SC27XX + PMIC chips. config CHARGER_UCS1002 tristate "Microchip UCS1002 USB Port Power Controller" @@ -698,9 +698,9 @@ config CHARGER_BD70528 select LINEAR_RANGES default n help - Say Y here to enable support for getting battery status - information and altering charger configurations from charger - block of the ROHM BD70528 Power Management IC. + Say Y here to enable support for getting battery status + information and altering charger configurations from charger + block of the ROHM BD70528 Power Management IC. config CHARGER_BD99954 tristate "ROHM bd99954 charger driver"