linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean-Francois Dagenais <jeff.dagenais@gmail.com>
To: sre@kernel.org, linux-pm@vger.kernel.org
Cc: Jean-Francois Dagenais <jeff.dagenais@gmail.com>
Subject: [PATCH 3/7] power: supply: sbs-battery: add force_load as a dts property
Date: Fri,  1 Nov 2019 15:07:01 -0400	[thread overview]
Message-ID: <20191101190705.13393-3-jeff.dagenais@gmail.com> (raw)
In-Reply-To: <20191101190705.13393-1-jeff.dagenais@gmail.com>

This extends the behaviour of the existing module param so that system
integrators can specify the flag in device-tree.

Signed-off-by: Jean-Francois Dagenais <jeff.dagenais@gmail.com>
---
 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 f9e8c14ac830..f92b98d900d2 100644
--- a/drivers/power/supply/sbs-battery.c
+++ b/drivers/power/supply/sbs-battery.c
@@ -814,6 +814,7 @@ static int sbs_probe(struct i2c_client *client,
 	struct power_supply_desc *sbs_desc;
 	struct sbs_platform_data *pdata = client->dev.platform_data;
 	struct power_supply_config psy_cfg = {};
+	bool force_load;
 	int rc;
 	int irq;
 
@@ -858,6 +859,9 @@ static int sbs_probe(struct i2c_client *client,
 	}
 	chip->i2c_retry_count = chip->i2c_retry_count + 1;
 
+	force_load = of_property_read_bool(client->dev.of_node,
+					   "sbs,force-load");
+
 	chip->gpio_detect = devm_gpiod_get_optional(&client->dev,
 			"sbs,battery-detect", GPIOD_IN);
 	if (IS_ERR(chip->gpio_detect)) {
@@ -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 (!(param_force_load || chip->gpio_detect)) {
+	if (!(param_force_load || force_load || chip->gpio_detect)) {
 		rc = sbs_read_word_data(client, sbs_data[REG_STATUS].addr);
 
 		if (rc < 0) {
-- 
2.23.0


  parent reply	other threads:[~2019-11-01 19:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-01 19:06 [PATCH 1/7] power: supply: sbs-battery: use octal permissions on module param Jean-Francois Dagenais
2019-11-01 19:07 ` [PATCH 2/7] power: supply: sbs-battery: prefix module param variable Jean-Francois Dagenais
2019-11-01 19:07 ` Jean-Francois Dagenais [this message]
2019-12-19  1:19   ` [PATCH 3/7] power: supply: sbs-battery: add force_load as a dts property Sebastian Reichel
2019-11-01 19:07 ` [PATCH 4/7] devicetree: bindings: sbs-battery: add sbs,force-load property Jean-Francois Dagenais
2019-12-19  1:23   ` Sebastian Reichel
2019-11-01 19:07 ` [PATCH 5/7] power: supply: sbs-battery: fix CAPACITY_MODE bit naming Jean-Francois Dagenais
2019-12-19  1:22   ` Sebastian Reichel
2019-11-01 19:07 ` [PATCH 6/7] power: supply: sbs-battery: add ability to disable charger broadcasts Jean-Francois Dagenais
2019-11-01 19:07 ` [PATCH 7/7] dt-bindings: power: sbs-battery: add disable-charger-broadcasts doc Jean-Francois Dagenais
2019-12-19  1:22   ` Sebastian Reichel
2019-12-19  1:13 ` [PATCH 1/7] power: supply: sbs-battery: use octal permissions on module param Sebastian Reichel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191101190705.13393-3-jeff.dagenais@gmail.com \
    --to=jeff.dagenais@gmail.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).