[PATCH] dt-bindings: i2c: Add device clock-stretch time via dts

2021-03-13 Thread qii.wang
From: Qii Wang tSU,STA/tHD,STA/tSU,STOP maybe out of spec due to device clock-stretching or circuit loss, we could get device clock-stretch time from dts to adjust these parameters to meet the spec via EXT_CONF register. Signed-off-by: Qii Wang ---

[RESEND] i2c: mediatek: Get device clock-stretch time via dts

2021-03-13 Thread qii.wang
From: Qii Wang tSU,STA/tHD,STA/tSU,STOP maybe out of spec due to device clock-stretching or circuit loss, we could get device clock-stretch time from dts to adjust these parameters to meet the spec via EXT_CONF register. Signed-off-by: Qii Wang --- drivers/i2c/busses/i2c-mt65xx.c | 6 +-

[PATCH] i2c: mediatek: Get device clock-stretch time via dts

2021-02-03 Thread qii.wang
From: Qii Wang tSU,STA/tHD,STA/tSU,STOP maybe out of spec due to device clock-stretching or circuit loss, we could get device clock-stretch time from dts to adjust these parameters to meet the spec via EXT_CONF register. Signed-off-by: Qii Wang --- drivers/i2c/busses/i2c-mt65xx.c | 6 +-

[RESEND, V2] i2c: mediatek: Move suspend and resume handling to NOIRQ phase

2021-01-09 Thread qii.wang
From: Qii Wang Some i2c device driver indirectly uses I2C driver when it is now being suspended. The i2c devices driver is suspended during the NOIRQ phase and this cannot be changed due to other dependencies. Therefore, we also need to move the suspend handling for the I2C controller driver to

i2c: mediatek: Fix apdma and i2c hand-shake timeout

2020-12-24 Thread qii.wang
From: Qii Wang With the apdma remove hand-shake signal, it requirs special operation timing to reset i2c manually, otherwise the interrupt will not be triggered, i2c transmission will be timeout. Signed-off-by: Qii Wang --- drivers/i2c/busses/i2c-mt65xx.c | 27 ++- 1

[PATCH] arm64: dts: mediatek: Correct i2c clock of MT8192

2020-12-21 Thread qii.wang
From: Qii Wang imp wrapper clock is the i2c source clock of MT8192 Signed-off-by: Qii Wang --- arch/arm64/boot/dts/mediatek/mt8192.dtsi | 43 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/arch/arm64/boot/dts/mediatek/mt8192.dtsi

[v2] i2c: mediatek: Move suspend and resume handling to NOIRQ phase

2020-11-18 Thread qii.wang
From: Qii Wang Some i2c device driver indirectly uses I2C driver when it is now being suspended. The i2c devices driver is suspended during the NOIRQ phase and this cannot be changed due to other dependencies. Therefore, we also need to move the suspend handling for the I2C controller driver to

[i2c-next,PATCH] i2c: medaitek: Move suspend and resume handling to NOIRQ phase

2020-11-07 Thread qii.wang
From: Qii Wang Some i2c device driver indirectly uses I2C driver when it is now being suspended. The i2c devices driver is suspended during the NOIRQ phase and this cannot be changed due to other dependencies. Therefore, we also need to move the suspend handling for the I2C controller driver to

[PATCH] i2c: mediatek: move dma reset before i2c reset

2020-10-30 Thread qii.wang
From: Qii Wang The i2c driver default do dma reset after i2c reset, but sometimes i2c reset will trigger dma tx2rx, then apdma write data to dram which has been i2c_put_dma_safe_msg_buf(kfree). Move dma reset before i2c reset in mtk_i2c_init_hw to fix it. Signed-off-by: Qii Wang ---

[PATCH] i2c: mediatek: Fix generic definitions for bus frequencies

2020-09-12 Thread qii.wang
From: Qii Wang The master code needs to being sent when the speed is more than I2C_MAX_FAST_MODE_PLUS_FREQ instead of I2C_MAX_HIGH_SPEED_MODE_FREQ. Fix it. Signed-off-by: Qii Wang --- drivers/i2c/busses/i2c-mt65xx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

[next] i2c: mediatek: Use div_u64 for 64-bit division to fix 32-bit kernels

2020-05-20 Thread qii.wang
From: Qii Wang Use div_u64 for 64-bit division, and change sample_ns type to unsigned int. Otherwise, the module will reference __udivdi3 under 32-bit kernels, which is not allowed in kernel space. Signed-off-by: Qii Wang --- drivers/i2c/busses/i2c-mt65xx.c | 3 ++- 1 file changed, 2

[PATCH] arm64: dts: mt8183: add I2C nodes

2019-08-22 Thread qii.wang
From: Qii Wang Add i2c nodes to mt8183 and mt8183-evb. Signed-off-by: Qii Wang --- arch/arm64/boot/dts/mediatek/mt8183-evb.dts | 96 ++ arch/arm64/boot/dts/mediatek/mt8183.dtsi| 189 2 files changed, 285 insertions(+) diff --git

[PATCH] dt-bindings: i3c: cdns: Use correct cells for I2C device

