aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /include/media
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'include/media')
-rw-r--r--include/media/cx25840.h1
-rw-r--r--include/media/davinci/isif.h531
-rw-r--r--include/media/davinci/vpfe_capture.h4
-rw-r--r--include/media/davinci/vpss.h41
-rw-r--r--include/media/ir-common.h44
-rw-r--r--include/media/ir-core.h74
-rw-r--r--include/media/ir-kbd-i2c.h2
-rw-r--r--include/media/mt9t112.h30
-rw-r--r--include/media/ov772x.h14
-rw-r--r--include/media/rj54n1cb0c.h19
-rw-r--r--include/media/saa7146_vv.h4
-rw-r--r--include/media/sh_mobile_ceu.h2
-rw-r--r--include/media/soc_camera.h32
-rw-r--r--include/media/soc_camera_platform.h3
-rw-r--r--include/media/soc_mediabus.h65
-rw-r--r--include/media/timb_radio.h36
-rw-r--r--include/media/tuner.h1
-rw-r--r--include/media/tvp7002.h56
-rw-r--r--include/media/tw9910.h5
-rw-r--r--include/media/v4l2-chip-ident.h32
-rw-r--r--include/media/v4l2-common.h2
-rw-r--r--include/media/v4l2-dev.h23
-rw-r--r--include/media/v4l2-ioctl.h15
-rw-r--r--include/media/v4l2-mediabus.h61
-rw-r--r--include/media/v4l2-subdev.h163
-rw-r--r--include/media/videobuf-core.h4
-rw-r--r--include/media/videobuf-dma-contig.h2
-rw-r--r--include/media/videobuf-dma-sg.h2
-rw-r--r--include/media/videobuf-dvb.h4
-rw-r--r--include/media/videobuf-vmalloc.h4
30 files changed, 1180 insertions, 96 deletions
diff --git a/include/media/cx25840.h b/include/media/cx25840.h
index 2c3fbaa33f74..0b0cb1776796 100644
--- a/include/media/cx25840.h
+++ b/include/media/cx25840.h
@@ -84,6 +84,7 @@ enum cx25840_video_input {
84 CX25840_NONE0_CH3 = 0x80000080, 84 CX25840_NONE0_CH3 = 0x80000080,
85 CX25840_NONE1_CH3 = 0x800000c0, 85 CX25840_NONE1_CH3 = 0x800000c0,
86 CX25840_SVIDEO_ON = 0x80000100, 86 CX25840_SVIDEO_ON = 0x80000100,
87 CX25840_COMPONENT_ON = 0x80000200,
87}; 88};
88 89
89enum cx25840_audio_input { 90enum cx25840_audio_input {
diff --git a/include/media/davinci/isif.h b/include/media/davinci/isif.h
new file mode 100644
index 000000000000..b0b74ad618cc
--- /dev/null
+++ b/include/media/davinci/isif.h
@@ -0,0 +1,531 @@
1/*
2 * Copyright (C) 2008-2009 Texas Instruments Inc
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * isif header file
19 */
20#ifndef _ISIF_H
21#define _ISIF_H
22
23#include <media/davinci/ccdc_types.h>
24#include <media/davinci/vpfe_types.h>
25
26/* isif float type S8Q8/U8Q8 */
27struct isif_float_8 {
28 /* 8 bit integer part */
29 __u8 integer;
30 /* 8 bit decimal part */
31 __u8 decimal;
32};
33
34/* isif float type U16Q16/S16Q16 */
35struct isif_float_16 {
36 /* 16 bit integer part */
37 __u16 integer;
38 /* 16 bit decimal part */
39 __u16 decimal;
40};
41
42/************************************************************************
43 * Vertical Defect Correction parameters
44 ***********************************************************************/
45/* Defect Correction (DFC) table entry */
46struct isif_vdfc_entry {
47 /* vertical position of defect */
48 __u16 pos_vert;
49 /* horizontal position of defect */
50 __u16 pos_horz;
51 /*
52 * Defect level of Vertical line defect position. This is subtracted
53 * from the data at the defect position
54 */
55 __u8 level_at_pos;
56 /*
57 * Defect level of the pixels upper than the vertical line defect.
58 * This is subtracted from the data
59 */
60 __u8 level_up_pixels;
61 /*
62 * Defect level of the pixels lower than the vertical line defect.
63 * This is subtracted from the data
64 */
65 __u8 level_low_pixels;
66};
67
68#define ISIF_VDFC_TABLE_SIZE 8
69struct isif_dfc {
70 /* enable vertical defect correction */
71 __u8 en;
72 /* Defect level subtraction. Just fed through if saturating */
73#define ISIF_VDFC_NORMAL 0
74 /*
75 * Defect level subtraction. Horizontal interpolation ((i-2)+(i+2))/2
76 * if data saturating
77 */
78#define ISIF_VDFC_HORZ_INTERPOL_IF_SAT 1
79 /* Horizontal interpolation (((i-2)+(i+2))/2) */
80#define ISIF_VDFC_HORZ_INTERPOL 2
81 /* one of the vertical defect correction modes above */
82 __u8 corr_mode;
83 /* 0 - whole line corrected, 1 - not pixels upper than the defect */
84 __u8 corr_whole_line;
85#define ISIF_VDFC_NO_SHIFT 0
86#define ISIF_VDFC_SHIFT_1 1
87#define ISIF_VDFC_SHIFT_2 2
88#define ISIF_VDFC_SHIFT_3 3
89#define ISIF_VDFC_SHIFT_4 4
90 /*
91 * defect level shift value. level_at_pos, level_upper_pos,
92 * and level_lower_pos can be shifted up by this value. Choose
93 * one of the values above
94 */
95 __u8 def_level_shift;
96 /* defect saturation level */
97 __u16 def_sat_level;
98 /* number of vertical defects. Max is ISIF_VDFC_TABLE_SIZE */
99 __u16 num_vdefects;
100 /* VDFC table ptr */
101 struct isif_vdfc_entry table[ISIF_VDFC_TABLE_SIZE];
102};
103
104struct isif_horz_bclamp {
105
106 /* Horizontal clamp disabled. Only vertical clamp value is subtracted */
107#define ISIF_HORZ_BC_DISABLE 0
108 /*
109 * Horizontal clamp value is calculated and subtracted from image data
110 * along with vertical clamp value
111 */
112#define ISIF_HORZ_BC_CLAMP_CALC_ENABLED 1
113 /*
114 * Horizontal clamp value calculated from previous image is subtracted
115 * from image data along with vertical clamp value.
116 */
117#define ISIF_HORZ_BC_CLAMP_NOT_UPDATED 2
118 /* horizontal clamp mode. One of the values above */
119 __u8 mode;
120 /*
121 * pixel value limit enable.
122 * 0 - limit disabled
123 * 1 - pixel value limited to 1023
124 */
125 __u8 clamp_pix_limit;
126 /* Select Most left window for bc calculation */
127#define ISIF_SEL_MOST_LEFT_WIN 0
128 /* Select Most right window for bc calculation */
129#define ISIF_SEL_MOST_RIGHT_WIN 1
130 /* Select most left or right window for clamp val calculation */
131 __u8 base_win_sel_calc;
132 /* Window count per color for calculation. range 1-32 */
133 __u8 win_count_calc;
134 /* Window start position - horizontal for calculation. 0 - 8191 */
135 __u16 win_start_h_calc;
136 /* Window start position - vertical for calculation 0 - 8191 */
137 __u16 win_start_v_calc;
138#define ISIF_HORZ_BC_SZ_H_2PIXELS 0
139#define ISIF_HORZ_BC_SZ_H_4PIXELS 1
140#define ISIF_HORZ_BC_SZ_H_8PIXELS 2
141#define ISIF_HORZ_BC_SZ_H_16PIXELS 3
142 /* Width of the sample window in pixels for calculation */
143 __u8 win_h_sz_calc;
144#define ISIF_HORZ_BC_SZ_V_32PIXELS 0
145#define ISIF_HORZ_BC_SZ_V_64PIXELS 1
146#define ISIF_HORZ_BC_SZ_V_128PIXELS 2
147#define ISIF_HORZ_BC_SZ_V_256PIXELS 3
148 /* Height of the sample window in pixels for calculation */
149 __u8 win_v_sz_calc;
150};
151
152/************************************************************************
153 * Black Clamp parameters
154 ***********************************************************************/
155struct isif_vert_bclamp {
156 /* Reset value used is the clamp value calculated */
157#define ISIF_VERT_BC_USE_HORZ_CLAMP_VAL 0
158 /* Reset value used is reset_clamp_val configured */
159#define ISIF_VERT_BC_USE_CONFIG_CLAMP_VAL 1
160 /* No update, previous image value is used */
161#define ISIF_VERT_BC_NO_UPDATE 2
162 /*
163 * Reset value selector for vertical clamp calculation. Use one of
164 * the above values
165 */
166 __u8 reset_val_sel;
167 /* U8Q8. Line average coefficient used in vertical clamp calculation */
168 __u8 line_ave_coef;
169 /* Height of the optical black region for calculation */
170 __u16 ob_v_sz_calc;
171 /* Optical black region start position - horizontal. 0 - 8191 */
172 __u16 ob_start_h;
173 /* Optical black region start position - vertical 0 - 8191 */
174 __u16 ob_start_v;
175};
176
177struct isif_black_clamp {
178 /*
179 * This offset value is added irrespective of the clamp enable status.
180 * S13
181 */
182 __u16 dc_offset;
183 /*
184 * Enable black/digital clamp value to be subtracted from the image data
185 */
186 __u8 en;
187 /*
188 * black clamp mode. same/separate clamp for 4 colors
189 * 0 - disable - same clamp value for all colors
190 * 1 - clamp value calculated separately for all colors
191 */
192 __u8 bc_mode_color;
193 /* Vrtical start position for bc subtraction */
194 __u16 vert_start_sub;
195 /* Black clamp for horizontal direction */
196 struct isif_horz_bclamp horz;
197 /* Black clamp for vertical direction */
198 struct isif_vert_bclamp vert;
199};
200
201/*************************************************************************
202** Color Space Convertion (CSC)
203*************************************************************************/
204#define ISIF_CSC_NUM_COEFF 16
205struct isif_color_space_conv {
206 /* Enable color space conversion */
207 __u8 en;
208 /*
209 * csc coeffient table. S8Q5, M00 at index 0, M01 at index 1, and
210 * so forth
211 */
212 struct isif_float_8 coeff[ISIF_CSC_NUM_COEFF];
213};
214
215
216/*************************************************************************
217** Black Compensation parameters
218*************************************************************************/
219struct isif_black_comp {
220 /* Comp for Red */
221 __s8 r_comp;
222 /* Comp for Gr */
223 __s8 gr_comp;
224 /* Comp for Blue */
225 __s8 b_comp;
226 /* Comp for Gb */
227 __s8 gb_comp;
228};
229
230/*************************************************************************
231** Gain parameters
232*************************************************************************/
233struct isif_gain {
234 /* Gain for Red or ye */
235 struct isif_float_16 r_ye;
236 /* Gain for Gr or cy */
237 struct isif_float_16 gr_cy;
238 /* Gain for Gb or g */
239 struct isif_float_16 gb_g;
240 /* Gain for Blue or mg */
241 struct isif_float_16 b_mg;
242};
243
244#define ISIF_LINEAR_TAB_SIZE 192
245/*************************************************************************
246** Linearization parameters
247*************************************************************************/
248struct isif_linearize {
249 /* Enable or Disable linearization of data */
250 __u8 en;
251 /* Shift value applied */
252 __u8 corr_shft;
253 /* scale factor applied U11Q10 */
254 struct isif_float_16 scale_fact;
255 /* Size of the linear table */
256 __u16 table[ISIF_LINEAR_TAB_SIZE];
257};
258
259/* Color patterns */
260#define ISIF_RED 0
261#define ISIF_GREEN_RED 1
262#define ISIF_GREEN_BLUE 2
263#define ISIF_BLUE 3
264struct isif_col_pat {
265 __u8 olop;
266 __u8 olep;
267 __u8 elop;
268 __u8 elep;
269};
270
271/*************************************************************************
272** Data formatter parameters
273*************************************************************************/
274struct isif_fmtplen {
275 /*
276 * number of program entries for SET0, range 1 - 16
277 * when fmtmode is ISIF_SPLIT, 1 - 8 when fmtmode is
278 * ISIF_COMBINE
279 */
280 __u16 plen0;
281 /*
282 * number of program entries for SET1, range 1 - 16
283 * when fmtmode is ISIF_SPLIT, 1 - 8 when fmtmode is
284 * ISIF_COMBINE
285 */
286 __u16 plen1;
287 /**
288 * number of program entries for SET2, range 1 - 16
289 * when fmtmode is ISIF_SPLIT, 1 - 8 when fmtmode is
290 * ISIF_COMBINE
291 */
292 __u16 plen2;
293 /**
294 * number of program entries for SET3, range 1 - 16
295 * when fmtmode is ISIF_SPLIT, 1 - 8 when fmtmode is
296 * ISIF_COMBINE
297 */
298 __u16 plen3;
299};
300
301struct isif_fmt_cfg {
302#define ISIF_SPLIT 0
303#define ISIF_COMBINE 1
304 /* Split or combine or line alternate */
305 __u8 fmtmode;
306 /* enable or disable line alternating mode */
307 __u8 ln_alter_en;
308#define ISIF_1LINE 0
309#define ISIF_2LINES 1
310#define ISIF_3LINES 2
311#define ISIF_4LINES 3
312 /* Split/combine line number */
313 __u8 lnum;
314 /* Address increment Range 1 - 16 */
315 __u8 addrinc;
316};
317
318struct isif_fmt_addr_ptr {
319 /* Initial address */
320 __u32 init_addr;
321 /* output line number */
322#define ISIF_1STLINE 0
323#define ISIF_2NDLINE 1
324#define ISIF_3RDLINE 2
325#define ISIF_4THLINE 3
326 __u8 out_line;
327};
328
329struct isif_fmtpgm_ap {
330 /* program address pointer */
331 __u8 pgm_aptr;
332 /* program address increment or decrement */
333 __u8 pgmupdt;
334};
335
336struct isif_data_formatter {
337 /* Enable/Disable data formatter */
338 __u8 en;
339 /* data formatter configuration */
340 struct isif_fmt_cfg cfg;
341 /* Formatter program entries length */
342 struct isif_fmtplen plen;
343 /* first pixel in a line fed to formatter */
344 __u16 fmtrlen;
345 /* HD interval for output line. Only valid when split line */
346 __u16 fmthcnt;
347 /* formatter address pointers */
348 struct isif_fmt_addr_ptr fmtaddr_ptr[16];
349 /* program enable/disable */
350 __u8 pgm_en[32];
351 /* program address pointers */
352 struct isif_fmtpgm_ap fmtpgm_ap[32];
353};
354
355struct isif_df_csc {
356 /* Color Space Conversion confguration, 0 - csc, 1 - df */
357 __u8 df_or_csc;
358 /* csc configuration valid if df_or_csc is 0 */
359 struct isif_color_space_conv csc;
360 /* data formatter configuration valid if df_or_csc is 1 */
361 struct isif_data_formatter df;
362 /* start pixel in a line at the input */
363 __u32 start_pix;
364 /* number of pixels in input line */
365 __u32 num_pixels;
366 /* start line at the input */
367 __u32 start_line;
368 /* number of lines at the input */
369 __u32 num_lines;
370};
371
372struct isif_gain_offsets_adj {
373 /* Gain adjustment per color */
374 struct isif_gain gain;
375 /* Offset adjustment */
376 __u16 offset;
377 /* Enable or Disable Gain adjustment for SDRAM data */
378 __u8 gain_sdram_en;
379 /* Enable or Disable Gain adjustment for IPIPE data */
380 __u8 gain_ipipe_en;
381 /* Enable or Disable Gain adjustment for H3A data */
382 __u8 gain_h3a_en;
383 /* Enable or Disable Gain adjustment for SDRAM data */
384 __u8 offset_sdram_en;
385 /* Enable or Disable Gain adjustment for IPIPE data */
386 __u8 offset_ipipe_en;
387 /* Enable or Disable Gain adjustment for H3A data */
388 __u8 offset_h3a_en;
389};
390
391struct isif_cul {
392 /* Horizontal Cull pattern for odd lines */
393 __u8 hcpat_odd;
394 /* Horizontal Cull pattern for even lines */
395 __u8 hcpat_even;
396 /* Vertical Cull pattern */
397 __u8 vcpat;
398 /* Enable or disable lpf. Apply when cull is enabled */
399 __u8 en_lpf;
400};
401
402struct isif_compress {
403#define ISIF_ALAW 0
404#define ISIF_DPCM 1
405#define ISIF_NO_COMPRESSION 2
406 /* Compression Algorithm used */
407 __u8 alg;
408 /* Choose Predictor1 for DPCM compression */
409#define ISIF_DPCM_PRED1 0
410 /* Choose Predictor2 for DPCM compression */
411#define ISIF_DPCM_PRED2 1
412 /* Predictor for DPCM compression */
413 __u8 pred;
414};
415
416/* all the stuff in this struct will be provided by userland */
417struct isif_config_params_raw {
418 /* Linearization parameters for image sensor data input */
419 struct isif_linearize linearize;
420 /* Data formatter or CSC */
421 struct isif_df_csc df_csc;
422 /* Defect Pixel Correction (DFC) confguration */
423 struct isif_dfc dfc;
424 /* Black/Digital Clamp configuration */
425 struct isif_black_clamp bclamp;
426 /* Gain, offset adjustments */
427 struct isif_gain_offsets_adj gain_offset;
428 /* Culling */
429 struct isif_cul culling;
430 /* A-Law and DPCM compression options */
431 struct isif_compress compress;
432 /* horizontal offset for Gain/LSC/DFC */
433 __u16 horz_offset;
434 /* vertical offset for Gain/LSC/DFC */
435 __u16 vert_offset;
436 /* color pattern for field 0 */
437 struct isif_col_pat col_pat_field0;
438 /* color pattern for field 1 */
439 struct isif_col_pat col_pat_field1;
440#define ISIF_NO_SHIFT 0
441#define ISIF_1BIT_SHIFT 1
442#define ISIF_2BIT_SHIFT 2
443#define ISIF_3BIT_SHIFT 3
444#define ISIF_4BIT_SHIFT 4
445#define ISIF_5BIT_SHIFT 5
446#define ISIF_6BIT_SHIFT 6
447 /* Data shift applied before storing to SDRAM */
448 __u8 data_shift;
449 /* enable input test pattern generation */
450 __u8 test_pat_gen;
451};
452
453#ifdef __KERNEL__
454struct isif_ycbcr_config {
455 /* isif pixel format */
456 enum ccdc_pixfmt pix_fmt;
457 /* isif frame format */
458 enum ccdc_frmfmt frm_fmt;
459 /* ISIF crop window */
460 struct v4l2_rect win;
461 /* field polarity */
462 enum vpfe_pin_pol fid_pol;
463 /* interface VD polarity */
464 enum vpfe_pin_pol vd_pol;
465 /* interface HD polarity */
466 enum vpfe_pin_pol hd_pol;
467 /* isif pix order. Only used for ycbcr capture */
468 enum ccdc_pixorder pix_order;
469 /* isif buffer type. Only used for ycbcr capture */
470 enum ccdc_buftype buf_type;
471};
472
473/* MSB of image data connected to sensor port */
474enum isif_data_msb {
475 ISIF_BIT_MSB_15,
476 ISIF_BIT_MSB_14,
477 ISIF_BIT_MSB_13,
478 ISIF_BIT_MSB_12,
479 ISIF_BIT_MSB_11,
480 ISIF_BIT_MSB_10,
481 ISIF_BIT_MSB_9,
482 ISIF_BIT_MSB_8,
483 ISIF_BIT_MSB_7
484};
485
486enum isif_cfa_pattern {
487 ISIF_CFA_PAT_MOSAIC,
488 ISIF_CFA_PAT_STRIPE
489};
490
491struct isif_params_raw {
492 /* isif pixel format */
493 enum ccdc_pixfmt pix_fmt;
494 /* isif frame format */
495 enum ccdc_frmfmt frm_fmt;
496 /* video window */
497 struct v4l2_rect win;
498 /* field polarity */
499 enum vpfe_pin_pol fid_pol;
500 /* interface VD polarity */
501 enum vpfe_pin_pol vd_pol;
502 /* interface HD polarity */
503 enum vpfe_pin_pol hd_pol;
504 /* buffer type. Applicable for interlaced mode */
505 enum ccdc_buftype buf_type;
506 /* Gain values */
507 struct isif_gain gain;
508 /* cfa pattern */
509 enum isif_cfa_pattern cfa_pat;
510 /* Data MSB position */
511 enum isif_data_msb data_msb;
512 /* Enable horizontal flip */
513 unsigned char horz_flip_en;
514 /* Enable image invert vertically */
515 unsigned char image_invert_en;
516
517 /* all the userland defined stuff*/
518 struct isif_config_params_raw config_params;
519};
520
521enum isif_data_pack {
522 ISIF_PACK_16BIT,
523 ISIF_PACK_12BIT,
524 ISIF_PACK_8BIT
525};
526
527#define ISIF_WIN_NTSC {0, 0, 720, 480}
528#define ISIF_WIN_VGA {0, 0, 640, 480}
529
530#endif
531#endif
diff --git a/include/media/davinci/vpfe_capture.h b/include/media/davinci/vpfe_capture.h
index 71d8982e13ff..4314a5f6a087 100644
--- a/include/media/davinci/vpfe_capture.h
+++ b/include/media/davinci/vpfe_capture.h
@@ -83,6 +83,8 @@ struct vpfe_subdev_info {
83struct vpfe_config { 83struct vpfe_config {
84 /* Number of sub devices connected to vpfe */ 84 /* Number of sub devices connected to vpfe */
85 int num_subdevs; 85 int num_subdevs;
86 /* i2c bus adapter no */
87 int i2c_adapter_id;
86 /* information about each subdev */ 88 /* information about each subdev */
87 struct vpfe_subdev_info *sub_devs; 89 struct vpfe_subdev_info *sub_devs;
88 /* evm card info */ 90 /* evm card info */
@@ -163,7 +165,7 @@ struct vpfe_device {
163 u8 started; 165 u8 started;
164 /* 166 /*
165 * offset where second field starts from the starting of the 167 * offset where second field starts from the starting of the
166 * buffer for field seperated YCbCr formats 168 * buffer for field separated YCbCr formats
167 */ 169 */
168 u32 field_off; 170 u32 field_off;
169}; 171};
diff --git a/include/media/davinci/vpss.h b/include/media/davinci/vpss.h
index fcdff745fae2..c59cc029c74a 100644
--- a/include/media/davinci/vpss.h
+++ b/include/media/davinci/vpss.h
@@ -29,7 +29,19 @@
29/* selector for ccdc input selection on DM355 */ 29/* selector for ccdc input selection on DM355 */
30enum vpss_ccdc_source_sel { 30enum vpss_ccdc_source_sel {
31 VPSS_CCDCIN, 31 VPSS_CCDCIN,
32 VPSS_HSSIIN 32 VPSS_HSSIIN,
33 VPSS_PGLPBK, /* for DM365 only */
34 VPSS_CCDCPG /* for DM365 only */
35};
36
37struct vpss_sync_pol {
38 unsigned int ccdpg_hdpol:1;
39 unsigned int ccdpg_vdpol:1;
40};
41
42struct vpss_pg_frame_size {
43 short hlpfr;
44 short pplen;
33}; 45};
34 46
35/* Used for enable/diable VPSS Clock */ 47/* Used for enable/diable VPSS Clock */
@@ -47,12 +59,38 @@ enum vpss_clock_sel {
47 */ 59 */
48 VPSS_VENC_CLOCK_SEL, 60 VPSS_VENC_CLOCK_SEL,
49 VPSS_VPBE_CLOCK, 61 VPSS_VPBE_CLOCK,
62 /* DM365 only clocks */
63 VPSS_IPIPEIF_CLOCK,
64 VPSS_RSZ_CLOCK,
65 VPSS_BL_CLOCK,
66 /*
67 * When using VPSS_PCLK_INTERNAL in vpss_enable_clock() api
68 * following applies:-
69 * en = 0 disable internal PCLK
70 * en = 1 enables internal PCLK
71 */
72 VPSS_PCLK_INTERNAL,
73 /*
74 * When using VPSS_PSYNC_CLOCK_SEL in vpss_enable_clock() api
75 * following applies:-
76 * en = 0 enables MMR clock
77 * en = 1 enables VPSS clock
78 */
79 VPSS_PSYNC_CLOCK_SEL,
80 VPSS_LDC_CLOCK_SEL,
81 VPSS_OSD_CLOCK_SEL,
82 VPSS_FDIF_CLOCK,
83 VPSS_LDC_CLOCK
50}; 84};
51 85
52/* select input to ccdc on dm355 */ 86/* select input to ccdc on dm355 */
53int vpss_select_ccdc_source(enum vpss_ccdc_source_sel src_sel); 87int vpss_select_ccdc_source(enum vpss_ccdc_source_sel src_sel);
54/* enable/disable a vpss clock, 0 - success, -1 - failure */ 88/* enable/disable a vpss clock, 0 - success, -1 - failure */
55int vpss_enable_clock(enum vpss_clock_sel clock_sel, int en); 89int vpss_enable_clock(enum vpss_clock_sel clock_sel, int en);
90/* set sync polarity, only for DM365*/
91void dm365_vpss_set_sync_pol(struct vpss_sync_pol);
92/* set the PG_FRAME_SIZE register, only for DM365 */
93void dm365_vpss_set_pg_frame_size(struct vpss_pg_frame_size);
56 94
57/* wbl reset for dm644x */ 95/* wbl reset for dm644x */
58enum vpss_wbl_sel { 96enum vpss_wbl_sel {
@@ -65,5 +103,6 @@ enum vpss_wbl_sel {
65 VPSS_PCR_PREV_WBL_0, 103 VPSS_PCR_PREV_WBL_0,
66 VPSS_PCR_CCDC_WBL_O, 104 VPSS_PCR_CCDC_WBL_O,
67}; 105};
106/* clear wbl overflow flag for DM6446 */
68int vpss_clear_wbl_overflow(enum vpss_wbl_sel wbl_sel); 107int vpss_clear_wbl_overflow(enum vpss_wbl_sel wbl_sel);
69#endif 108#endif
diff --git a/include/media/ir-common.h b/include/media/ir-common.h
index 29f0e53cff94..c66298062d39 100644
--- a/include/media/ir-common.h
+++ b/include/media/ir-common.h
@@ -26,26 +26,7 @@
26#include <linux/input.h> 26#include <linux/input.h>
27#include <linux/workqueue.h> 27#include <linux/workqueue.h>
28#include <linux/interrupt.h> 28#include <linux/interrupt.h>
29 29#include <media/ir-core.h>
30#define IR_TYPE_RC5 1
31#define IR_TYPE_PD 2 /* Pulse distance encoded IR */
32#define IR_TYPE_OTHER 99
33
34#define IR_KEYTAB_TYPE u32
35#define IR_KEYTAB_SIZE 128 /* enougth for rc5, probably need more some day */
36
37struct ir_scancode {
38 u16 scancode;
39 u32 keycode;
40};
41
42struct ir_scancode_table {
43 struct ir_scancode *scan;
44 int size;
45};
46
47#define IR_KEYCODE(tab,code) (((unsigned)code < IR_KEYTAB_SIZE) \
48 ? tab[code] : KEY_RESERVED)
49 30
50#define RC5_START(x) (((x)>>12)&3) 31#define RC5_START(x) (((x)>>12)&3)
51#define RC5_TOGGLE(x) (((x)>>11)&1) 32#define RC5_TOGGLE(x) (((x)>>11)&1)
@@ -54,12 +35,10 @@ struct ir_scancode_table {
54 35
55struct ir_input_state { 36struct ir_input_state {
56 /* configuration */ 37 /* configuration */
57 int ir_type; 38 u64 ir_type;
58 IR_KEYTAB_TYPE ir_codes[IR_KEYTAB_SIZE];
59 39
60 /* key info */ 40 /* key info */
61 u32 ir_raw; /* raw data */ 41 u32 ir_key; /* ir scancode */
62 u32 ir_key; /* ir key code */
63 u32 keycode; /* linux key code */ 42 u32 keycode; /* linux key code */
64 int keypressed; /* current state */ 43 int keypressed; /* current state */
65}; 44};
@@ -102,20 +81,23 @@ struct card_ir {
102 struct tasklet_struct tlet; 81 struct tasklet_struct tlet;
103}; 82};
104 83
105void ir_input_init(struct input_dev *dev, struct ir_input_state *ir, 84/* Routines from ir-functions.c */
106 int ir_type, struct ir_scancode_table *ir_codes); 85
86int ir_input_init(struct input_dev *dev, struct ir_input_state *ir,
87 const u64 ir_type);
107void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir); 88void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir);
108void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir, 89void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir,
109 u32 ir_key, u32 ir_raw); 90 u32 ir_key);
110u32 ir_extract_bits(u32 data, u32 mask); 91u32 ir_extract_bits(u32 data, u32 mask);
111int ir_dump_samples(u32 *samples, int count); 92int ir_dump_samples(u32 *samples, int count);
112int ir_decode_biphase(u32 *samples, int count, int low, int high); 93int ir_decode_biphase(u32 *samples, int count, int low, int high);
113int ir_decode_pulsedistance(u32 *samples, int count, int low, int high); 94int ir_decode_pulsedistance(u32 *samples, int count, int low, int high);
95u32 ir_rc5_decode(unsigned int code);
114 96
115void ir_rc5_timer_end(unsigned long data); 97void ir_rc5_timer_end(unsigned long data);
116void ir_rc5_timer_keyup(unsigned long data); 98void ir_rc5_timer_keyup(unsigned long data);
117 99
118/* Keymaps to be used by other modules */ 100/* scancode->keycode map tables from ir-keymaps.c */
119 101
120extern struct ir_scancode_table ir_codes_empty_table; 102extern struct ir_scancode_table ir_codes_empty_table;
121extern struct ir_scancode_table ir_codes_avermedia_table; 103extern struct ir_scancode_table ir_codes_avermedia_table;
@@ -150,6 +132,7 @@ extern struct ir_scancode_table ir_codes_rc5_tv_table;
150extern struct ir_scancode_table ir_codes_winfast_table; 132extern struct ir_scancode_table ir_codes_winfast_table;
151extern struct ir_scancode_table ir_codes_pinnacle_color_table; 133extern struct ir_scancode_table ir_codes_pinnacle_color_table;
152extern struct ir_scancode_table ir_codes_hauppauge_new_table; 134extern struct ir_scancode_table ir_codes_hauppauge_new_table;
135extern struct ir_scancode_table ir_codes_rc5_hauppauge_new_table;
153extern struct ir_scancode_table ir_codes_npgtech_table; 136extern struct ir_scancode_table ir_codes_npgtech_table;
154extern struct ir_scancode_table ir_codes_norwood_table; 137extern struct ir_scancode_table ir_codes_norwood_table;
155extern struct ir_scancode_table ir_codes_proteus_2309_table; 138extern struct ir_scancode_table ir_codes_proteus_2309_table;
@@ -172,8 +155,13 @@ extern struct ir_scancode_table ir_codes_ati_tv_wonder_hd_600_table;
172extern struct ir_scancode_table ir_codes_kworld_plus_tv_analog_table; 155extern struct ir_scancode_table ir_codes_kworld_plus_tv_analog_table;
173extern struct ir_scancode_table ir_codes_kaiomy_table; 156extern struct ir_scancode_table ir_codes_kaiomy_table;
174extern struct ir_scancode_table ir_codes_dm1105_nec_table; 157extern struct ir_scancode_table ir_codes_dm1105_nec_table;
158extern struct ir_scancode_table ir_codes_tevii_nec_table;
159extern struct ir_scancode_table ir_codes_tbs_nec_table;
175extern struct ir_scancode_table ir_codes_evga_indtube_table; 160extern struct ir_scancode_table ir_codes_evga_indtube_table;
176extern struct ir_scancode_table ir_codes_terratec_cinergy_xs_table; 161extern struct ir_scancode_table ir_codes_terratec_cinergy_xs_table;
177extern struct ir_scancode_table ir_codes_videomate_s350_table; 162extern struct ir_scancode_table ir_codes_videomate_s350_table;
178extern struct ir_scancode_table ir_codes_gadmei_rm008z_table; 163extern struct ir_scancode_table ir_codes_gadmei_rm008z_table;
164extern struct ir_scancode_table ir_codes_nec_terratec_cinergy_xs_table;
165extern struct ir_scancode_table ir_codes_winfast_usbii_deluxe_table;
166extern struct ir_scancode_table ir_codes_kworld_315u_table;
179#endif 167#endif
diff --git a/include/media/ir-core.h b/include/media/ir-core.h
new file mode 100644
index 000000000000..61c223bc3953
--- /dev/null
+++ b/include/media/ir-core.h
@@ -0,0 +1,74 @@
1/*
2 * Remote Controller core header
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation version 2 of the License.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#ifndef _IR_CORE
15#define _IR_CORE
16
17#include <linux/input.h>
18#include <linux/spinlock.h>
19
20extern int ir_core_debug;
21#define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \
22 printk(KERN_DEBUG "%s: " fmt , __func__, ## arg)
23
24#define IR_TYPE_UNKNOWN 0
25#define IR_TYPE_RC5 (1 << 0) /* Philips RC5 protocol */
26#define IR_TYPE_PD (1 << 1) /* Pulse distance encoded IR */
27#define IR_TYPE_NEC (1 << 2)
28#define IR_TYPE_OTHER (((u64)1) << 63l)
29
30struct ir_scancode {
31 u16 scancode;
32 u32 keycode;
33};
34
35struct ir_scancode_table {
36 struct ir_scancode *scan;
37 int size;
38 u64 ir_type;
39 spinlock_t lock;
40};
41
42struct ir_dev_props {
43 unsigned long allowed_protos;
44 void *priv;
45 int (*change_protocol)(void *priv, u64 ir_type);
46};
47
48
49struct ir_input_dev {
50 struct input_dev *dev; /* Input device*/
51 struct ir_scancode_table rc_tab; /* scan/key table */
52 unsigned long devno; /* device number */
53 struct attribute_group attr; /* IR attributes */
54 struct device *class_dev; /* virtual class dev */
55 const struct ir_dev_props *props; /* Device properties */
56};
57#define to_ir_input_dev(_attr) container_of(_attr, struct ir_input_dev, attr)
58
59/* Routines from ir-keytable.c */
60
61u32 ir_g_keycode_from_table(struct input_dev *input_dev,
62 u32 scancode);
63
64int ir_input_register(struct input_dev *dev,
65 const struct ir_scancode_table *ir_codes,
66 const struct ir_dev_props *props);
67void ir_input_unregister(struct input_dev *input_dev);
68
69/* Routines from ir-sysfs.c */
70
71int ir_register_class(struct input_dev *input_dev);
72void ir_unregister_class(struct input_dev *input_dev);
73
74#endif
diff --git a/include/media/ir-kbd-i2c.h b/include/media/ir-kbd-i2c.h
index aaf65e8b1a40..9142936603cc 100644
--- a/include/media/ir-kbd-i2c.h
+++ b/include/media/ir-kbd-i2c.h
@@ -36,7 +36,7 @@ enum ir_kbd_get_key_fn {
36struct IR_i2c_init_data { 36struct IR_i2c_init_data {
37 struct ir_scancode_table *ir_codes; 37 struct ir_scancode_table *ir_codes;
38 const char *name; 38 const char *name;
39 int type; /* IR_TYPE_RC5, IR_TYPE_PD, etc */ 39 u64 type; /* IR_TYPE_RC5, IR_TYPE_PD, etc */
40 /* 40 /*
41 * Specify either a function pointer or a value indicating one of 41 * Specify either a function pointer or a value indicating one of
42 * ir_kbd_i2c's internal get_key functions 42 * ir_kbd_i2c's internal get_key functions
diff --git a/include/media/mt9t112.h b/include/media/mt9t112.h
new file mode 100644
index 000000000000..a43c74ab05ec
--- /dev/null
+++ b/include/media/mt9t112.h
@@ -0,0 +1,30 @@
1/* mt9t112 Camera
2 *
3 * Copyright (C) 2009 Renesas Solutions Corp.
4 * Kuninori Morimoto <morimoto.kuninori@renesas.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 version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __MT9T112_H__
12#define __MT9T112_H__
13
14#define MT9T112_FLAG_PCLK_RISING_EDGE (1 << 0)
15#define MT9T112_FLAG_DATAWIDTH_8 (1 << 1) /* default width is 10 */
16
17struct mt9t112_pll_divider {
18 u8 m, n;
19 u8 p1, p2, p3, p4, p5, p6, p7;
20};
21
22/*
23 * mt9t112 camera info
24 */
25struct mt9t112_camera_info {
26 u32 flags;
27 struct mt9t112_pll_divider divider;
28};
29
30#endif /* __MT9T112_H__ */
diff --git a/include/media/ov772x.h b/include/media/ov772x.h
index 30d9629198ef..548bf1155c83 100644
--- a/include/media/ov772x.h
+++ b/include/media/ov772x.h
@@ -1,4 +1,5 @@
1/* ov772x Camera 1/*
2 * ov772x Camera
2 * 3 *
3 * Copyright (C) 2008 Renesas Solutions Corp. 4 * Copyright (C) 2008 Renesas Solutions Corp.
4 * Kuninori Morimoto <morimoto.kuninori@renesas.com> 5 * Kuninori Morimoto <morimoto.kuninori@renesas.com>
@@ -14,8 +15,9 @@
14#include <media/soc_camera.h> 15#include <media/soc_camera.h>
15 16
16/* for flags */ 17/* for flags */
17#define OV772X_FLAG_VFLIP 0x00000001 /* Vertical flip image */ 18#define OV772X_FLAG_VFLIP (1 << 0) /* Vertical flip image */
18#define OV772X_FLAG_HFLIP 0x00000002 /* Horizontal flip image */ 19#define OV772X_FLAG_HFLIP (1 << 1) /* Horizontal flip image */
20#define OV772X_FLAG_8BIT (1 << 2) /* default 10 bit */
19 21
20/* 22/*
21 * for Edge ctrl 23 * for Edge ctrl
@@ -52,10 +54,8 @@ struct ov772x_edge_ctrl {
52 * ov772x camera info 54 * ov772x camera info
53 */ 55 */
54struct ov772x_camera_info { 56struct ov772x_camera_info {
55 unsigned long buswidth; 57 unsigned long flags;
56 unsigned long flags; 58 struct ov772x_edge_ctrl edgectrl;
57 struct soc_camera_link link;
58 struct ov772x_edge_ctrl edgectrl;
59}; 59};
60 60
61#endif /* __OV772X_H__ */ 61#endif /* __OV772X_H__ */
diff --git a/include/media/rj54n1cb0c.h b/include/media/rj54n1cb0c.h
new file mode 100644
index 000000000000..8ae3288ae925
--- /dev/null
+++ b/include/media/rj54n1cb0c.h
@@ -0,0 +1,19 @@
1/*
2 * RJ54N1CB0C Private data
3 *
4 * Copyright (C) 2009, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
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 version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __RJ54N1CB0C_H__
12#define __RJ54N1CB0C_H__
13
14struct rj54n1_pdata {
15 unsigned int mclk_freq;
16 bool ioctl_high;
17};
18
19#endif
diff --git a/include/media/saa7146_vv.h b/include/media/saa7146_vv.h
index eed5fccc83f3..4aeff96ff7d8 100644
--- a/include/media/saa7146_vv.h
+++ b/include/media/saa7146_vv.h
@@ -108,8 +108,6 @@ struct saa7146_fh {
108 108
109struct saa7146_vv 109struct saa7146_vv
110{ 110{
111 int vbi_minor;
112
113 /* vbi capture */ 111 /* vbi capture */
114 struct saa7146_dmaqueue vbi_q; 112 struct saa7146_dmaqueue vbi_q;
115 /* vbi workaround interrupt queue */ 113 /* vbi workaround interrupt queue */
@@ -117,8 +115,6 @@ struct saa7146_vv
117 int vbi_fieldcount; 115 int vbi_fieldcount;
118 struct saa7146_fh *vbi_streaming; 116 struct saa7146_fh *vbi_streaming;
119 117
120 int video_minor;
121
122 int video_status; 118 int video_status;
123 struct saa7146_fh *video_fh; 119 struct saa7146_fh *video_fh;
124 120
diff --git a/include/media/sh_mobile_ceu.h b/include/media/sh_mobile_ceu.h
index 0f3524cff435..b67747836878 100644
--- a/include/media/sh_mobile_ceu.h
+++ b/include/media/sh_mobile_ceu.h
@@ -3,6 +3,8 @@
3 3
4#define SH_CEU_FLAG_USE_8BIT_BUS (1 << 0) /* use 8bit bus width */ 4#define SH_CEU_FLAG_USE_8BIT_BUS (1 << 0) /* use 8bit bus width */
5#define SH_CEU_FLAG_USE_16BIT_BUS (1 << 1) /* use 16bit bus width */ 5#define SH_CEU_FLAG_USE_16BIT_BUS (1 << 1) /* use 16bit bus width */
6#define SH_CEU_FLAG_HSYNC_LOW (1 << 2) /* default High if possible */
7#define SH_CEU_FLAG_VSYNC_LOW (1 << 3) /* default High if possible */
6 8
7struct sh_mobile_ceu_info { 9struct sh_mobile_ceu_info {
8 unsigned long flags; 10 unsigned long flags;
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index 3d74e60032dd..9d69f01b6fa2 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -24,18 +24,13 @@ struct soc_camera_device {
24 struct device *pdev; /* Platform device */ 24 struct device *pdev; /* Platform device */
25 s32 user_width; 25 s32 user_width;
26 s32 user_height; 26 s32 user_height;
27 unsigned short width_min; 27 enum v4l2_colorspace colorspace;
28 unsigned short height_min;
29 unsigned short y_skip_top; /* Lines to skip at the top */
30 unsigned char iface; /* Host number */ 28 unsigned char iface; /* Host number */
31 unsigned char devnum; /* Device number per host */ 29 unsigned char devnum; /* Device number per host */
32 unsigned char buswidth; /* See comment in .c */
33 struct soc_camera_sense *sense; /* See comment in struct definition */ 30 struct soc_camera_sense *sense; /* See comment in struct definition */
34 struct soc_camera_ops *ops; 31 struct soc_camera_ops *ops;
35 struct video_device *vdev; 32 struct video_device *vdev;
36 const struct soc_camera_data_format *current_fmt; 33 const struct soc_camera_format_xlate *current_fmt;
37 const struct soc_camera_data_format *formats;
38 int num_formats;
39 struct soc_camera_format_xlate *user_formats; 34 struct soc_camera_format_xlate *user_formats;
40 int num_user_formats; 35 int num_user_formats;
41 enum v4l2_field field; /* Preserve field over close() */ 36 enum v4l2_field field; /* Preserve field over close() */
@@ -86,6 +81,8 @@ struct soc_camera_host_ops {
86 int (*set_bus_param)(struct soc_camera_device *, __u32); 81 int (*set_bus_param)(struct soc_camera_device *, __u32);
87 int (*get_ctrl)(struct soc_camera_device *, struct v4l2_control *); 82 int (*get_ctrl)(struct soc_camera_device *, struct v4l2_control *);
88 int (*set_ctrl)(struct soc_camera_device *, struct v4l2_control *); 83 int (*set_ctrl)(struct soc_camera_device *, struct v4l2_control *);
84 int (*get_parm)(struct soc_camera_device *, struct v4l2_streamparm *);
85 int (*set_parm)(struct soc_camera_device *, struct v4l2_streamparm *);
89 unsigned int (*poll)(struct file *, poll_table *); 86 unsigned int (*poll)(struct file *, poll_table *);
90 const struct v4l2_queryctrl *controls; 87 const struct v4l2_queryctrl *controls;
91 int num_controls; 88 int num_controls;
@@ -107,6 +104,8 @@ struct soc_camera_link {
107 int i2c_adapter_id; 104 int i2c_adapter_id;
108 struct i2c_board_info *board_info; 105 struct i2c_board_info *board_info;
109 const char *module_name; 106 const char *module_name;
107 void *priv;
108
110 /* 109 /*
111 * For non-I2C devices platform platform has to provide methods to 110 * For non-I2C devices platform platform has to provide methods to
112 * add a device to the system and to remove 111 * add a device to the system and to remove
@@ -162,23 +161,13 @@ static inline struct v4l2_subdev *soc_camera_to_subdev(
162int soc_camera_host_register(struct soc_camera_host *ici); 161int soc_camera_host_register(struct soc_camera_host *ici);
163void soc_camera_host_unregister(struct soc_camera_host *ici); 162void soc_camera_host_unregister(struct soc_camera_host *ici);
164 163
165const struct soc_camera_data_format *soc_camera_format_by_fourcc(
166 struct soc_camera_device *icd, unsigned int fourcc);
167const struct soc_camera_format_xlate *soc_camera_xlate_by_fourcc( 164const struct soc_camera_format_xlate *soc_camera_xlate_by_fourcc(
168 struct soc_camera_device *icd, unsigned int fourcc); 165 struct soc_camera_device *icd, unsigned int fourcc);
169 166
170struct soc_camera_data_format {
171 const char *name;
172 unsigned int depth;
173 __u32 fourcc;
174 enum v4l2_colorspace colorspace;
175};
176
177/** 167/**
178 * struct soc_camera_format_xlate - match between host and sensor formats 168 * struct soc_camera_format_xlate - match between host and sensor formats
179 * @cam_fmt: sensor format provided by the sensor 169 * @code: code of a sensor provided format
180 * @host_fmt: host format after host translation from cam_fmt 170 * @host_fmt: host format after host translation from code
181 * @buswidth: bus width for this format
182 * 171 *
183 * Host and sensor translation structure. Used in table of host and sensor 172 * Host and sensor translation structure. Used in table of host and sensor
184 * formats matchings in soc_camera_device. A host can override the generic list 173 * formats matchings in soc_camera_device. A host can override the generic list
@@ -186,9 +175,8 @@ struct soc_camera_data_format {
186 * format setup. 175 * format setup.
187 */ 176 */
188struct soc_camera_format_xlate { 177struct soc_camera_format_xlate {
189 const struct soc_camera_data_format *cam_fmt; 178 enum v4l2_mbus_pixelcode code;
190 const struct soc_camera_data_format *host_fmt; 179 const struct soc_mbus_pixelfmt *host_fmt;
191 unsigned char buswidth;
192}; 180};
193 181
194struct soc_camera_ops { 182struct soc_camera_ops {
diff --git a/include/media/soc_camera_platform.h b/include/media/soc_camera_platform.h
index bb70401b8141..0ecefe227b76 100644
--- a/include/media/soc_camera_platform.h
+++ b/include/media/soc_camera_platform.h
@@ -19,11 +19,10 @@ struct device;
19struct soc_camera_platform_info { 19struct soc_camera_platform_info {
20 const char *format_name; 20 const char *format_name;
21 unsigned long format_depth; 21 unsigned long format_depth;
22 struct v4l2_pix_format format; 22 struct v4l2_mbus_framefmt format;
23 unsigned long bus_param; 23 unsigned long bus_param;
24 struct device *dev; 24 struct device *dev;
25 int (*set_capture)(struct soc_camera_platform_info *info, int enable); 25 int (*set_capture)(struct soc_camera_platform_info *info, int enable);
26 struct soc_camera_link link;
27}; 26};
28 27
29#endif /* __SOC_CAMERA_H__ */ 28#endif /* __SOC_CAMERA_H__ */
diff --git a/include/media/soc_mediabus.h b/include/media/soc_mediabus.h
new file mode 100644
index 000000000000..037cd7be001e
--- /dev/null
+++ b/include/media/soc_mediabus.h
@@ -0,0 +1,65 @@
1/*
2 * SoC-camera Media Bus API extensions
3 *
4 * Copyright (C) 2009, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
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 version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef SOC_MEDIABUS_H
12#define SOC_MEDIABUS_H
13
14#include <linux/videodev2.h>
15
16#include <media/v4l2-mediabus.h>
17
18/**
19 * enum soc_mbus_packing - data packing types on the media-bus
20 * @SOC_MBUS_PACKING_NONE: no packing, bit-for-bit transfer to RAM
21 * @SOC_MBUS_PACKING_2X8_PADHI: 16 bits transferred in 2 8-bit samples, in the
22 * possibly incomplete byte high bits are padding
23 * @SOC_MBUS_PACKING_2X8_PADLO: as above, but low bits are padding
24 * @SOC_MBUS_PACKING_EXTEND16: sample width (e.g., 10 bits) has to be extended
25 * to 16 bits
26 */
27enum soc_mbus_packing {
28 SOC_MBUS_PACKING_NONE,
29 SOC_MBUS_PACKING_2X8_PADHI,
30 SOC_MBUS_PACKING_2X8_PADLO,
31 SOC_MBUS_PACKING_EXTEND16,
32};
33
34/**
35 * enum soc_mbus_order - sample order on the media bus
36 * @SOC_MBUS_ORDER_LE: least significant sample first
37 * @SOC_MBUS_ORDER_BE: most significant sample first
38 */
39enum soc_mbus_order {
40 SOC_MBUS_ORDER_LE,
41 SOC_MBUS_ORDER_BE,
42};
43
44/**
45 * struct soc_mbus_pixelfmt - Data format on the media bus
46 * @name: Name of the format
47 * @fourcc: Fourcc code, that will be obtained if the data is
48 * stored in memory in the following way:
49 * @packing: Type of sample-packing, that has to be used
50 * @order: Sample order when storing in memory
51 * @bits_per_sample: How many bits the bridge has to sample
52 */
53struct soc_mbus_pixelfmt {
54 const char *name;
55 u32 fourcc;
56 enum soc_mbus_packing packing;
57 enum soc_mbus_order order;
58 u8 bits_per_sample;
59};
60
61const struct soc_mbus_pixelfmt *soc_mbus_get_fmtdesc(
62 enum v4l2_mbus_pixelcode code);
63s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf);
64
65#endif
diff --git a/include/media/timb_radio.h b/include/media/timb_radio.h
new file mode 100644
index 000000000000..fcd32a3696ba
--- /dev/null
+++ b/include/media/timb_radio.h
@@ -0,0 +1,36 @@
1/*
2 * timb_radio.h Platform struct for the Timberdale radio driver
3 * Copyright (c) 2009 Intel Corporation
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19#ifndef _TIMB_RADIO_
20#define _TIMB_RADIO_ 1
21
22#include <linux/i2c.h>
23
24struct timb_radio_platform_data {
25 int i2c_adapter; /* I2C adapter where the tuner and dsp are attached */
26 struct {
27 const char *module_name;
28 struct i2c_board_info *info;
29 } tuner;
30 struct {
31 const char *module_name;
32 struct i2c_board_info *info;
33 } dsp;
34};
35
36#endif
diff --git a/include/media/tuner.h b/include/media/tuner.h
index 4d5b53ff17db..5505c5360ca3 100644
--- a/include/media/tuner.h
+++ b/include/media/tuner.h
@@ -129,6 +129,7 @@
129#define TUNER_PARTSNIC_PTI_5NF05 81 129#define TUNER_PARTSNIC_PTI_5NF05 81
130#define TUNER_PHILIPS_CU1216L 82 130#define TUNER_PHILIPS_CU1216L 82
131#define TUNER_NXP_TDA18271 83 131#define TUNER_NXP_TDA18271 83
132#define TUNER_SONY_BTF_PXN01Z 84
132 133
133/* tv card specific */ 134/* tv card specific */
134#define TDA9887_PRESENT (1<<0) 135#define TDA9887_PRESENT (1<<0)
diff --git a/include/media/tvp7002.h b/include/media/tvp7002.h
new file mode 100644
index 000000000000..ee4353459ef5
--- /dev/null
+++ b/include/media/tvp7002.h
@@ -0,0 +1,56 @@
1/* Texas Instruments Triple 8-/10-BIT 165-/110-MSPS Video and Graphics
2 * Digitizer with Horizontal PLL registers
3 *
4 * Copyright (C) 2009 Texas Instruments Inc
5 * Author: Santiago Nunez-Corrales <santiago.nunez@ridgerun.com>
6 *
7 * This code is partially based upon the TVP5150 driver
8 * written by Mauro Carvalho Chehab (mchehab@infradead.org),
9 * the TVP514x driver written by Vaibhav Hiremath <hvaibhav@ti.com>
10 * and the TVP7002 driver in the TI LSP 2.10.00.14
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 */
26#ifndef _TVP7002_H_
27#define _TVP7002_H_
28
29/* Platform-dependent data
30 *
31 * clk_polarity:
32 * 0 -> data clocked out on rising edge of DATACLK signal
33 * 1 -> data clocked out on falling edge of DATACLK signal
34 * hs_polarity:
35 * 0 -> active low HSYNC output
36 * 1 -> active high HSYNC output
37 * sog_polarity:
38 * 0 -> normal operation
39 * 1 -> operation with polarity inverted
40 * vs_polarity:
41 * 0 -> active low VSYNC output
42 * 1 -> active high VSYNC output
43 * fid_polarity:
44 * 0 -> the field ID output is set to logic 1 for an odd
45 * field (field 1) and set to logic 0 for an even
46 * field (field 0).
47 * 1 -> operation with polarity inverted.
48 */
49struct tvp7002_config {
50 u8 clk_polarity;
51 u8 hs_polarity;
52 u8 vs_polarity;
53 u8 fid_polarity;
54 u8 sog_polarity;
55};
56#endif
diff --git a/include/media/tw9910.h b/include/media/tw9910.h
index 73231e7880d8..90bcf1fa5421 100644
--- a/include/media/tw9910.h
+++ b/include/media/tw9910.h
@@ -30,9 +30,8 @@ enum tw9910_mpout_pin {
30}; 30};
31 31
32struct tw9910_video_info { 32struct tw9910_video_info {
33 unsigned long buswidth; 33 unsigned long buswidth;
34 enum tw9910_mpout_pin mpout; 34 enum tw9910_mpout_pin mpout;
35 struct soc_camera_link link;
36}; 35};
37 36
38 37
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h
index cf16689adba7..56abf21dd786 100644
--- a/include/media/v4l2-chip-ident.h
+++ b/include/media/v4l2-chip-ident.h
@@ -39,6 +39,7 @@ enum {
39 39
40 /* module saa7115: reserved range 101-149 */ 40 /* module saa7115: reserved range 101-149 */
41 V4L2_IDENT_SAA7111 = 101, 41 V4L2_IDENT_SAA7111 = 101,
42 V4L2_IDENT_SAA7111A = 102,
42 V4L2_IDENT_SAA7113 = 103, 43 V4L2_IDENT_SAA7113 = 103,
43 V4L2_IDENT_SAA7114 = 104, 44 V4L2_IDENT_SAA7114 = 104,
44 V4L2_IDENT_SAA7115 = 105, 45 V4L2_IDENT_SAA7115 = 105,
@@ -64,6 +65,7 @@ enum {
64 V4L2_IDENT_OV9650 = 254, 65 V4L2_IDENT_OV9650 = 254,
65 V4L2_IDENT_OV9655 = 255, 66 V4L2_IDENT_OV9655 = 255,
66 V4L2_IDENT_SOI968 = 256, 67 V4L2_IDENT_SOI968 = 256,
68 V4L2_IDENT_OV9640 = 257,
67 69
68 /* module saa7146: reserved range 300-309 */ 70 /* module saa7146: reserved range 300-309 */
69 V4L2_IDENT_SAA7146 = 300, 71 V4L2_IDENT_SAA7146 = 300,
@@ -72,6 +74,7 @@ enum {
72 V4L2_IDENT_CX23418_843 = 403, /* Integrated A/V Decoder on the '418 */ 74 V4L2_IDENT_CX23418_843 = 403, /* Integrated A/V Decoder on the '418 */
73 V4L2_IDENT_CX23415 = 415, 75 V4L2_IDENT_CX23415 = 415,
74 V4L2_IDENT_CX23416 = 416, 76 V4L2_IDENT_CX23416 = 416,
77 V4L2_IDENT_CX23417 = 417,
75 V4L2_IDENT_CX23418 = 418, 78 V4L2_IDENT_CX23418 = 418,
76 79
77 /* module au0828 */ 80 /* module au0828 */
@@ -129,6 +132,12 @@ enum {
129 V4L2_IDENT_SAA6752HS = 6752, 132 V4L2_IDENT_SAA6752HS = 6752,
130 V4L2_IDENT_SAA6752HS_AC3 = 6753, 133 V4L2_IDENT_SAA6752HS_AC3 = 6753,
131 134
135 /* modules tef6862: just ident 6862 */
136 V4L2_IDENT_TEF6862 = 6862,
137
138 /* module tvp7002: just ident 7002 */
139 V4L2_IDENT_TVP7002 = 7002,
140
132 /* module adv7170: just ident 7170 */ 141 /* module adv7170: just ident 7170 */
133 V4L2_IDENT_ADV7170 = 7170, 142 V4L2_IDENT_ADV7170 = 7170,
134 143
@@ -150,6 +159,9 @@ enum {
150 /* module adv7343: just ident 7343 */ 159 /* module adv7343: just ident 7343 */
151 V4L2_IDENT_ADV7343 = 7343, 160 V4L2_IDENT_ADV7343 = 7343,
152 161
162 /* module saa7706h: just ident 7706 */
163 V4L2_IDENT_SAA7706H = 7706,
164
153 /* module wm8739: just ident 8739 */ 165 /* module wm8739: just ident 8739 */
154 V4L2_IDENT_WM8739 = 8739, 166 V4L2_IDENT_WM8739 = 8739,
155 167
@@ -165,12 +177,27 @@ enum {
165 /* module mt9v011, just ident 8243 */ 177 /* module mt9v011, just ident 8243 */
166 V4L2_IDENT_MT9V011 = 8243, 178 V4L2_IDENT_MT9V011 = 8243,
167 179
180 /* module cx23885 and cx25840 */
181 V4L2_IDENT_CX23885 = 8850,
182 V4L2_IDENT_CX23885_AV = 8851, /* Integrated A/V decoder */
183 V4L2_IDENT_CX23887 = 8870,
184 V4L2_IDENT_CX23887_AV = 8871, /* Integrated A/V decoder */
185 V4L2_IDENT_CX23888 = 8880,
186 V4L2_IDENT_CX23888_AV = 8881, /* Integrated A/V decoder */
187 V4L2_IDENT_CX23888_IR = 8882, /* Integrated infrared controller */
188
168 /* module tw9910: just ident 9910 */ 189 /* module tw9910: just ident 9910 */
169 V4L2_IDENT_TW9910 = 9910, 190 V4L2_IDENT_TW9910 = 9910,
170 191
171 /* module sn9c20x: just ident 10000 */ 192 /* module sn9c20x: just ident 10000 */
172 V4L2_IDENT_SN9C20X = 10000, 193 V4L2_IDENT_SN9C20X = 10000,
173 194
195 /* module cx231xx and cx25840 */
196 V4L2_IDENT_CX2310X_AV = 23099, /* Integrated A/V decoder; not in '100 */
197 V4L2_IDENT_CX23100 = 23100,
198 V4L2_IDENT_CX23101 = 23101,
199 V4L2_IDENT_CX23102 = 23102,
200
174 /* module msp3400: reserved range 34000-34999 and 44000-44999 */ 201 /* module msp3400: reserved range 34000-34999 and 44000-44999 */
175 V4L2_IDENT_MSPX4XX = 34000, /* generic MSPX4XX identifier, only 202 V4L2_IDENT_MSPX4XX = 34000, /* generic MSPX4XX identifier, only
176 use internally (tveeprom.c). */ 203 use internally (tveeprom.c). */
@@ -247,6 +274,8 @@ enum {
247 V4L2_IDENT_MT9V022IX7ATC = 45010, /* No way to detect "normal" I77ATx */ 274 V4L2_IDENT_MT9V022IX7ATC = 45010, /* No way to detect "normal" I77ATx */
248 V4L2_IDENT_MT9V022IX7ATM = 45015, /* and "lead free" IA7ATx chips */ 275 V4L2_IDENT_MT9V022IX7ATM = 45015, /* and "lead free" IA7ATx chips */
249 V4L2_IDENT_MT9T031 = 45020, 276 V4L2_IDENT_MT9T031 = 45020,
277 V4L2_IDENT_MT9T111 = 45021,
278 V4L2_IDENT_MT9T112 = 45022,
250 V4L2_IDENT_MT9V111 = 45031, 279 V4L2_IDENT_MT9V111 = 45031,
251 V4L2_IDENT_MT9V112 = 45032, 280 V4L2_IDENT_MT9V112 = 45032,
252 281
@@ -264,6 +293,9 @@ enum {
264 293
265 /* module m52790: just ident 52790 */ 294 /* module m52790: just ident 52790 */
266 V4L2_IDENT_M52790 = 52790, 295 V4L2_IDENT_M52790 = 52790,
296
297 /* Sharp RJ54N1CB0C, 0xCB0C = 51980 */
298 V4L2_IDENT_RJ54N1CB0C = 51980,
267}; 299};
268 300
269#endif 301#endif
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index 1c25b10da34b..1c7b259f341c 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -212,5 +212,5 @@ void v4l_bound_align_image(unsigned int *w, unsigned int wmin,
212 unsigned int *h, unsigned int hmin, 212 unsigned int *h, unsigned int hmin,
213 unsigned int hmax, unsigned int halign, 213 unsigned int hmax, unsigned int halign,
214 unsigned int salign); 214 unsigned int salign);
215 215int v4l_fill_dv_preset_info(u32 preset, struct v4l2_dv_enum_preset *info);
216#endif /* V4L2_COMMON_H_ */ 216#endif /* V4L2_COMMON_H_ */
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index 73c9867d744c..2dee93892ea2 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -28,10 +28,10 @@ struct v4l2_ioctl_callbacks;
28struct video_device; 28struct video_device;
29struct v4l2_device; 29struct v4l2_device;
30 30
31/* Flag to mark the video_device struct as unregistered. 31/* Flag to mark the video_device struct as registered.
32 Drivers can set this flag if they want to block all future 32 Drivers can clear this flag if they want to block all future
33 device access. It is set by video_unregister_device. */ 33 device access. It is cleared by video_unregister_device. */
34#define V4L2_FL_UNREGISTERED (0) 34#define V4L2_FL_REGISTERED (0)
35 35
36struct v4l2_file_operations { 36struct v4l2_file_operations {
37 struct module *owner; 37 struct module *owner;
@@ -96,9 +96,7 @@ struct video_device
96/* Register video devices. Note that if video_register_device fails, 96/* Register video devices. Note that if video_register_device fails,
97 the release() callback of the video_device structure is *not* called, so 97 the release() callback of the video_device structure is *not* called, so
98 the caller is responsible for freeing any data. Usually that means that 98 the caller is responsible for freeing any data. Usually that means that
99 you call video_device_release() on failure. 99 you call video_device_release() on failure. */
100
101 Also note that vdev->minor is set to -1 if the registration failed. */
102int __must_check video_register_device(struct video_device *vdev, int type, int nr); 100int __must_check video_register_device(struct video_device *vdev, int type, int nr);
103 101
104/* Same as video_register_device, but no warning is issued if the desired 102/* Same as video_register_device, but no warning is issued if the desired
@@ -106,7 +104,7 @@ int __must_check video_register_device(struct video_device *vdev, int type, int
106int __must_check video_register_device_no_warn(struct video_device *vdev, int type, int nr); 104int __must_check video_register_device_no_warn(struct video_device *vdev, int type, int nr);
107 105
108/* Unregister video devices. Will do nothing if vdev == NULL or 106/* Unregister video devices. Will do nothing if vdev == NULL or
109 vdev->minor < 0. */ 107 video_is_registered() returns false. */
110void video_unregister_device(struct video_device *vdev); 108void video_unregister_device(struct video_device *vdev);
111 109
112/* helper functions to alloc/release struct video_device, the 110/* helper functions to alloc/release struct video_device, the
@@ -141,9 +139,14 @@ static inline void *video_drvdata(struct file *file)
141 return video_get_drvdata(video_devdata(file)); 139 return video_get_drvdata(video_devdata(file));
142} 140}
143 141
144static inline int video_is_unregistered(struct video_device *vdev) 142static inline const char *video_device_node_name(struct video_device *vdev)
143{
144 return dev_name(&vdev->dev);
145}
146
147static inline int video_is_registered(struct video_device *vdev)
145{ 148{
146 return test_bit(V4L2_FL_UNREGISTERED, &vdev->flags); 149 return test_bit(V4L2_FL_REGISTERED, &vdev->flags);
147} 150}
148 151
149#endif /* _V4L2_DEV_H */ 152#endif /* _V4L2_DEV_H */
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
index 7a4529defa88..e8ba0f2efbae 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
@@ -239,6 +239,21 @@ struct v4l2_ioctl_ops {
239 int (*vidioc_enum_frameintervals) (struct file *file, void *fh, 239 int (*vidioc_enum_frameintervals) (struct file *file, void *fh,
240 struct v4l2_frmivalenum *fival); 240 struct v4l2_frmivalenum *fival);
241 241
242 /* DV Timings IOCTLs */
243 int (*vidioc_enum_dv_presets) (struct file *file, void *fh,
244 struct v4l2_dv_enum_preset *preset);
245
246 int (*vidioc_s_dv_preset) (struct file *file, void *fh,
247 struct v4l2_dv_preset *preset);
248 int (*vidioc_g_dv_preset) (struct file *file, void *fh,
249 struct v4l2_dv_preset *preset);
250 int (*vidioc_query_dv_preset) (struct file *file, void *fh,
251 struct v4l2_dv_preset *qpreset);
252 int (*vidioc_s_dv_timings) (struct file *file, void *fh,
253 struct v4l2_dv_timings *timings);
254 int (*vidioc_g_dv_timings) (struct file *file, void *fh,
255 struct v4l2_dv_timings *timings);
256
242 /* For other private ioctls */ 257 /* For other private ioctls */
243 long (*vidioc_default) (struct file *file, void *fh, 258 long (*vidioc_default) (struct file *file, void *fh,
244 int cmd, void *arg); 259 int cmd, void *arg);
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
new file mode 100644
index 000000000000..0dbe02ada259
--- /dev/null
+++ b/include/media/v4l2-mediabus.h
@@ -0,0 +1,61 @@
1/*
2 * Media Bus API header
3 *
4 * Copyright (C) 2009, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
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 version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef V4L2_MEDIABUS_H
12#define V4L2_MEDIABUS_H
13
14/*
15 * These pixel codes uniquely identify data formats on the media bus. Mostly
16 * they correspond to similarly named V4L2_PIX_FMT_* formats, format 0 is
17 * reserved, V4L2_MBUS_FMT_FIXED shall be used by host-client pairs, where the
18 * data format is fixed. Additionally, "2X8" means that one pixel is transferred
19 * in two 8-bit samples, "BE" or "LE" specify in which order those samples are
20 * transferred over the bus: "LE" means that the least significant bits are
21 * transferred first, "BE" means that the most significant bits are transferred
22 * first, and "PADHI" and "PADLO" define which bits - low or high, in the
23 * incomplete high byte, are filled with padding bits.
24 */
25enum v4l2_mbus_pixelcode {
26 V4L2_MBUS_FMT_FIXED = 1,
27 V4L2_MBUS_FMT_YUYV8_2X8_LE,
28 V4L2_MBUS_FMT_YVYU8_2X8_LE,
29 V4L2_MBUS_FMT_YUYV8_2X8_BE,
30 V4L2_MBUS_FMT_YVYU8_2X8_BE,
31 V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE,
32 V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE,
33 V4L2_MBUS_FMT_RGB565_2X8_LE,
34 V4L2_MBUS_FMT_RGB565_2X8_BE,
35 V4L2_MBUS_FMT_SBGGR8_1X8,
36 V4L2_MBUS_FMT_SBGGR10_1X10,
37 V4L2_MBUS_FMT_GREY8_1X8,
38 V4L2_MBUS_FMT_Y10_1X10,
39 V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE,
40 V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE,
41 V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE,
42 V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE,
43};
44
45/**
46 * struct v4l2_mbus_framefmt - frame format on the media bus
47 * @width: frame width
48 * @height: frame height
49 * @code: data format code
50 * @field: used interlacing type
51 * @colorspace: colorspace of the data
52 */
53struct v4l2_mbus_framefmt {
54 __u32 width;
55 __u32 height;
56 enum v4l2_mbus_pixelcode code;
57 enum v4l2_field field;
58 enum v4l2_colorspace colorspace;
59};
60
61#endif
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index d411345f244b..2bcdca0a57fc 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -22,6 +22,17 @@
22#define _V4L2_SUBDEV_H 22#define _V4L2_SUBDEV_H
23 23
24#include <media/v4l2-common.h> 24#include <media/v4l2-common.h>
25#include <media/v4l2-mediabus.h>
26
27/* generic v4l2_device notify callback notification values */
28#define V4L2_SUBDEV_IR_RX_NOTIFY _IOW('v', 0, u32)
29#define V4L2_SUBDEV_IR_RX_FIFO_SERVICE_REQ 0x00000001
30#define V4L2_SUBDEV_IR_RX_END_OF_RX_DETECTED 0x00000002
31#define V4L2_SUBDEV_IR_RX_HW_FIFO_OVERRUN 0x00000004
32#define V4L2_SUBDEV_IR_RX_SW_FIFO_OVERRUN 0x00000008
33
34#define V4L2_SUBDEV_IR_TX_NOTIFY _IOW('v', 1, u32)
35#define V4L2_SUBDEV_IR_TX_FIFO_SERVICE_REQ 0x00000001
25 36
26struct v4l2_device; 37struct v4l2_device;
27struct v4l2_subdev; 38struct v4l2_subdev;
@@ -96,6 +107,9 @@ struct v4l2_decode_vbi_line {
96 107
97 s_gpio: set GPIO pins. Very simple right now, might need to be extended with 108 s_gpio: set GPIO pins. Very simple right now, might need to be extended with
98 a direction argument if needed. 109 a direction argument if needed.
110
111 s_power: puts subdevice in power saving mode (on == 0) or normal operation
112 mode (on == 1).
99 */ 113 */
100struct v4l2_subdev_core_ops { 114struct v4l2_subdev_core_ops {
101 int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip); 115 int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip);
@@ -118,6 +132,7 @@ struct v4l2_subdev_core_ops {
118 int (*g_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg); 132 int (*g_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg);
119 int (*s_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg); 133 int (*s_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg);
120#endif 134#endif
135 int (*s_power)(struct v4l2_subdev *sd, int on);
121}; 136};
122 137
123/* s_mode: switch the tuner to a specific tuner mode. Replacement of s_radio. 138/* s_mode: switch the tuner to a specific tuner mode. Replacement of s_radio.
@@ -127,8 +142,6 @@ struct v4l2_subdev_core_ops {
127 s_type_addr: sets tuner type and its I2C addr. 142 s_type_addr: sets tuner type and its I2C addr.
128 143
129 s_config: sets tda9887 specific stuff, like port1, port2 and qss 144 s_config: sets tda9887 specific stuff, like port1, port2 and qss
130
131 s_standby: puts tuner on powersaving state, disabling it, except for i2c.
132 */ 145 */
133struct v4l2_subdev_tuner_ops { 146struct v4l2_subdev_tuner_ops {
134 int (*s_mode)(struct v4l2_subdev *sd, enum v4l2_tuner_type); 147 int (*s_mode)(struct v4l2_subdev *sd, enum v4l2_tuner_type);
@@ -141,7 +154,6 @@ struct v4l2_subdev_tuner_ops {
141 int (*s_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm); 154 int (*s_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm);
142 int (*s_type_addr)(struct v4l2_subdev *sd, struct tuner_setup *type); 155 int (*s_type_addr)(struct v4l2_subdev *sd, struct tuner_setup *type);
143 int (*s_config)(struct v4l2_subdev *sd, const struct v4l2_priv_tun_config *config); 156 int (*s_config)(struct v4l2_subdev *sd, const struct v4l2_priv_tun_config *config);
144 int (*s_standby)(struct v4l2_subdev *sd);
145}; 157};
146 158
147/* s_clock_freq: set the frequency (in Hz) of the audio clock output. 159/* s_clock_freq: set the frequency (in Hz) of the audio clock output.
@@ -168,6 +180,7 @@ struct v4l2_subdev_audio_ops {
168 int (*s_clock_freq)(struct v4l2_subdev *sd, u32 freq); 180 int (*s_clock_freq)(struct v4l2_subdev *sd, u32 freq);
169 int (*s_i2s_clock_freq)(struct v4l2_subdev *sd, u32 freq); 181 int (*s_i2s_clock_freq)(struct v4l2_subdev *sd, u32 freq);
170 int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config); 182 int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config);
183 int (*s_stream)(struct v4l2_subdev *sd, int enable);
171}; 184};
172 185
173/* 186/*
@@ -196,7 +209,7 @@ struct v4l2_subdev_audio_ops {
196 s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by 209 s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by
197 video input devices. 210 video input devices.
198 211
199 s_crystal_freq: sets the frequency of the crystal used to generate the 212 s_crystal_freq: sets the frequency of the crystal used to generate the
200 clocks in Hz. An extra flags field allows device specific configuration 213 clocks in Hz. An extra flags field allows device specific configuration
201 regarding clock frequency dividers, etc. If not used, then set flags 214 regarding clock frequency dividers, etc. If not used, then set flags
202 to 0. If the frequency is not supported, then -EINVAL is returned. 215 to 0. If the frequency is not supported, then -EINVAL is returned.
@@ -206,6 +219,26 @@ struct v4l2_subdev_audio_ops {
206 219
207 s_routing: see s_routing in audio_ops, except this version is for video 220 s_routing: see s_routing in audio_ops, except this version is for video
208 devices. 221 devices.
222
223 s_dv_preset: set dv (Digital Video) preset in the sub device. Similar to
224 s_std()
225
226 query_dv_preset: query dv preset in the sub device. This is similar to
227 querystd()
228
229 s_dv_timings(): Set custom dv timings in the sub device. This is used
230 when sub device is capable of setting detailed timing information
231 in the hardware to generate/detect the video signal.
232
233 g_dv_timings(): Get custom dv timings in the sub device.
234
235 enum_mbus_fmt: enumerate pixel formats, provided by a video data source
236
237 g_mbus_fmt: get the current pixel format, provided by a video data source
238
239 try_mbus_fmt: try to set a pixel format on a video data source
240
241 s_mbus_fmt: set a pixel format on a video data source
209 */ 242 */
210struct v4l2_subdev_video_ops { 243struct v4l2_subdev_video_ops {
211 int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config); 244 int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config);
@@ -229,13 +262,125 @@ struct v4l2_subdev_video_ops {
229 int (*s_parm)(struct v4l2_subdev *sd, struct v4l2_streamparm *param); 262 int (*s_parm)(struct v4l2_subdev *sd, struct v4l2_streamparm *param);
230 int (*enum_framesizes)(struct v4l2_subdev *sd, struct v4l2_frmsizeenum *fsize); 263 int (*enum_framesizes)(struct v4l2_subdev *sd, struct v4l2_frmsizeenum *fsize);
231 int (*enum_frameintervals)(struct v4l2_subdev *sd, struct v4l2_frmivalenum *fival); 264 int (*enum_frameintervals)(struct v4l2_subdev *sd, struct v4l2_frmivalenum *fival);
265 int (*s_dv_preset)(struct v4l2_subdev *sd,
266 struct v4l2_dv_preset *preset);
267 int (*query_dv_preset)(struct v4l2_subdev *sd,
268 struct v4l2_dv_preset *preset);
269 int (*s_dv_timings)(struct v4l2_subdev *sd,
270 struct v4l2_dv_timings *timings);
271 int (*g_dv_timings)(struct v4l2_subdev *sd,
272 struct v4l2_dv_timings *timings);
273 int (*enum_mbus_fmt)(struct v4l2_subdev *sd, int index,
274 enum v4l2_mbus_pixelcode *code);
275 int (*g_mbus_fmt)(struct v4l2_subdev *sd,
276 struct v4l2_mbus_framefmt *fmt);
277 int (*try_mbus_fmt)(struct v4l2_subdev *sd,
278 struct v4l2_mbus_framefmt *fmt);
279 int (*s_mbus_fmt)(struct v4l2_subdev *sd,
280 struct v4l2_mbus_framefmt *fmt);
281};
282
283/**
284 * struct v4l2_subdev_sensor_ops - v4l2-subdev sensor operations
285 * @g_skip_top_lines: number of lines at the top of the image to be skipped.
286 * This is needed for some sensors, which always corrupt
287 * several top lines of the output image, or which send their
288 * metadata in them.
289 */
290struct v4l2_subdev_sensor_ops {
291 int (*g_skip_top_lines)(struct v4l2_subdev *sd, u32 *lines);
292};
293
294/*
295 interrupt_service_routine: Called by the bridge chip's interrupt service
296 handler, when an IR interrupt status has be raised due to this subdev,
297 so that this subdev can handle the details. It may schedule work to be
298 performed later. It must not sleep. *Called from an IRQ context*.
299
300 [rt]x_g_parameters: Get the current operating parameters and state of the
301 the IR receiver or transmitter.
302
303 [rt]x_s_parameters: Set the current operating parameters and state of the
304 the IR receiver or transmitter. It is recommended to call
305 [rt]x_g_parameters first to fill out the current state, and only change
306 the fields that need to be changed. Upon return, the actual device
307 operating parameters and state will be returned. Note that hardware
308 limitations may prevent the actual settings from matching the requested
309 settings - e.g. an actual carrier setting of 35,904 Hz when 36,000 Hz
310 was requested. An exception is when the shutdown parameter is true.
311 The last used operational parameters will be returned, but the actual
312 state of the hardware be different to minimize power consumption and
313 processing when shutdown is true.
314
315 rx_read: Reads received codes or pulse width data.
316 The semantics are similar to a non-blocking read() call.
317
318 tx_write: Writes codes or pulse width data for transmission.
319 The semantics are similar to a non-blocking write() call.
320 */
321
322enum v4l2_subdev_ir_mode {
323 V4L2_SUBDEV_IR_MODE_PULSE_WIDTH, /* space & mark widths in nanosecs */
324};
325
326/* Data format of data read or written for V4L2_SUBDEV_IR_MODE_PULSE_WIDTH */
327#define V4L2_SUBDEV_IR_PULSE_MAX_WIDTH_NS 0x7fffffff
328#define V4L2_SUBDEV_IR_PULSE_LEVEL_MASK 0x80000000
329#define V4L2_SUBDEV_IR_PULSE_RX_SEQ_END 0xffffffff
330
331struct v4l2_subdev_ir_parameters {
332 /* Either Rx or Tx */
333 unsigned int bytes_per_data_element; /* of data in read or write call */
334 enum v4l2_subdev_ir_mode mode;
335
336 bool enable;
337 bool interrupt_enable;
338 bool shutdown; /* true: set hardware to low/no power, false: normal */
339
340 bool modulation; /* true: uses carrier, false: baseband */
341 u32 max_pulse_width; /* ns, valid only for baseband signal */
342 unsigned int carrier_freq; /* Hz, valid only for modulated signal*/
343 unsigned int duty_cycle; /* percent, valid only for modulated signal*/
344 bool invert; /* logically invert sense of mark/space */
345
346 /* Rx only */
347 u32 noise_filter_min_width; /* ns, min time of a valid pulse */
348 unsigned int carrier_range_lower; /* Hz, valid only for modulated sig */
349 unsigned int carrier_range_upper; /* Hz, valid only for modulated sig */
350 u32 resolution; /* ns */
351};
352
353struct v4l2_subdev_ir_ops {
354 /* Common to receiver and transmitter */
355 int (*interrupt_service_routine)(struct v4l2_subdev *sd,
356 u32 status, bool *handled);
357
358 /* Receiver */
359 int (*rx_read)(struct v4l2_subdev *sd, u8 *buf, size_t count,
360 ssize_t *num);
361
362 int (*rx_g_parameters)(struct v4l2_subdev *sd,
363 struct v4l2_subdev_ir_parameters *params);
364 int (*rx_s_parameters)(struct v4l2_subdev *sd,
365 struct v4l2_subdev_ir_parameters *params);
366
367 /* Transmitter */
368 int (*tx_write)(struct v4l2_subdev *sd, u8 *buf, size_t count,
369 ssize_t *num);
370
371 int (*tx_g_parameters)(struct v4l2_subdev *sd,
372 struct v4l2_subdev_ir_parameters *params);
373 int (*tx_s_parameters)(struct v4l2_subdev *sd,
374 struct v4l2_subdev_ir_parameters *params);
232}; 375};
233 376
234struct v4l2_subdev_ops { 377struct v4l2_subdev_ops {
235 const struct v4l2_subdev_core_ops *core; 378 const struct v4l2_subdev_core_ops *core;
236 const struct v4l2_subdev_tuner_ops *tuner; 379 const struct v4l2_subdev_tuner_ops *tuner;
237 const struct v4l2_subdev_audio_ops *audio; 380 const struct v4l2_subdev_audio_ops *audio;
238 const struct v4l2_subdev_video_ops *video; 381 const struct v4l2_subdev_video_ops *video;
382 const struct v4l2_subdev_ir_ops *ir;
383 const struct v4l2_subdev_sensor_ops *sensor;
239}; 384};
240 385
241#define V4L2_SUBDEV_NAME_SIZE 32 386#define V4L2_SUBDEV_NAME_SIZE 32
@@ -290,7 +435,7 @@ static inline void v4l2_subdev_init(struct v4l2_subdev *sd,
290 Example: err = v4l2_subdev_call(sd, core, g_chip_ident, &chip); 435 Example: err = v4l2_subdev_call(sd, core, g_chip_ident, &chip);
291 */ 436 */
292#define v4l2_subdev_call(sd, o, f, args...) \ 437#define v4l2_subdev_call(sd, o, f, args...) \
293 (!(sd) ? -ENODEV : (((sd) && (sd)->ops->o && (sd)->ops->o->f) ? \ 438 (!(sd) ? -ENODEV : (((sd)->ops->o && (sd)->ops->o->f) ? \
294 (sd)->ops->o->f((sd) , ##args) : -ENOIOCTLCMD)) 439 (sd)->ops->o->f((sd) , ##args) : -ENOIOCTLCMD))
295 440
296/* Send a notification to v4l2_device. */ 441/* Send a notification to v4l2_device. */
diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h
index 1c5946c44758..316fdccdcaa0 100644
--- a/include/media/videobuf-core.h
+++ b/include/media/videobuf-core.h
@@ -166,7 +166,7 @@ struct videobuf_queue {
166 enum v4l2_field field; 166 enum v4l2_field field;
167 enum v4l2_field last; /* for field=V4L2_FIELD_ALTERNATE */ 167 enum v4l2_field last; /* for field=V4L2_FIELD_ALTERNATE */
168 struct videobuf_buffer *bufs[VIDEO_MAX_FRAME]; 168 struct videobuf_buffer *bufs[VIDEO_MAX_FRAME];
169 struct videobuf_queue_ops *ops; 169 const struct videobuf_queue_ops *ops;
170 struct videobuf_qtype_ops *int_ops; 170 struct videobuf_qtype_ops *int_ops;
171 171
172 unsigned int streaming:1; 172 unsigned int streaming:1;
@@ -195,7 +195,7 @@ void *videobuf_queue_to_vmalloc (struct videobuf_queue* q,
195 struct videobuf_buffer *buf); 195 struct videobuf_buffer *buf);
196 196
197void videobuf_queue_core_init(struct videobuf_queue *q, 197void videobuf_queue_core_init(struct videobuf_queue *q,
198 struct videobuf_queue_ops *ops, 198 const struct videobuf_queue_ops *ops,
199 struct device *dev, 199 struct device *dev,
200 spinlock_t *irqlock, 200 spinlock_t *irqlock,
201 enum v4l2_buf_type type, 201 enum v4l2_buf_type type,
diff --git a/include/media/videobuf-dma-contig.h b/include/media/videobuf-dma-contig.h
index 549386681aab..ebaa9bc1ee8d 100644
--- a/include/media/videobuf-dma-contig.h
+++ b/include/media/videobuf-dma-contig.h
@@ -17,7 +17,7 @@
17#include <media/videobuf-core.h> 17#include <media/videobuf-core.h>
18 18
19void videobuf_queue_dma_contig_init(struct videobuf_queue *q, 19void videobuf_queue_dma_contig_init(struct videobuf_queue *q,
20 struct videobuf_queue_ops *ops, 20 const struct videobuf_queue_ops *ops,
21 struct device *dev, 21 struct device *dev,
22 spinlock_t *irqlock, 22 spinlock_t *irqlock,
23 enum v4l2_buf_type type, 23 enum v4l2_buf_type type,
diff --git a/include/media/videobuf-dma-sg.h b/include/media/videobuf-dma-sg.h
index dda47f0082e9..53e72f787175 100644
--- a/include/media/videobuf-dma-sg.h
+++ b/include/media/videobuf-dma-sg.h
@@ -103,7 +103,7 @@ struct videobuf_dmabuf *videobuf_to_dma (struct videobuf_buffer *buf);
103void *videobuf_sg_alloc(size_t size); 103void *videobuf_sg_alloc(size_t size);
104 104
105void videobuf_queue_sg_init(struct videobuf_queue* q, 105void videobuf_queue_sg_init(struct videobuf_queue* q,
106 struct videobuf_queue_ops *ops, 106 const struct videobuf_queue_ops *ops,
107 struct device *dev, 107 struct device *dev,
108 spinlock_t *irqlock, 108 spinlock_t *irqlock,
109 enum v4l2_buf_type type, 109 enum v4l2_buf_type type,
diff --git a/include/media/videobuf-dvb.h b/include/media/videobuf-dvb.h
index 6ba4f1271d23..07cf4b9d0a65 100644
--- a/include/media/videobuf-dvb.h
+++ b/include/media/videobuf-dvb.h
@@ -42,7 +42,9 @@ int videobuf_dvb_register_bus(struct videobuf_dvb_frontends *f,
42 void *adapter_priv, 42 void *adapter_priv,
43 struct device *device, 43 struct device *device,
44 short *adapter_nr, 44 short *adapter_nr,
45 int mfe_shared); 45 int mfe_shared,
46 int (*fe_ioctl_override)(struct dvb_frontend *,
47 unsigned int, void *, unsigned int));
46 48
47void videobuf_dvb_unregister_bus(struct videobuf_dvb_frontends *f); 49void videobuf_dvb_unregister_bus(struct videobuf_dvb_frontends *f);
48 50
diff --git a/include/media/videobuf-vmalloc.h b/include/media/videobuf-vmalloc.h
index e87222c6a125..4b419a257a7d 100644
--- a/include/media/videobuf-vmalloc.h
+++ b/include/media/videobuf-vmalloc.h
@@ -30,8 +30,8 @@ struct videobuf_vmalloc_memory
30}; 30};
31 31
32void videobuf_queue_vmalloc_init(struct videobuf_queue* q, 32void videobuf_queue_vmalloc_init(struct videobuf_queue* q,
33 struct videobuf_queue_ops *ops, 33 const struct videobuf_queue_ops *ops,
34 void *dev, 34 struct device *dev,
35 spinlock_t *irqlock, 35 spinlock_t *irqlock,
36 enum v4l2_buf_type type, 36 enum v4l2_buf_type type,
37 enum v4l2_field field, 37 enum v4l2_field field,