Commit 1bd3a40f authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

fixed 10389 missing detection

parent 9bbe1dd0
...@@ -289,6 +289,7 @@ static int set_enable(struct device *dev, int chn, int enable); ...@@ -289,6 +289,7 @@ static int set_enable(struct device *dev, int chn, int enable);
static int get_pgood(struct device *dev, int chn); static int get_pgood(struct device *dev, int chn);
static struct device * find_device_by_i2c_addr(int address); static struct device * find_device_by_i2c_addr(int address);
static int i2c_addr_gpiochip_match(struct gpio_chip *chip, void *data);
int gpio_10389_ctrl(struct device *dev, int value); int gpio_10389_ctrl(struct device *dev, int value);
/* /*
...@@ -656,9 +657,10 @@ int gpio_10389_ctrl(struct device *dev, int value){ ...@@ -656,9 +657,10 @@ int gpio_10389_ctrl(struct device *dev, int value){
int i, res; int i, res;
int val = 0; int val = 0;
struct device *tmp_dev; struct gpio_chip *chip;
tmp_dev=find_device_by_i2c_addr(GPIO_10389_U4_ADDR); int tmp_addr = GPIO_10389_U4_ADDR;
if (!tmp_dev) { chip = gpiochip_find(&tmp_addr, i2c_addr_gpiochip_match);
if (chip==NULL) {
pr_err("10389 is not connected\n"); pr_err("10389 is not connected\n");
return -ENODEV; return -ENODEV;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment