2 * media.h - Media Controller specific ALSA driver code
4 * Copyright (c) 2016 Shuah Khan <shuahkh@osg.samsung.com>
5 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
7 * This file is released under the GPLv2.
11 * This file adds Media Controller support to ALSA driver
12 * to use the Media Controller API to share tuner with DVB
13 * and V4L2 drivers that control media device. Media device
14 * is created based on existing quirks framework. Using this
15 * approach, the media controller API usage can be added for
20 #ifdef CONFIG_SND_USB_AUDIO_USE_MEDIA_CONTROLLER
22 #include <media/media-device.h>
23 #include <media/media-entity.h>
24 #include <sound/asound.h>
27 struct media_device *media_dev;
28 struct media_entity media_entity;
29 struct media_intf_devnode *intf_devnode;
30 struct media_link *intf_link;
31 struct media_pad media_pad;
32 struct media_pipeline media_pipe;
36 * One source pad each for SNDRV_PCM_STREAM_CAPTURE and
37 * SNDRV_PCM_STREAM_PLAYBACK. One for sink pad to link
40 #define MEDIA_MIXER_PAD_MAX (SNDRV_PCM_STREAM_LAST + 2)
42 struct media_mixer_ctl {
43 struct media_device *media_dev;
44 struct media_entity media_entity;
45 struct media_intf_devnode *intf_devnode;
46 struct media_link *intf_link;
47 struct media_pad media_pad[MEDIA_MIXER_PAD_MAX];
48 struct media_pipeline media_pipe;
51 int media_snd_device_create(struct snd_usb_audio *chip,
52 struct usb_interface *iface);
53 void media_snd_device_delete(struct snd_usb_audio *chip);
54 int media_snd_stream_init(struct snd_usb_substream *subs, struct snd_pcm *pcm,
56 void media_snd_stream_delete(struct snd_usb_substream *subs);
57 int media_snd_start_pipeline(struct snd_usb_substream *subs);
58 void media_snd_stop_pipeline(struct snd_usb_substream *subs);
60 static inline int media_snd_device_create(struct snd_usb_audio *chip,
61 struct usb_interface *iface)
63 static inline void media_snd_device_delete(struct snd_usb_audio *chip) { }
64 static inline int media_snd_stream_init(struct snd_usb_substream *subs,
65 struct snd_pcm *pcm, int stream)
67 static inline void media_snd_stream_delete(struct snd_usb_substream *subs) { }
68 static inline int media_snd_start_pipeline(struct snd_usb_substream *subs)
70 static inline void media_snd_stop_pipeline(struct snd_usb_substream *subs) { }
72 #endif /* __MEDIA_H */