#include <linux/compat.h>
#include <linux/export.h>
#include <linux/idr.h>
#include <linux/ioctl.h>
#include <linux/media.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/pci.h>
#include <linux/usb.h>
#include <linux/version.h>
#include <media/media-device.h>
#include <media/media-devnode.h>
#include <media/media-entity.h>
#include <media/media-request.h>
#ifdef CONFIG_MEDIA_CONTROLLER
#define MEDIA_ENT_SUBTYPE_MASK …
#define MEDIA_ENT_T_DEVNODE_UNKNOWN …
static inline void __user *media_get_uptr(__u64 arg)
{ … }
static int media_device_open(struct file *filp)
{ … }
static int media_device_close(struct file *filp)
{ … }
static long media_device_get_info(struct media_device *dev, void *arg)
{ … }
static struct media_entity *find_entity(struct media_device *mdev, u32 id)
{ … }
static long media_device_enum_entities(struct media_device *mdev, void *arg)
{ … }
static void media_device_kpad_to_upad(const struct media_pad *kpad,
struct media_pad_desc *upad)
{ … }
static long media_device_enum_links(struct media_device *mdev, void *arg)
{ … }
static long media_device_setup_link(struct media_device *mdev, void *arg)
{ … }
static long media_device_get_topology(struct media_device *mdev, void *arg)
{ … }
static long media_device_request_alloc(struct media_device *mdev, void *arg)
{ … }
static long copy_arg_from_user(void *karg, void __user *uarg, unsigned int cmd)
{ … }
static long copy_arg_to_user(void __user *uarg, void *karg, unsigned int cmd)
{ … }
#define MEDIA_IOC_FL_GRAPH_MUTEX …
#define MEDIA_IOC_ARG(__cmd, func, fl, from_user, to_user) …
#define MEDIA_IOC(__cmd, func, fl) …
struct media_ioctl_info { … };
static const struct media_ioctl_info ioctl_info[] = …;
static long media_device_ioctl(struct file *filp, unsigned int cmd,
unsigned long __arg)
{ … }
#ifdef CONFIG_COMPAT
struct media_links_enum32 { … };
static long media_device_enum_links32(struct media_device *mdev,
struct media_links_enum32 __user *ulinks)
{ … }
#define MEDIA_IOC_ENUM_LINKS32 …
static long media_device_compat_ioctl(struct file *filp, unsigned int cmd,
unsigned long arg)
{ … }
#endif
static const struct media_file_operations media_device_fops = …;
static ssize_t model_show(struct device *cd,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(model);
static void media_device_release(struct media_devnode *devnode)
{ … }
static void __media_device_unregister_entity(struct media_entity *entity)
{ … }
int __must_check media_device_register_entity(struct media_device *mdev,
struct media_entity *entity)
{ … }
EXPORT_SYMBOL_GPL(…);
void media_device_unregister_entity(struct media_entity *entity)
{ … }
EXPORT_SYMBOL_GPL(…);
void media_device_init(struct media_device *mdev)
{ … }
EXPORT_SYMBOL_GPL(…);
void media_device_cleanup(struct media_device *mdev)
{ … }
EXPORT_SYMBOL_GPL(…);
int __must_check __media_device_register(struct media_device *mdev,
struct module *owner)
{ … }
EXPORT_SYMBOL_GPL(…);
void media_device_register_entity_notify(struct media_device *mdev,
struct media_entity_notify *nptr)
{ … }
EXPORT_SYMBOL_GPL(…);
static void __media_device_unregister_entity_notify(struct media_device *mdev,
struct media_entity_notify *nptr)
{ … }
void media_device_unregister_entity_notify(struct media_device *mdev,
struct media_entity_notify *nptr)
{ … }
EXPORT_SYMBOL_GPL(…);
void media_device_unregister(struct media_device *mdev)
{ … }
EXPORT_SYMBOL_GPL(…);
#if IS_ENABLED(CONFIG_PCI)
void media_device_pci_init(struct media_device *mdev,
struct pci_dev *pci_dev,
const char *name)
{ … }
EXPORT_SYMBOL_GPL(…);
#endif
#if IS_ENABLED(CONFIG_USB)
void __media_device_usb_init(struct media_device *mdev,
struct usb_device *udev,
const char *board_name,
const char *driver_name)
{ … }
EXPORT_SYMBOL_GPL(…);
#endif
#endif