File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 1212#include <linux/device.h>
1313#include <linux/err.h>
1414#include <linux/i2c.h>
15+ #include <linux/gpio/consumer.h>
1516#include <linux/mfd/adp5585.h>
1617#include <linux/mfd/core.h>
1718#include <linux/mod_devicetable.h>
@@ -690,6 +691,7 @@ static int adp5585_i2c_probe(struct i2c_client *i2c)
690691{
691692 struct regmap_config * regmap_config ;
692693 struct adp5585_dev * adp5585 ;
694+ struct gpio_desc * gpio ;
693695 unsigned int id ;
694696 int ret ;
695697
@@ -714,6 +716,20 @@ static int adp5585_i2c_probe(struct i2c_client *i2c)
714716 if (ret )
715717 return ret ;
716718
719+ gpio = devm_gpiod_get_optional (& i2c -> dev , "reset" , GPIOD_OUT_HIGH );
720+ if (IS_ERR (gpio ))
721+ return PTR_ERR (gpio );
722+
723+ /*
724+ * Note the timings are not documented anywhere in the datasheet. They are just
725+ * reasonable values that work.
726+ */
727+ if (gpio ) {
728+ fsleep (30 );
729+ gpiod_set_value_cansleep (gpio , 0 );
730+ fsleep (60 );
731+ }
732+
717733 adp5585 -> regmap = devm_regmap_init_i2c (i2c , regmap_config );
718734 if (IS_ERR (adp5585 -> regmap ))
719735 return dev_err_probe (& i2c -> dev , PTR_ERR (adp5585 -> regmap ),
You can’t perform that action at this time.
0 commit comments