From: Shawn Guo Date: Sun, 14 Jul 2013 13:52:38 +0000 (+0800) Subject: ENGR00269945: gpio: pca953x: add device_reset() call X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9762905437f3ac3324f10fdfd15d394f888b6334;p=karo-tx-linux.git ENGR00269945: gpio: pca953x: add device_reset() call The pca953x type of devices, e.g. max7310, may have a reset which needs to be handled to get the device start working. Add a device_reset() call for that, and defer the probe if the reset controller for that is not ready yet. Signed-off-by: Shawn Guo --- diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c index 426c51dd420c..74f7008af3f2 100644 --- a/drivers/gpio/gpio-pca953x.c +++ b/drivers/gpio/gpio-pca953x.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #ifdef CONFIG_OF_GPIO #include @@ -752,6 +753,10 @@ static int pca953x_probe(struct i2c_client *client, mutex_init(&chip->i2c_lock); + ret = device_reset(&client->dev); + if (ret == -ENODEV) + return -EPROBE_DEFER; + /* initialize cached registers from their original values. * we can't share this chip with another i2c master. */