From 0fdb15ba78e89fd3d8bc07e5281627f4f9944bc2 Mon Sep 17 00:00:00 2001 From: Gerald Dachs Date: Mon, 25 Apr 2016 20:22:36 +0200 Subject: [PATCH] WeTek_Core/WeTek_Play: fix new cec driver patch --- .../patches/linux/080-amlogic-cec-driver.patch | 16 ++++++++++++---- .../patches/linux/080-amlogic-cec-driver.patch | 16 ++++++++++++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/projects/WeTek_Core/patches/linux/080-amlogic-cec-driver.patch b/projects/WeTek_Core/patches/linux/080-amlogic-cec-driver.patch index 12dcacca90..e4685d281e 100644 --- a/projects/WeTek_Core/patches/linux/080-amlogic-cec-driver.patch +++ b/projects/WeTek_Core/patches/linux/080-amlogic-cec-driver.patch @@ -55,10 +55,10 @@ index 7a944cd..f74ec1f 100755 #EXTRA_CFLAGS += -O2 diff --git a/drivers/amlogic/hdmi/hdmi_tx/amlogic_cec.c b/drivers/amlogic/hdmi/hdmi_tx/amlogic_cec.c new file mode 100644 -index 0000000..a3556b3 +index 0000000..1bfc29b --- /dev/null +++ b/drivers/amlogic/hdmi/hdmi_tx/amlogic_cec.c -@@ -0,0 +1,671 @@ +@@ -0,0 +1,679 @@ +/* linux/drivers/amlogic/hdmi/hdmi_tx/amlogic_cec.c + * + * Copyright (c) 2016 Gerald Dachs @@ -549,7 +549,6 @@ index 0000000..a3556b3 + + retval = entry->size; + -+ amlogic_cec_set_rx_state(STATE_RX); + +error_exit: + if (entry != NULL) @@ -558,6 +557,11 @@ index 0000000..a3556b3 + kfree(entry); + } + ++ if (list_empty(&cec_rx_struct.list)) ++ { ++ amlogic_cec_set_rx_state(STATE_RX); ++ } ++ + spin_unlock_irqrestore(&cec_rx_struct.lock, spin_flags); + + return retval; @@ -651,7 +655,11 @@ index 0000000..a3556b3 + +static u32 amlogic_cec_poll(struct file *file, poll_table *wait) +{ -+ poll_wait(file, &cec_rx_struct.waitq, wait); ++ ++ if (atomic_read(&cec_rx_struct.state) != STATE_DONE) ++ { ++ poll_wait(file, &cec_rx_struct.waitq, wait); ++ } + + if (atomic_read(&cec_rx_struct.state) == STATE_DONE) + { diff --git a/projects/WeTek_Play/patches/linux/080-amlogic-cec-driver.patch b/projects/WeTek_Play/patches/linux/080-amlogic-cec-driver.patch index 12dcacca90..e4685d281e 100644 --- a/projects/WeTek_Play/patches/linux/080-amlogic-cec-driver.patch +++ b/projects/WeTek_Play/patches/linux/080-amlogic-cec-driver.patch @@ -55,10 +55,10 @@ index 7a944cd..f74ec1f 100755 #EXTRA_CFLAGS += -O2 diff --git a/drivers/amlogic/hdmi/hdmi_tx/amlogic_cec.c b/drivers/amlogic/hdmi/hdmi_tx/amlogic_cec.c new file mode 100644 -index 0000000..a3556b3 +index 0000000..1bfc29b --- /dev/null +++ b/drivers/amlogic/hdmi/hdmi_tx/amlogic_cec.c -@@ -0,0 +1,671 @@ +@@ -0,0 +1,679 @@ +/* linux/drivers/amlogic/hdmi/hdmi_tx/amlogic_cec.c + * + * Copyright (c) 2016 Gerald Dachs @@ -549,7 +549,6 @@ index 0000000..a3556b3 + + retval = entry->size; + -+ amlogic_cec_set_rx_state(STATE_RX); + +error_exit: + if (entry != NULL) @@ -558,6 +557,11 @@ index 0000000..a3556b3 + kfree(entry); + } + ++ if (list_empty(&cec_rx_struct.list)) ++ { ++ amlogic_cec_set_rx_state(STATE_RX); ++ } ++ + spin_unlock_irqrestore(&cec_rx_struct.lock, spin_flags); + + return retval; @@ -651,7 +655,11 @@ index 0000000..a3556b3 + +static u32 amlogic_cec_poll(struct file *file, poll_table *wait) +{ -+ poll_wait(file, &cec_rx_struct.waitq, wait); ++ ++ if (atomic_read(&cec_rx_struct.state) != STATE_DONE) ++ { ++ poll_wait(file, &cec_rx_struct.waitq, wait); ++ } + + if (atomic_read(&cec_rx_struct.state) == STATE_DONE) + {