Skip to content

Commit f29cc6d

Browse files
Stanislav Jakubeksre
authored andcommitted
power: supply: sc27xx: Fix battery detect GPIO probe
The DT bindings specify the property as 'battery-detect-gpios', add handling for it. Keep fallback to the deprecated 'bat-detect-gpio' property to keep compatibility with older DTS. Signed-off-by: Stanislav Jakubek <[email protected]> Link: https://lore.kernel.org/r/ca28b2f2037929c0011fc5c779c332c1d1ad5308.1730720720.git.stano.jakubek@gmail.com Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 2da0cb9 commit f29cc6d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/power/supply/sc27xx_fuel_gauge.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,10 +1183,14 @@ static int sc27xx_fgu_probe(struct platform_device *pdev)
11831183
return PTR_ERR(data->charge_chan);
11841184
}
11851185

1186-
data->gpiod = devm_gpiod_get(dev, "bat-detect", GPIOD_IN);
1186+
data->gpiod = devm_gpiod_get(dev, "battery-detect", GPIOD_IN);
11871187
if (IS_ERR(data->gpiod)) {
1188-
dev_err(dev, "failed to get battery detection GPIO\n");
1189-
return PTR_ERR(data->gpiod);
1188+
data->gpiod = devm_gpiod_get(dev, "bat-detect", GPIOD_IN);
1189+
if (IS_ERR(data->gpiod)) {
1190+
dev_err(dev, "failed to get battery detection GPIO\n");
1191+
return PTR_ERR(data->gpiod);
1192+
}
1193+
dev_warn(dev, "bat-detect is deprecated, please use battery-detect\n");
11901194
}
11911195

11921196
ret = gpiod_get_value_cansleep(data->gpiod);

0 commit comments

Comments
 (0)