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

[DRIVER] fxl6408: add reset-gpios control with shared line support

Add optional reset-gpios pin control.
Also, 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 f187da1f
No related branches found
No related tags found
No related merge requests found
......@@ -154,10 +154,23 @@ static int fxl6408_probe(struct i2c_client *client,
struct device *dev = &client->dev;
struct fxl6408_chip *chip;
struct gpio_chip *gc;
struct gpio_desc *reset_gpio;
unsigned int val;
int gpio_base;
int ret;
u8 device_id;
reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
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);
}
/* Check the device ID register to see if it's responding.
* This also clears RST_INT as a side effect, so we won't get
* the "we've been power cycled" interrupt once we enable
......
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