linux/drivers/media/cec/usb/extron-da-hd-4k-plus/extron-da-hd-4k-plus.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright 2021-2024 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
 */

/*
 * Currently this driver does not fully support the serial port of the
 * Extron, only the USB port is fully supported.
 *
 * Issues specific to using the serial port instead of the USB since the
 * serial port doesn't detect if the device is powered off:
 *
 * - Some periodic ping mechanism is needed to detect when the Extron is
 *   powered off and when it is powered on again.
 * - What to do when it is powered off and the driver is modprobed? Keep
 *   trying to contact the Extron indefinitely?
 */

#include <linux/completion.h>
#include <linux/ctype.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/time.h>

#include "extron-da-hd-4k-plus.h"

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();

static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC();

static unsigned int vendor_id;
module_param(vendor_id, uint, 0444);
MODULE_PARM_DESC();

static char manufacturer_name[4];
module_param_string();
MODULE_PARM_DESC();

static bool hpd_never_low;
module_param(hpd_never_low, bool, 0644);
MODULE_PARM_DESC();

#define EXTRON_TIMEOUT_SECS

static const u8 hdmi_edid[256] =;

static const u8 hdmi_edid_4k_300[256] =;

static const u8 hdmi_edid_4k_600[256] =;

static int extron_send_byte(struct serio *serio, char byte)
{}

static int extron_send_len(struct serio *serio, const char *command,
			   const unsigned char *bin, unsigned int len)
{}

static int extron_send_and_wait_len(struct extron *extron, struct extron_port *port,
				    const char *cmd, const unsigned char *bin,
				    unsigned int len, const char *response)
{}

static int extron_send_and_wait(struct extron *extron, struct extron_port *port,
				const char *cmd, const char *response)
{}

static void extron_parse_edid(struct extron_port *port)
{}

static int get_edid_tag_location(const u8 *edid, unsigned int size,
				 u8 want_tag, u8 ext_tag)
{}

static void extron_edid_crc(u8 *edid)
{}

/*
 * Fill in EDID string. As per VESA EDID-1.3, strings are at most 13 chars
 * long. If shorter then add a 0x0a character after the string and pad the
 * remainder with spaces.
 */
static void extron_set_edid_string(u8 *start, const char *s)
{}

static void extron_update_edid(struct extron_port *port, unsigned int blocks)
{}

static int extron_write_edid(struct extron_port *port,
			     const u8 *edid, unsigned int blocks)
{}

static void update_edid_work(struct work_struct *w)
{}

static void extron_read_edid(struct extron_port *port)
{}

static void extron_irq_work_handler(struct work_struct *work)
{}

static void extron_process_received(struct extron_port *port, const char *data)
{}

static void extron_port_signal_change(struct extron_port *port, bool has_sig)
{}

static void extron_process_signal_change(struct extron *extron, const char *data)
{}

static void extron_port_edid_change(struct extron_port *port, bool has_edid)
{}

static void extron_process_edid_change(struct extron *extron, const char *data)
{}

static void extron_phys_addr_change(struct extron_port *port, u16 pa)
{}

static void extron_process_tx_done(struct extron_port *port, char status)
{}

static void extron_add_edid(struct extron_port *port, const char *hex)
{}

static irqreturn_t extron_interrupt(struct serio *serio, unsigned char data,
				    unsigned int flags)
{}

static int extron_cec_adap_enable(struct cec_adapter *adap, bool enable)
{}

static int extron_cec_adap_log_addr(struct cec_adapter *adap, u8 log_addr)
{}

static int extron_cec_adap_transmit(struct cec_adapter *adap, u8 attempts,
				    u32 signal_free_time, struct cec_msg *msg)
{}

static void extron_cec_adap_unconfigured(struct cec_adapter *adap)
{}

static void extron_cec_configured(struct cec_adapter *adap)
{}

static void extron_cec_adap_nb_transmit_canceled(struct cec_adapter *adap,
						 const struct cec_msg *msg)
{}

static int extron_received(struct cec_adapter *adap, struct cec_msg *msg)
{}

#define log_printf(adap, file, fmt, arg...)

static const char * const pwr_state[] =;

static void extron_adap_status_port(struct extron_port *port, struct seq_file *file)
{}

static void extron_adap_status(struct cec_adapter *adap, struct seq_file *file)
{}

static const struct cec_adap_ops extron_cec_adap_ops =;

static int extron_querycap(struct file *file, void *priv,
			   struct v4l2_capability *cap)
{}

static int extron_enum_input(struct file *file, void *priv, struct v4l2_input *inp)
{}

static int extron_g_input(struct file *file, void *priv, unsigned int *i)
{}

static int extron_s_input(struct file *file, void *priv, unsigned int i)
{}

static int extron_enum_output(struct file *file, void *priv, struct v4l2_output *out)
{}

static int extron_g_output(struct file *file, void *priv, unsigned int *o)
{}

static int extron_s_output(struct file *file, void *priv, unsigned int o)
{}

static int extron_g_edid(struct file *file, void *_fh,
			 struct v4l2_edid *edid)
{}

static int extron_s_edid(struct file *file, void *_fh, struct v4l2_edid *edid)
{}

static int extron_log_status(struct file *file, void *priv)
{}

static const struct v4l2_ioctl_ops extron_ioctl_ops =;

static const struct v4l2_file_operations extron_fops =;

static const struct video_device extron_videodev =;

static void extron_disconnect(struct serio *serio)
{}

static int extron_setup(struct extron *extron)
{}

static int extron_setup_thread(void *_extron)
{}

static int extron_connect(struct serio *serio, struct serio_driver *drv)
{}

static const struct serio_device_id extron_serio_ids[] =;

MODULE_DEVICE_TABLE(serio, extron_serio_ids);

static struct serio_driver extron_drv =;

module_serio_driver();