From: Qii Wang <qii.wang@mediatek.com>
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 <qii.wang@mediatek.com>
---
drivers/i2c/busses/i2c-mt65xx.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
@@ -245,6 +245,7 @@ struct mtk_i2c {u16irq_stat;/* interrupt status */unsignedintclk_src_div;unsignedintspeed_hz;/* The speed in transfer */+unsignedintclock_stretch_ns;enummtk_trans_opop;u16timing_reg;u16high_speed_reg;
@@ -607,7 +608,8 @@ static int mtk_i2c_check_ac_timing(struct mtk_i2c *i2c,elseclk_ns=sample_ns/2;-su_sta_cnt=DIV_ROUND_UP(spec->min_su_sta_ns,clk_ns);+su_sta_cnt=DIV_ROUND_UP(spec->min_su_sta_ns+i2c->clock_stretch_ns,+clk_ns);if(su_sta_cnt>max_sta_cnt)return-1;
From: Qii Wang <qii.wang@mediatek.com> Date: 2021-03-01 12:23:27
Hi,
On Wed, 2021-02-03 at 18:35 +0800, qii.wang@mediatek.com wrote:
From: Qii Wang <qii.wang@mediatek.com>
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 <qii.wang@mediatek.com>
---
Can it merge into 5.12? or do I need to resend the patch?
Thanks,
Qii
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Ikjoon Jang <hidden> Date: 2021-03-02 12:04:32
Hi Qii,
On Wed, Feb 3, 2021 at 6:43 PM [off-list ref] wrote:
quoted hunk
From: Qii Wang <qii.wang@mediatek.com>
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 <qii.wang@mediatek.com>
---
drivers/i2c/busses/i2c-mt65xx.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
@@ -245,6 +245,7 @@ struct mtk_i2c {u16irq_stat;/* interrupt status */unsignedintclk_src_div;unsignedintspeed_hz;/* The speed in transfer */+unsignedintclock_stretch_ns;enummtk_trans_opop;u16timing_reg;u16high_speed_reg;
@@ -607,7 +608,8 @@ static int mtk_i2c_check_ac_timing(struct mtk_i2c *i2c,elseclk_ns=sample_ns/2;-su_sta_cnt=DIV_ROUND_UP(spec->min_su_sta_ns,clk_ns);+su_sta_cnt=DIV_ROUND_UP(spec->min_su_sta_ns+i2c->clock_stretch_ns,+clk_ns);if(su_sta_cnt>max_sta_cnt)return-1;
I think this new property "clock-stretch-ns" is for the same purpose of
"i2c-scl-falling-time-ns" + "i2c-scl-rising-time-ns" defined in
Documentation/devicetree/bindings/i2c/i2c.txt?
I think this new property "clock-stretch-ns" is for the same purpose of
"i2c-scl-falling-time-ns" + "i2c-scl-rising-time-ns" defined in
Documentation/devicetree/bindings/i2c/i2c.txt?
I haven't find the corresponding instructions;and this patch is for the
problem caused by clock-stretch when the scl is pulled.