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

TOMOYO Linux Cross Reference
Linux/sound/usb/media.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ 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.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0+ */
  2 /*
  3  * media.h - Media Controller specific ALSA driver code
  4  *
  5  * Copyright (c) 2019 Shuah Khan <shuah@kernel.org>
  6  *
  7  */
  8 
  9 /*
 10  * This file adds Media Controller support to the ALSA driver
 11  * to use the Media Controller API to share the tuner with DVB
 12  * and V4L2 drivers that control the media device.
 13  *
 14  * The media device is created based on the existing quirks framework.
 15  * Using this approach, the media controller API usage can be added for
 16  * a specific device.
 17  */
 18 #ifndef __MEDIA_H
 19 
 20 #ifdef CONFIG_SND_USB_AUDIO_USE_MEDIA_CONTROLLER
 21 
 22 #include <linux/media.h>
 23 #include <media/media-device.h>
 24 #include <media/media-entity.h>
 25 #include <media/media-dev-allocator.h>
 26 #include <sound/asound.h>
 27 
 28 struct media_ctl {
 29         struct media_device *media_dev;
 30         struct media_entity media_entity;
 31         struct media_intf_devnode *intf_devnode;
 32         struct media_link *intf_link;
 33         struct media_pad media_pad;
 34         struct media_pipeline media_pipe;
 35 };
 36 
 37 /*
 38  * One source pad each for SNDRV_PCM_STREAM_CAPTURE and
 39  * SNDRV_PCM_STREAM_PLAYBACK. One for sink pad to link
 40  * to AUDIO Source
 41  */
 42 #define MEDIA_MIXER_PAD_MAX    (SNDRV_PCM_STREAM_LAST + 2)
 43 
 44 struct media_mixer_ctl {
 45         struct media_device *media_dev;
 46         struct media_entity media_entity;
 47         struct media_intf_devnode *intf_devnode;
 48         struct media_link *intf_link;
 49         struct media_pad media_pad[MEDIA_MIXER_PAD_MAX];
 50         struct media_pipeline media_pipe;
 51 };
 52 
 53 int snd_media_device_create(struct snd_usb_audio *chip,
 54                             struct usb_interface *iface);
 55 void snd_media_device_delete(struct snd_usb_audio *chip);
 56 int snd_media_stream_init(struct snd_usb_substream *subs, struct snd_pcm *pcm,
 57                           int stream);
 58 void snd_media_stream_delete(struct snd_usb_substream *subs);
 59 int snd_media_start_pipeline(struct snd_usb_substream *subs);
 60 void snd_media_stop_pipeline(struct snd_usb_substream *subs);
 61 #else
 62 static inline int snd_media_device_create(struct snd_usb_audio *chip,
 63                                           struct usb_interface *iface)
 64                                                 { return 0; }
 65 static inline void snd_media_device_delete(struct snd_usb_audio *chip) { }
 66 static inline int snd_media_stream_init(struct snd_usb_substream *subs,
 67                                         struct snd_pcm *pcm, int stream)
 68                                                 { return 0; }
 69 static inline void snd_media_stream_delete(struct snd_usb_substream *subs) { }
 70 static inline int snd_media_start_pipeline(struct snd_usb_substream *subs)
 71                                         { return 0; }
 72 static inline void snd_media_stop_pipeline(struct snd_usb_substream *subs) { }
 73 #endif
 74 #endif /* __MEDIA_H */
 75 

~ [ 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