From: Nuno Sá <nuno.sa@xxxxxxxxxx> Make sure to perform an Hardware reset during probe if the pin is given in FW. Signed-off-by: Nuno Sá <nuno.sa@xxxxxxxxxx> --- drivers/mfd/adp5585.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/mfd/adp5585.c b/drivers/mfd/adp5585.c index 8f95a02661880477e5eddb4248e92ee1bc69d674..dd8c4221cacd5bbff3179c48015401279bbf3d33 100644 --- a/drivers/mfd/adp5585.c +++ b/drivers/mfd/adp5585.c @@ -11,6 +11,7 @@ #include <linux/device.h> #include <linux/err.h> #include <linux/i2c.h> +#include <linux/gpio/consumer.h> #include <linux/mfd/adp5585.h> #include <linux/mfd/core.h> #include <linux/minmax.h> @@ -832,6 +833,7 @@ static int adp5585_i2c_probe(struct i2c_client *i2c) { const struct adp5585_info *info; struct adp5585_dev *adp5585; + struct gpio_desc *gpio; unsigned int id; int ret; @@ -853,6 +855,16 @@ static int adp5585_i2c_probe(struct i2c_client *i2c) if (ret) return ret; + gpio = devm_gpiod_get_optional(&i2c->dev, "reset", GPIOD_OUT_HIGH); + if (IS_ERR(gpio)) + return PTR_ERR(gpio); + + if (gpio) { + fsleep(30); + gpiod_set_value_cansleep(gpio, 0); + fsleep(60); + } + adp5585->regmap = devm_regmap_init_i2c(i2c, info->regmap_config); if (IS_ERR(adp5585->regmap)) return dev_err_probe(&i2c->dev, PTR_ERR(adp5585->regmap), -- 2.48.1