-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path001_cec.patch
85 lines (74 loc) · 2.69 KB
/
001_cec.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
commit 7c545ae5467cca6ce537e213ecd647fcd4c3c4c0
Author: wolfgar <[email protected]>
Date: Fri Sep 12 01:42:52 2014 +0200
Remove superflous guards that could even break invocation from mxc-hdmi
diff --git a/drivers/mxc/hdmi-cec/mxc_hdmi-cec.c b/drivers/mxc/hdmi-cec/mxc_hdmi-cec.c
index e53510f..88670bd 100644
--- a/drivers/mxc/hdmi-cec/mxc_hdmi-cec.c
+++ b/drivers/mxc/hdmi-cec/mxc_hdmi-cec.c
@@ -83,8 +83,6 @@ struct hdmi_cec_event {
static LIST_HEAD(head);
-static int hdmi_cec_ready = 0;
-static int hdmi_cec_started;
static int hdmi_cec_major;
static struct class *hdmi_cec_class;
static struct hdmi_cec_priv hdmi_cec_data;
@@ -315,7 +313,7 @@ static ssize_t hdmi_cec_write(struct file *file, const char __user *buf,
mutex_unlock(&hdmi_cec_data.lock);
return -EACCES;
}
- /* Ensure that there is only one writer who is the only listener of tx_cec_queue */
+ /* Ensure that there is only one writer who is the unique listener of tx_cec_queue */
if (hdmi_cec_data.tx_answer != CEC_TX_AVAIL) {
mutex_unlock(&hdmi_cec_data.lock);
return -EBUSY;
@@ -359,13 +357,11 @@ static ssize_t hdmi_cec_write(struct file *file, const char __user *buf,
return ret;
}
+
void hdmi_cec_start_device(void)
{
u8 val;
- if (!hdmi_cec_ready || hdmi_cec_started)
- return;
-
val = hdmi_readb(HDMI_MC_CLKDIS);
val &= ~HDMI_MC_CLKDIS_CECCLK_DISABLE;
hdmi_writeb(val, HDMI_MC_CLKDIS);
@@ -378,11 +374,7 @@ void hdmi_cec_start_device(void)
hdmi_writeb(val, HDMI_CEC_MASK);
hdmi_writeb(val, HDMI_IH_MUTE_CEC_STAT0);
hdmi_cec_data.link_status = hdmi_readb(HDMI_PHY_STAT0) & 0x02;
- mutex_lock(&hdmi_cec_data.lock);
hdmi_cec_data.cec_state = true;
- mutex_unlock(&hdmi_cec_data.lock);
-
- hdmi_cec_started = 1;
}
EXPORT_SYMBOL(hdmi_cec_start_device);
@@ -390,9 +382,6 @@ void hdmi_cec_stop_device(void)
{
u8 val;
- if (!hdmi_cec_ready || !hdmi_cec_started)
- return;
-
hdmi_writeb(0x10, HDMI_CEC_CTRL);
val = HDMI_IH_CEC_STAT0_WAKEUP | HDMI_IH_CEC_STAT0_ERROR_FOLL | HDMI_IH_CEC_STAT0_ERROR_INIT | HDMI_IH_CEC_STAT0_ARB_LOST | \
HDMI_IH_CEC_STAT0_NACK | HDMI_IH_CEC_STAT0_EOM | HDMI_IH_CEC_STAT0_DONE;
@@ -402,11 +391,7 @@ void hdmi_cec_stop_device(void)
val = hdmi_readb(HDMI_MC_CLKDIS);
val |= HDMI_MC_CLKDIS_CECCLK_DISABLE;
hdmi_writeb(val, HDMI_MC_CLKDIS);
- mutex_lock(&hdmi_cec_data.lock);
hdmi_cec_data.cec_state = false;
- mutex_unlock(&hdmi_cec_data.lock);
-
- hdmi_cec_started = 0;
}
EXPORT_SYMBOL(hdmi_cec_stop_device);
@@ -580,7 +565,6 @@ static int hdmi_cec_dev_probe(struct platform_device *pdev)
INIT_DELAYED_WORK(&hdmi_cec_data.hdmi_cec_work, mxc_hdmi_cec_worker);
dev_info(&pdev->dev, "HDMI CEC initialized\n");
- hdmi_cec_ready = 1;
goto out;
err_out_class: