lantiq: fix broadcasts and vlans in two iface mode
[oweals/openwrt.git] / target / linux / brcm2708 / patches-4.9 / 0111-i2c-bcm2835-Support-i2c-dev-ioctl-I2C_TIMEOUT.patch
1 From 0c2744e901150b27a60bded1acb058ce26709d5a Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
3 Date: Fri, 23 Sep 2016 04:57:17 +0200
4 Subject: [PATCH] i2c: bcm2835: Support i2c-dev ioctl I2C_TIMEOUT
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Use i2c_adapter->timeout for the completion timeout value. The core
10 default is 1 second.
11
12 Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
13 Reviewed-by: Eric Anholt <eric@anholt.net>
14 ---
15  drivers/i2c/busses/i2c-bcm2835.c | 4 +---
16  1 file changed, 1 insertion(+), 3 deletions(-)
17
18 --- a/drivers/i2c/busses/i2c-bcm2835.c
19 +++ b/drivers/i2c/busses/i2c-bcm2835.c
20 @@ -53,8 +53,6 @@
21  #define BCM2835_I2C_CDIV_MIN   0x0002
22  #define BCM2835_I2C_CDIV_MAX   0xFFFE
23  
24 -#define BCM2835_I2C_TIMEOUT (msecs_to_jiffies(1000))
25 -
26  struct bcm2835_i2c_dev {
27         struct device *dev;
28         void __iomem *regs;
29 @@ -242,7 +240,7 @@ static int bcm2835_i2c_xfer(struct i2c_a
30         bcm2835_i2c_start_transfer(i2c_dev);
31  
32         time_left = wait_for_completion_timeout(&i2c_dev->completion,
33 -                                               BCM2835_I2C_TIMEOUT);
34 +                                               adap->timeout);
35         if (!time_left) {
36                 bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C,
37                                    BCM2835_I2C_C_CLEAR);