aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-09 22:50:49 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-09 22:50:49 -0500
commit3e7468313758913c5e4d372f35b271b96bad1298 (patch)
treeeb612d252a9e2349a1173451cd779beebd18a33e /include
parent6825fbc4cb219f2c98bb7d157915d797cf5cb823 (diff)
parente97f4677961f68e29bd906022ebf60a6df7f530a (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (345 commits) V4L/DVB (13542): ir-keytable: Allow dynamic table change V4L/DVB (13541): atbm8830: replace 64-bit division and floating point usage V4L/DVB (13540): ir-common: Cleanup get key evdev code V4L/DVB (13539): ir-common: add __func__ for debug messages V4L/DVB (13538): ir-common: Use a dynamic keycode table V4L/DVB (13537): ir: Prepare the code for dynamic keycode table allocation V4L/DVB (13536): em28xx: Use the full RC5 code on HVR-950 Remote Controller V4L/DVB (13535): ir-common: Add a hauppauge new table with the complete RC5 code V4L/DVB (13534): ir-common: Remove some unused fields/structs V4L/DVB (13533): ir: use dynamic tables, instead of static ones V4L/DVB (13532): ir-common: Add infrastructure to use a dynamic keycode table V4L/DVB (13531): ir-common: rename the debug routine to allow exporting it V4L/DVB (13458): go7007: subdev conversion V4L/DVB (13457): s2250: subdev conversion V4L/DVB (13456): s2250: Change module structure V4L/DVB (13528): em28xx: add support for em2800 VC211A card em28xx: don't reduce scale to half size for em2800 em28xx: don't load audio modules when AC97 is mis-detected em28xx: em2800 chips support max width of 640 V4L/DVB (13523): dvb-bt8xx: fix compile warning ... Fix up trivial conflicts due to spelling fixes from the trivial tree in Documentation/video4linux/gspca.txt drivers/media/video/cx18/cx18-mailbox.h
Diffstat (limited to 'include')
-rw-r--r--include/linux/videodev2.h7
-rw-r--r--include/media/cx25840.h1
-rw-r--r--include/media/davinci/vpfe_capture.h2
-rw-r--r--include/media/ir-common.h43
-rw-r--r--include/media/v4l2-chip-ident.h23
-rw-r--r--include/media/v4l2-subdev.h103
-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
11 files changed, 171 insertions, 24 deletions
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index dfd4745a955f..32b92298fd79 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -361,6 +361,7 @@ struct v4l2_pix_format {
361#define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ 361#define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */
362#define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */ 362#define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */
363#define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */ 363#define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */
364#define V4L2_PIX_FMT_STV0680 v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */
364 365
365/* 366/*
366 * F O R M A T E N U M E R A T I O N 367 * F O R M A T E N U M E R A T I O N
@@ -563,6 +564,7 @@ struct v4l2_framebuffer {
563#define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010 564#define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010
564#define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020 565#define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020
565#define V4L2_FBUF_CAP_LOCAL_INV_ALPHA 0x0040 566#define V4L2_FBUF_CAP_LOCAL_INV_ALPHA 0x0040
567#define V4L2_FBUF_CAP_SRC_CHROMAKEY 0x0080
566/* Flags for the 'flags' field. */ 568/* Flags for the 'flags' field. */
567#define V4L2_FBUF_FLAG_PRIMARY 0x0001 569#define V4L2_FBUF_FLAG_PRIMARY 0x0001
568#define V4L2_FBUF_FLAG_OVERLAY 0x0002 570#define V4L2_FBUF_FLAG_OVERLAY 0x0002
@@ -570,6 +572,7 @@ struct v4l2_framebuffer {
570#define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008 572#define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008
571#define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010 573#define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010
572#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020 574#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020
575#define V4L2_FBUF_FLAG_SRC_CHROMAKEY 0x0040
573 576
574struct v4l2_clip { 577struct v4l2_clip {
575 struct v4l2_rect c; 578 struct v4l2_rect c;
@@ -912,8 +915,10 @@ enum v4l2_colorfx {
912#define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32) 915#define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32)
913#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33) 916#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33)
914 917
918#define V4L2_CID_ROTATE (V4L2_CID_BASE+34)
919#define V4L2_CID_BG_COLOR (V4L2_CID_BASE+35)
915/* last CID + 1 */ 920/* last CID + 1 */
916#define V4L2_CID_LASTP1 (V4L2_CID_BASE+34) 921#define V4L2_CID_LASTP1 (V4L2_CID_BASE+36)
917 922
918/* MPEG-class control IDs defined by V4L2 */ 923/* MPEG-class control IDs defined by V4L2 */
919#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) 924#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
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/vpfe_capture.h b/include/media/davinci/vpfe_capture.h
index 71d8982e13ff..d863e5e8426d 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 */
diff --git a/include/media/ir-common.h b/include/media/ir-common.h
index 29f0e53cff94..e41a99ee353e 100644
--- a/include/media/ir-common.h
+++ b/include/media/ir-common.h
@@ -26,14 +26,16 @@
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#include <linux/spinlock.h>
30
31extern int media_ir_debug; /* media_ir_debug level (0,1,2) */
32#define IR_dprintk(level, fmt, arg...) if (media_ir_debug >= level) \
33 printk(KERN_DEBUG "%s: " fmt , __func__, ## arg)
29 34
30#define IR_TYPE_RC5 1 35#define IR_TYPE_RC5 1
31#define IR_TYPE_PD 2 /* Pulse distance encoded IR */ 36#define IR_TYPE_PD 2 /* Pulse distance encoded IR */
32#define IR_TYPE_OTHER 99 37#define IR_TYPE_OTHER 99
33 38
34#define IR_KEYTAB_TYPE u32
35#define IR_KEYTAB_SIZE 128 /* enougth for rc5, probably need more some day */
36
37struct ir_scancode { 39struct ir_scancode {
38 u16 scancode; 40 u16 scancode;
39 u32 keycode; 41 u32 keycode;
@@ -42,11 +44,9 @@ struct ir_scancode {
42struct ir_scancode_table { 44struct ir_scancode_table {
43 struct ir_scancode *scan; 45 struct ir_scancode *scan;
44 int size; 46 int size;
47 spinlock_t lock;
45}; 48};
46 49
47#define IR_KEYCODE(tab,code) (((unsigned)code < IR_KEYTAB_SIZE) \
48 ? tab[code] : KEY_RESERVED)
49
50#define RC5_START(x) (((x)>>12)&3) 50#define RC5_START(x) (((x)>>12)&3)
51#define RC5_TOGGLE(x) (((x)>>11)&1) 51#define RC5_TOGGLE(x) (((x)>>11)&1)
52#define RC5_ADDR(x) (((x)>>6)&31) 52#define RC5_ADDR(x) (((x)>>6)&31)
@@ -55,11 +55,11 @@ struct ir_scancode_table {
55struct ir_input_state { 55struct ir_input_state {
56 /* configuration */ 56 /* configuration */
57 int ir_type; 57 int ir_type;
58 IR_KEYTAB_TYPE ir_codes[IR_KEYTAB_SIZE]; 58
59 struct ir_scancode_table keytable;
59 60
60 /* key info */ 61 /* key info */
61 u32 ir_raw; /* raw data */ 62 u32 ir_key; /* ir scancode */
62 u32 ir_key; /* ir key code */
63 u32 keycode; /* linux key code */ 63 u32 keycode; /* linux key code */
64 int keypressed; /* current state */ 64 int keypressed; /* current state */
65}; 65};
@@ -102,20 +102,36 @@ struct card_ir {
102 struct tasklet_struct tlet; 102 struct tasklet_struct tlet;
103}; 103};
104 104
105void ir_input_init(struct input_dev *dev, struct ir_input_state *ir, 105/* Routines from ir-functions.c */
106
107int ir_input_init(struct input_dev *dev, struct ir_input_state *ir,
106 int ir_type, struct ir_scancode_table *ir_codes); 108 int ir_type, struct ir_scancode_table *ir_codes);
107void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir); 109void 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, 110void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir,
109 u32 ir_key, u32 ir_raw); 111 u32 ir_key);
110u32 ir_extract_bits(u32 data, u32 mask); 112u32 ir_extract_bits(u32 data, u32 mask);
111int ir_dump_samples(u32 *samples, int count); 113int ir_dump_samples(u32 *samples, int count);
112int ir_decode_biphase(u32 *samples, int count, int low, int high); 114int ir_decode_biphase(u32 *samples, int count, int low, int high);
113int ir_decode_pulsedistance(u32 *samples, int count, int low, int high); 115int ir_decode_pulsedistance(u32 *samples, int count, int low, int high);
116u32 ir_rc5_decode(unsigned int code);
114 117
115void ir_rc5_timer_end(unsigned long data); 118void ir_rc5_timer_end(unsigned long data);
116void ir_rc5_timer_keyup(unsigned long data); 119void ir_rc5_timer_keyup(unsigned long data);
117 120
118/* Keymaps to be used by other modules */ 121/* Routines from ir-keytable.c */
122
123u32 ir_g_keycode_from_table(struct input_dev *input_dev,
124 u32 scancode);
125
126int ir_set_keycode_table(struct input_dev *input_dev,
127 struct ir_scancode_table *rc_tab);
128
129int ir_roundup_tablesize(int n_elems);
130int ir_copy_table(struct ir_scancode_table *destin,
131 const struct ir_scancode_table *origin);
132void ir_input_free(struct input_dev *input_dev);
133
134/* scancode->keycode map tables from ir-keymaps.c */
119 135
120extern struct ir_scancode_table ir_codes_empty_table; 136extern struct ir_scancode_table ir_codes_empty_table;
121extern struct ir_scancode_table ir_codes_avermedia_table; 137extern struct ir_scancode_table ir_codes_avermedia_table;
@@ -150,6 +166,7 @@ extern struct ir_scancode_table ir_codes_rc5_tv_table;
150extern struct ir_scancode_table ir_codes_winfast_table; 166extern struct ir_scancode_table ir_codes_winfast_table;
151extern struct ir_scancode_table ir_codes_pinnacle_color_table; 167extern struct ir_scancode_table ir_codes_pinnacle_color_table;
152extern struct ir_scancode_table ir_codes_hauppauge_new_table; 168extern struct ir_scancode_table ir_codes_hauppauge_new_table;
169extern struct ir_scancode_table ir_codes_rc5_hauppauge_new_table;
153extern struct ir_scancode_table ir_codes_npgtech_table; 170extern struct ir_scancode_table ir_codes_npgtech_table;
154extern struct ir_scancode_table ir_codes_norwood_table; 171extern struct ir_scancode_table ir_codes_norwood_table;
155extern struct ir_scancode_table ir_codes_proteus_2309_table; 172extern struct ir_scancode_table ir_codes_proteus_2309_table;
@@ -172,6 +189,8 @@ 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; 189extern struct ir_scancode_table ir_codes_kworld_plus_tv_analog_table;
173extern struct ir_scancode_table ir_codes_kaiomy_table; 190extern struct ir_scancode_table ir_codes_kaiomy_table;
174extern struct ir_scancode_table ir_codes_dm1105_nec_table; 191extern struct ir_scancode_table ir_codes_dm1105_nec_table;
192extern struct ir_scancode_table ir_codes_tevii_nec_table;
193extern struct ir_scancode_table ir_codes_tbs_nec_table;
175extern struct ir_scancode_table ir_codes_evga_indtube_table; 194extern struct ir_scancode_table ir_codes_evga_indtube_table;
176extern struct ir_scancode_table ir_codes_terratec_cinergy_xs_table; 195extern struct ir_scancode_table ir_codes_terratec_cinergy_xs_table;
177extern struct ir_scancode_table ir_codes_videomate_s350_table; 196extern struct ir_scancode_table ir_codes_videomate_s350_table;
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h
index cf16689adba7..91942dbe64e3 100644
--- a/include/media/v4l2-chip-ident.h
+++ b/include/media/v4l2-chip-ident.h
@@ -64,6 +64,7 @@ enum {
64 V4L2_IDENT_OV9650 = 254, 64 V4L2_IDENT_OV9650 = 254,
65 V4L2_IDENT_OV9655 = 255, 65 V4L2_IDENT_OV9655 = 255,
66 V4L2_IDENT_SOI968 = 256, 66 V4L2_IDENT_SOI968 = 256,
67 V4L2_IDENT_OV9640 = 257,
67 68
68 /* module saa7146: reserved range 300-309 */ 69 /* module saa7146: reserved range 300-309 */
69 V4L2_IDENT_SAA7146 = 300, 70 V4L2_IDENT_SAA7146 = 300,
@@ -72,6 +73,7 @@ enum {
72 V4L2_IDENT_CX23418_843 = 403, /* Integrated A/V Decoder on the '418 */ 73 V4L2_IDENT_CX23418_843 = 403, /* Integrated A/V Decoder on the '418 */
73 V4L2_IDENT_CX23415 = 415, 74 V4L2_IDENT_CX23415 = 415,
74 V4L2_IDENT_CX23416 = 416, 75 V4L2_IDENT_CX23416 = 416,
76 V4L2_IDENT_CX23417 = 417,
75 V4L2_IDENT_CX23418 = 418, 77 V4L2_IDENT_CX23418 = 418,
76 78
77 /* module au0828 */ 79 /* module au0828 */
@@ -129,6 +131,9 @@ enum {
129 V4L2_IDENT_SAA6752HS = 6752, 131 V4L2_IDENT_SAA6752HS = 6752,
130 V4L2_IDENT_SAA6752HS_AC3 = 6753, 132 V4L2_IDENT_SAA6752HS_AC3 = 6753,
131 133
134 /* modules tef6862: just ident 6862 */
135 V4L2_IDENT_TEF6862 = 6862,
136
132 /* module adv7170: just ident 7170 */ 137 /* module adv7170: just ident 7170 */
133 V4L2_IDENT_ADV7170 = 7170, 138 V4L2_IDENT_ADV7170 = 7170,
134 139
@@ -165,12 +170,27 @@ enum {
165 /* module mt9v011, just ident 8243 */ 170 /* module mt9v011, just ident 8243 */
166 V4L2_IDENT_MT9V011 = 8243, 171 V4L2_IDENT_MT9V011 = 8243,
167 172
173 /* module cx23885 and cx25840 */
174 V4L2_IDENT_CX23885 = 8850,
175 V4L2_IDENT_CX23885_AV = 8851, /* Integrated A/V decoder */
176 V4L2_IDENT_CX23887 = 8870,
177 V4L2_IDENT_CX23887_AV = 8871, /* Integrated A/V decoder */
178 V4L2_IDENT_CX23888 = 8880,
179 V4L2_IDENT_CX23888_AV = 8881, /* Integrated A/V decoder */
180 V4L2_IDENT_CX23888_IR = 8882, /* Integrated infrared controller */
181
168 /* module tw9910: just ident 9910 */ 182 /* module tw9910: just ident 9910 */
169 V4L2_IDENT_TW9910 = 9910, 183 V4L2_IDENT_TW9910 = 9910,
170 184
171 /* module sn9c20x: just ident 10000 */ 185 /* module sn9c20x: just ident 10000 */
172 V4L2_IDENT_SN9C20X = 10000, 186 V4L2_IDENT_SN9C20X = 10000,
173 187
188 /* module cx231xx and cx25840 */
189 V4L2_IDENT_CX2310X_AV = 23099, /* Integrated A/V decoder; not in '100 */
190 V4L2_IDENT_CX23100 = 23100,
191 V4L2_IDENT_CX23101 = 23101,
192 V4L2_IDENT_CX23102 = 23102,
193
174 /* module msp3400: reserved range 34000-34999 and 44000-44999 */ 194 /* module msp3400: reserved range 34000-34999 and 44000-44999 */
175 V4L2_IDENT_MSPX4XX = 34000, /* generic MSPX4XX identifier, only 195 V4L2_IDENT_MSPX4XX = 34000, /* generic MSPX4XX identifier, only
176 use internally (tveeprom.c). */ 196 use internally (tveeprom.c). */
@@ -264,6 +284,9 @@ enum {
264 284
265 /* module m52790: just ident 52790 */ 285 /* module m52790: just ident 52790 */
266 V4L2_IDENT_M52790 = 52790, 286 V4L2_IDENT_M52790 = 52790,
287
288 /* Sharp RJ54N1CB0C, 0xCB0C = 51980 */
289 V4L2_IDENT_RJ54N1CB0C = 51980,
267}; 290};
268 291
269#endif 292#endif
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index d411345f244b..00bf17608453 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -23,6 +23,16 @@
23 23
24#include <media/v4l2-common.h> 24#include <media/v4l2-common.h>
25 25
26/* generic v4l2_device notify callback notification values */
27#define V4L2_SUBDEV_IR_RX_NOTIFY _IOW('v', 0, u32)
28#define V4L2_SUBDEV_IR_RX_FIFO_SERVICE_REQ 0x00000001
29#define V4L2_SUBDEV_IR_RX_END_OF_RX_DETECTED 0x00000002
30#define V4L2_SUBDEV_IR_RX_HW_FIFO_OVERRUN 0x00000004
31#define V4L2_SUBDEV_IR_RX_SW_FIFO_OVERRUN 0x00000008
32
33#define V4L2_SUBDEV_IR_TX_NOTIFY _IOW('v', 1, u32)
34#define V4L2_SUBDEV_IR_TX_FIFO_SERVICE_REQ 0x00000001
35
26struct v4l2_device; 36struct v4l2_device;
27struct v4l2_subdev; 37struct v4l2_subdev;
28struct tuner_setup; 38struct tuner_setup;
@@ -96,6 +106,9 @@ struct v4l2_decode_vbi_line {
96 106
97 s_gpio: set GPIO pins. Very simple right now, might need to be extended with 107 s_gpio: set GPIO pins. Very simple right now, might need to be extended with
98 a direction argument if needed. 108 a direction argument if needed.
109
110 s_power: puts subdevice in power saving mode (on == 0) or normal operation
111 mode (on == 1).
99 */ 112 */
100struct v4l2_subdev_core_ops { 113struct v4l2_subdev_core_ops {
101 int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip); 114 int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip);
@@ -118,6 +131,7 @@ struct v4l2_subdev_core_ops {
118 int (*g_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg); 131 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); 132 int (*s_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg);
120#endif 133#endif
134 int (*s_power)(struct v4l2_subdev *sd, int on);
121}; 135};
122 136
123/* s_mode: switch the tuner to a specific tuner mode. Replacement of s_radio. 137/* s_mode: switch the tuner to a specific tuner mode. Replacement of s_radio.
@@ -127,8 +141,6 @@ struct v4l2_subdev_core_ops {
127 s_type_addr: sets tuner type and its I2C addr. 141 s_type_addr: sets tuner type and its I2C addr.
128 142
129 s_config: sets tda9887 specific stuff, like port1, port2 and qss 143 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 */ 144 */
133struct v4l2_subdev_tuner_ops { 145struct v4l2_subdev_tuner_ops {
134 int (*s_mode)(struct v4l2_subdev *sd, enum v4l2_tuner_type); 146 int (*s_mode)(struct v4l2_subdev *sd, enum v4l2_tuner_type);
@@ -141,7 +153,6 @@ struct v4l2_subdev_tuner_ops {
141 int (*s_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm); 153 int (*s_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm);
142 int (*s_type_addr)(struct v4l2_subdev *sd, struct tuner_setup *type); 154 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); 155 int (*s_config)(struct v4l2_subdev *sd, const struct v4l2_priv_tun_config *config);
144 int (*s_standby)(struct v4l2_subdev *sd);
145}; 156};
146 157
147/* s_clock_freq: set the frequency (in Hz) of the audio clock output. 158/* s_clock_freq: set the frequency (in Hz) of the audio clock output.
@@ -231,11 +242,95 @@ struct v4l2_subdev_video_ops {
231 int (*enum_frameintervals)(struct v4l2_subdev *sd, struct v4l2_frmivalenum *fival); 242 int (*enum_frameintervals)(struct v4l2_subdev *sd, struct v4l2_frmivalenum *fival);
232}; 243};
233 244
245/*
246 interrupt_service_routine: Called by the bridge chip's interrupt service
247 handler, when an IR interrupt status has be raised due to this subdev,
248 so that this subdev can handle the details. It may schedule work to be
249 performed later. It must not sleep. *Called from an IRQ context*.
250
251 [rt]x_g_parameters: Get the current operating parameters and state of the
252 the IR receiver or transmitter.
253
254 [rt]x_s_parameters: Set the current operating parameters and state of the
255 the IR receiver or transmitter. It is recommended to call
256 [rt]x_g_parameters first to fill out the current state, and only change
257 the fields that need to be changed. Upon return, the actual device
258 operating parameters and state will be returned. Note that hardware
259 limitations may prevent the actual settings from matching the requested
260 settings - e.g. an actual carrier setting of 35,904 Hz when 36,000 Hz
261 was requested. An exception is when the shutdown parameter is true.
262 The last used operational parameters will be returned, but the actual
263 state of the hardware be different to minimize power consumption and
264 processing when shutdown is true.
265
266 rx_read: Reads received codes or pulse width data.
267 The semantics are similar to a non-blocking read() call.
268
269 tx_write: Writes codes or pulse width data for transmission.
270 The semantics are similar to a non-blocking write() call.
271 */
272
273enum v4l2_subdev_ir_mode {
274 V4L2_SUBDEV_IR_MODE_PULSE_WIDTH, /* space & mark widths in nanosecs */
275};
276
277/* Data format of data read or written for V4L2_SUBDEV_IR_MODE_PULSE_WIDTH */
278#define V4L2_SUBDEV_IR_PULSE_MAX_WIDTH_NS 0x7fffffff
279#define V4L2_SUBDEV_IR_PULSE_LEVEL_MASK 0x80000000
280#define V4L2_SUBDEV_IR_PULSE_RX_SEQ_END 0xffffffff
281
282struct v4l2_subdev_ir_parameters {
283 /* Either Rx or Tx */
284 unsigned int bytes_per_data_element; /* of data in read or write call */
285 enum v4l2_subdev_ir_mode mode;
286
287 bool enable;
288 bool interrupt_enable;
289 bool shutdown; /* true: set hardware to low/no power, false: normal */
290
291 bool modulation; /* true: uses carrier, false: baseband */
292 u32 max_pulse_width; /* ns, valid only for baseband signal */
293 unsigned int carrier_freq; /* Hz, valid only for modulated signal*/
294 unsigned int duty_cycle; /* percent, valid only for modulated signal*/
295 bool invert; /* logically invert sense of mark/space */
296
297 /* Rx only */
298 u32 noise_filter_min_width; /* ns, min time of a valid pulse */
299 unsigned int carrier_range_lower; /* Hz, valid only for modulated sig */
300 unsigned int carrier_range_upper; /* Hz, valid only for modulated sig */
301 u32 resolution; /* ns */
302};
303
304struct v4l2_subdev_ir_ops {
305 /* Common to receiver and transmitter */
306 int (*interrupt_service_routine)(struct v4l2_subdev *sd,
307 u32 status, bool *handled);
308
309 /* Receiver */
310 int (*rx_read)(struct v4l2_subdev *sd, u8 *buf, size_t count,
311 ssize_t *num);
312
313 int (*rx_g_parameters)(struct v4l2_subdev *sd,
314 struct v4l2_subdev_ir_parameters *params);
315 int (*rx_s_parameters)(struct v4l2_subdev *sd,
316 struct v4l2_subdev_ir_parameters *params);
317
318 /* Transmitter */
319 int (*tx_write)(struct v4l2_subdev *sd, u8 *buf, size_t count,
320 ssize_t *num);
321
322 int (*tx_g_parameters)(struct v4l2_subdev *sd,
323 struct v4l2_subdev_ir_parameters *params);
324 int (*tx_s_parameters)(struct v4l2_subdev *sd,
325 struct v4l2_subdev_ir_parameters *params);
326};
327
234struct v4l2_subdev_ops { 328struct v4l2_subdev_ops {
235 const struct v4l2_subdev_core_ops *core; 329 const struct v4l2_subdev_core_ops *core;
236 const struct v4l2_subdev_tuner_ops *tuner; 330 const struct v4l2_subdev_tuner_ops *tuner;
237 const struct v4l2_subdev_audio_ops *audio; 331 const struct v4l2_subdev_audio_ops *audio;
238 const struct v4l2_subdev_video_ops *video; 332 const struct v4l2_subdev_video_ops *video;
333 const struct v4l2_subdev_ir_ops *ir;
239}; 334};
240 335
241#define V4L2_SUBDEV_NAME_SIZE 32 336#define V4L2_SUBDEV_NAME_SIZE 32
@@ -290,7 +385,7 @@ static inline void v4l2_subdev_init(struct v4l2_subdev *sd,
290 Example: err = v4l2_subdev_call(sd, core, g_chip_ident, &chip); 385 Example: err = v4l2_subdev_call(sd, core, g_chip_ident, &chip);
291 */ 386 */
292#define v4l2_subdev_call(sd, o, f, args...) \ 387#define v4l2_subdev_call(sd, o, f, args...) \
293 (!(sd) ? -ENODEV : (((sd) && (sd)->ops->o && (sd)->ops->o->f) ? \ 388 (!(sd) ? -ENODEV : (((sd)->ops->o && (sd)->ops->o->f) ? \
294 (sd)->ops->o->f((sd) , ##args) : -ENOIOCTLCMD)) 389 (sd)->ops->o->f((sd) , ##args) : -ENOIOCTLCMD))
295 390
296/* Send a notification to v4l2_device. */ 391/* 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,