Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4266844ybi; Mon, 29 Jul 2019 22:51:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqwtaYdZVT9eoNtPG3uKESuSQar4Gra8gICayOXcR3ZTJXGqRv7KhDSvFBe+ITHRVUX7d3QQ X-Received: by 2002:aa7:9dcd:: with SMTP id g13mr41083165pfq.204.1564465861178; Mon, 29 Jul 2019 22:51:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564465861; cv=none; d=google.com; s=arc-20160816; b=WK2Dn1/l8AYph43y5TpZPz9UV/lhhmxZVrzkkzl3oeUpRopZfHT/eILNb3PODud56b eSLiibJvreXbd5WB5F5bODrRosCuzoRvwIO9yenEY/eqitq/MzN1iQjFE1BSRVbpcshF 1gtmTkQfrPlsIzBWbENJa+AdI942/WdTe/wFSR+uMJvj2eG6hQIg/TeyJthUrhgc7yTd kaMXtXL+hD0Gxso/0E3DRpK3oKOJSzdxQe4vdK9mZD6VQVIls2+i5IWUVK277ZlBUWhM nVW8PBCrwTnHzUTpL9HU1BjEmGtNxozntv/G6o16NyWRYbuis2BSJ6PJpjUQ7JW+0tzY TRkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=CZ/qbh71cM7/4Sn8yjlhaQLGnLaI4jI9zz5SRsmHonU=; b=Z2AisqIM0A4ZxAdgzTmqFTxYGCTtlenjSkHt69FXUdWM1Glx/63eaq0XwNWVEuTx4n f5dssR3oiC9H/FwK9Vy2nDAP+hlkIdfmqpWunq6ZhbfYSxEyTExeWCalExrf1ptd/ZxE /qlJuY7LYxy4RcdtzZogkvXm9m74utMNS90KhkqblaNYnWhVgLZ6pK4OIaId9PrtYcap eVuKdhmFxIMPzkHnyDT9MBQjwwJnaVZ/tT5YbqvWNrduMUI4Jk2mOMmp4ilbi4ZqF1d8 nYcOWw2t+4bprczDTWu/jpojgKLNLCPZsr04+MKgXkn1Q2pYlwJM5G61GTo0qMATuARF 4hpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=gEUI3Lxu; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i9si26845497plb.284.2019.07.29.22.50.46; Mon, 29 Jul 2019 22:51:01 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=gEUI3Lxu; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726168AbfG3EJd (ORCPT + 99 others); Tue, 30 Jul 2019 00:09:33 -0400 Received: from mail-yw1-f65.google.com ([209.85.161.65]:36231 "EHLO mail-yw1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726073AbfG3EJc (ORCPT ); Tue, 30 Jul 2019 00:09:32 -0400 Received: by mail-yw1-f65.google.com with SMTP id x67so22023890ywd.3 for ; Mon, 29 Jul 2019 21:09:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CZ/qbh71cM7/4Sn8yjlhaQLGnLaI4jI9zz5SRsmHonU=; b=gEUI3Lxu5EebGD79kpxXdVItRKE8YQtmrOx6MnmyBgNFQsAgthepQdmZ7YR24w91Au t2mdnKbzJP26aoKvKj64M3Y1fbgDMqFpixGzeM4dryfG/Q7j1VgUiN7NsjbxINHXxHFD MkKT9HFQLK9wYcOWV5UZR2X4jiPOMR/XsKylcLWpPDfQVS+Abg8MYfhpyx29l3LoeiFa c+/vLs6STG4OAqwqT2s1otHpzYVR3GdRdWLH0QQH7fi/vopR5hK50jpEx4hG0kNBEd9T CKkXZ33pqiZn67enA6AfLOLSTk+TqDn8xdvWDXTotFeFlA21RHjqlu1Qo7h4o6LXfcr+ gfAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CZ/qbh71cM7/4Sn8yjlhaQLGnLaI4jI9zz5SRsmHonU=; b=jc8b+5SgFZ6Nuld5VoiseVEpXKKRdx/Xe0Jeje3IWRzLK5Bb9IYDK2UUy6PDi48sST vJKkinj9ocqkvMQsNT+i2uTLh9KQ9T6DBNKr8nZlpUL5+qdXmrxKAHfrSODTxQa/eMfb mFzElfLVbFPIakYVcFJ19NZY+paJC3PBxPqHQ6edP3s1TogbJ2aMCZ18zWxeqC0HiRMy pyDkGyQNmqcfH8DxNQGxFvfJsHvbcNQvCV5vHsiQD7uAW/MJy6fr/XD9NhcETn0AowE2 d3uUQuYDy1MEgwxddA11IhVuFOl2zj0LkzA9/koLJB4ItRAWGzltrvoazk3Pp1+sgrd3 tu7Q== X-Gm-Message-State: APjAAAXIszBLBTs3KI/akqHOQPu+ZpJWdWhJ3WS1/MFhW/KBDQCqT87h Ha2gmY/W4l7y88dT8tBhfU4pOyphOqZ9Ui8EwAOEmQ== X-Received: by 2002:a81:3803:: with SMTP id f3mr67420374ywa.337.1564459771762; Mon, 29 Jul 2019 21:09:31 -0700 (PDT) MIME-Version: 1.0 References: <1564030601-14639-1-git-send-email-rtresidd@electromag.com.au> <5023c937-0662-57e0-c104-bb9c23b07a49@electromag.com.au> In-Reply-To: <5023c937-0662-57e0-c104-bb9c23b07a49@electromag.com.au> From: Guenter Roeck Date: Mon, 29 Jul 2019 21:09:20 -0700 Message-ID: Subject: Re: [PATCH 1/1] power: supply: sbs-battery: Add ability to force load a battery via the devicetree To: Richard Tresidder Cc: Sebastian Reichel , Kate Stewart , Greg Kroah-Hartman , Thomas Gleixner , rfontana@redhat.com, allison@lohutok.net, Linux PM list , linux-kernel , Nick Crews Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 29, 2019 at 8:02 PM Richard Tresidder wrote: > > 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"); > > + Maybe it is documented in another patch, which I have not seen. If it isn't, it will have to be documented and reviewed by a devicetree maintainer. Either case, I don't immediately see why the variable needs to reside in struct sbs_info; it seems to be used only in the probe function. > > 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) { >