aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek/patches/0031-I2C-mediatek-Add-driver-for-MediaTek-MT8173-I2C-cont.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/mediatek/patches/0031-I2C-mediatek-Add-driver-for-MediaTek-MT8173-I2C-cont.patch')
-rw-r--r--target/linux/mediatek/patches/0031-I2C-mediatek-Add-driver-for-MediaTek-MT8173-I2C-cont.patch23
1 files changed, 9 insertions, 14 deletions
diff --git a/target/linux/mediatek/patches/0031-I2C-mediatek-Add-driver-for-MediaTek-MT8173-I2C-cont.patch b/target/linux/mediatek/patches/0031-I2C-mediatek-Add-driver-for-MediaTek-MT8173-I2C-cont.patch
index 25ea23ef23..af9673de4b 100644
--- a/target/linux/mediatek/patches/0031-I2C-mediatek-Add-driver-for-MediaTek-MT8173-I2C-cont.patch
+++ b/target/linux/mediatek/patches/0031-I2C-mediatek-Add-driver-for-MediaTek-MT8173-I2C-cont.patch
@@ -15,8 +15,6 @@ Signed-off-by: Eddie Huang <eddie.huang@mediatek.com>
drivers/i2c/busses/i2c-mt65xx.c | 104 ++++++++++++++++++++++++++++-----------
1 file changed, 76 insertions(+), 28 deletions(-)
-diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c
-index faecf7e..c501421 100644
--- a/drivers/i2c/busses/i2c-mt65xx.c
+++ b/drivers/i2c/busses/i2c-mt65xx.c
@@ -33,10 +33,13 @@
@@ -51,7 +49,7 @@ index faecf7e..c501421 100644
};
struct mtk_i2c {
-@@ -172,21 +179,39 @@ static const struct i2c_adapter_quirks mt6577_i2c_quirks = {
+@@ -172,21 +179,39 @@ static const struct i2c_adapter_quirks m
.max_comb_2nd_msg_len = MAX_WRRD_TRANS_SIZE_MT6577,
};
@@ -91,7 +89,7 @@ index faecf7e..c501421 100644
{}
};
MODULE_DEVICE_TABLE(of, mtk_i2c_of_match);
-@@ -343,9 +368,11 @@ static int mtk_i2c_set_speed(struct mtk_i2c *i2c, unsigned int clk_src_in_hz)
+@@ -343,9 +368,11 @@ static int mtk_i2c_set_speed(struct mtk_
return 0;
}
@@ -104,7 +102,7 @@ index faecf7e..c501421 100644
u16 control_reg;
dma_addr_t rpaddr = 0;
dma_addr_t wpaddr = 0;
-@@ -361,6 +388,8 @@ static int mtk_i2c_do_transfer(struct mtk_i2c *i2c, struct i2c_msg *msgs)
+@@ -361,6 +388,8 @@ static int mtk_i2c_do_transfer(struct mt
control_reg |= I2C_CONTROL_RS;
if (i2c->op == I2C_MASTER_WRRD)
control_reg |= I2C_CONTROL_DIR_CHANGE | I2C_CONTROL_RS;
@@ -113,7 +111,7 @@ index faecf7e..c501421 100644
mtk_i2c_writew(control_reg, i2c, OFFSET_CONTROL);
/* set start condition */
-@@ -375,13 +404,13 @@ static int mtk_i2c_do_transfer(struct mtk_i2c *i2c, struct i2c_msg *msgs)
+@@ -375,13 +404,13 @@ static int mtk_i2c_do_transfer(struct mt
mtk_i2c_writew(addr_reg, i2c, OFFSET_SLAVE_ADDR);
/* Clear interrupt status */
@@ -131,7 +129,7 @@ index faecf7e..c501421 100644
/* Set transfer and transaction len */
if (i2c->op == I2C_MASTER_WRRD) {
-@@ -390,7 +419,7 @@ static int mtk_i2c_do_transfer(struct mtk_i2c *i2c, struct i2c_msg *msgs)
+@@ -390,7 +419,7 @@ static int mtk_i2c_do_transfer(struct mt
mtk_i2c_writew(I2C_WRRD_TRANAC_VALUE, i2c, OFFSET_TRANSAC_LEN);
} else {
mtk_i2c_writew(msgs->len, i2c, OFFSET_TRANSFER_LEN);
@@ -140,7 +138,7 @@ index faecf7e..c501421 100644
}
/* Prepare buffer data to start transfer */
-@@ -436,13 +465,23 @@ static int mtk_i2c_do_transfer(struct mtk_i2c *i2c, struct i2c_msg *msgs)
+@@ -436,13 +465,23 @@ static int mtk_i2c_do_transfer(struct mt
/* flush before sending start */
mb();
mtk_i2c_writel_dma(I2C_DMA_START_EN, i2c, OFFSET_EN);
@@ -166,7 +164,7 @@ index faecf7e..c501421 100644
| I2C_TRANSAC_COMP), i2c, OFFSET_INTR_MASK);
if (i2c->op == I2C_MASTER_WR) {
-@@ -472,6 +511,10 @@ static int mtk_i2c_do_transfer(struct mtk_i2c *i2c, struct i2c_msg *msgs)
+@@ -472,6 +511,10 @@ static int mtk_i2c_do_transfer(struct mt
return -EREMOTEIO;
}
@@ -177,7 +175,7 @@ index faecf7e..c501421 100644
return 0;
}
-@@ -486,28 +529,33 @@ static int mtk_i2c_transfer(struct i2c_adapter *adap,
+@@ -486,28 +529,33 @@ static int mtk_i2c_transfer(struct i2c_a
if (ret)
return ret;
@@ -230,7 +228,7 @@ index faecf7e..c501421 100644
/* the return value is number of executed messages */
ret = num;
-@@ -521,7 +569,7 @@ static irqreturn_t mtk_i2c_irq(int irqno, void *dev_id)
+@@ -521,7 +569,7 @@ static irqreturn_t mtk_i2c_irq(int irqno
struct mtk_i2c *i2c = dev_id;
i2c->irq_stat = mtk_i2c_readw(i2c, OFFSET_INTR_STAT);
@@ -239,6 +237,3 @@ index faecf7e..c501421 100644
| I2C_TRANSAC_COMP, i2c, OFFSET_INTR_STAT);
complete(&i2c->msg_complete);
---
-1.7.10.4
-