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

2018-12-11 Thread Qii Wang
On Mon, 2018-12-03 at 21:49 -0800, Sean Wang wrote: > 於 2018年12月3日 週一 上午5:34寫道: > > > > From: qii wang > > > > Add i2c compatible for MT8183. Compare to 2712 i2c controller, MT8183 has > > different registers, offsets, clock, and multi-user function

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

2018-12-13 Thread Qii Wang
On Tue, 2018-12-11 at 21:20 +0100, Wolfram Sang wrote: > On Mon, Dec 03, 2018 at 09:32:51PM +0800, qii.w...@mediatek.com wrote: > > From: qii wang > > > > Completion_done is useless when we don't use its return value, > > so we remove it. Different speeds have b

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

2018-12-13 Thread Qii Wang
On Tue, 2018-12-11 at 21:29 +0100, Wolfram Sang wrote: > > + - ch-offset: base reg offset for multi-user. > > What is "multi-user"? Why can't you add this offset to the reg-property > directly? > Thanks for your comment. There are 3 channel in one MT8183 I3C controller, and every channel can be

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

2018-12-17 Thread Qii Wang
On Tue, 2018-12-18 at 00:06 +0100, Wolfram Sang wrote: > > > What is "multi-user"? Why can't you add this offset to the reg-property > > > directly? > > ... > > > MT8183 doesn't need to support muti-user according to the latest project > > information, and I'll remove this feature from patches. >

[PATCH 2/6] i2c: mediatek: speeds is replaced by macros definitions

2018-12-21 Thread qii wang
Different speeds have been defined by macros, so we use macros definitions. Signed-off-by: qii wang --- drivers/i2c/busses/i2c-mt65xx.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c index a74ef76

[PATCH 4/6] i2c: mediatek: Add offsets array for new i2c registers

2018-12-21 Thread 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 deletions(-) diff

[PATCH 6/6] i2c: mediatek: Add i2c support for MediaTek MT8183

2018-12-21 Thread 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 | 127 --- 1 file changed, 120 insertions(+), 7 deletions

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

2018-12-21 Thread qii wang
Add MT7629 i2c binding to binding file. 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 b/Documentation/devicetree/bindings/i2c/i2c-mtk.txt index e199695

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

2018-12-21 Thread qii wang
This series are based on 4.20-rc1 and provide five patches to support mt7629 and mt8183 IC. Main changes compared to v1: --remove useless dt-binding for mt7629 --split a patch into two(2/6 3/6) --muti-user feature was dropped qii wang (6): dt-bindings: i2c: Add Mediatek MT7629 i2c binding

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

2018-12-21 Thread 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 |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff

[PATCH 3/6] i2c: mediatek: remove completion_done()

2018-12-21 Thread qii wang
Completion_done() is useless when we don't use its return value, so we remove it. Signed-off-by: qii wang --- drivers/i2c/busses/i2c-mt65xx.c |2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c index 7396449..660de1e 1

[PATCH RESEND v6 5/6] i2c: mediatek: Add i2c support for MediaTek MT8183

2019-04-02 Thread Qii Wang
Add i2c compatible for MT8183. Compare to MT2712 i2c controller, MT8183 has different register offsets. Ltiming_reg is added to adjust low width of SCL. Arb clock and dma_sync are needed. Signed-off-by: Qii Wang Reviewed-by: Nicolas Boichat --- drivers/i2c/busses/i2c-mt65xx.c | 62

[PATCH RESEND v6 2/6] dt-bindings: i2c: Add Mediatek MT8183 i2c binding

2019-04-02 Thread Qii Wang
Add MT8183 i2c binding to binding file. Compare to MT2712 i2c controller, MT8183 has different registers, offsets, and clock. Signed-off-by: Qii Wang Reviewed-by: Matthias Brugger --- Documentation/devicetree/bindings/i2c/i2c-mtk.txt |4 +++- 1 file changed, 3 insertions(+), 1 deletion

[PATCH RESEND v6 0/6] add i2c support for mt8183

2019-04-02 Thread Qii Wang
for-next --remove i2c fallback for i3c controller Main changes compared to v2: --update commit message --add Reviewed-by from Rob Herring, Nicolas and Sean Main changes compared to v1: --remove useless dt-binding for mt7629 --split a patch into two(2/6 3/6) --muti-user feature was dropped Qii Wang

[PATCH RESEND v6 6/6] dts: arm64: mt8183: Add I2C nodes

2019-04-02 Thread Qii Wang
This patch adds i2c nodes for I2C controllers Signed-off-by: Qii Wang --- arch/arm64/boot/dts/mediatek/mt8183.dtsi | 192 ++ 1 file changed, 192 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8183.dtsi b/arch/arm64/boot/dts/mediatek/mt8183.dtsi index

[PATCH RESEND v6 4/6] i2c: mediatek: Add i2c and apdma sync in i2c driver

