summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-01-11 19:00:03 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-01-11 19:00:03 +0100
commite05529dd8b582c4421938066a5ff5006452ced78 (patch)
treeb4e925b08f2f672c6331db06c4b1986e58f89a75 /drivers/i2c
parent0c3f4d1da2277ac0cb88dc32ac0de48bc241e01f (diff)
parent9563a024d28c0f35db8fc459931f4909bbffe5eb (diff)
downloadbarebox-e05529dd8b582c4421938066a5ff5006452ced78.tar.gz
barebox-e05529dd8b582c4421938066a5ff5006452ced78.tar.xz
Merge branch 'for-next/misc'
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/muxes/i2c-mux-pca954x.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c
index baeae7bb94..0d5515b716 100644
--- a/drivers/i2c/muxes/i2c-mux-pca954x.c
+++ b/drivers/i2c/muxes/i2c-mux-pca954x.c
@@ -45,6 +45,8 @@
#include <i2c/i2c-algo-bit.h>
#include <i2c/i2c-mux.h>
#include <init.h>
+#include <gpio.h>
+#include <of_gpio.h>
#define PCA954X_MAX_NCHANS 8
@@ -179,6 +181,7 @@ static int pca954x_probe(struct device_d *dev)
int num, force;
struct pca954x *data;
int ret = -ENODEV;
+ int gpio;
data = kzalloc(sizeof(struct pca954x), GFP_KERNEL);
if (!data) {
@@ -188,6 +191,10 @@ static int pca954x_probe(struct device_d *dev)
i2c_set_clientdata(client, data);
+ gpio = of_get_named_gpio(dev->device_node, "reset-gpios", 0);
+ if (gpio_is_valid(gpio))
+ gpio_direction_output(gpio, 1);
+
/* Read the mux register at addr to verify
* that the mux is in fact present.
*/