2019-07-01 Thread qii.wang
From: Qii Wang I2C device reg should be "reg = <0x52 0x0 0x10>;" Signed-off-by: Qii Wang --- .../devicetree/bindings/i3c/cdns,i3c-master.txt|2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/i3c/cdns,i3c-master.txt

[PATCH 1/5] dt-bindings: i2c: Add Mediatek MT7629 i2c binding

2018-12-03 Thread qii.wang
From: qii wang Add MT7629 i2c binding to i2c-mt2712.txt and there is no need to modify i2c driver. Signed-off-by: qii wang --- Documentation/devicetree/bindings/i2c/i2c-mtk.txt |1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/i2c/i2c-mtk.txt

[PATCH 3/5] i2c: mediatek: Add offsets array for new i2c registers

2018-12-03 Thread qii.wang
From: qii wang New i2c registers would have different offsets, so we use different offsets array to distinguish different i2c registers version. Signed-off-by: qii wang --- drivers/i2c/busses/i2c-mt65xx.c | 163 +-- 1 file changed, 104 insertions(+), 59

[PATCH 2/5] i2c: mediatek: remove useless code and replace definitions

2018-12-03 Thread qii.wang
From: qii wang Completion_done is useless when we don't use its return value, so we remove it. Different speeds have been defined by macros, so we use macros definitions. Signed-off-by: qii wang --- drivers/i2c/busses/i2c-mt65xx.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-)

[PATCH 4/5] dt-bindings: i2c: Add Mediatek MT8183 i2c binding

2018-12-03 Thread qii.wang
From: qii wang Add MT8183 i2c binding to binding file. Compare to 2712 i2c controller, MT8183 has different registers, offsets, clock, and multi-user function. Signed-off-by: qii wang --- Documentation/devicetree/bindings/i2c/i2c-mtk.txt |7 +-- 1 file changed, 5 insertions(+), 2

[PATCH 1/5] dt-bindings: i2c: Add Mediatek MT7629 i2c binding

2018-12-03 Thread qii.wang
From: qii wang Add MT7629 i2c binding to i2c-mt2712.txt and there is no need to modify i2c driver. Signed-off-by: qii wang --- Documentation/devicetree/bindings/i2c/i2c-mtk.txt |1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/i2c/i2c-mtk.txt

[PATCH 3/5] i2c: mediatek: Add offsets array for new i2c registers

2018-12-03 Thread qii.wang
From: qii wang New i2c registers would have different offsets, so we use different offsets array to distinguish different i2c registers version. Signed-off-by: qii wang --- drivers/i2c/busses/i2c-mt65xx.c | 163 +-- 1 file changed, 104 insertions(+), 59

[PATCH 2/5] i2c: mediatek: remove useless code and replace definitions

2018-12-03 Thread qii.wang
From: qii wang Completion_done is useless when we don't use its return value, so we remove it. Different speeds have been defined by macros, so we use macros definitions. Signed-off-by: qii wang --- drivers/i2c/busses/i2c-mt65xx.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-)

[PATCH 4/5] dt-bindings: i2c: Add Mediatek MT8183 i2c binding

2018-12-03 Thread qii.wang
From: qii wang Add MT8183 i2c binding to binding file. Compare to 2712 i2c controller, MT8183 has different registers, offsets, clock, and multi-user function. Signed-off-by: qii wang --- Documentation/devicetree/bindings/i2c/i2c-mtk.txt |7 +-- 1 file changed, 5 insertions(+), 2

[PATCH 0/5] add i2c support for mt7629 and mt8183

2018-12-03 Thread qii.wang
This series are based on 4.20-rc1 and provide five patches to support mt7629 and mt8183 IC. qii wang (5): dt-bindings: i2c: Add Mediatek MT7629 i2c binding i2c: mediatek: remove useless code and replace definitions i2c: mediatek: Add offsets array for new i2c registers dt-bindings: i2c:

[PATCH 0/5] add i2c support for mt7629 and mt8183

2018-12-03 Thread qii.wang
This series are based on 4.20-rc1 and provide five patches to support mt7629 and mt8183 IC. qii wang (5): dt-bindings: i2c: Add Mediatek MT7629 i2c binding i2c: mediatek: remove useless code and replace definitions i2c: mediatek: Add offsets array for new i2c registers dt-bindings: i2c:

[PATCH 5/5] i2c: mediatek: Add i2c compatible for MediaTek MT8183

2018-12-03 Thread qii.wang
From: qii wang Add i2c compatible for MT8183. Compare to 2712 i2c controller, MT8183 has different registers, offsets, clock, and multi-user function. Signed-off-by: qii wang --- drivers/i2c/busses/i2c-mt65xx.c | 136 +-- 1 file changed, 130 insertions(+),

[PATCH 5/5] i2c: mediatek: Add i2c compatible for MediaTek MT8183

2018-12-03 Thread qii.wang
From: qii wang Add i2c compatible for MT8183. Compare to 2712 i2c controller, MT8183 has different registers, offsets, clock, and multi-user function. Signed-off-by: qii wang --- drivers/i2c/busses/i2c-mt65xx.c | 136 +-- 1 file changed, 130 insertions(+),