2019-04-02 Thread Qii Wang
When i2c and apdma use different source clocks, we should enable synchronization between them. Signed-off-by: Qii Wang Reviewed-by: Nicolas Boichat --- drivers/i2c/busses/i2c-mt65xx.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers

[PATCH RESEND v6 3/6] i2c: mediatek: Add arb clock in i2c driver

2019-04-02 Thread Qii Wang
When two i2c controllers are internally connected to the same GPIO pins, the arb clock is needed to ensure that the waveforms do not interfere with each other. And we also need to enable the interrupt to find arb lost, old i2c controllers also have the bit. Signed-off-by: Qii Wang Reviewed-by

[PATCH RESEND v6 1/6] i2c: mediatek: Add offsets array for new i2c registers

2019-04-02 Thread 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 Reviewed-by: Matthias Brugger --- drivers/i2c/busses/i2c-mt65xx.c | 163 +-- 1 file changed, 104

[PATCH v5 0/5] add i2c support for mt8183

2019-02-26 Thread Qii Wang
fallback for i3c controller Main changes compared to v2: --update commit message --add Reviewed-by from Rob Herring, Nicolas and Sean Main changes compared to v1: --remove useless dt-binding for mt7629 --split a patch into two(2/6 3/6) --muti-user feature was dropped Qii Wang (5): i2c

[PATCH v5 3/5] i2c: mediatek: Add arb clock in i2c driver

2019-02-26 Thread Qii Wang
When two i2c controllers are internally connected to the same GPIO pins, the arb clock is needed to ensure that the waveforms do not interfere with each other. Signed-off-by: Qii Wang --- drivers/i2c/busses/i2c-mt65xx.c | 25 ++--- 1 file changed, 22 insertions(+), 3

[PATCH v5 4/5] i2c: mediatek: Add i2c and apdma sync in i2c driver

2019-02-26 Thread Qii Wang
When i2c and apdma use different source clocks, we should enable synchronization between them. Signed-off-by: Qii Wang --- drivers/i2c/busses/i2c-mt65xx.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c index

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

2019-02-26 Thread Qii Wang
Add MT8183 i2c binding to binding file. Compare to MT2712 i2c controller, MT8183 has different registers, offsets, and clock. Signed-off-by: Qii Wang --- Documentation/devicetree/bindings/i2c/i2c-mtk.txt |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation

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

2019-02-26 Thread Qii Wang
Add i2c compatible for MT8183. Compare to MT2712 i2c controller, MT8183 has different register offsets. Ltiming_reg is added to adjust low width of SCL. Arb clock and dma_sync are needed. Signed-off-by: Qii Wang --- drivers/i2c/busses/i2c-mt65xx.c | 53

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

2019-02-26 Thread 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 Reviewed-by: Matthias Brugger --- drivers/i2c/busses/i2c-mt65xx.c | 163 +-- 1 file changed, 104

Re: [PATCH v2 2/2] i2c: mediatek: Add i2c ac-timing adjust support

2020-05-18 Thread Qii Wang
On Mon, 2020-05-18 at 17:44 +0200, Geert Uytterhoeven wrote: > On Thu, May 14, 2020 at 3:13 PM Qii Wang wrote: > > This patch adds a algorithm to calculate some ac-timing parameters > > which can fully meet I2C Spec. > > > > Signed-off-by: Qii Wang > > --- >

Re: [PATCH v2 2/2] i2c: mediatek: Add i2c ac-timing adjust support

2020-05-20 Thread Qii Wang
Hi Geert, On Tue, 2020-05-19 at 09:14 +0200, Geert Uytterhoeven wrote: > Hi Qii, > > On Tue, May 19, 2020 at 4:59 AM Qii Wang wrote: > > On Mon, 2020-05-18 at 17:44 +0200, Geert Uytterhoeven wrote: > > > On Thu, May 14, 2020 at 3:13 PM Qii Wang wrote: > > >

Re: [PATCH v2 2/2] i2c: mediatek: Add i2c ac-timing adjust support

2020-05-20 Thread Qii Wang
Hi Geert, On Wed, 2020-05-20 at 10:58 +0200, Geert Uytterhoeven wrote: > Hi Qii, > > On Wed, May 20, 2020 at 10:44 AM Qii Wang wrote: > > On Tue, 2020-05-19 at 09:14 +0200, Geert Uytterhoeven wrote: > > > On Tue, May 19, 2020 at 4:59 AM Qii Wang wrote: > > > &g

[PATCH v3 3/4] dt-bindings: i2c: update bindings for MT8192 SoC

2020-08-05 Thread Qii Wang
Add a DT binding documentation for the MT8192 soc. Acked-by: Rob Herring Signed-off-by: Qii Wang --- Documentation/devicetree/bindings/i2c/i2c-mt65xx.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/i2c/i2c-mt65xx.txt b/Documentation/devicetree

