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 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>
@@ -690,6 +691,7 @@ static int adp5585_i2c_probe(struct i2c_client *i2c)
690
691
{
691
692
struct regmap_config * regmap_config ;
692
693
struct adp5585_dev * adp5585 ;
694
+ struct gpio_desc * gpio ;
693
695
unsigned int id ;
694
696
int ret ;
695
697
@@ -714,6 +716,20 @@ static int adp5585_i2c_probe(struct i2c_client *i2c)
714
716
if (ret )
715
717
return ret ;
716
718
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
+
717
733
adp5585 -> regmap = devm_regmap_init_i2c (i2c , regmap_config );
718
734
if (IS_ERR (adp5585 -> regmap ))
719
735
return dev_err_probe (& i2c -> dev , PTR_ERR (adp5585 -> regmap ),
You can’t perform that action at this time.
0 commit comments