4 * Copyright (C) 2010 Nokia Corporation
6 * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
7 * Sakari Ailus <sakari.ailus@iki.fi>
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.
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.
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
23 #ifndef _MEDIA_DEVICE_H
24 #define _MEDIA_DEVICE_H
26 #include <linux/device.h>
27 #include <linux/list.h>
29 #include <media/media-devnode.h>
32 * struct media_device - Media 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
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.
45 * The parent @dev is a physical device. It must be set before registering the
48 * @model is a descriptive model name exported through sysfs. It doesn't have to
52 /* dev->driver_data points to this struct. */
54 struct media_devnode devnode;
63 /* media_devnode to media_device */
64 #define to_media_device(node) container_of(node, struct media_device, devnode)
66 int __must_check media_device_register(struct media_device *mdev);
67 void media_device_unregister(struct media_device *mdev);