From: Graeme Smecher <gsmecher@threespeedlogic.com>
To: linux-kernel@vger.kernel.org
Cc: Graeme Smecher <gsmecher@threespeedlogic.com>,
Grant Likely <grant.likely@linaro.org>,
Haojian Zhuang <haojian.zhuang@marvell.com>
Subject: [PATCH] gpio: pca953x: Don't flip bits on PCA957x GPIO expanders when probing them.
Date: Fri, 2 Aug 2013 14:24:16 -0700 [thread overview]
Message-ID: <1375478656-3577-1-git-send-email-gsmecher@threespeedlogic.com> (raw)
The pca957x driver supports a handful of I2C GPIO expanders from NXP, Maxim,
and TI. For the PCA9574 and PCA9575 devices only, the driver resets the GPIO
level and direction in the pca957x_probe function. This seems like the wrong
thing to do, since it can cause hardware bit twiddles during warm reboots when
the chip state and reset values don't match.
This kind of initialization is best left upstream (in a bootloader) or
downstream (in userspace). It's also an inconsistency across devices supported
by this driver.
Signed-off-by: Graeme Smecher <gsmecher@threespeedlogic.com>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Haojian Zhuang <haojian.zhuang@marvell.com>
---
drivers/gpio/gpio-pca953x.c | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 426c51d..47c08d8 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -683,17 +683,6 @@ static int device_pca957x_init(struct pca953x_chip *chip, u32 invert)
int ret;
u8 val[MAX_BANK];
- /* Let every port in proper state, that could save power */
- memset(val, 0, NBANK(chip));
- pca953x_write_regs(chip, PCA957X_PUPD, val);
- memset(val, 0xFF, NBANK(chip));
- pca953x_write_regs(chip, PCA957X_CFG, val);
- memset(val, 0, NBANK(chip));
- pca953x_write_regs(chip, PCA957X_OUT, val);
-
- ret = pca953x_read_regs(chip, PCA957X_IN, val);
- if (ret)
- goto out;
ret = pca953x_read_regs(chip, PCA957X_OUT, chip->reg_output);
if (ret)
goto out;
--
1.7.10.4
next reply other threads:[~2013-08-02 22:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-02 21:24 Graeme Smecher [this message]
2013-08-04 12:35 ` Haojian Zhuang
2013-09-09 18:14 ` Graeme Smecher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1375478656-3577-1-git-send-email-gsmecher@threespeedlogic.com \
--to=gsmecher@threespeedlogic.com \
--cc=grant.likely@linaro.org \
--cc=haojian.zhuang@marvell.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®