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

TOMOYO Linux Cross Reference
Linux/include/media/media-dev-allocator.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ 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.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0+ */
  2 /*
  3  * media-dev-allocator.h - Media Controller Device Allocator API
  4  *
  5  * Copyright (c) 2019 Shuah Khan <shuah@kernel.org>
  6  *
  7  * Credits: Suggested by Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  8  */
  9 
 10 /*
 11  * This file adds a global ref-counted Media Controller Device Instance API.
 12  * A system wide global media device list is managed and each media device
 13  * includes a kref count. The last put on the media device releases the media
 14  * device instance.
 15  */
 16 
 17 #ifndef _MEDIA_DEV_ALLOCATOR_H
 18 #define _MEDIA_DEV_ALLOCATOR_H
 19 
 20 struct usb_device;
 21 
 22 #if defined(CONFIG_MEDIA_CONTROLLER) && IS_ENABLED(CONFIG_USB)
 23 /**
 24  * media_device_usb_allocate() - Allocate and return struct &media device
 25  *
 26  * @udev:               struct &usb_device pointer
 27  * @module_name:        should be filled with %KBUILD_MODNAME
 28  * @owner:              struct module pointer %THIS_MODULE for the driver.
 29  *                      %THIS_MODULE is null for a built-in driver.
 30  *                      It is safe even when %THIS_MODULE is null.
 31  *
 32  * This interface should be called to allocate a Media Device when multiple
 33  * drivers share usb_device and the media device. This interface allocates
 34  * &media_device structure and calls media_device_usb_init() to initialize
 35  * it.
 36  *
 37  */
 38 struct media_device *media_device_usb_allocate(struct usb_device *udev,
 39                                                const char *module_name,
 40                                                struct module *owner);
 41 /**
 42  * media_device_delete() - Release media device. Calls kref_put().
 43  *
 44  * @mdev:               struct &media_device pointer
 45  * @module_name:        should be filled with %KBUILD_MODNAME
 46  * @owner:              struct module pointer %THIS_MODULE for the driver.
 47  *                      %THIS_MODULE is null for a built-in driver.
 48  *                      It is safe even when %THIS_MODULE is null.
 49  *
 50  * This interface should be called to put Media Device Instance kref.
 51  */
 52 void media_device_delete(struct media_device *mdev, const char *module_name,
 53                          struct module *owner);
 54 #else
 55 static inline struct media_device *media_device_usb_allocate(
 56                         struct usb_device *udev, const char *module_name,
 57                         struct module *owner)
 58                         { return NULL; }
 59 static inline void media_device_delete(
 60                         struct media_device *mdev, const char *module_name,
 61                         struct module *owner) { }
 62 #endif /* CONFIG_MEDIA_CONTROLLER && CONFIG_USB */
 63 #endif /* _MEDIA_DEV_ALLOCATOR_H */
 64 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php