1 #include <linux/export.h>
2 #include <linux/hdmi-notifier.h>
3 #include <linux/notifier.h>
4 #include <linux/string.h>
6 static BLOCKING_NOTIFIER_HEAD(hdmi_notifier);
8 int hdmi_register_notifier(struct notifier_block *nb)
10 return blocking_notifier_chain_register(&hdmi_notifier, nb);
12 EXPORT_SYMBOL_GPL(hdmi_register_notifier);
14 int hdmi_unregister_notifier(struct notifier_block *nb)
16 return blocking_notifier_chain_unregister(&hdmi_notifier, nb);
18 EXPORT_SYMBOL_GPL(hdmi_unregister_notifier);
20 void hdmi_event_connect(struct device *dev)
22 struct hdmi_event_base base;
26 blocking_notifier_call_chain(&hdmi_notifier, HDMI_CONNECTED, &base);
28 EXPORT_SYMBOL_GPL(hdmi_event_connect);
30 void hdmi_event_disconnect(struct device *dev)
32 struct hdmi_event_base base;
36 blocking_notifier_call_chain(&hdmi_notifier, HDMI_DISCONNECTED, &base);
38 EXPORT_SYMBOL_GPL(hdmi_event_disconnect);
40 void hdmi_event_new_edid(struct device *dev, const void *edid, size_t size)
42 struct hdmi_event_new_edid new_edid;
44 new_edid.base.source = dev;
48 blocking_notifier_call_chain(&hdmi_notifier, HDMI_NEW_EDID, &new_edid);
50 EXPORT_SYMBOL_GPL(hdmi_event_new_edid);
52 void hdmi_event_new_eld(struct device *dev, const void *eld)
54 struct hdmi_event_new_eld new_eld;
56 new_eld.base.source = dev;
57 memcpy(new_eld.eld, eld, sizeof(new_eld.eld));
59 blocking_notifier_call_chain(&hdmi_notifier, HDMI_NEW_ELD, &new_eld);
61 EXPORT_SYMBOL_GPL(hdmi_event_new_eld);