[PATCH v3 2/4] i2c: mediatek: Add access to more than 8GB dram in i2c driver

2020-08-05 Thread Qii Wang
Newer MTK chip support more than 8GB of dram. Replace support_33bits with more general dma_max_support and remove mtk_i2c_set_4g_mode. Reviewed-by: Yingjoe Chen Signed-off-by: Qii Wang --- drivers/i2c/busses/i2c-mt65xx.c | 39 +-- 1 file changed, 17

[PATCH v3 1/4] i2c: mediatek: Add apdma sync in i2c driver

2020-08-05 Thread Qii Wang
With the apdma remove hand-shake signal, it need to keep i2c and apdma in sync manually. Reviewed-by: Yingjoe Chen Reviewed-by: Matthias Brugger Signed-off-by: Qii Wang --- drivers/i2c/busses/i2c-mt65xx.c | 23 --- 1 file changed, 20 insertions(+), 3 deletions(-) diff

[PATCH v3 0/4] add i2c support for mt8192

2020-08-05 Thread Qii Wang
This series are based on 5.8-rc1 and we provide four i2c patches to support mt8192 SoC. Main changes compared to v2: --delete unused I2C_DMA_4G_MODE Main changes compared to v1: --modify the commit with access more than 8GB dram --add Reviewed-by and Acked-by from Yingjoe, Matthias and Rob Qii

[PATCH v3 4/4] i2c: mediatek: Add i2c compatible for MediaTek MT8192

2020-08-05 Thread Qii Wang
Add i2c compatible for MT8192. Compare to MT8183 i2c controller, MT8192 support more then 8GB DMA mode. Signed-off-by: Qii Wang --- drivers/i2c/busses/i2c-mt65xx.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c

Re: [PATCH] i2c: mediatek: Fix i2c_spec_values description

2020-08-06 Thread Qii Wang
On Thu, 2020-08-06 at 11:48 +0200, Matthias Brugger wrote: > The struct i2c_spec_values have it's members documented but is missing the > starting '@', which leads to warings like: > > drivers/i2c/busses/i2c-mt65xx.c:267: warning: Function parameter or member > 'min_low_ns' not described in 'i2c

Re: [PATCH] i2c: mediatek: Fix i2c_spec_values description

2020-08-06 Thread Qii Wang
On Thu, 2020-08-06 at 15:35 +0200, Matthias Brugger wrote: > > On 06/08/2020 13:06, Qii Wang wrote: > > On Thu, 2020-08-06 at 11:48 +0200, Matthias Brugger wrote: > >> The struct i2c_spec_values have it's members documented but is missing the > >> starti

Re: [v2] i2c: mediatek: Fix i2c_spec_values description

2020-08-07 Thread Qii Wang
ing: Function parameter or member > 'min_low_ns' not described in 'i2c_spec_values' > > We also delete min_high_ns member as it is not used in the code. > > Signed-off-by: Matthias Brugger Reviewed-by: Qii Wang > --- > > Changes since v1: > del

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

2020-12-22 Thread Qii Wang
Hi sirs: If there is no new comment, I will resent it in 5.11.

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

2021-03-25 Thread Qii Wang
On Wed, 2021-03-24 at 11:12 -0600, Rob Herring wrote: > On Sat, Mar 13, 2021 at 04:07:09PM +0800, qii.w...@mediatek.com wrote: > > 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

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

2021-04-12 Thread Qii Wang
On Wed, 2021-04-07 at 20:19 +0200, Wolfram Sang wrote: > > Due to clock stretch, our HW IP cannot meet the ac-timing > > spec(tSU;STA,tSU;STO). > > There isn't a same delay for clock stretching, so we need pass a > > parameter which can be found through measurement to meet most > > conditions. >

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

2021-04-13 Thread Qii Wang
On Tue, 2021-04-13 at 22:17 +0200, Wolfram Sang wrote: > On Mon, Apr 12, 2021 at 08:03:14PM +0800, Qii Wang wrote: > > I can't see the relationship between "i2c-scl-falling-time-ns" and clock > > stretching, is there a parameter related to clock stretching? > &g

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

2021-04-07 Thread Qii Wang
On Tue, 2021-04-06 at 21:48 +0200, Wolfram Sang wrote: > On Sat, Mar 13, 2021 at 04:04:24PM +0800, qii.w...@mediatek.com wrote: > > From: Qii Wang > > > > tSU,STA/tHD,STA/tSU,STOP maybe out of spec due to device > > clock-stretching or circuit loss, we could get de

[PATCH 0/3] Add some fix patches

2021-04-16 Thread Qii Wang
This series are based on 5.12-rc2 and we provide three i2c patches to fix some historical issues. Qii Wang (3): i2c: mediatek: Fix send master code at more than 1MHz i2c: mediatek: Fix wrong dma sync flag i2c: mediatek: Use scl_int_delay_ns to compensate clock-stretching drivers/i2c

