Commit 757d250518c4905c5d13c8974446e08a2e3cf244

Authored by Hans Verkuil
Committed by Mauro Carvalho Chehab
1 parent ac272ed7f1

V4L/DVB (3430): Add new internal VIDIOC_INT commands

- Add new internal VIDIOC_INT commands for setting the tuner mode,
for putting a chip into standby mode and to set/get the routing
of inputs/outputs of audio or video of a chip. These new commands
will replace older commands that are no longer up to the task.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>

Showing 1 changed file with 44 additions and 7 deletions Side-by-side Diff

include/media/v4l2-common.h
... ... @@ -115,12 +115,15 @@
115 115 };
116 116  
117 117 /* audio ioctls */
118   -/* v4l device was opened in Radio mode */
  118 +
  119 +/* v4l device was opened in Radio mode, to be replaced by VIDIOC_INT_S_TUNER_MODE */
119 120 #define AUDC_SET_RADIO _IO('d',88)
120   -/* select from TV,radio,extern,MUTE */
  121 +
  122 +/* select from TV,radio,extern,MUTE, to be replaced with VIDIOC_INT_S_AUDIO_ROUTING */
121 123 #define AUDC_SET_INPUT _IOW('d',89,int)
122 124  
123   -/* msp3400 ioctl: will be removed in the near future */
  125 +/* msp3400 ioctl: will be removed in the near future, to be replaced by
  126 + VIDIOC_INT_S_AUDIO_ROUTING. */
124 127 struct msp_matrix {
125 128 int input;
126 129 int output;
127 130  
128 131  
129 132  
... ... @@ -128,13 +131,26 @@
128 131 #define MSP_SET_MATRIX _IOW('m',17,struct msp_matrix)
129 132  
130 133 /* tuner ioctls */
  134 +
131 135 /* Sets tuner type and its I2C addr */
132   -#define TUNER_SET_TYPE_ADDR _IOW('d',90,int)
133   -/* Puts tuner on powersaving state, disabling it, except for i2c */
134   -#define TUNER_SET_STANDBY _IOW('d',91,int)
  136 +#define TUNER_SET_TYPE_ADDR _IOW('d', 90, int)
  137 +
  138 +/* Puts tuner on powersaving state, disabling it, except for i2c. To be replaced
  139 + by VIDIOC_INT_S_STANDBY. */
  140 +#define TUNER_SET_STANDBY _IOW('d', 91, int)
  141 +
135 142 /* Sets tda9887 specific stuff, like port1, port2 and qss */
136   -#define TDA9887_SET_CONFIG _IOW('d',92,int)
  143 +#define TDA9887_SET_CONFIG _IOW('d', 92, int)
137 144  
  145 +/* Switch the tuner to a specific tuner mode. Replacement of AUDC_SET_RADIO */
  146 +#define VIDIOC_INT_S_TUNER_MODE _IOW('d', 93, enum v4l2_tuner_type)
  147 +
  148 +/* Generic standby command. Passing -1 (all bits set to 1) will put the whole
  149 + chip into standby mode, value 0 will make the chip fully active. Specific
  150 + bits can be used by certain chips to enable/disable specific subsystems.
  151 + Replacement of TUNER_SET_STANDBY. */
  152 +#define VIDIOC_INT_S_STANDBY _IOW('d', 94, u32)
  153 +
138 154 /* only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */
139 155 #define VIDIOC_INT_S_REGISTER _IOR ('d', 100, struct v4l2_register)
140 156 #define VIDIOC_INT_G_REGISTER _IOWR('d', 101, struct v4l2_register)
... ... @@ -180,6 +196,27 @@
180 196 Usual values for the frequency are 1024000 and 2048000.
181 197 If the frequency is not supported, then -EINVAL is returned. */
182 198 #define VIDIOC_INT_I2S_CLOCK_FREQ _IOW ('d', 108, u32)
  199 +
  200 +/* Routing definition, device dependent. It specifies which inputs (if any)
  201 + should be routed to which outputs (if any). */
  202 +struct v4l2_routing {
  203 + u32 input;
  204 + u32 output;
  205 +};
  206 +
  207 +/* These internal commands should be used to define the inputs and outputs
  208 + of an audio/video chip. They will replace AUDC_SET_INPUT.
  209 + The v4l2 API commands VIDIOC_S/G_INPUT, VIDIOC_S/G_OUTPUT,
  210 + VIDIOC_S/G_AUDIO and VIDIOC_S/G_AUDOUT are meant to be used by the
  211 + user. Internally these commands should be used to switch inputs/outputs
  212 + because only the driver knows how to map a 'Television' input to the precise
  213 + input/output routing of an A/D converter, or a DSP, or a video digitizer.
  214 + These four commands should only be sent directly to an i2c device, they
  215 + should not be broadcast as the routing is very device specific. */
  216 +#define VIDIOC_INT_S_AUDIO_ROUTING _IOW ('d', 109, struct v4l2_routing)
  217 +#define VIDIOC_INT_G_AUDIO_ROUTING _IOR ('d', 110, struct v4l2_routing *)
  218 +#define VIDIOC_INT_S_VIDEO_ROUTING _IOW ('d', 111, struct v4l2_routing)
  219 +#define VIDIOC_INT_G_VIDEO_ROUTING _IOR ('d', 112, struct v4l2_routing *)
183 220  
184 221 #endif /* V4L2_COMMON_H_ */