Skip to content
Snippets Groups Projects
Commit a58c25ff authored by Gianfranco Mariotti's avatar Gianfranco Mariotti
Browse files

[DRIVER] pca953x: support reset-gpios shared line

Some systems connect several devices to a single reset GPIO.
For these devices to get out of reset and probe successfully, treat
the reset returning -EBUSY as the line already having been hogged
and do not abort the probe.
parent f3285b79
No related branches found
No related tags found
No related merge requests found
......@@ -981,8 +981,15 @@ static int pca953x_probe(struct i2c_client *client,
*/
reset_gpio = devm_gpiod_get_optional(&client->dev, "reset",
GPIOD_OUT_LOW);
if (IS_ERR(reset_gpio))
return PTR_ERR(reset_gpio);
if (IS_ERR(reset_gpio)) {
ret = PTR_ERR(reset_gpio);
/* reset may be shared with other devices: do not abort on -EBUSY */
if (ret != -EBUSY) {
dev_err(dev, "Could not get reset-gpios: %d\n", ret);
return ret;
}
dev_warn(dev, "Could not get reset-gpios: already in use\n", ret);
}
}
chip->client = client;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment