Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
media.h
Go to the documentation of this file.
1 /*
2  * Multimedia device API
3  *
4  * Copyright (C) 2010 Nokia Corporation
5  *
6  * Contacts: Laurent Pinchart <[email protected]>
7  * Sakari Ailus <[email protected]>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License version 2 as
11  * published by the Free Software Foundation.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21  */
22 
23 #ifndef __LINUX_MEDIA_H
24 #define __LINUX_MEDIA_H
25 
26 #include <linux/ioctl.h>
27 #include <linux/types.h>
28 #include <linux/version.h>
29 
30 #define MEDIA_API_VERSION KERNEL_VERSION(0, 1, 0)
31 
33  char driver[16];
34  char model[32];
35  char serial[40];
36  char bus_info[32];
41 };
42 
43 #define MEDIA_ENT_ID_FLAG_NEXT (1 << 31)
44 
45 #define MEDIA_ENT_TYPE_SHIFT 16
46 #define MEDIA_ENT_TYPE_MASK 0x00ff0000
47 #define MEDIA_ENT_SUBTYPE_MASK 0x0000ffff
48 
49 #define MEDIA_ENT_T_DEVNODE (1 << MEDIA_ENT_TYPE_SHIFT)
50 #define MEDIA_ENT_T_DEVNODE_V4L (MEDIA_ENT_T_DEVNODE + 1)
51 #define MEDIA_ENT_T_DEVNODE_FB (MEDIA_ENT_T_DEVNODE + 2)
52 #define MEDIA_ENT_T_DEVNODE_ALSA (MEDIA_ENT_T_DEVNODE + 3)
53 #define MEDIA_ENT_T_DEVNODE_DVB (MEDIA_ENT_T_DEVNODE + 4)
54 
55 #define MEDIA_ENT_T_V4L2_SUBDEV (2 << MEDIA_ENT_TYPE_SHIFT)
56 #define MEDIA_ENT_T_V4L2_SUBDEV_SENSOR (MEDIA_ENT_T_V4L2_SUBDEV + 1)
57 #define MEDIA_ENT_T_V4L2_SUBDEV_FLASH (MEDIA_ENT_T_V4L2_SUBDEV + 2)
58 #define MEDIA_ENT_T_V4L2_SUBDEV_LENS (MEDIA_ENT_T_V4L2_SUBDEV + 3)
59 
60 #define MEDIA_ENT_FL_DEFAULT (1 << 0)
61 
64  char name[32];
71 
73 
74  union {
75  /* Node specifications */
76  struct {
79  } v4l;
80  struct {
81  __u32 major;
82  __u32 minor;
83  } fb;
84  struct {
88  } alsa;
89  int dvb;
90 
91  /* Sub-device specifications */
92  /* Nothing needed yet */
93  __u8 raw[184];
94  };
95 };
96 
97 #define MEDIA_PAD_FL_SINK (1 << 0)
98 #define MEDIA_PAD_FL_SOURCE (1 << 1)
99 
101  __u32 entity; /* entity ID */
102  __u16 index; /* pad index */
103  __u32 flags; /* pad flags */
105 };
106 
107 #define MEDIA_LNK_FL_ENABLED (1 << 0)
108 #define MEDIA_LNK_FL_IMMUTABLE (1 << 1)
109 #define MEDIA_LNK_FL_DYNAMIC (1 << 2)
110 
116 };
117 
120  /* Should have enough room for pads elements */
122  /* Should have enough room for links elements */
125 };
126 
127 #define MEDIA_IOC_DEVICE_INFO _IOWR('|', 0x00, struct media_device_info)
128 #define MEDIA_IOC_ENUM_ENTITIES _IOWR('|', 0x01, struct media_entity_desc)
129 #define MEDIA_IOC_ENUM_LINKS _IOWR('|', 0x02, struct media_links_enum)
130 #define MEDIA_IOC_SETUP_LINK _IOWR('|', 0x03, struct media_link_desc)
131 
132 #endif /* __LINUX_MEDIA_H */