Switch the driver to gpiod API, this should help with different polarity of RESET signal.
Signed-off-by: Alexander Shiyan <eagle.alexander...@gmail.com> --- drivers/i2c/muxes/i2c-mux-pca954x.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c index 4a926fb92b..9807d915a3 100644 --- a/drivers/i2c/muxes/i2c-mux-pca954x.c +++ b/drivers/i2c/muxes/i2c-mux-pca954x.c @@ -41,8 +41,7 @@ #include <i2c/i2c.h> #include <i2c/i2c-algo-bit.h> #include <i2c/i2c-mux.h> -#include <gpio.h> -#include <of_gpio.h> +#include <linux/gpio/consumer.h> #define PCA954X_MAX_NCHANS 8 @@ -187,7 +186,7 @@ static int pca954x_probe(struct device *dev) int num; struct pca954x *data; int ret = -ENODEV; - int gpio; + struct gpio_desc *gpio; bool idle_disconnect; data = kzalloc(sizeof(struct pca954x), GFP_KERNEL); @@ -198,9 +197,11 @@ static int pca954x_probe(struct device *dev) i2c_set_clientdata(client, data); - gpio = of_get_named_gpio(dev->of_node, "reset-gpios", 0); - if (gpio_is_valid(gpio)) - gpio_direction_output(gpio, 1); + gpio = gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); + if (IS_ERR(gpio)) + return PTR_ERR(gpio); + + gpiod_set_value(gpio, 0); /* Write the mux register at addr to verify * that the mux is in fact present. This also -- 2.38.2