Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4251164ybi; Mon, 29 Jul 2019 22:31:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZ96zXFFLm/pvNnjwtrXIQRuVv213xn67S2pDp+nokr955R3cmAw6YXFac0sZaJc+VRzev X-Received: by 2002:a17:90a:1ac5:: with SMTP id p63mr113268659pjp.25.1564464683335; Mon, 29 Jul 2019 22:31:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564464683; cv=none; d=google.com; s=arc-20160816; b=dGr4jJjapGlQu9dP+Tnbt6vbyHJ3NgMhEfUHygx3dZmHeyEwsHUF5y8Dxrt+p5HYuv 5Fdo/I20fKSVq0ggrhN5asEuN8OvuRExaLXd3gV1pyXZWZdpERikqwolwiAOPGHM6bv1 nt9J37zcFks0HfYSdwOV3UPKIZ95Gf182uh8OrPi6i5tJtVN8UM2jkRsSVrWLymAoxqP oJax41V9NV4zrblgW+o9ojJq1sHNh3i4VUtOQfIdU0HhwJGj1zvlXV6XhkiZcq6A18qX /sVWttz2DQeKz4+QC/Zkz2hmAeL0ZtR7ZYGw411byhILBnKFpjvQNC6No909xbv3dBwc fr1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject; bh=WaJhe1anD+Q/6axoUKZ/1cjqsiutiUxzvXlaaU/LcrA=; b=TUt++/faD+FB4f3I0xZ5BLjOlb94g5nrYwVP6iM16l5GbvSwFj7GNks53xs+AwraZV JiJCYO0r7AughjWKdASZpDvQB5W11FLEyNSX6h7HtbcoRmDmQ+sEW2Nuu054Izu6B9l7 MfVz4MV/w4SUQLrXb5LJBXnxcF0HRSQApqusFt7X28zL11EtoB1MB19bf+PzrffGNvDi cYwnf+ErrqkbMtGeA1mouP/mtBpx1c8AJxQwO61d51z4cHL5ChUn+yjzGs+0t6rMzOfL d2jhB2F9Eh9L26nJzLBpSHZxI9ay9/hN6VWHSZV/C4Tzeas1qvF9l6jjDEAoKG4K3cfH xzAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z15si32001494pgf.85.2019.07.29.22.31.08; Mon, 29 Jul 2019 22:31:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732842AbfG3DCh (ORCPT + 99 others); Mon, 29 Jul 2019 23:02:37 -0400 Received: from anchovy2.45ru.net.au ([203.30.46.146]:36426 "EHLO anchovy2.45ru.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732834AbfG3DCf (ORCPT ); Mon, 29 Jul 2019 23:02:35 -0400 Received: (qmail 342 invoked by uid 5089); 30 Jul 2019 03:02:33 -0000 Received: by simscan 1.2.0 ppid: 32701, pid: 32702, t: 0.3042s scanners: regex: 1.2.0 attach: 1.2.0 clamav: 0.88.3/m:40/d:1950 spam: 3.1.4 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on anchovy2 X-Spam-Level: X-Spam-Status: No, score=-0.4 required=6.0 tests=ALL_TRUSTED,AWL autolearn=disabled version=3.4.1 Received: from unknown (HELO ?192.168.0.34?) (rtresidd@electromag.com.au@203.59.235.95) by anchovy3.45ru.net.au with ESMTPA; 30 Jul 2019 03:02:32 -0000 Subject: Re: [PATCH 1/1] power: supply: sbs-battery: Add ability to force load a battery via the devicetree To: sre@kernel.org, kstewart@linuxfoundation.org, gregkh@linuxfoundation.org, tglx@linutronix.de, rfontana@redhat.com, allison@lohutok.net, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Nick Crews , Guenter Roeck References: <1564030601-14639-1-git-send-email-rtresidd@electromag.com.au> From: Richard Tresidder Message-ID: <5023c937-0662-57e0-c104-bb9c23b07a49@electromag.com.au> Date: Tue, 30 Jul 2019 11:02:29 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <1564030601-14639-1-git-send-email-rtresidd@electromag.com.au> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-AU Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Nick and Guenter Just adding you to this one also seeing as you're looking at that other sbs_battery patch for me. Not sure why the get maintainers didn't list you for this one. Cheers    Richard Tresidder > Add the ability to force load a hot pluggable battery during boot where > there is no gpio detect method available and the module is statically > built. Normal polling will then occur on that battery when it is inserted. > > Signed-off-by: Richard Tresidder > --- > > Notes: > Add the ability to force load a hot pluggable battery during boot where > there is no gpio detect method available and the module is statically > built. Normal polling will then occur on that battery when it is inserted. > > drivers/power/supply/sbs-battery.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/power/supply/sbs-battery.c b/drivers/power/supply/sbs-battery.c > index 048d205..ea8ba3e 100644 > --- a/drivers/power/supply/sbs-battery.c > +++ b/drivers/power/supply/sbs-battery.c > @@ -161,6 +161,7 @@ struct sbs_info { > int poll_time; > u32 i2c_retry_count; > u32 poll_retry_count; > + bool force_load; > struct delayed_work work; > struct mutex mode_lock; > u32 flags; > @@ -852,6 +853,9 @@ static int sbs_probe(struct i2c_client *client, > if (rc) > chip->poll_retry_count = 0; > > + chip->force_load = of_property_read_bool(client->dev.of_node, > + "sbs,force-load"); > + > if (pdata) { > chip->poll_retry_count = pdata->poll_retry_count; > chip->i2c_retry_count = pdata->i2c_retry_count; > @@ -890,7 +894,7 @@ static int sbs_probe(struct i2c_client *client, > * Before we register, we might need to make sure we can actually talk > * to the battery. > */ > - if (!(force_load || chip->gpio_detect)) { > + if (!(force_load || chip->gpio_detect || chip->force_load)) { > rc = sbs_read_word_data(client, sbs_data[REG_STATUS].addr); > > if (rc < 0) {