summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamal Shafi <kamalshafi@google.com>2024-01-19 20:09:27 +0800
committerKamal Shafi <kamalshafi@google.com>2024-01-22 07:27:52 +0000
commitdd9edf7bea7a7db2357730be9221f87b7593b815 (patch)
tree6d05e2564541e6fee1f018f018c01d835ca03dc9
parent6383692b1624b64253a6aa9b4df65f7bfa6b892b (diff)
downloadgs-android-gs-shusky-5.15-android14-qpr2.tar.gz
If optional GPIO are provisioned from the device tree, need to retry probe if can't be acquired. This is to avoid peripherals unable to power up. Bug: 317937395 Test: build pass Change-Id: I2aad8a6be94b969cd137888d44f7914f1b4c4f34 Signed-off-by: Kamal Shafi <kamalshafi@google.com> (cherry picked from commit 20a5da2b8e1cafbc3bf218e3c3bd4d7e8095b1b2)
-rw-r--r--drivers/mfd/slg51002-core.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mfd/slg51002-core.c b/drivers/mfd/slg51002-core.c
index e17610315..fccb1c0fa 100644
--- a/drivers/mfd/slg51002-core.c
+++ b/drivers/mfd/slg51002-core.c
@@ -636,6 +636,9 @@ static int slg51002_i2c_probe(struct i2c_client *client,
slg51002->chip_bb_pin = gpio;
usleep_range(2000, 2020);
+ } else if (of_property_read_bool(client->dev.of_node, "dlg,bb-gpios")) {
+ /* retry probe if property exist */
+ return gpio;
} else {
slg51002->chip_bb_pin = -1;
}
@@ -655,6 +658,9 @@ static int slg51002_i2c_probe(struct i2c_client *client,
slg51002->chip_buck_pin = gpio;
usleep_range(2000, 2020);
+ } else if (of_property_read_bool(client->dev.of_node, "dlg,buck-gpios")) {
+ /* retry probe if property exist */
+ return gpio;
} else {
slg51002->chip_buck_pin = -1;
}