#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
#include <linux/dmi.h>
#include <linux/pci.h>
#include <linux/cec.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/platform_data/cros_ec_commands.h>
#include <linux/platform_data/cros_ec_proto.h>
#include <media/cec.h>
#include <media/cec-notifier.h>
#define DRV_NAME …
struct cros_ec_cec_port { … };
struct cros_ec_cec { … };
static void cros_ec_cec_received_message(struct cros_ec_cec_port *port,
uint8_t *msg, uint8_t len)
{ … }
static void handle_cec_message(struct cros_ec_cec *cros_ec_cec)
{ … }
static void cros_ec_cec_read_message(struct cros_ec_cec_port *port)
{ … }
static void handle_cec_event(struct cros_ec_cec *cros_ec_cec)
{ … }
static int cros_ec_cec_event(struct notifier_block *nb,
unsigned long queued_during_suspend,
void *_notify)
{ … }
static int cros_ec_cec_set_log_addr(struct cec_adapter *adap, u8 logical_addr)
{ … }
static int cros_ec_cec_transmit(struct cec_adapter *adap, u8 attempts,
u32 signal_free_time, struct cec_msg *cec_msg)
{ … }
static int cros_ec_cec_adap_enable(struct cec_adapter *adap, bool enable)
{ … }
static const struct cec_adap_ops cros_ec_cec_ops = …;
#ifdef CONFIG_PM_SLEEP
static int cros_ec_cec_suspend(struct device *dev)
{ … }
static int cros_ec_cec_resume(struct device *dev)
{ … }
#endif
static SIMPLE_DEV_PM_OPS(cros_ec_cec_pm_ops,
cros_ec_cec_suspend, cros_ec_cec_resume);
#if IS_ENABLED(CONFIG_PCI) && IS_ENABLED(CONFIG_DMI)
struct cec_dmi_match { … };
static const char *const port_b_conns[] = …;
static const char *const port_db_conns[] = …;
static const char *const port_ba_conns[] = …;
static const char *const port_d_conns[] = …;
static const struct cec_dmi_match cec_dmi_match_table[] = …;
static struct device *cros_ec_cec_find_hdmi_dev(struct device *dev,
const char * const **conns)
{ … }
#else
static struct device *cros_ec_cec_find_hdmi_dev(struct device *dev,
const char * const **conns)
{
return ERR_PTR(-ENODEV);
}
#endif
static int cros_ec_cec_get_num_ports(struct cros_ec_cec *cros_ec_cec)
{ … }
static int cros_ec_cec_get_write_cmd_version(struct cros_ec_cec *cros_ec_cec)
{ … }
static int cros_ec_cec_init_port(struct device *dev,
struct cros_ec_cec *cros_ec_cec,
int port_num, struct device *hdmi_dev,
const char * const *conns)
{ … }
static int cros_ec_cec_probe(struct platform_device *pdev)
{ … }
static void cros_ec_cec_remove(struct platform_device *pdev)
{ … }
static const struct platform_device_id cros_ec_cec_id[] = …;
MODULE_DEVICE_TABLE(platform, cros_ec_cec_id);
static struct platform_driver cros_ec_cec_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;