2017-11-01 21:09:13 +07:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
2010-08-18 21:41:22 +07:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __LINUX_MEDIA_H
|
|
|
|
#define __LINUX_MEDIA_H
|
|
|
|
|
2015-12-12 01:07:57 +07:00
|
|
|
#ifndef __KERNEL__
|
|
|
|
#include <stdint.h>
|
|
|
|
#endif
|
2010-08-18 21:41:22 +07:00
|
|
|
#include <linux/ioctl.h>
|
|
|
|
#include <linux/types.h>
|
|
|
|
|
|
|
|
struct media_device_info {
|
|
|
|
char driver[16];
|
|
|
|
char model[32];
|
|
|
|
char serial[40];
|
|
|
|
char bus_info[32];
|
|
|
|
__u32 media_version;
|
|
|
|
__u32 hw_revision;
|
|
|
|
__u32 driver_version;
|
|
|
|
__u32 reserved[31];
|
|
|
|
};
|
|
|
|
|
2015-08-21 21:40:34 +07:00
|
|
|
/*
|
2015-12-11 02:25:41 +07:00
|
|
|
* Base number ranges for entity functions
|
2015-08-21 21:40:34 +07:00
|
|
|
*
|
2018-02-05 18:19:00 +07:00
|
|
|
* 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.
|
2015-08-21 21:40:34 +07:00
|
|
|
*/
|
2018-02-05 18:19:00 +07:00
|
|
|
#define MEDIA_ENT_F_BASE 0x00000000
|
|
|
|
#define MEDIA_ENT_F_OLD_BASE 0x00010000
|
|
|
|
#define MEDIA_ENT_F_OLD_SUBDEV_BASE 0x00020000
|
2015-08-21 21:40:34 +07:00
|
|
|
|
|
|
|
/*
|
2018-02-05 18:19:00 +07:00
|
|
|
* Initial value to be used when a new entity is created
|
|
|
|
* Drivers should change it to something useful.
|
2015-08-21 21:40:34 +07:00
|
|
|
*/
|
2018-02-05 18:19:00 +07:00
|
|
|
#define MEDIA_ENT_F_UNKNOWN MEDIA_ENT_F_BASE
|
2015-08-21 22:17:40 +07:00
|
|
|
|
2015-05-08 08:12:38 +07:00
|
|
|
/*
|
2018-02-05 18:19:00 +07:00
|
|
|
* 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.
|
2015-12-11 02:25:41 +07:00
|
|
|
*/
|
2018-02-05 18:19:00 +07:00
|
|
|
#define MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN MEDIA_ENT_F_OLD_SUBDEV_BASE
|
2015-12-11 02:25:41 +07:00
|
|
|
|
[media] media.h: add support for IF-PLL video/sound decoder
Very old hardware may have an analog stage tuner. Those hardware
consists of a PLL that converts a RF signal into IF signals.
Depending on the hardware, those video IF signal can be
decoded directly by the bridge chipset. Most Conexant
chips (bt8x8, cx2388x, etc) have internally the decoders
for that. Yet, even on such hardware, the tuner may have
internally its own TV multi-standard decoder like tda9887.
The same happens with the audio IF signal, where some bridges
are capable of receiving it, while others require an external
IF-PLL sound decoder, like msp3400.
Those external IF-PLL audio and video decoders have their own
I2C address, and use different drivers to handle them. So, they're
mapped as different subdevices on Linux.
Thankfully, all modern hardware comes with an IC chip that
has both the RF and the IF stages on it, being capable of
decoding audio and video IF signals internally.
Yet, as we need to support drivers that can work with either
analog or silicon tuners, we need to add two entity types
for those old hardware.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-28 16:28:08 +07:00
|
|
|
/*
|
2018-02-05 18:19:00 +07:00
|
|
|
* DVB entity functions
|
[media] media.h: add support for IF-PLL video/sound decoder
Very old hardware may have an analog stage tuner. Those hardware
consists of a PLL that converts a RF signal into IF signals.
Depending on the hardware, those video IF signal can be
decoded directly by the bridge chipset. Most Conexant
chips (bt8x8, cx2388x, etc) have internally the decoders
for that. Yet, even on such hardware, the tuner may have
internally its own TV multi-standard decoder like tda9887.
The same happens with the audio IF signal, where some bridges
are capable of receiving it, while others require an external
IF-PLL sound decoder, like msp3400.
Those external IF-PLL audio and video decoders have their own
I2C address, and use different drivers to handle them. So, they're
mapped as different subdevices on Linux.
Thankfully, all modern hardware comes with an IC chip that
has both the RF and the IF stages on it, being capable of
decoding audio and video IF signals internally.
Yet, as we need to support drivers that can work with either
analog or silicon tuners, we need to add two entity types
for those old hardware.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-28 16:28:08 +07:00
|
|
|
*/
|
2018-02-05 18:19:00 +07:00
|
|
|
#define MEDIA_ENT_F_DTV_DEMOD (MEDIA_ENT_F_BASE + 0x00001)
|
|
|
|
#define MEDIA_ENT_F_TS_DEMUX (MEDIA_ENT_F_BASE + 0x00002)
|
|
|
|
#define MEDIA_ENT_F_DTV_CA (MEDIA_ENT_F_BASE + 0x00003)
|
|
|
|
#define MEDIA_ENT_F_DTV_NET_DECAP (MEDIA_ENT_F_BASE + 0x00004)
|
2016-02-16 18:20:45 +07:00
|
|
|
|
2016-02-12 06:41:20 +07:00
|
|
|
/*
|
2018-02-05 18:19:00 +07:00
|
|
|
* I/O entity functions
|
2016-02-12 06:41:20 +07:00
|
|
|
*/
|
2018-02-05 18:19:00 +07:00
|
|
|
#define MEDIA_ENT_F_IO_V4L (MEDIA_ENT_F_OLD_BASE + 1)
|
|
|
|
#define MEDIA_ENT_F_IO_DTV (MEDIA_ENT_F_BASE + 0x01001)
|
|
|
|
#define MEDIA_ENT_F_IO_VBI (MEDIA_ENT_F_BASE + 0x01002)
|
|
|
|
#define MEDIA_ENT_F_IO_SWRADIO (MEDIA_ENT_F_BASE + 0x01003)
|
2016-02-12 06:41:20 +07:00
|
|
|
|
2016-02-16 07:00:30 +07:00
|
|
|
/*
|
2018-02-05 18:19:00 +07:00
|
|
|
* Sensor functions
|
2016-02-16 07:00:30 +07:00
|
|
|
*/
|
2018-02-05 18:19:00 +07:00
|
|
|
#define MEDIA_ENT_F_CAM_SENSOR (MEDIA_ENT_F_OLD_SUBDEV_BASE + 1)
|
|
|
|
#define MEDIA_ENT_F_FLASH (MEDIA_ENT_F_OLD_SUBDEV_BASE + 2)
|
|
|
|
#define MEDIA_ENT_F_LENS (MEDIA_ENT_F_OLD_SUBDEV_BASE + 3)
|
2016-02-16 07:00:30 +07:00
|
|
|
|
2015-12-11 02:25:41 +07:00
|
|
|
/*
|
2018-02-05 18:19:00 +07:00
|
|
|
* Digital TV, analog TV, radio and/or software defined radio tuner functions.
|
2015-12-11 02:25:41 +07:00
|
|
|
*
|
[media] media.h: add support for IF-PLL video/sound decoder
Very old hardware may have an analog stage tuner. Those hardware
consists of a PLL that converts a RF signal into IF signals.
Depending on the hardware, those video IF signal can be
decoded directly by the bridge chipset. Most Conexant
chips (bt8x8, cx2388x, etc) have internally the decoders
for that. Yet, even on such hardware, the tuner may have
internally its own TV multi-standard decoder like tda9887.
The same happens with the audio IF signal, where some bridges
are capable of receiving it, while others require an external
IF-PLL sound decoder, like msp3400.
Those external IF-PLL audio and video decoders have their own
I2C address, and use different drivers to handle them. So, they're
mapped as different subdevices on Linux.
Thankfully, all modern hardware comes with an IC chip that
has both the RF and the IF stages on it, being capable of
decoding audio and video IF signals internally.
Yet, as we need to support drivers that can work with either
analog or silicon tuners, we need to add two entity types
for those old hardware.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-28 16:28:08 +07:00
|
|
|
* 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.
|
2015-12-12 03:26:53 +07:00
|
|
|
*/
|
2018-02-05 18:19:00 +07:00
|
|
|
#define MEDIA_ENT_F_TUNER (MEDIA_ENT_F_OLD_SUBDEV_BASE + 5)
|
2015-12-11 02:25:41 +07:00
|
|
|
|
2018-02-05 18:19:00 +07:00
|
|
|
/*
|
|
|
|
* 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)
|
2015-08-31 21:41:29 +07:00
|
|
|
|
2018-02-05 18:19:00 +07:00
|
|
|
/*
|
|
|
|
* Audio entity functions
|
|
|
|
*/
|
|
|
|
#define MEDIA_ENT_F_AUDIO_CAPTURE (MEDIA_ENT_F_BASE + 0x03001)
|
|
|
|
#define MEDIA_ENT_F_AUDIO_PLAYBACK (MEDIA_ENT_F_BASE + 0x03002)
|
|
|
|
#define MEDIA_ENT_F_AUDIO_MIXER (MEDIA_ENT_F_BASE + 0x03003)
|
2015-12-11 02:25:41 +07:00
|
|
|
|
|
|
|
/*
|
2018-02-05 18:19:00 +07:00
|
|
|
* Processing entity functions
|
2015-12-11 02:25:41 +07:00
|
|
|
*/
|
2018-02-05 18:19:00 +07:00
|
|
|
#define MEDIA_ENT_F_PROC_VIDEO_COMPOSER (MEDIA_ENT_F_BASE + 0x4001)
|
|
|
|
#define MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER (MEDIA_ENT_F_BASE + 0x4002)
|
|
|
|
#define MEDIA_ENT_F_PROC_VIDEO_PIXEL_ENC_CONV (MEDIA_ENT_F_BASE + 0x4003)
|
|
|
|
#define MEDIA_ENT_F_PROC_VIDEO_LUT (MEDIA_ENT_F_BASE + 0x4004)
|
|
|
|
#define MEDIA_ENT_F_PROC_VIDEO_SCALER (MEDIA_ENT_F_BASE + 0x4005)
|
|
|
|
#define MEDIA_ENT_F_PROC_VIDEO_STATISTICS (MEDIA_ENT_F_BASE + 0x4006)
|
2018-07-04 21:13:47 +07:00
|
|
|
#define MEDIA_ENT_F_PROC_VIDEO_ENCODER (MEDIA_ENT_F_BASE + 0x4007)
|
|
|
|
#define MEDIA_ENT_F_PROC_VIDEO_DECODER (MEDIA_ENT_F_BASE + 0x4008)
|
2017-07-28 14:25:06 +07:00
|
|
|
|
2018-02-05 18:19:00 +07:00
|
|
|
/*
|
|
|
|
* Switch and bridge entity functions
|
|
|
|
*/
|
|
|
|
#define MEDIA_ENT_F_VID_MUX (MEDIA_ENT_F_BASE + 0x5001)
|
|
|
|
#define MEDIA_ENT_F_VID_IF_BRIDGE (MEDIA_ENT_F_BASE + 0x5002)
|
2015-08-21 21:40:34 +07:00
|
|
|
|
2018-06-28 20:03:42 +07:00
|
|
|
/*
|
|
|
|
* Video decoder/encoder functions
|
|
|
|
*/
|
|
|
|
#define MEDIA_ENT_F_ATV_DECODER (MEDIA_ENT_F_OLD_SUBDEV_BASE + 4)
|
|
|
|
#define MEDIA_ENT_F_DV_DECODER (MEDIA_ENT_F_BASE + 0x6001)
|
|
|
|
#define MEDIA_ENT_F_DV_ENCODER (MEDIA_ENT_F_BASE + 0x6002)
|
|
|
|
|
2015-08-31 21:41:29 +07:00
|
|
|
/* Entity flags */
|
2018-02-05 18:19:00 +07:00
|
|
|
#define MEDIA_ENT_FL_DEFAULT (1 << 0)
|
|
|
|
#define MEDIA_ENT_FL_CONNECTOR (1 << 1)
|
|
|
|
|
|
|
|
/* OR with the entity id value to find the next entity */
|
|
|
|
#define MEDIA_ENT_ID_FLAG_NEXT (1 << 31)
|
2009-12-09 18:40:01 +07:00
|
|
|
|
|
|
|
struct media_entity_desc {
|
|
|
|
__u32 id;
|
|
|
|
char name[32];
|
|
|
|
__u32 type;
|
|
|
|
__u32 revision;
|
|
|
|
__u32 flags;
|
|
|
|
__u32 group_id;
|
|
|
|
__u16 pads;
|
|
|
|
__u16 links;
|
|
|
|
|
|
|
|
__u32 reserved[4];
|
|
|
|
|
|
|
|
union {
|
|
|
|
/* Node specifications */
|
[media] media: Fix DVB devnode representation at media controller
The previous provision for DVB media controller support were to
define an ID (likely meaning the adapter number) for the DVB
devnodes.
This is just plain wrong. Just like V4L, DVB devices (and any other
device node)) are uniquely identified via a (major, minor) tuple.
This is enough to uniquely identify a devnode, no matter what
API it implements.
So, before we go too far, let's mark the old v4l, fb, dvb and alsa
"devnode" info as deprecated, and just call it as "dev".
We can latter add fields specific to each API if needed.
As we don't want to break compilation on already existing apps,
let's just keep the old definitions as-is, adding a note that
those are deprecated at media-entity.h.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-02 22:18:23 +07:00
|
|
|
struct {
|
|
|
|
__u32 major;
|
|
|
|
__u32 minor;
|
|
|
|
} dev;
|
|
|
|
|
2018-02-05 18:19:00 +07:00
|
|
|
#if !defined(__KERNEL__)
|
2015-02-25 22:05:13 +07:00
|
|
|
/*
|
|
|
|
* 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;
|
|
|
|
|
[media] media: Fix DVB devnode representation at media controller
The previous provision for DVB media controller support were to
define an ID (likely meaning the adapter number) for the DVB
devnodes.
This is just plain wrong. Just like V4L, DVB devices (and any other
device node)) are uniquely identified via a (major, minor) tuple.
This is enough to uniquely identify a devnode, no matter what
API it implements.
So, before we go too far, let's mark the old v4l, fb, dvb and alsa
"devnode" info as deprecated, and just call it as "dev".
We can latter add fields specific to each API if needed.
As we don't want to break compilation on already existing apps,
let's just keep the old definitions as-is, adding a note that
those are deprecated at media-entity.h.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-02 22:18:23 +07:00
|
|
|
/*
|
|
|
|
* DEPRECATED: previous node specifications. Kept just to
|
2018-02-05 18:19:00 +07:00
|
|
|
* avoid breaking compilation. Use media_entity_desc.dev
|
|
|
|
* instead.
|
[media] media: Fix DVB devnode representation at media controller
The previous provision for DVB media controller support were to
define an ID (likely meaning the adapter number) for the DVB
devnodes.
This is just plain wrong. Just like V4L, DVB devices (and any other
device node)) are uniquely identified via a (major, minor) tuple.
This is enough to uniquely identify a devnode, no matter what
API it implements.
So, before we go too far, let's mark the old v4l, fb, dvb and alsa
"devnode" info as deprecated, and just call it as "dev".
We can latter add fields specific to each API if needed.
As we don't want to break compilation on already existing apps,
let's just keep the old definitions as-is, adding a note that
those are deprecated at media-entity.h.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-02 22:18:23 +07:00
|
|
|
*/
|
2009-12-09 18:40:01 +07:00
|
|
|
struct {
|
|
|
|
__u32 major;
|
|
|
|
__u32 minor;
|
|
|
|
} v4l;
|
|
|
|
struct {
|
|
|
|
__u32 major;
|
|
|
|
__u32 minor;
|
|
|
|
} fb;
|
|
|
|
int dvb;
|
[media] media: Fix DVB devnode representation at media controller
The previous provision for DVB media controller support were to
define an ID (likely meaning the adapter number) for the DVB
devnodes.
This is just plain wrong. Just like V4L, DVB devices (and any other
device node)) are uniquely identified via a (major, minor) tuple.
This is enough to uniquely identify a devnode, no matter what
API it implements.
So, before we go too far, let's mark the old v4l, fb, dvb and alsa
"devnode" info as deprecated, and just call it as "dev".
We can latter add fields specific to each API if needed.
As we don't want to break compilation on already existing apps,
let's just keep the old definitions as-is, adding a note that
those are deprecated at media-entity.h.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-02 22:18:23 +07:00
|
|
|
#endif
|
2009-12-09 18:40:01 +07:00
|
|
|
|
|
|
|
/* Sub-device specifications */
|
|
|
|
/* Nothing needed yet */
|
|
|
|
__u8 raw[184];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-02-05 18:19:00 +07:00
|
|
|
#define MEDIA_PAD_FL_SINK (1 << 0)
|
|
|
|
#define MEDIA_PAD_FL_SOURCE (1 << 1)
|
|
|
|
#define MEDIA_PAD_FL_MUST_CONNECT (1 << 2)
|
2009-12-09 18:40:01 +07:00
|
|
|
|
|
|
|
struct media_pad_desc {
|
|
|
|
__u32 entity; /* entity ID */
|
|
|
|
__u16 index; /* pad index */
|
|
|
|
__u32 flags; /* pad flags */
|
|
|
|
__u32 reserved[2];
|
|
|
|
};
|
|
|
|
|
2018-02-05 18:19:00 +07:00
|
|
|
#define MEDIA_LNK_FL_ENABLED (1 << 0)
|
|
|
|
#define MEDIA_LNK_FL_IMMUTABLE (1 << 1)
|
|
|
|
#define MEDIA_LNK_FL_DYNAMIC (1 << 2)
|
2009-12-09 18:40:01 +07:00
|
|
|
|
2018-02-05 18:19:00 +07:00
|
|
|
#define MEDIA_LNK_FL_LINK_TYPE (0xf << 28)
|
|
|
|
# define MEDIA_LNK_FL_DATA_LINK (0 << 28)
|
|
|
|
# define MEDIA_LNK_FL_INTERFACE_LINK (1 << 28)
|
2015-08-23 18:28:21 +07:00
|
|
|
|
2009-12-09 18:40:01 +07:00
|
|
|
struct media_link_desc {
|
|
|
|
struct media_pad_desc source;
|
|
|
|
struct media_pad_desc sink;
|
|
|
|
__u32 flags;
|
|
|
|
__u32 reserved[2];
|
|
|
|
};
|
|
|
|
|
|
|
|
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];
|
|
|
|
};
|
|
|
|
|
2015-08-20 17:43:07 +07:00
|
|
|
/* Interface type ranges */
|
|
|
|
|
2018-02-05 18:19:00 +07:00
|
|
|
#define MEDIA_INTF_T_DVB_BASE 0x00000100
|
|
|
|
#define MEDIA_INTF_T_V4L_BASE 0x00000200
|
2015-08-20 17:43:07 +07:00
|
|
|
|
|
|
|
/* Interface types */
|
|
|
|
|
2018-02-05 18:19:00 +07:00
|
|
|
#define MEDIA_INTF_T_DVB_FE (MEDIA_INTF_T_DVB_BASE)
|
|
|
|
#define MEDIA_INTF_T_DVB_DEMUX (MEDIA_INTF_T_DVB_BASE + 1)
|
|
|
|
#define MEDIA_INTF_T_DVB_DVR (MEDIA_INTF_T_DVB_BASE + 2)
|
|
|
|
#define MEDIA_INTF_T_DVB_CA (MEDIA_INTF_T_DVB_BASE + 3)
|
|
|
|
#define MEDIA_INTF_T_DVB_NET (MEDIA_INTF_T_DVB_BASE + 4)
|
|
|
|
|
|
|
|
#define MEDIA_INTF_T_V4L_VIDEO (MEDIA_INTF_T_V4L_BASE)
|
|
|
|
#define MEDIA_INTF_T_V4L_VBI (MEDIA_INTF_T_V4L_BASE + 1)
|
|
|
|
#define MEDIA_INTF_T_V4L_RADIO (MEDIA_INTF_T_V4L_BASE + 2)
|
|
|
|
#define MEDIA_INTF_T_V4L_SUBDEV (MEDIA_INTF_T_V4L_BASE + 3)
|
|
|
|
#define MEDIA_INTF_T_V4L_SWRADIO (MEDIA_INTF_T_V4L_BASE + 4)
|
|
|
|
#define MEDIA_INTF_T_V4L_TOUCH (MEDIA_INTF_T_V4L_BASE + 5)
|
|
|
|
|
|
|
|
#if defined(__KERNEL__)
|
2016-02-12 06:41:18 +07:00
|
|
|
|
2015-08-23 18:28:21 +07:00
|
|
|
/*
|
2018-02-05 18:19:00 +07:00
|
|
|
* Connector functions
|
2015-08-23 18:28:21 +07:00
|
|
|
*
|
2018-02-05 18:19:00 +07:00
|
|
|
* For now these should not be used in userspace, as some definitions may
|
|
|
|
* change.
|
2015-08-23 18:28:21 +07:00
|
|
|
*
|
2018-02-05 18:19:00 +07:00
|
|
|
* It is the responsibility of the entity drivers to add connectors and links.
|
2015-08-23 18:28:21 +07:00
|
|
|
*/
|
2018-02-05 18:19:00 +07:00
|
|
|
#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)
|
2015-08-23 18:28:21 +07:00
|
|
|
|
2018-02-05 18:19:00 +07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* MC next gen API definitions
|
|
|
|
*/
|
2016-01-25 16:29:13 +07:00
|
|
|
|
2018-02-28 17:41:11 +07:00
|
|
|
/*
|
|
|
|
* 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) >= ((4 << 16) | (19 << 8) | 0))
|
|
|
|
|
2015-08-23 18:28:21 +07:00
|
|
|
struct media_v2_entity {
|
|
|
|
__u32 id;
|
2018-02-05 18:19:00 +07:00
|
|
|
char name[64];
|
2015-09-06 20:59:08 +07:00
|
|
|
__u32 function; /* Main function of the entity */
|
2018-02-28 17:41:11 +07:00
|
|
|
__u32 flags;
|
|
|
|
__u32 reserved[5];
|
2016-03-04 00:20:14 +07:00
|
|
|
} __attribute__ ((packed));
|
2015-08-23 18:28:21 +07:00
|
|
|
|
|
|
|
/* Should match the specific fields at media_intf_devnode */
|
|
|
|
struct media_v2_intf_devnode {
|
|
|
|
__u32 major;
|
|
|
|
__u32 minor;
|
2016-03-04 00:20:14 +07:00
|
|
|
} __attribute__ ((packed));
|
2015-08-23 18:28:21 +07:00
|
|
|
|
|
|
|
struct media_v2_interface {
|
|
|
|
__u32 id;
|
|
|
|
__u32 intf_type;
|
|
|
|
__u32 flags;
|
|
|
|
__u32 reserved[9];
|
|
|
|
|
|
|
|
union {
|
|
|
|
struct media_v2_intf_devnode devnode;
|
|
|
|
__u32 raw[16];
|
|
|
|
};
|
2016-03-04 00:20:14 +07:00
|
|
|
} __attribute__ ((packed));
|
2015-08-23 18:28:21 +07:00
|
|
|
|
2018-02-27 19:24:09 +07:00
|
|
|
/*
|
|
|
|
* 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) >= ((4 << 16) | (19 << 8) | 0))
|
|
|
|
|
2015-08-23 18:28:21 +07:00
|
|
|
struct media_v2_pad {
|
|
|
|
__u32 id;
|
|
|
|
__u32 entity_id;
|
|
|
|
__u32 flags;
|
2018-02-27 19:24:09 +07:00
|
|
|
__u32 index;
|
|
|
|
__u32 reserved[4];
|
2016-03-04 00:20:14 +07:00
|
|
|
} __attribute__ ((packed));
|
2015-08-23 18:28:21 +07:00
|
|
|
|
|
|
|
struct media_v2_link {
|
|
|
|
__u32 id;
|
|
|
|
__u32 source_id;
|
|
|
|
__u32 sink_id;
|
|
|
|
__u32 flags;
|
2016-03-04 00:20:14 +07:00
|
|
|
__u32 reserved[6];
|
|
|
|
} __attribute__ ((packed));
|
2015-08-23 18:28:21 +07:00
|
|
|
|
|
|
|
struct media_v2_topology {
|
2015-12-12 01:07:57 +07:00
|
|
|
__u64 topology_version;
|
2015-08-23 18:28:21 +07:00
|
|
|
|
2015-12-17 18:07:38 +07:00
|
|
|
__u32 num_entities;
|
|
|
|
__u32 reserved1;
|
2015-12-12 01:07:57 +07:00
|
|
|
__u64 ptr_entities;
|
2015-08-23 18:28:21 +07:00
|
|
|
|
2015-12-17 18:07:38 +07:00
|
|
|
__u32 num_interfaces;
|
|
|
|
__u32 reserved2;
|
2015-12-12 01:07:57 +07:00
|
|
|
__u64 ptr_interfaces;
|
2015-08-23 18:28:21 +07:00
|
|
|
|
2015-12-17 18:07:38 +07:00
|
|
|
__u32 num_pads;
|
|
|
|
__u32 reserved3;
|
2015-12-12 01:07:57 +07:00
|
|
|
__u64 ptr_pads;
|
2015-08-23 18:28:21 +07:00
|
|
|
|
2015-12-17 18:07:38 +07:00
|
|
|
__u32 num_links;
|
|
|
|
__u32 reserved4;
|
2015-12-12 01:07:57 +07:00
|
|
|
__u64 ptr_links;
|
2016-03-04 00:20:14 +07:00
|
|
|
} __attribute__ ((packed));
|
2015-08-23 18:28:21 +07:00
|
|
|
|
|
|
|
/* ioctls */
|
2015-08-20 17:43:07 +07:00
|
|
|
|
2018-02-05 18:19:00 +07:00
|
|
|
#define MEDIA_IOC_DEVICE_INFO _IOWR('|', 0x00, struct media_device_info)
|
|
|
|
#define MEDIA_IOC_ENUM_ENTITIES _IOWR('|', 0x01, struct media_entity_desc)
|
|
|
|
#define MEDIA_IOC_ENUM_LINKS _IOWR('|', 0x02, struct media_links_enum)
|
|
|
|
#define MEDIA_IOC_SETUP_LINK _IOWR('|', 0x03, struct media_link_desc)
|
|
|
|
#define MEDIA_IOC_G_TOPOLOGY _IOWR('|', 0x04, struct media_v2_topology)
|
|
|
|
|
2018-06-15 20:19:46 +07:00
|
|
|
#ifndef __KERNEL__
|
2018-02-05 18:19:00 +07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
|
|
|
|
#define MEDIA_ENT_T_DEVNODE_UNKNOWN (MEDIA_ENT_F_OLD_BASE | \
|
|
|
|
MEDIA_ENT_SUBTYPE_MASK)
|
|
|
|
|
|
|
|
#define MEDIA_ENT_T_DEVNODE MEDIA_ENT_F_OLD_BASE
|
|
|
|
#define MEDIA_ENT_T_DEVNODE_V4L MEDIA_ENT_F_IO_V4L
|
|
|
|
#define MEDIA_ENT_T_DEVNODE_FB (MEDIA_ENT_F_OLD_BASE + 2)
|
|
|
|
#define MEDIA_ENT_T_DEVNODE_ALSA (MEDIA_ENT_F_OLD_BASE + 3)
|
|
|
|
#define MEDIA_ENT_T_DEVNODE_DVB (MEDIA_ENT_F_OLD_BASE + 4)
|
|
|
|
|
|
|
|
#define MEDIA_ENT_T_UNKNOWN MEDIA_ENT_F_UNKNOWN
|
|
|
|
#define MEDIA_ENT_T_V4L2_VIDEO MEDIA_ENT_F_IO_V4L
|
|
|
|
#define MEDIA_ENT_T_V4L2_SUBDEV MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN
|
|
|
|
#define MEDIA_ENT_T_V4L2_SUBDEV_SENSOR MEDIA_ENT_F_CAM_SENSOR
|
|
|
|
#define MEDIA_ENT_T_V4L2_SUBDEV_FLASH MEDIA_ENT_F_FLASH
|
|
|
|
#define MEDIA_ENT_T_V4L2_SUBDEV_LENS MEDIA_ENT_F_LENS
|
|
|
|
#define MEDIA_ENT_T_V4L2_SUBDEV_DECODER MEDIA_ENT_F_ATV_DECODER
|
|
|
|
#define MEDIA_ENT_T_V4L2_SUBDEV_TUNER MEDIA_ENT_F_TUNER
|
|
|
|
|
2018-06-28 19:56:02 +07:00
|
|
|
#define MEDIA_ENT_F_DTV_DECODER MEDIA_ENT_F_DV_DECODER
|
|
|
|
|
2018-02-05 18:19:00 +07:00
|
|
|
/*
|
|
|
|
* There is still no 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.
|
|
|
|
*/
|
|
|
|
#define MEDIA_INTF_T_ALSA_BASE 0x00000300
|
|
|
|
#define MEDIA_INTF_T_ALSA_PCM_CAPTURE (MEDIA_INTF_T_ALSA_BASE)
|
|
|
|
#define MEDIA_INTF_T_ALSA_PCM_PLAYBACK (MEDIA_INTF_T_ALSA_BASE + 1)
|
|
|
|
#define MEDIA_INTF_T_ALSA_CONTROL (MEDIA_INTF_T_ALSA_BASE + 2)
|
|
|
|
#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 */
|
2018-07-25 19:51:39 +07:00
|
|
|
#define MEDIA_API_VERSION ((0 << 16) | (1 << 8) | 0)
|
2018-02-05 18:19:00 +07:00
|
|
|
|
|
|
|
#endif
|
2010-08-18 21:41:22 +07:00
|
|
|
|
|
|
|
#endif /* __LINUX_MEDIA_H */
|