Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4271278ybi; Mon, 29 Jul 2019 22:56:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqx4OX2NM2pMuAxtP77GuLokRQntM70oEvtYdc59Wx9UtJDabbjSKoed+Cks0KaO0gJj9+T2 X-Received: by 2002:a17:90a:5806:: with SMTP id h6mr112195975pji.126.1564466205085; Mon, 29 Jul 2019 22:56:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564466205; cv=none; d=google.com; s=arc-20160816; b=FPd7wO+C0Db3iokcBAES1UqIuWzy4SFYY6QP0k6bFeIN5OuX69/toGo7fr1MKNTZ6+ hmCFaSyLHo3xJFyUJMc3MCYKCvh983Plw2fabq3Otitip1QVt6m7rbfjQoNnuX+cUsFQ Y4dLzcsKDKfLOpciRlKrCGrVrXyEK4jH2QUNECAEtYXT9N4E8zaHKyzVg1SBeWM4uCDR Ax7p+m0+EXhLrRJH56BYttjeaWNxh2F/p7nuwxvME1u9YDqkckanbZoPx+bWv8uNQgcG ZtbieGXNl0XW/67h2lMXz3zDu6vmCg0OdPhfGLD+2n6u94EAUnz0yB4xNBj0qAsc7IZr Urkg== 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:cc:to:subject; bh=Di6FTM5yifNzpkNjkpx8m0bgBnO4fMDxX0Di8UARl+A=; b=t33nS9ENTXrweWIK7HQ0fe6Ih+8jdcSIOjiGGBmYas+32foeMT4fQ9DxrjSD+w909c fl5dfVlztwoMImB6fYzGaqOld/dFcRcq0LV1lnh29h3mq1kdLAMN/8+DU+c26Afh0oK7 ujNKnbKf4xKw1vy1XzZDc3yyH5KxqHFIyAabe9AcRQ5Z9Sd+rWX6sGewrynKjK0wq0an mbOPLd1rYaCBbi07EM6Hn9kWtMSzPkSTVIDnXt81BuVyICA0RxkvHppz6W8Lv1MD9mhE zE0hW/QsBI0AtWoHLBOYyc4YV7yMWho/F1jFxL+DqJxvqlQpZJgGMQLpfMTTpK7jX0r/ vCPw== 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 g24si29117255pfi.119.2019.07.29.22.56.30; Mon, 29 Jul 2019 22:56:45 -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 S1727412AbfG3Fth (ORCPT + 99 others); Tue, 30 Jul 2019 01:49:37 -0400 Received: from anchovy2.45ru.net.au ([203.30.46.146]:45724 "EHLO anchovy2.45ru.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726197AbfG3Fth (ORCPT ); Tue, 30 Jul 2019 01:49:37 -0400 Received: (qmail 23817 invoked by uid 5089); 30 Jul 2019 05:49:35 -0000 Received: by simscan 1.2.0 ppid: 23689, pid: 23690, t: 0.3585s 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 05:49:34 -0000 Subject: Re: [PATCH 1/1] power: supply: sbs-battery: Add ability to force load a battery via the devicetree To: Guenter Roeck Cc: Sebastian Reichel , Kate Stewart , Greg Kroah-Hartman , Thomas Gleixner , rfontana@redhat.com, allison@lohutok.net, Linux PM list , linux-kernel , Nick Crews References: <1564030601-14639-1-git-send-email-rtresidd@electromag.com.au> <5023c937-0662-57e0-c104-bb9c23b07a49@electromag.com.au> From: Richard Tresidder Message-ID: Date: Tue, 30 Jul 2019 13:49:30 +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: 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 Guenter   See below Richard Tresidder Cheers   Richard Tresidder ** On 30/07/2019 12:09 pm, Guenter Roeck wrote: > 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. Good point, we don't actually need to store the value, it can just be a local. Yep I had done a device tree documentation patch, but confused myself when submitting due to it having to be in a separate patch I think I need to create 2 different patches but submit in the same email via send-patch as a multipart patch.. I'll try to fix that when I send it in again. > >>> 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) { >