Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
media-device.h
Go to the documentation of this file.
1 /*
2  * Media device
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 _MEDIA_DEVICE_H
24 #define _MEDIA_DEVICE_H
25 
26 #include <linux/list.h>
27 #include <linux/mutex.h>
28 #include <linux/spinlock.h>
29 
30 #include <media/media-devnode.h>
31 #include <media/media-entity.h>
32 
33 struct device;
34 
59 struct media_device {
60  /* dev->driver_data points to this struct. */
61  struct device *dev;
63 
64  char model[32];
65  char serial[40];
66  char bus_info[32];
69 
72 
73  /* Protects the entities list */
75  /* Serializes graph operations. */
77 
79  struct media_pad *sink, u32 flags);
80 };
81 
82 /* media_devnode to media_device */
83 #define to_media_device(node) container_of(node, struct media_device, devnode)
84 
86 void media_device_unregister(struct media_device *mdev);
87 
89  struct media_entity *entity);
91 
92 /* Iterate over all entities. */
93 #define media_device_for_each_entity(entity, mdev) \
94  list_for_each_entry(entity, &(mdev)->entities, list)
95 
96 #endif