[media] v4l2-mc.h: prevent it for being included twice
[deliverable/linux.git] / include / media / v4l2-mc.h
CommitLineData
6aad127d
MCC
1/*
2 * v4l2-mc.h - Media Controller V4L2 types and prototypes
3 *
4 * Copyright (C) 2016 Mauro Carvalho Chehab <mchehab@osg.samsung.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
db152276
MCC
17#ifndef _V4L2_MC_H
18#define _V4L2_MC_H
19
54d0dbac
MCC
20#include <media/media-device.h>
21
6aad127d
MCC
22/**
23 * enum tuner_pad_index - tuner pad index for MEDIA_ENT_F_TUNER
24 *
25 * @TUNER_PAD_RF_INPUT: Radiofrequency (RF) sink pad, usually linked to a
26 * RF connector entity.
5c9077ea
MCC
27 * @TUNER_PAD_OUTPUT: Tuner video output source pad. Contains the video
28 * chrominance and luminance or the hole bandwidth
29 * of the signal converted to an Intermediate Frequency
30 * (IF) or to baseband (on zero-IF tuners).
31 * @TUNER_PAD_AUD_OUT: Tuner audio output source pad. Tuners used to decode
32 * analog TV signals have an extra pad for audio output.
33 * Old tuners use an analog stage with a saw filter for
34 * the audio IF frequency. The output of the pad is, in
35 * this case, the audio IF, with should be decoded either
36 * by the bridge chipset (that's the case of cx2388x
37 * chipsets) or may require an external IF sound
38 * processor, like msp34xx. On modern silicon tuners,
39 * the audio IF decoder is usually incorporated at the
40 * tuner. On such case, the output of this pad is an
41 * audio sampled data.
6aad127d
MCC
42 * @TUNER_NUM_PADS: Number of pads of the tuner.
43 */
44enum tuner_pad_index {
45 TUNER_PAD_RF_INPUT,
46 TUNER_PAD_OUTPUT,
5c9077ea 47 TUNER_PAD_AUD_OUT,
6aad127d 48 TUNER_NUM_PADS
5c9077ea 49};
953a457e
MCC
50
51/**
52 * enum if_vid_dec_index - video IF-PLL pad index for
53 * MEDIA_ENT_F_IF_VID_DECODER
54 *
55 * @IF_VID_DEC_PAD_IF_INPUT: video Intermediate Frequency (IF) sink pad
56 * @IF_VID_DEC_PAD_OUT: IF-PLL video output source pad. Contains the
57 * video chrominance and luminance IF signals.
58 * @IF_VID_DEC_PAD_NUM_PADS: Number of pads of the video IF-PLL.
59 */
60enum if_vid_dec_pad_index {
61 IF_VID_DEC_PAD_IF_INPUT,
62 IF_VID_DEC_PAD_OUT,
63 IF_VID_DEC_PAD_NUM_PADS
64};
65
66/**
67 * enum if_aud_dec_index - audio/sound IF-PLL pad index for
68 * MEDIA_ENT_F_IF_AUD_DECODER
69 *
70 * @IF_AUD_DEC_PAD_IF_INPUT: audio Intermediate Frequency (IF) sink pad
71 * @IF_AUD_DEC_PAD_OUT: IF-PLL audio output source pad. Contains the
72 * audio sampled stream data, usually connected
73 * to the bridge bus via an Inter-IC Sound (I2S)
74 * bus.
75 * @IF_AUD_DEC_PAD_NUM_PADS: Number of pads of the audio IF-PLL.
76 */
77enum if_aud_dec_pad_index {
78 IF_AUD_DEC_PAD_IF_INPUT,
79 IF_AUD_DEC_PAD_OUT,
80 IF_AUD_DEC_PAD_NUM_PADS
81};
e4001e95
MCC
82
83/**
84 * enum demod_pad_index - analog TV pad index for MEDIA_ENT_F_ATV_DECODER
85 *
86 * @DEMOD_PAD_IF_INPUT: IF input sink pad.
87 * @DEMOD_PAD_VID_OUT: Video output source pad.
88 * @DEMOD_PAD_VBI_OUT: Vertical Blank Interface (VBI) output source pad.
89 * @DEMOD_NUM_PADS: Maximum number of output pads.
90 */
91enum demod_pad_index {
92 DEMOD_PAD_IF_INPUT,
93 DEMOD_PAD_VID_OUT,
94 DEMOD_PAD_VBI_OUT,
95 DEMOD_NUM_PADS
96};
54d0dbac 97
7047f298
MCC
98
99struct pci_dev; /* We don't need to include pci.h here */
100
101#ifdef CONFIG_MEDIA_CONTROLLER
54d0dbac
MCC
102/**
103 * v4l2_mc_create_media_graph() - create Media Controller links at the graph.
104 *
105 * @mdev: pointer to the &media_device struct.
106 *
107 * Add links between the entities commonly found on PC customer's hardware at
108 * the V4L2 side: camera sensors, audio and video PLL-IF decoders, tuners,
109 * analog TV decoder and I/O entities (video, VBI and Software Defined Radio).
110 * NOTE: webcams are modelled on a very simple way: the sensor is
111 * connected directly to the I/O entity. All dirty details, like
112 * scaler and crop HW are hidden. While such mapping is enough for v4l2
113 * interface centric PC-consumer's hardware, V4L2 subdev centric camera
114 * hardware should not use this routine, as it will not build the right graph.
115 */
54d0dbac 116int v4l2_mc_create_media_graph(struct media_device *mdev);
7047f298
MCC
117
118/**
119 * v4l2_mc_pci_media_device_init() - create and initialize a
120 * struct &media_device from a PCI device.
121 *
122 * @pci_dev: pointer to struct pci_dev
123 * @name: media device name. If %NULL, the routine will use the default
124 * name for the pci device, given by pci_name() macro.
125 */
126struct media_device *v4l2_mc_pci_media_device_init(struct pci_dev *pci_dev,
127 char *name);
128
129
54d0dbac
MCC
130#else
131static inline int v4l2_mc_create_media_graph(struct media_device *mdev)
132{
133 return 0;
134}
7047f298
MCC
135
136struct media_device *v4l2_mc_pci_media_device_init(struct pci_dev *pci_dev,
137 char *name) {
138 return NULL;
139}
140
54d0dbac 141#endif
db152276
MCC
142
143#endif
This page took 0.032031 seconds and 5 git commands to generate.