~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/media/media-device.h

Version: ~ [ linux-5.16 ] ~ [ linux-5.15.13 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.90 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.170 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.224 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.261 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.296 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.298 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  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/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 
 35 /**
 36  * struct media_device - Media device
 37  * @dev:        Parent device
 38  * @devnode:    Media device node
 39  * @model:      Device model name
 40  * @serial:     Device serial number (optional)
 41  * @bus_info:   Unique and stable device location identifier
 42  * @hw_revision: Hardware device revision
 43  * @driver_version: Device driver version
 44  * @entity_id:  ID of the next entity to be registered
 45  * @entities:   List of registered entities
 46  * @lock:       Entities list lock
 47  * @graph_mutex: Entities graph operation lock
 48  *
 49  * This structure represents an abstract high-level media device. It allows easy
 50  * access to entities and provides basic media device-level support. The
 51  * structure can be allocated directly or embedded in a larger structure.
 52  *
 53  * The parent @dev is a physical device. It must be set before registering the
 54  * media device.
 55  *
 56  * @model is a descriptive model name exported through sysfs. It doesn't have to
 57  * be unique.
 58  */
 59 struct media_device {
 60         /* dev->driver_data points to this struct. */
 61         struct device *dev;
 62         struct media_devnode devnode;
 63 
 64         char model[32];
 65         char serial[40];
 66         char bus_info[32];
 67         u32 hw_revision;
 68         u32 driver_version;
 69 
 70         u32 entity_id;
 71         struct list_head entities;
 72 
 73         /* Protects the entities list */
 74         spinlock_t lock;
 75         /* Serializes graph operations. */
 76         struct mutex graph_mutex;
 77 
 78         int (*link_notify)(struct media_pad *source,
 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 
 85 int __must_check media_device_register(struct media_device *mdev);
 86 void media_device_unregister(struct media_device *mdev);
 87 
 88 int __must_check media_device_register_entity(struct media_device *mdev,
 89                                               struct media_entity *entity);
 90 void media_device_unregister_entity(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
 97 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp