aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm2708/patches-4.14/950-0033-i2c-bcm2835-Add-debug-support.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/brcm2708/patches-4.14/950-0033-i2c-bcm2835-Add-debug-support.patch')
-rw-r--r--target/linux/brcm2708/patches-4.14/950-0033-i2c-bcm2835-Add-debug-support.patch17
1 files changed, 9 insertions, 8 deletions
diff --git a/target/linux/brcm2708/patches-4.14/950-0033-i2c-bcm2835-Add-debug-support.patch b/target/linux/brcm2708/patches-4.14/950-0033-i2c-bcm2835-Add-debug-support.patch
index f740fb5871..47bb41f3d9 100644
--- a/target/linux/brcm2708/patches-4.14/950-0033-i2c-bcm2835-Add-debug-support.patch
+++ b/target/linux/brcm2708/patches-4.14/950-0033-i2c-bcm2835-Add-debug-support.patch
@@ -142,8 +142,8 @@ Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
+ bcm2835_debug_add(i2c_dev, ~0);
}
- /*
-@@ -206,6 +289,7 @@ static irqreturn_t bcm2835_i2c_isr(int t
+ static void bcm2835_i2c_finish_transfer(struct bcm2835_i2c_dev *i2c_dev)
+@@ -215,6 +298,7 @@ static irqreturn_t bcm2835_i2c_isr(int t
u32 val, err;
val = bcm2835_i2c_readl(i2c_dev, BCM2835_I2C_S);
@@ -151,7 +151,7 @@ Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
err = val & (BCM2835_I2C_S_CLKT | BCM2835_I2C_S_ERR);
if (err) {
-@@ -272,6 +356,13 @@ static int bcm2835_i2c_xfer(struct i2c_a
+@@ -281,6 +365,13 @@ static int bcm2835_i2c_xfer(struct i2c_a
unsigned long time_left;
int i, ret;
@@ -165,18 +165,19 @@ Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
for (i = 0; i < (num - 1); i++)
if (msgs[i].flags & I2C_M_RD) {
dev_warn_once(i2c_dev->dev,
-@@ -291,6 +382,10 @@ static int bcm2835_i2c_xfer(struct i2c_a
-
+@@ -301,6 +392,11 @@ static int bcm2835_i2c_xfer(struct i2c_a
time_left = wait_for_completion_timeout(&i2c_dev->completion,
adap->timeout);
+
+ if (debug > 1 || (debug && (!time_left || i2c_dev->msg_err)))
+ bcm2835_debug_print(i2c_dev);
+ i2c_dev->debug_num_msgs = 0;
+ i2c_dev->debug_num = 0;
++
+ bcm2835_i2c_finish_transfer(i2c_dev);
+
if (!time_left) {
- bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C,
- BCM2835_I2C_C_CLEAR);
-@@ -301,7 +396,9 @@ static int bcm2835_i2c_xfer(struct i2c_a
+@@ -313,7 +409,9 @@ static int bcm2835_i2c_xfer(struct i2c_a
if (!i2c_dev->msg_err)
return num;