summaryrefslogtreecommitdiff
path: root/drivers/gpio
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@freescale.com>2013-07-14 21:52:38 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-23 16:42:32 +0300
commit07f46bc0c978347cc578b5e232f2a154692bf6c4 (patch)
tree8d320dfb48d6b3d3d72e65539358520722c79cc1 /drivers/gpio
parent890e978e54b5f0f125b3cd981faee463ac8ad45e (diff)
MLK-11293: 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 <shawn.guo@freescale.com> Signed-off-by: Fugang Duan <B38611@freescale.com> (cherry picked from commit: d3264091b30b777d94a18efda9823a06668d5b10)
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-pca953x.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index fe731f094257..f0bb7b5aabb6 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -17,6 +17,7 @@
#include <linux/interrupt.h>
#include <linux/i2c.h>
#include <linux/platform_data/pca953x.h>
+#include <linux/reset.h>
#include <linux/slab.h>
#include <asm/unaligned.h>
#include <linux/of_platform.h>
@@ -813,6 +814,10 @@ static int pca953x_probe(struct i2c_client *client,
lockdep_set_subclass(&chip->i2c_lock,
i2c_adapter_depth(client->adapter));
+ 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.
*/