linux/drivers/media/cec/platform/cros-ec/cros-ec-cec.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * CEC driver for ChromeOS Embedded Controller
 *
 * Copyright (c) 2018 BayLibre, SAS
 * Author: Neil Armstrong <[email protected]>
 */

#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 - Driver data for a single EC CEC port
 *
 * @port_num: port number
 * @adap: CEC adapter
 * @notify: CEC notifier pointer
 * @rx_msg: storage for a received message
 * @cros_ec_cec: pointer to the parent struct
 */
struct cros_ec_cec_port {};

/**
 * struct cros_ec_cec - Driver data for EC CEC
 *
 * @cros_ec: Pointer to EC device
 * @notifier: Notifier info for responding to EC events
 * @write_cmd_version: Highest supported version of EC_CMD_CEC_WRITE_MSG.
 * @num_ports: Number of CEC ports
 * @ports: Array of ports
 */
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)

/*
 * Specify the DRM device name handling the HDMI output and the HDMI connector
 * corresponding to each CEC port. The order of connectors must match the order
 * in the EC (first connector is EC port 0, ...), and the number of connectors
 * must match the number of ports in the EC (which can be queried using the
 * EC_CMD_CEC_PORT_COUNT host command).
 */

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();