hc
2024-08-16 a24a44ff9ca902811b99aa9663d697cf452e08ef
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
#include <linux/export.h>
#include <linux/hdmi-notifier.h>
#include <linux/notifier.h>
#include <linux/string.h>
 
static BLOCKING_NOTIFIER_HEAD(hdmi_notifier);
 
int hdmi_register_notifier(struct notifier_block *nb)
{
   return blocking_notifier_chain_register(&hdmi_notifier, nb);
}
EXPORT_SYMBOL_GPL(hdmi_register_notifier);
 
int hdmi_unregister_notifier(struct notifier_block *nb)
{
   return blocking_notifier_chain_unregister(&hdmi_notifier, nb);
}
EXPORT_SYMBOL_GPL(hdmi_unregister_notifier);
 
void hdmi_event_connect(struct device *dev)
{
   struct hdmi_event_base base;
 
   base.source = dev;
 
   blocking_notifier_call_chain(&hdmi_notifier, HDMI_CONNECTED, &base);
}
EXPORT_SYMBOL_GPL(hdmi_event_connect);
 
void hdmi_event_disconnect(struct device *dev)
{
   struct hdmi_event_base base;
 
   base.source = dev;
 
   blocking_notifier_call_chain(&hdmi_notifier, HDMI_DISCONNECTED, &base);
}
EXPORT_SYMBOL_GPL(hdmi_event_disconnect);
 
void hdmi_event_new_edid(struct device *dev, const void *edid, size_t size)
{
   struct hdmi_event_new_edid new_edid;
 
   new_edid.base.source = dev;
   new_edid.edid = edid;
   new_edid.size = size;
 
   blocking_notifier_call_chain(&hdmi_notifier, HDMI_NEW_EDID, &new_edid);
}
EXPORT_SYMBOL_GPL(hdmi_event_new_edid);
 
void hdmi_event_new_eld(struct device *dev, const void *eld)
{
   struct hdmi_event_new_eld new_eld;
 
   new_eld.base.source = dev;
   memcpy(new_eld.eld, eld, sizeof(new_eld.eld));
 
   blocking_notifier_call_chain(&hdmi_notifier, HDMI_NEW_ELD, &new_eld);
}
EXPORT_SYMBOL_GPL(hdmi_event_new_eld);