linux/drivers/media/cec/core/cec-core.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * cec-core.c - HDMI Consumer Electronics Control framework - Core
 *
 * Copyright 2016 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
 */

#include <linux/errno.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/kmod.h>
#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/string.h>
#include <linux/types.h>

#include "cec-priv.h"

#define CEC_NUM_DEVICES
#define CEC_NAME

/*
 * 400 ms is the time it takes for one 16 byte message to be
 * transferred and 5 is the maximum number of retries. Add
 * another 100 ms as a margin. So if the transmit doesn't
 * finish before that time something is really wrong and we
 * have to time out.
 *
 * This is a sign that something it really wrong and a warning
 * will be issued.
 */
#define CEC_XFER_TIMEOUT_MS

int cec_debug;
module_param_named(debug, cec_debug, int, 0644);
MODULE_PARM_DESC();

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

static dev_t cec_dev_t;

/* Active devices */
static DEFINE_MUTEX(cec_devnode_lock);
static DECLARE_BITMAP(cec_devnode_nums, CEC_NUM_DEVICES);

static struct dentry *top_cec_dir;

/* dev to cec_devnode */
#define to_cec_devnode(cd)

int cec_get_device(struct cec_devnode *devnode)
{}

void cec_put_device(struct cec_devnode *devnode)
{}

/* Called when the last user of the cec device exits. */
static void cec_devnode_release(struct device *cd)
{}

static const struct bus_type cec_bus_type =;

/*
 * Register a cec device node
 *
 * The registration code assigns minor numbers and registers the new device node
 * with the kernel. An error is returned if no free minor number can be found,
 * or if the registration of the device node fails.
 *
 * Zero is returned on success.
 *
 * Note that if the cec_devnode_register call fails, the release() callback of
 * the cec_devnode structure is *not* called, so the caller is responsible for
 * freeing any data.
 */
static int __must_check cec_devnode_register(struct cec_devnode *devnode,
					     struct module *owner)
{}

/*
 * Unregister a cec device node
 *
 * This unregisters the passed device. Future open calls will be met with
 * errors.
 *
 * This function can safely be called if the device node has never been
 * registered or has already been unregistered.
 */
static void cec_devnode_unregister(struct cec_adapter *adap)
{}

#ifdef CONFIG_DEBUG_FS
static ssize_t cec_error_inj_write(struct file *file,
	const char __user *ubuf, size_t count, loff_t *ppos)
{}

static int cec_error_inj_show(struct seq_file *sf, void *unused)
{}

static int cec_error_inj_open(struct inode *inode, struct file *file)
{}

static const struct file_operations cec_error_inj_fops =;
#endif

struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops,
					 void *priv, const char *name, u32 caps,
					 u8 available_las)
{}
EXPORT_SYMBOL_GPL();

int cec_register_adapter(struct cec_adapter *adap,
			 struct device *parent)
{}
EXPORT_SYMBOL_GPL();

void cec_unregister_adapter(struct cec_adapter *adap)
{}
EXPORT_SYMBOL_GPL();

void cec_delete_adapter(struct cec_adapter *adap)
{}
EXPORT_SYMBOL_GPL();

/*
 *	Initialise cec for linux
 */
static int __init cec_devnode_init(void)
{}

static void __exit cec_devnode_exit(void)
{}

subsys_initcall(cec_devnode_init);
module_exit()

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