Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10421536ybi; Wed, 24 Jul 2019 22:56:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJR/tc4e9Kf8EQtGI8BHrpvmxtUruA7KryA7sIz8p8oUKAJo3EyBQsl3zXy1SaMhViUQOg X-Received: by 2002:a17:902:2ac7:: with SMTP id j65mr90133404plb.242.1564034173489; Wed, 24 Jul 2019 22:56:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564034173; cv=none; d=google.com; s=arc-20160816; b=r22BRqtQY+XxnFTA4ALaRRKsrQcVhbLauggpUvKRf8qmefWfcyPmaYsYyCVqM/6CtE fZMCluf93EsU846UMXyHceA7+CQ4OBjmg3MXMd2KDCHwC3+ph63r9nVKZ3DbNJ93yMAZ LWOpy+UMQ42+qKNuiM1amL7oZQmnOSC17koPIvadwQ+8BO8mpsVjj0t8NnorYUM7AoxC qJhbooSDQW6lWFKCsin5HRDQPe+jn7RFvv7wAJW0okvuyt+gxriZwQJ9wit2smSgIKbY fVOrf4B1jmu67UtWJU2XtV5/j0WlhqjP743qX5I6CpJHRYTaIMzu5gUrlz/cLIS5Qr9+ +9/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from; bh=U5p0OncPkvuI0WxKQykp5dIP7Lpbztwi6UwazjENWLk=; b=eO9mD+ABQmNMhrrFiaSFHIgi/de4TIfgYs6tsMPvJVMP1kXC3U5xYe7NJkswgOxaiV WDGopnxnEIaFJIOIh+eziOYVnlk9KieLgaJOs/TAE424yfxDcfKs+MbIRyNNtko2t+Am 7d5NKaUY1ObIH6NNOcKBW5KaKl+cUM1XcQpru7EJDhyhjFxLamE79yW2f7RfYzMMOiVu aOIPwRwh9/rMPcuQxZCHQiED/Om18KNSGpkroW3NeN1/frJ7BLC984AULjKtli/21d4y saJjicPnpOuBwIcu14eppuHYbmyWwQxrEpkPGIBwUbVNKWDZ74cnV14UFnGEKMIwGRvs Sh1A== 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 r26si16085428pgv.189.2019.07.24.22.55.59; Wed, 24 Jul 2019 22:56:13 -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 S2390417AbfGYFGJ (ORCPT + 99 others); Thu, 25 Jul 2019 01:06:09 -0400 Received: from icp-osb-irony-out1.external.iinet.net.au ([203.59.1.210]:42198 "EHLO icp-osb-irony-out1.external.iinet.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390362AbfGYFGI (ORCPT ); Thu, 25 Jul 2019 01:06:08 -0400 X-Greylist: delayed 559 seconds by postgrey-1.27 at vger.kernel.org; Thu, 25 Jul 2019 01:06:07 EDT X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2CxDAAmNTld/1/rO8tlhW4hEhcTjRi?= =?us-ascii?q?IFwGCQwGDWYVTkRcJAQEBAQEBAQEBGxwBAYQ6BIMAOBMBAwEBAQQBAQEBBQF?= =?us-ascii?q?thGVFhXgvcnASgyKBdxOtZDOIeYFIgTSHCYRugUA/g3VshAMKG4V/BJU3lTQ?= =?us-ascii?q?JgSV2lBIZmAqLX4FYmWMhgVhNHxmDJ4J5jho1MIskglIBAQ?= X-IPAS-Result: =?us-ascii?q?A2CxDAAmNTld/1/rO8tlhW4hEhcTjRiIFwGCQwGDWYVTk?= =?us-ascii?q?RcJAQEBAQEBAQEBGxwBAYQ6BIMAOBMBAwEBAQQBAQEBBQFthGVFhXgvcnASg?= =?us-ascii?q?yKBdxOtZDOIeYFIgTSHCYRugUA/g3VshAMKG4V/BJU3lTQJgSV2lBIZmAqLX?= =?us-ascii?q?4FYmWMhgVhNHxmDJ4J5jho1MIskglIBAQ?= X-IronPort-AV: E=Sophos;i="5.64,305,1559491200"; d="scan'208";a="228497770" Received: from 203-59-235-95.perm.iinet.net.au (HELO rtcentos7.electromag.com.au) ([203.59.235.95]) by icp-osb-irony-out1.iinet.net.au with ESMTP; 25 Jul 2019 12:56:43 +0800 From: Richard Tresidder To: sre@kernel.org, kstewart@linuxfoundation.org, gregkh@linuxfoundation.org, tglx@linutronix.de, rfontana@redhat.com, allison@lohutok.net, rtresidd@electromag.com.au, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/1] power: supply: sbs-battery: Add ability to force load a battery via the devicetree Date: Thu, 25 Jul 2019 12:56:41 +0800 Message-Id: <1564030601-14639-1-git-send-email-rtresidd@electromag.com.au> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) { -- 1.8.3.1