Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mfd: adp5585: Add support for a reset pin

Make sure to perform an Hardware reset during probe if the pin is given
in FW.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20250701-dev-adp5589-fw-v7-20-b1fcfe9e9826@analog.com
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Nuno Sá and committed by
Lee Jones
45ee66c3 ce262d6d

+16
+16
drivers/mfd/adp5585.c
··· 12 12 #include <linux/device.h> 13 13 #include <linux/err.h> 14 14 #include <linux/i2c.h> 15 + #include <linux/gpio/consumer.h> 15 16 #include <linux/mfd/adp5585.h> 16 17 #include <linux/mfd/core.h> 17 18 #include <linux/mod_devicetable.h> ··· 691 690 { 692 691 struct regmap_config *regmap_config; 693 692 struct adp5585_dev *adp5585; 693 + struct gpio_desc *gpio; 694 694 unsigned int id; 695 695 int ret; 696 696 ··· 715 713 ret = devm_regulator_get_enable(&i2c->dev, "vdd"); 716 714 if (ret) 717 715 return ret; 716 + 717 + gpio = devm_gpiod_get_optional(&i2c->dev, "reset", GPIOD_OUT_HIGH); 718 + if (IS_ERR(gpio)) 719 + return PTR_ERR(gpio); 720 + 721 + /* 722 + * Note the timings are not documented anywhere in the datasheet. They are just 723 + * reasonable values that work. 724 + */ 725 + if (gpio) { 726 + fsleep(30); 727 + gpiod_set_value_cansleep(gpio, 0); 728 + fsleep(60); 729 + } 718 730 719 731 adp5585->regmap = devm_regmap_init_i2c(i2c, regmap_config); 720 732 if (IS_ERR(adp5585->regmap))