aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2009-12-09 06:39:58 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-22 03:53:09 -0400
commit176fb0d108f7495ccf9aa127e1342a1a0d87e004 (patch)
treea1b54ad186dde663853d4d2d24f42cd7c0f94bfb /include/media
parentcf4b9211b5680cd9ca004232e517fb7ec5bf5316 (diff)
[media] media: Media device
The media_device structure abstracts functions common to all kind of media devices (v4l2, dvb, alsa, ...). It manages media entities and offers a userspace API to discover and configure the media device internal topology. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/media-device.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/include/media/media-device.h b/include/media/media-device.h
new file mode 100644
index 000000000000..30857f7fc22b
--- /dev/null
+++ b/include/media/media-device.h
@@ -0,0 +1,69 @@
1/*
2 * Media device
3 *
4 * Copyright (C) 2010 Nokia Corporation
5 *
6 * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
7 * Sakari Ailus <sakari.ailus@iki.fi>
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/device.h>
27#include <linux/list.h>
28
29#include <media/media-devnode.h>
30
31/**
32 * struct media_device - Media device
33 * @dev: Parent device
34 * @devnode: Media device node
35 * @model: Device model name
36 * @serial: Device serial number (optional)
37 * @bus_info: Unique and stable device location identifier
38 * @hw_revision: Hardware device revision
39 * @driver_version: Device driver version
40 *
41 * This structure represents an abstract high-level media device. It allows easy
42 * access to entities and provides basic media device-level support. The
43 * structure can be allocated directly or embedded in a larger structure.
44 *
45 * The parent @dev is a physical device. It must be set before registering the
46 * media device.
47 *
48 * @model is a descriptive model name exported through sysfs. It doesn't have to
49 * be unique.
50 */
51struct media_device {
52 /* dev->driver_data points to this struct. */
53 struct device *dev;
54 struct media_devnode devnode;
55
56 char model[32];
57 char serial[40];
58 char bus_info[32];
59 u32 hw_revision;
60 u32 driver_version;
61};
62
63/* media_devnode to media_device */
64#define to_media_device(node) container_of(node, struct media_device, devnode)
65
66int __must_check media_device_register(struct media_device *mdev);
67void media_device_unregister(struct media_device *mdev);
68
69#endif