Skip to content

Commit 4bc7d89

Browse files
wolfgarjnettlet
authored andcommitted
MXC-CEC: Remove embedded logics from the driver so that libcec is responsible for all this work
Since libcec does the complete handling of the state machine and the setup logic by itself, kill any traces of "smartness" in the driver. Signed-off-by: Rudi <[email protected]>
1 parent b8bc503 commit 4bc7d89

File tree

1 file changed

+6
-28
lines changed

1 file changed

+6
-28
lines changed

drivers/mxc/hdmi-cec/mxc_hdmi-cec.c

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static irqreturn_t mxc_hdmi_cec_isr(int irq, void *data)
133133

134134
void mxc_hdmi_cec_handle(u16 cec_stat)
135135
{
136-
u8 val = 0, i = 0;
136+
u8 i = 0;
137137
struct hdmi_cec_event *event = NULL;
138138

139139
/* The current transmission is successful (for initiator only). */
@@ -172,29 +172,16 @@ void mxc_hdmi_cec_handle(u16 cec_stat)
172172

173173
/* An error is detected on cec line (for initiator only). */
174174
if (cec_stat & HDMI_IH_CEC_STAT0_ERROR_INIT) {
175-
mutex_lock(&hdmi_cec_data.lock);
176-
hdmi_cec_data.send_error++;
177-
if (hdmi_cec_data.send_error > 2) {
178-
pr_err("%s:Re-transmission is attempted more than 2 times!\n", __func__);
179-
hdmi_cec_data.send_error = 0;
180-
mutex_unlock(&hdmi_cec_data.lock);
181-
hdmi_cec_data.tx_answer = cec_stat;
182-
wake_up(&tx_cec_queue);
183-
return;
184-
}
185-
for (i = 0; i < hdmi_cec_data.msg_len; i++)
186-
hdmi_writeb(hdmi_cec_data.last_msg[i], HDMI_CEC_TX_DATA0+i);
187-
hdmi_writeb(hdmi_cec_data.msg_len, HDMI_CEC_TX_CNT);
188-
val = hdmi_readb(HDMI_CEC_CTRL);
189-
val |= 0x01;
190-
hdmi_writeb(val, HDMI_CEC_CTRL);
191-
mutex_unlock(&hdmi_cec_data.lock);
175+
hdmi_cec_data.tx_answer = cec_stat;
176+
wake_up(&tx_cec_queue);
177+
return;
192178
}
193179
/* A frame is not acknowledged in a directly addressed message.
194180
* Or a frame is negatively acknowledged in
195181
* a broadcast message (for initiator only).
196182
*/
197183
if (cec_stat & HDMI_IH_CEC_STAT0_NACK) {
184+
hdmi_cec_data.send_error++;
198185
hdmi_cec_data.tx_answer = cec_stat;
199186
wake_up(&tx_cec_queue);
200187
}
@@ -395,7 +382,7 @@ static long hdmi_cec_ioctl(struct file *filp, u_int cmd,
395382
u_long arg)
396383
{
397384
int ret = 0, status = 0;
398-
u8 val = 0, msg = 0;
385+
u8 val = 0;
399386
struct mxc_edid_cfg hdmi_edid_cfg;
400387
pr_debug("function : %s\n", __func__);
401388
if (!open_count)
@@ -419,15 +406,6 @@ static long hdmi_cec_ioctl(struct file *filp, u_int cmd,
419406
hdmi_writeb(0, HDMI_CEC_ADDR_L);
420407
} else
421408
ret = -EINVAL;
422-
/*Send Polling message with same source and destination address*/
423-
if (0 == ret && 15 != hdmi_cec_data.Logical_address) {
424-
msg = (hdmi_cec_data.Logical_address << 4)|hdmi_cec_data.Logical_address;
425-
hdmi_writeb(1, HDMI_CEC_TX_CNT);
426-
hdmi_writeb(msg, HDMI_CEC_TX_DATA0);
427-
val = hdmi_readb(HDMI_CEC_CTRL);
428-
val |= 0x01;
429-
hdmi_writeb(val, HDMI_CEC_CTRL);
430-
}
431409
mutex_unlock(&hdmi_cec_data.lock);
432410
break;
433411
case HDMICEC_IOC_STARTDEVICE:

0 commit comments

Comments
 (0)