[PATCH 2/3] i2c: mediatek: Fix wrong dma sync flag

2021-04-16 Thread Qii Wang
The right flag is apdma_sync when apdma remove hand-shake signel. Signed-off-by: Qii Wang --- drivers/i2c/busses/i2c-mt65xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c index 3e34261..bf25acb 100644 --- a

[PATCH 1/3] i2c: mediatek: Fix send master code at more than 1MHz

2021-04-16 Thread Qii Wang
There are some omissions in the previous patch about replacing I2C_MAX_FAST_MODE__FREQ with I2C_MAX_FAST_MODE_PLUS_FREQ and need to fix it. Fixes: b44658e755b5("i2c: mediatek: Send i2c master code at more than 1MHz") Signed-off-by: Qii Wang --- drivers/i2c/busses/i2c-mt65xx.c | 9 ++

[PATCH 3/3] i2c: mediatek: Use scl_int_delay_ns to compensate clock-stretching

2021-04-16 Thread Qii Wang
The parameters of tSU,STA/tHD,STA/tSU,STOP maybe out of spec due to device clock-stretch or circuit loss, we could get a suitable scl_int_delay_ns from i2c_timings to compensate these parameters to meet the spec via EXT_CONF register. Signed-off-by: Qii Wang --- drivers/i2c/busses/i2c-mt65xx.c

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

2020-12-09 Thread Qii Wang
On Mon, 2020-12-07 at 18:35 +0200, Grygorii Strashko wrote: > > > > > On Thu, 2020-12-03 at 10:01 +0200, Grygorii Strashko wrote: > >> > >> On 03/12/2020 03:25, Qii Wang wrote: > >>> On Wed, 2020-12-02 at 16:35 +0100, Wolfram Sang wrote: >

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

2020-12-06 Thread Qii Wang
ttps://patchwork.kernel.org/project/linux-acpi/patch/20180923135812.29574-8-hdego...@redhat.com/ On Thu, 2020-12-03 at 10:01 +0200, Grygorii Strashko wrote: > > On 03/12/2020 03:25, Qii Wang wrote: > > On Wed, 2020-12-02 at 16:35 +0100, Wolfram Sang wrote: > >> Hi, > >> > >>&

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

2020-12-02 Thread Qii Wang
; > Therefore, we also need to move the suspend handling for the I2C > > controller driver to the NOIRQ phase as well. > > > > Signed-off-by: Qii Wang > > Is this a bugfix and should go into 5.10? Or can it wait for 5.11? > Yes, Can you help to apply it into 5.10? Thanks > Thanks, > >Wolfram >

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

2021-03-01 Thread Qii Wang
Hi, On Wed, 2021-02-03 at 18:35 +0800, qii.w...@mediatek.com wrote: > 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

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

2021-03-02 Thread Qii Wang
Hi, On Tue, 2021-03-02 at 19:30 +0800, Ikjoon Jang wrote: > Hi Qii, > > > > @@ -1171,6 +1173,8 @@ static int mtk_i2c_parse_dt(struct device_node *np, > > struct mtk_i2c *i2c) > > if (i2c->clk_src_div == 0) > > return -EINVAL; > > > > + of_property_read_u32(np, "clock-

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

2021-01-26 Thread Qii Wang
Hi Wolfram, On Sat, 2021-01-09 at 16:29 +0800, qii.w...@mediatek.com wrote: > 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 oth

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

2021-01-04 Thread Qii Wang
On Mon, 2021-01-04 at 19:32 +0100, Wolfram Sang wrote: > On Mon, Jan 04, 2021 at 07:29:59PM +0100, Wolfram Sang wrote: > > On Thu, Dec 24, 2020 at 08:26:07PM +0800, qii.w...@mediatek.com wrote: > > > From: Qii Wang > > > > > > With the apdma remove h

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

2020-12-15 Thread Qii Wang
On Mon, 2020-12-14 at 22:08 +0200, Grygorii Strashko wrote: > > On 14/12/2020 10:48, Qii Wang wrote: > > On Thu, 2020-12-10 at 15:03 +0200, Grygorii Strashko wrote: > >> > >> On 10/12/2020 03:56, Qii Wang wrote: > >>> On Mon, 2020-12-

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

2020-12-14 Thread Qii Wang
On Thu, 2020-12-10 at 15:03 +0200, Grygorii Strashko wrote: > > On 10/12/2020 03:56, Qii Wang wrote: > > On Mon, 2020-12-07 at 18:35 +0200, Grygorii Strashko wrote: > >> > >>> > >>> On Thu, 2020-12-03 at 10:01 +0200, Grygorii Strashko wrote: >

Re: [PATCH v2] i2c: mediatek: disable zero-length transfers for mt8183

2019-08-23 Thread Qii Wang
On Thu, 2019-08-22 at 17:45 +0800, Hsin-Yi Wang wrote: > When doing i2cdetect quick write mode, we would get transfer > error ENOMEM, and i2cdetect shows there's no device at the address. > Quoting from mt8183 datasheet, the number of transfers to be > transferred in one transaction should be set t

Re: [PATCH v2] i2c: mediatek: disable zero-length transfers for mt8183

2019-08-23 Thread Qii Wang
On Fri, 2019-08-23 at 16:13 +0800, Hsin-Yi Wang wrote: > On Fri, Aug 23, 2019 at 4:09 PM Qii Wang wrote: > > > > > > > static u32 mtk_i2c_functionality(struct i2c_adapter *adap) > > > { > > > - return I2C_FUNC_I2C | I2C_FUNC_SMBUS

Re: [PATCH 1/2] dt-bindings: i2c: Add MediaTek i2c AC timing binding

2019-07-17 Thread Qii Wang
On Wed, 2019-06-26 at 15:39 +0200, Wolfram Sang wrote: > Hi, > > On Tue, Jun 11, 2019 at 04:11:54PM +0800, Qii Wang wrote: > > Add i2c AC timing binding to binding file. It can give the AC > > timing parameters to meet I2C specification at different speed. > > > >

Re: [PATCH v3 1/2] dt-bindings: i3c: Document MediaTek I3C master bindings

2019-07-26 Thread Qii Wang
On Wed, 2019-07-24 at 14:21 -0600, Rob Herring wrote: > On Tue, Jul 09, 2019 at 09:09:21PM +0800, Qii Wang wrote: > > Document MediaTek I3C master DT bindings. > > > > Signed-off-by: Qii Wang > > --- > > .../devicetree/bindings/i3c/mtk,i3c-master.txt | 48

Re: [PATCH v3 5/6] dt-bindings: i2c: Add Mediatek MT8183 i2c binding

2019-02-19 Thread Qii Wang
On Sat, 2019-02-16 at 13:29 +0100, Wolfram Sang wrote: > > Maybe you think that MT8183 SoC only has the I3C controllers. Actually, > > there are I2C and I3C controllers on MT8183 SoC. We will remove > > "mediatek,share-i3c" for I2C controller driver, so these patches are > > just to support the I2C

[PATCH v4 2/3] dt-bindings: i2c: Add Mediatek MT8183 i2c binding

2019-02-20 Thread Qii Wang
Add MT8183 i2c binding to binding file. Compare to MT2712 i2c controller, MT8183 has different registers, offsets, and clock. Signed-off-by: Qii Wang --- Documentation/devicetree/bindings/i2c/i2c-mtk.txt |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation

[PATCH v4 0/3] add i2c support for mt8183

2019-02-20 Thread Qii Wang
, Nicolas and Sean Main changes compared to v1: --remove useless dt-binding for mt7629 --split a patch into two(2/6 3/6) --muti-user feature was dropped Qii Wang (3): i2c: mediatek: Add offsets array for new i2c registers dt-bindings: i2c: Add Mediatek MT8183 i2c binding i2c: mediatek: Add

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

2019-02-20 Thread 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 deletions(-) diff

[PATCH v4 3/3] i2c: mediatek: Add i2c support for MediaTek MT8183

2019-02-20 Thread Qii Wang
Add i2c compatible for MT8183. Compare to MT2712 i2c controller, MT8183 has different registers, offsets and clock. Signed-off-by: Qii Wang --- drivers/i2c/busses/i2c-mt65xx.c | 89 --- 1 file changed, 84 insertions(+), 5 deletions(-) diff --git a/drivers

[PATCH v3 3/6] i2c: mediatek: remove completion_done()

2019-01-21 Thread qii wang
Completion_done() is useless when we don't use its return value, so we remove it. Signed-off-by: qii wang --- drivers/i2c/busses/i2c-mt65xx.c |2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c index 7396449..660de1e 1

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

2019-01-21 Thread qii wang
Add MT7629 i2c binding to binding file. Signed-off-by: qii wang Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/i2c/i2c-mtk.txt |1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/i2c/i2c-mtk.txt b/Documentation/devicetree/bindings/i2c/i2c

[PATCH v3 2/6] i2c: mediatek: speeds is replaced by macros definitions

2019-01-21 Thread qii wang
Different speeds have been defined by macros, so we use macros definitions. Signed-off-by: qii wang Reviewed-by: Nicolas Boichat --- drivers/i2c/busses/i2c-mt65xx.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses

[PATCH v3 6/6] i2c: mediatek: Add i2c support for MediaTek MT8183

2019-01-21 Thread qii wang
Add i2c compatible for MT8183. Compare to 2712 i2c controller, MT8183 has different registers, offsets, clock, and share i3c controller. Signed-off-by: qii wang --- drivers/i2c/busses/i2c-mt65xx.c | 127 --- 1 file changed, 120 insertions(+), 7 deletions

[PATCH v3 4/6] i2c: mediatek: Add offsets array for new i2c registers

2019-01-21 Thread 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 Reviewed-by: Sean Wang Reviewed-by: Nicolas Boichat --- drivers/i2c/busses/i2c-mt65xx.c | 163 +-- 1

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

2019-01-21 Thread qii wang
) --muti-user feature was dropped qii wang (6): dt-bindings: i2c: Add Mediatek MT7629 i2c binding i2c: mediatek: speeds is replaced by macros definitions i2c: mediatek: remove completion_done() i2c: mediatek: Add offsets array for new i2c registers dt-bindings: i2c: Add Mediatek MT8183

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

2019-01-21 Thread qii wang
Add MT8183 i2c binding to binding file. Compare to 2712 i2c controller, MT8183 has different registers, offsets, clock, and share i3c controller. Signed-off-by: qii wang Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/i2c/i2c-mtk.txt |6 -- 1 file changed, 4 insertions

Re: [PATCH v3 1/2] dt-bindings: i3c: Document MediaTek I3C master bindings

2019-07-29 Thread Qii Wang
On Sat, 2019-07-27 at 11:18 +0200, Boris Brezillon wrote: > On Sat, 27 Jul 2019 09:23:33 +0800 > Qii Wang wrote: > > > On Wed, 2019-07-24 at 14:21 -0600, Rob Herring wrote: > > > On Tue, Jul 09, 2019 at 09:09:21PM +0800, Qii Wang wrote: > > > > Docu

[PATCH v2 2/2] i3c: master: Add driver for MediaTek IP

2019-06-25 Thread Qii Wang
Add a driver for MediaTek I3C master IP. Signed-off-by: Qii Wang --- drivers/i3c/master/Kconfig | 10 + drivers/i3c/master/Makefile |1 + drivers/i3c/master/i3c-master-mtk.c | 1239 +++ 3 files changed, 1250 insertions(+) create mode

[PATCH v2 1/2] dt-bindings: i3c: Document MediaTek I3C master bindings

2019-06-25 Thread Qii Wang
Document MediaTek I3C master DT bindings. Signed-off-by: Qii Wang --- .../devicetree/bindings/i3c/mtk,i3c-master.txt | 47 1 file changed, 47 insertions(+) create mode 100644 Documentation/devicetree/bindings/i3c/mtk,i3c-master.txt diff --git a/Documentation

[PATCH v2 0/2] Add MediaTek I3C master controller driver

2019-06-25 Thread Qii Wang
This series are based on 5.2-rc1, we provide two patches to support MediaTek I3C master controller. Main changes compared to v1: --remove clock-div, let clock driver handle it --let sample_cnt and step_cnt start from two Qii Wang (2): dt-bindings: i3c: Document MediaTek I3C master bindings

Re: [PATCH v2 1/2] dt-bindings: i3c: Document MediaTek I3C master bindings

2019-06-27 Thread Qii Wang
On Wed, 2019-06-26 at 18:23 +0200, Boris Brezillon wrote: > On Wed, 26 Jun 2019 13:36:27 +0800 > Qii Wang wrote: > > > Document MediaTek I3C master DT bindings. > > > > Signed-off-by: Qii Wang > > --- > > .../devicetree/bin

[PATCH 2/2] i2c: mediatek: Add i2c AC timing adjust support

2019-06-11 Thread Qii Wang
This patch adds some I2C timing registers to meet I2C spec, it configures these registers according to information passed via DT. Signed-off-by: Qii Wang --- drivers/i2c/busses/i2c-mt65xx.c | 94 ++- 1 file changed, 82 insertions(+), 12 deletions(-) diff

[PATCH 0/2] Add support for AC timing adjustment

2019-06-11 Thread Qii Wang
This series are based on 5.2-rc1, we provide two patches to support AC timing adjustment. Qii Wang (2): dt-bindings: i2c: Add MediaTek i2c AC timing binding i2c: mediatek: Add i2c AC timing adjust support .../devicetree/bindings/i2c/i2c-mt65xx.txt | 11 +++ drivers/i2c/busses/i2c

[PATCH 1/2] dt-bindings: i2c: Add MediaTek i2c AC timing binding

2019-06-11 Thread Qii Wang
Add i2c AC timing binding to binding file. It can give the AC timing parameters to meet I2C specification at different speed. Signed-off-by: Qii Wang --- .../devicetree/bindings/i2c/i2c-mt65xx.txt | 11 +++ 1 file changed, 11 insertions(+) diff --git a/Documentation

Re: [PATCH 2/2] i3c: master: Add driver for MediaTek IP

2019-06-11 Thread Qii Wang
On Tue, 2019-06-04 at 20:26 +0800, Qii Wang wrote: > On Tue, 2019-06-04 at 09:58 +0200, Boris Brezillon wrote: > > On Mon, 3 Jun 2019 11:51:03 +0800 > > Qii Wang wrote: > > > > > > > +static int mtk_i3c_master_probe(struct platform_device *pdev) > > &g

[PATCH v3 1/2] dt-bindings: i3c: Document MediaTek I3C master bindings

2019-07-09 Thread Qii Wang
Document MediaTek I3C master DT bindings. Signed-off-by: Qii Wang --- .../devicetree/bindings/i3c/mtk,i3c-master.txt | 48 1 file changed, 48 insertions(+) create mode 100644 Documentation/devicetree/bindings/i3c/mtk,i3c-master.txt diff --git a/Documentation

[PATCH v3 0/2] Add MediaTek I3C master controller driver

2019-07-09 Thread Qii Wang
driver handle it --let sample_cnt and step_cnt start from two Qii Wang (2): dt-bindings: i3c: Document MediaTek I3C master bindings i3c: master: Add driver for MediaTek IP .../devicetree/bindings/i3c/mtk,i3c-master.txt | 48 + drivers/i3c/master/Kconfig | 10

[PATCH v3 2/2] i3c: master: Add driver for MediaTek IP

2019-07-09 Thread Qii Wang
Add a driver for MediaTek I3C master IP. Signed-off-by: Qii Wang --- drivers/i3c/master/Kconfig | 10 + drivers/i3c/master/Makefile |1 + drivers/i3c/master/i3c-master-mtk.c | 1239 +++ 3 files changed, 1250 insertions(+) create mode

[PATCH v6 2/6] dt-bindings: i2c: Add Mediatek MT8183 i2c binding

2019-03-10 Thread Qii Wang
Add MT8183 i2c binding to binding file. Compare to MT2712 i2c controller, MT8183 has different registers, offsets, and clock. Signed-off-by: Qii Wang Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/i2c/i2c-mtk.txt |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff

[PATCH v6 4/6] i2c: mediatek: Add i2c and apdma sync in i2c driver

2019-03-10 Thread Qii Wang
When i2c and apdma use different source clocks, we should enable synchronization between them. Signed-off-by: Qii Wang Reviewed-by: Nicolas Boichat --- drivers/i2c/busses/i2c-mt65xx.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers

[PATCH v6 3/6] i2c: mediatek: Add arb clock in i2c driver

2019-03-10 Thread Qii Wang
When two i2c controllers are internally connected to the same GPIO pins, the arb clock is needed to ensure that the waveforms do not interfere with each other. And we also need to enable the interrupt to find arb lost, old i2c controllers also have the bit. Signed-off-by: Qii Wang --- drivers

[PATCH v6 5/6] i2c: mediatek: Add i2c support for MediaTek MT8183

2019-03-10 Thread Qii Wang
Add i2c compatible for MT8183. Compare to MT2712 i2c controller, MT8183 has different register offsets. Ltiming_reg is added to adjust low width of SCL. Arb clock and dma_sync are needed. Signed-off-by: Qii Wang --- drivers/i2c/busses/i2c-mt65xx.c | 62

[PATCH v6 6/6] dts: arm64: mt8183: Add I2C nodes

2019-03-10 Thread Qii Wang
This patch adds nodes for I2C controller. Signed-off-by: Qii Wang --- arch/arm64/boot/dts/mediatek/mt8183.dtsi | 190 ++ 1 file changed, 190 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8183.dtsi b/arch/arm64/boot/dts/mediatek/mt8183.dtsi index

[PATCH v6 1/6] i2c: mediatek: Add offsets array for new i2c registers

2019-03-10 Thread 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 Reviewed-by: Matthias Brugger --- drivers/i2c/busses/i2c-mt65xx.c | 163 +-- 1 file changed, 104

[PATCH v6 0/6] add i2c support for mt8183

2019-03-10 Thread Qii Wang
--add Reviewed-by from Rob Herring, Nicolas and Sean Main changes compared to v1: --remove useless dt-binding for mt7629 --split a patch into two(2/6 3/6) --muti-user feature was dropped Qii Wang (6): i2c: mediatek: Add offsets array for new i2c registers dt-bindings: i2c: Add Mediatek MT8183

Re: [PATCH v6 6/6] dts: arm64: mt8183: Add I2C nodes

2019-03-11 Thread Qii Wang
On Mon, 2019-03-11 at 16:36 +0800, Nicolas Boichat wrote: > On Mon, Mar 11, 2019 at 1:41 PM Qii Wang wrote: > > > > This patch adds nodes for I2C controller. > > > > Signed-off-by: Qii Wang > > --- > > This applies on top of some other uncommitted series

Re: [PATCH v3 5/6] dt-bindings: i2c: Add Mediatek MT8183 i2c binding

2019-02-13 Thread Qii Wang
On Tue, 2019-02-05 at 14:16 +0100, Wolfram Sang wrote: > > + - mediatek,share-i3c: i3c controller can share i2c function. > > I am not happy with this binding. There must be a better way of using > the I3C controller in I2C mode. I think it would be easier to tell if we > had an I3C driver to see

Re: [PATCH v4 2/3] dt-bindings: i2c: Add Mediatek MT8183 i2c binding

2019-02-21 Thread Qii Wang
On Wed, 2019-02-20 at 16:25 +0100, Matthias Brugger wrote: > > On 20/02/2019 13:33, Qii Wang wrote: > > Add MT8183 i2c binding to binding file. Compare to MT2712 i2c > > controller, MT8183 has different registers, offsets, and clock. > > > > Signed-off-by: Qii Wa

Re: [PATCH v4 3/3] i2c: mediatek: Add i2c support for MediaTek MT8183

2019-02-21 Thread Qii Wang
On Wed, 2019-02-20 at 15:41 +0100, Matthias Brugger wrote: > > On 20/02/2019 13:33, Qii Wang wrote: > > Add i2c compatible for MT8183. Compare to MT2712 i2c controller, > > MT8183 has different registers, offsets and clock. > > > > Signed-off-by: Qii Wang &

Re: [PATCH v3 5/6] dt-bindings: i2c: Add Mediatek MT8183 i2c binding

2019-02-16 Thread Qii Wang
On Fri, 2019-02-15 at 10:02 +0100, Wolfram Sang wrote: > On Thu, Feb 14, 2019 at 09:54:28AM +0800, Qii Wang wrote: > > On Tue, 2019-02-05 at 14:16 +0100, Wolfram Sang wrote: > > > > + - mediatek,share-i3c: i3c controller can share i2c function. > > > > > >

Re: [PATCH v4 3/3] i2c: mediatek: Add i2c support for MediaTek MT8183

2019-03-06 Thread Qii Wang
I am sorry to have missed some comment, and reply the mail again. On Wed, 2019-02-20 at 15:41 +0100, Matthias Brugger wrote: > > On 20/02/2019 13:33, Qii Wang wrote: > > Add i2c compatible for MT8183. Compare to MT2712 i2c controller, > > MT8183 has different registers,

Re: [PATCH v5 3/5] i2c: mediatek: Add arb clock in i2c driver

2019-03-06 Thread Qii Wang
On Wed, 2019-03-06 at 18:49 +0800, Nicolas Boichat wrote: > One thing I missed from Matthias' comment on v4: > https://patchwork.kernel.org/patch/10822083/ > > On Wed, Mar 6, 2019 at 6:44 PM Nicolas Boichat wrote: > > > > On Tue, Feb 26, 2019 at 9:11 PM Qii Wang wr

Re: [PATCH v5 5/5] i2c: mediatek: Add i2c support for MediaTek MT8183

2019-03-06 Thread Qii Wang
On Wed, 2019-03-06 at 18:52 +0800, Nicolas Boichat wrote: > On Tue, Feb 26, 2019 at 9:11 PM Qii Wang wrote: > > > > Add i2c compatible for MT8183. Compare to MT2712 i2c controller, > > MT8183 has different register offsets. Ltiming_reg is added to > > adjust low

Re: [PATCH] i2c: mediatek: Add i2c ac-timing adjust support

2020-05-13 Thread Qii Wang
On Tue, 2020-05-12 at 15:38 +0200, Wolfram Sang wrote: > Hi Qii Wang, > > On Thu, Mar 26, 2020 at 07:54:36PM +0800, qii.w...@mediatek.com wrote: > > From: Qii Wang > > > > This patch adds a algorithm to calculate some ac-timing parameters > > which can fully m

Re: [PATCH] i2c: mediatek: Add i2c ac-timing adjust support

2020-05-14 Thread Qii Wang
On Thu, 2020-05-14 at 08:29 +0200, Wolfram Sang wrote: > > > Last question: You seem to be the one doing major updates to this > > > driver. Thanks for that! Are you maybe interested in becoming the > > > maintainer for this driver? I think there won't be much patches to > > > review and reports to

[PATCH v2 0/2] Add i2c ac-timing adjust support

2020-05-14 Thread Qii Wang
This series are based on 5.7-rc1, we provide two patches to support i2c ac-timing. Main changes compared to v1: --add maintainer for mediatek i2c controller driver --fix warning of self-assignment Qii Wang (2): MAINTAINERS: add maintainer for mediatek i2c controller driver i2c: mediatek

[PATCH v2 2/2] i2c: mediatek: Add i2c ac-timing adjust support

2020-05-14 Thread Qii Wang
This patch adds a algorithm to calculate some ac-timing parameters which can fully meet I2C Spec. Signed-off-by: Qii Wang --- drivers/i2c/busses/i2c-mt65xx.c | 328 +--- 1 file changed, 277 insertions(+), 51 deletions(-) diff --git a/drivers/i2c/busses/i2c

  1   2   >