/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ /* * Multimedia device API * * Copyright (C) 2010 Nokia Corporation * * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com> * Sakari Ailus <sakari.ailus@iki.fi> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details.
*/
/* * Base number ranges for entity functions * * NOTE: Userspace should not rely on these ranges to identify a group * of function types, as newer functions can be added with any name within * the full u32 range. * * Some older functions use the MEDIA_ENT_F_OLD_*_BASE range. Do not * change this, this is for backwards compatibility. When adding new * functions always use MEDIA_ENT_F_BASE.
*/ #define MEDIA_ENT_F_BASE 0x00000000 #define MEDIA_ENT_F_OLD_BASE 0x00010000 #define MEDIA_ENT_F_OLD_SUBDEV_BASE 0x00020000
/* * Initial value to be used when a new entity is created * Drivers should change it to something useful.
*/ #define MEDIA_ENT_F_UNKNOWN MEDIA_ENT_F_BASE
/* * Subdevs are initialized with MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN in order * to preserve backward compatibility. Drivers must change to the proper * subdev type before registering the entity.
*/ #define MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN MEDIA_ENT_F_OLD_SUBDEV_BASE
/* * Digital TV, analog TV, radio and/or software defined radio tuner functions. * * It is a responsibility of the master/bridge drivers to add connectors * and links for MEDIA_ENT_F_TUNER. Please notice that some old tuners * may require the usage of separate I2C chips to decode analog TV signals, * when the master/bridge chipset doesn't have its own TV standard decoder. * On such cases, the IF-PLL staging is mapped via one or two entities: * MEDIA_ENT_F_IF_VID_DECODER and/or MEDIA_ENT_F_IF_AUD_DECODER.
*/ #define MEDIA_ENT_F_TUNER (MEDIA_ENT_F_OLD_SUBDEV_BASE + 5)
/* * Analog TV IF-PLL decoder functions * * It is a responsibility of the master/bridge drivers to create links * for MEDIA_ENT_F_IF_VID_DECODER and MEDIA_ENT_F_IF_AUD_DECODER.
*/ #define MEDIA_ENT_F_IF_VID_DECODER (MEDIA_ENT_F_BASE + 0x02001) #define MEDIA_ENT_F_IF_AUD_DECODER (MEDIA_ENT_F_BASE + 0x02002)
#if !defined(__KERNEL__) /* * TODO: this shouldn't have been added without * actual drivers that use this. When the first real driver * appears that sets this information, special attention * should be given whether this information is 1) enough, and * 2) can deal with udev rules that rename devices. The struct * dev would not be sufficient for this since that does not * contain the subdevice information. In addition, struct dev * can only refer to a single device, and not to multiple (e.g. * pcm and mixer devices).
*/ struct {
__u32 card;
__u32 device;
__u32 subdevice;
} alsa;
/* * DEPRECATED: previous node specifications. Kept just to * avoid breaking compilation. Use media_entity_desc.dev * instead.
*/ struct {
__u32 major;
__u32 minor;
} v4l; struct {
__u32 major;
__u32 minor;
} fb; int dvb; #endif
struct media_links_enum {
__u32 entity; /* Should have enough room for pads elements */ struct media_pad_desc __user *pads; /* Should have enough room for links elements */ struct media_link_desc __user *links;
__u32 reserved[4];
};
/* * Connector functions * * For now these should not be used in userspace, as some definitions may * change. * * It is the responsibility of the entity drivers to add connectors and links.
*/ #define MEDIA_ENT_F_CONN_RF (MEDIA_ENT_F_BASE + 0x30001) #define MEDIA_ENT_F_CONN_SVIDEO (MEDIA_ENT_F_BASE + 0x30002) #define MEDIA_ENT_F_CONN_COMPOSITE (MEDIA_ENT_F_BASE + 0x30003)
#endif
/* * MC next gen API definitions
*/
/* * Appeared in 4.19.0. * * The media_version argument comes from the media_version field in * struct media_device_info.
*/ #define MEDIA_V2_ENTITY_HAS_FLAGS(media_version) \
((media_version) >= ((4U << 16) | (19U << 8) | 0U))
struct media_v2_entity {
__u32 id; char name[64];
__u32 function; /* Main function of the entity */
__u32 flags;
__u32 reserved[5];
} __attribute__ ((packed));
/* Should match the specific fields at media_intf_devnode */ struct media_v2_intf_devnode {
__u32 major;
__u32 minor;
} __attribute__ ((packed));
/* * Appeared in 4.19.0. * * The media_version argument comes from the media_version field in * struct media_device_info.
*/ #define MEDIA_V2_PAD_HAS_INDEX(media_version) \
((media_version) >= ((4U << 16) | (19U << 8) | 0U))
/* * These ioctls are called on the request file descriptor as returned * by MEDIA_IOC_REQUEST_ALLOC.
*/ #define MEDIA_REQUEST_IOC_QUEUE _IO('|', 0x80) #define MEDIA_REQUEST_IOC_REINIT _IO('|', 0x81)
#ifndef __KERNEL__
/* * Legacy symbols used to avoid userspace compilation breakages. * Do not use any of this in new applications! * * Those symbols map the entity function into types and should be * used only on legacy programs for legacy hardware. Don't rely * on those for MEDIA_IOC_G_TOPOLOGY.
*/ #define MEDIA_ENT_TYPE_SHIFT 16 #define MEDIA_ENT_TYPE_MASK 0x00ff0000 #define MEDIA_ENT_SUBTYPE_MASK 0x0000ffff
/* * There is still no full ALSA support in the media controller. These * defines should not have been added and we leave them here only * in case some application tries to use these defines. * * The ALSA defines that are in use have been moved into __KERNEL__ * scope. As support gets added to these interface types, they should * be moved into __KERNEL__ scope with the code that uses them.
*/ #define MEDIA_INTF_T_ALSA_COMPRESS (MEDIA_INTF_T_ALSA_BASE + 3) #define MEDIA_INTF_T_ALSA_RAWMIDI (MEDIA_INTF_T_ALSA_BASE + 4) #define MEDIA_INTF_T_ALSA_HWDEP (MEDIA_INTF_T_ALSA_BASE + 5) #define MEDIA_INTF_T_ALSA_SEQUENCER (MEDIA_INTF_T_ALSA_BASE + 6) #define MEDIA_INTF_T_ALSA_TIMER (MEDIA_INTF_T_ALSA_BASE + 7)
/* Obsolete symbol for media_version, no longer used in the kernel */ #define MEDIA_API_VERSION ((0U << 16) | (1U << 8) | 0U)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.