diff options
author | Shawn Guo <shawn.guo@freescale.com> | 2013-07-14 21:52:38 +0800 |
---|---|---|
committer | Jason Liu <jason.hui.liu@nxp.com> | 2019-02-12 10:21:30 +0800 |
commit | f3deb0526c19a295aae4446e12bf5eff54bc8694 (patch) | |
tree | fc6734d090913cb70765da7aa736b85f7301ef16 /drivers/gpio | |
parent | 59a6e2dbed218099dd69153b4fc847a2f5adb8e1 (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>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-pca953x.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c index 1b9dbf691ae7..04d347a5073c 100644 --- a/drivers/gpio/gpio-pca953x.c +++ b/drivers/gpio/gpio-pca953x.c @@ -21,6 +21,7 @@ #include <linux/of_platform.h> #include <linux/platform_data/pca953x.h> #include <linux/regulator/consumer.h> +#include <linux/reset.h> #include <linux/slab.h> #include <asm/unaligned.h> @@ -845,6 +846,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. */ |