From: noralf@tronnes.org (Noralf Trønnes)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 6/8] i2c: bcm2835: Support i2c-dev ioctl I2C_TIMEOUT
Date: Tue, 27 Sep 2016 13:57:04 +0200 [thread overview]
Message-ID: <1474977426-3272-7-git-send-email-noralf@tronnes.org> (raw)
In-Reply-To: <1474977426-3272-1-git-send-email-noralf@tronnes.org>
Use i2c_adapter->timeout for the completion timeout value. The core
default is 1 second.
Signed-off-by: Noralf Tr?nnes <noralf@tronnes.org>
---
drivers/i2c/busses/i2c-bcm2835.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/i2c/busses/i2c-bcm2835.c b/drivers/i2c/busses/i2c-bcm2835.c
index f3a1472..79dd15f 100644
--- a/drivers/i2c/busses/i2c-bcm2835.c
+++ b/drivers/i2c/busses/i2c-bcm2835.c
@@ -53,8 +53,6 @@
#define BCM2835_I2C_CDIV_MIN 0x0002
#define BCM2835_I2C_CDIV_MAX 0xFFFE
-#define BCM2835_I2C_TIMEOUT (msecs_to_jiffies(1000))
-
struct bcm2835_i2c_dev {
struct device *dev;
void __iomem *regs;
@@ -233,7 +231,7 @@ static int bcm2835_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[],
bcm2835_i2c_start_transfer(i2c_dev);
time_left = wait_for_completion_timeout(&i2c_dev->completion,
- BCM2835_I2C_TIMEOUT);
+ adap->timeout);
if (!time_left) {
bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C,
BCM2835_I2C_C_CLEAR);
--
2.8.2
next prev parent reply other threads:[~2016-09-27 11:57 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-27 11:56 [PATCH v2 0/8] i2c: bcm2835: Bring in changes from downstream Noralf Trønnes
2016-09-27 11:56 ` [PATCH v2 1/8] i2c: bcm2835: Fix hang for writing messages larger than 16 bytes Noralf Trønnes
2016-09-27 11:57 ` [PATCH v2 2/8] i2c: bcm2835: Protect against unexpected TXW/RXR interrupts Noralf Trønnes
2016-09-27 11:57 ` [PATCH v2 3/8] i2c: bcm2835: Use ratelimited logging on transfer errors Noralf Trønnes
2016-09-27 13:01 ` Martin Sperl
2016-09-27 19:27 ` Noralf Trønnes
2016-09-27 11:57 ` [PATCH v2 4/8] i2c: bcm2835: Can't support I2C_M_IGNORE_NAK Noralf Trønnes
2016-09-27 11:57 ` [PATCH v2 5/8] i2c: bcm2835: Add support for Repeated Start Condition Noralf Trønnes
2016-09-27 11:57 ` Noralf Trønnes [this message]
2016-09-27 11:57 ` [PATCH v2 7/8] i2c: bcm2835: Add support for dynamic clock Noralf Trønnes
2016-09-27 11:57 ` [PATCH v2 8/8] ARM: bcm2835: Disable i2c2 in the Device Tree Noralf Trønnes
2016-09-27 17:25 ` Stefan Wahren
2016-09-27 18:53 ` Jan Kandziora
2016-09-27 19:23 ` Noralf Trønnes
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=1474977426-3272-7-git-send-email-noralf@tronnes.org \
--to=noralf@tronnes.org \
--cc=linux-arm-kernel@lists.infradead.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