Commit 7e360fa0 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

media: cec-pin: fix off-by-one SFT check

The CEC pin framework has to wait for the CEC bus to be idle for the
requested Signal Free Time before it can start a transmit.

However, the check for that was off by one, so transmits would start one
bit period (2.4ms) too late.
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 8515965e
...@@ -957,7 +957,7 @@ static enum hrtimer_restart cec_pin_timer(struct hrtimer *timer) ...@@ -957,7 +957,7 @@ static enum hrtimer_restart cec_pin_timer(struct hrtimer *timer)
* so we can kick off the pending transmit. * so we can kick off the pending transmit.
*/ */
delta = ktime_us_delta(ts, pin->ts); delta = ktime_us_delta(ts, pin->ts);
if (delta / CEC_TIM_DATA_BIT_TOTAL > if (delta / CEC_TIM_DATA_BIT_TOTAL >=
pin->tx_signal_free_time) { pin->tx_signal_free_time) {
pin->tx_nacked = false; pin->tx_nacked = false;
if (tx_custom_start(pin)) if (tx_custom_start(pin))
...@@ -968,7 +968,7 @@ static enum hrtimer_restart cec_pin_timer(struct hrtimer *timer) ...@@ -968,7 +968,7 @@ static enum hrtimer_restart cec_pin_timer(struct hrtimer *timer)
cec_pin_low(pin); cec_pin_low(pin);
break; break;
} }
if (delta / CEC_TIM_DATA_BIT_TOTAL > if (delta / CEC_TIM_DATA_BIT_TOTAL >=
pin->tx_signal_free_time - 1) pin->tx_signal_free_time - 1)
pin->state = CEC_ST_TX_WAIT; pin->state = CEC_ST_TX_WAIT;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment