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 09:15:04 +0000
commit754a34bda11eba2c8c4878a7ca54113f4342b4b5 (patch)
tree6d7365755ec637e60d3e77a66773572ad5c7561e
parent5a4a527c03f99646ccb0c8df9fe32dfc2895b8eb (diff)
downloadgs-android-gs-akita-5.15-android14-d2.tar.gz
slg51002: retry probe if any given gpio is missingandroid-14.0.0_r0.81android-14.0.0_r0.80android-gs-akita-5.15-android14-d2
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;
}