2010-08-18 22:41:22 +08: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.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __LINUX_MEDIA_H
|
|
|
|
#define __LINUX_MEDIA_H
|
|
|
|
|
|
|
|
#include <linux/ioctl.h>
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/version.h>
|
|
|
|
|
|
|
|
#define MEDIA_API_VERSION KERNEL_VERSION(0, 1, 0)
|
|
|
|
|
|
|
|
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];
|
|
|
|
};
|
|
|
|
|
2009-12-09 19:40:01 +08:00
|
|
|
#define MEDIA_ENT_ID_FLAG_NEXT (1 << 31)
|
|
|
|
|
|
|
|
#define MEDIA_ENT_TYPE_SHIFT 16
|
|
|
|
#define MEDIA_ENT_TYPE_MASK 0x00ff0000
|
|
|
|
#define MEDIA_ENT_SUBTYPE_MASK 0x0000ffff
|
|
|
|
|
|
|
|
#define MEDIA_ENT_T_DEVNODE (1 << MEDIA_ENT_TYPE_SHIFT)
|
|
|
|
#define MEDIA_ENT_T_DEVNODE_V4L (MEDIA_ENT_T_DEVNODE + 1)
|
|
|
|
#define MEDIA_ENT_T_DEVNODE_FB (MEDIA_ENT_T_DEVNODE + 2)
|
|
|
|
#define MEDIA_ENT_T_DEVNODE_ALSA (MEDIA_ENT_T_DEVNODE + 3)
|
2015-01-03 22:09:39 +08:00
|
|
|
#define MEDIA_ENT_T_DEVNODE_DVB_FE (MEDIA_ENT_T_DEVNODE + 4)
|
|
|
|
#define MEDIA_ENT_T_DEVNODE_DVB_DEMUX (MEDIA_ENT_T_DEVNODE + 5)
|
|
|
|
#define MEDIA_ENT_T_DEVNODE_DVB_DVR (MEDIA_ENT_T_DEVNODE + 6)
|
|
|
|
#define MEDIA_ENT_T_DEVNODE_DVB_CA (MEDIA_ENT_T_DEVNODE + 7)
|
|
|
|
#define MEDIA_ENT_T_DEVNODE_DVB_NET (MEDIA_ENT_T_DEVNODE + 8)
|
|
|
|
|
|
|
|
/* Legacy symbol. Use it to avoid userspace compilation breakages */
|
|
|
|
#define MEDIA_ENT_T_DEVNODE_DVB MEDIA_ENT_T_DEVNODE_DVB_FE
|
2009-12-09 19:40:01 +08:00
|
|
|
|
|
|
|
#define MEDIA_ENT_T_V4L2_SUBDEV (2 << MEDIA_ENT_TYPE_SHIFT)
|
|
|
|
#define MEDIA_ENT_T_V4L2_SUBDEV_SENSOR (MEDIA_ENT_T_V4L2_SUBDEV + 1)
|
|
|
|
#define MEDIA_ENT_T_V4L2_SUBDEV_FLASH (MEDIA_ENT_T_V4L2_SUBDEV + 2)
|
|
|
|
#define MEDIA_ENT_T_V4L2_SUBDEV_LENS (MEDIA_ENT_T_V4L2_SUBDEV + 3)
|
2013-02-08 00:48:51 +08:00
|
|
|
/* A converter of analogue video to its digital representation. */
|
|
|
|
#define MEDIA_ENT_T_V4L2_SUBDEV_DECODER (MEDIA_ENT_T_V4L2_SUBDEV + 4)
|
2009-12-09 19:40:01 +08:00
|
|
|
|
2015-01-26 19:53:18 +08:00
|
|
|
#define MEDIA_ENT_T_V4L2_SUBDEV_TUNER (MEDIA_ENT_T_V4L2_SUBDEV + 5)
|
|
|
|
|
2009-12-09 19:40:01 +08:00
|
|
|
#define MEDIA_ENT_FL_DEFAULT (1 << 0)
|
|
|
|
|
|
|
|
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 23:18:23 +08:00
|
|
|
struct {
|
|
|
|
__u32 major;
|
|
|
|
__u32 minor;
|
|
|
|
} dev;
|
|
|
|
|
|
|
|
#if 1
|
|
|
|
/*
|
|
|
|
* DEPRECATED: previous node specifications. Kept just to
|
|
|
|
* avoid breaking compilation, but media_entity_desc.dev
|
|
|
|
* should be used instead. In particular, alsa and dvb
|
|
|
|
* fields below are wrong: for all devnodes, there should
|
|
|
|
* be just major/minor inside the struct, as this is enough
|
|
|
|
* to represent any devnode, no matter what type.
|
|
|
|
*/
|
2009-12-09 19:40:01 +08:00
|
|
|
struct {
|
|
|
|
__u32 major;
|
|
|
|
__u32 minor;
|
|
|
|
} v4l;
|
|
|
|
struct {
|
|
|
|
__u32 major;
|
|
|
|
__u32 minor;
|
|
|
|
} fb;
|
|
|
|
struct {
|
|
|
|
__u32 card;
|
|
|
|
__u32 device;
|
|
|
|
__u32 subdevice;
|
|
|
|
} alsa;
|
|
|
|
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 23:18:23 +08:00
|
|
|
#endif
|
2009-12-09 19:40:01 +08:00
|
|
|
|
|
|
|
/* Sub-device specifications */
|
|
|
|
/* Nothing needed yet */
|
|
|
|
__u8 raw[184];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
#define MEDIA_PAD_FL_SINK (1 << 0)
|
|
|
|
#define MEDIA_PAD_FL_SOURCE (1 << 1)
|
2013-10-13 18:58:43 +08:00
|
|
|
#define MEDIA_PAD_FL_MUST_CONNECT (1 << 2)
|
2009-12-09 19:40:01 +08:00
|
|
|
|
|
|
|
struct media_pad_desc {
|
|
|
|
__u32 entity; /* entity ID */
|
|
|
|
__u16 index; /* pad index */
|
|
|
|
__u32 flags; /* pad flags */
|
|
|
|
__u32 reserved[2];
|
|
|
|
};
|
|
|
|
|
|
|
|
#define MEDIA_LNK_FL_ENABLED (1 << 0)
|
|
|
|
#define MEDIA_LNK_FL_IMMUTABLE (1 << 1)
|
2010-08-25 20:00:41 +08:00
|
|
|
#define MEDIA_LNK_FL_DYNAMIC (1 << 2)
|
2009-12-09 19:40:01 +08: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];
|
|
|
|
};
|
|
|
|
|
2011-03-06 04:14:33 +08: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)
|
2010-08-18 22:41:22 +08:00
|
|
|
|
|
|
|
#endif /* __LINUX_MEDIA_H */
|