diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-09 16:03:58 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-09 16:03:58 -0500 |
commit | f17578decc40df8fceff82b106582e30bdfb3189 (patch) | |
tree | 911a435a2094ac03ae649f020237674224e4124a /include/media | |
parent | 682e852e2638ed0aff84aa51181c9e5d2f939562 (diff) | |
parent | cec418346e5a411e907293aba7cc21ac53c95834 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/audiochip.h | 16 | ||||
-rw-r--r-- | include/media/saa7146_vv.h | 2 | ||||
-rw-r--r-- | include/media/tuner.h | 98 | ||||
-rw-r--r-- | include/media/v4l2-common.h | 85 |
4 files changed, 124 insertions, 77 deletions
diff --git a/include/media/audiochip.h b/include/media/audiochip.h index b7d4b0930408..295d256ee811 100644 --- a/include/media/audiochip.h +++ b/include/media/audiochip.h | |||
@@ -23,11 +23,6 @@ enum audiochip { | |||
23 | 23 | ||
24 | /* ---------------------------------------------------------------------- */ | 24 | /* ---------------------------------------------------------------------- */ |
25 | 25 | ||
26 | /* v4l device was opened in Radio mode */ | ||
27 | #define AUDC_SET_RADIO _IO('m',2) | ||
28 | /* select from TV,radio,extern,MUTE */ | ||
29 | #define AUDC_SET_INPUT _IOW('m',17,int) | ||
30 | |||
31 | /* audio inputs */ | 26 | /* audio inputs */ |
32 | #define AUDIO_TUNER 0x00 | 27 | #define AUDIO_TUNER 0x00 |
33 | #define AUDIO_RADIO 0x01 | 28 | #define AUDIO_RADIO 0x01 |
@@ -40,15 +35,4 @@ enum audiochip { | |||
40 | #define AUDIO_MUTE 0x80 | 35 | #define AUDIO_MUTE 0x80 |
41 | #define AUDIO_UNMUTE 0x81 | 36 | #define AUDIO_UNMUTE 0x81 |
42 | 37 | ||
43 | /* all the stuff below is obsolete and just here for reference. I'll | ||
44 | * remove it once the driver is tested and works fine. | ||
45 | * | ||
46 | * Instead creating alot of tiny API's for all kinds of different | ||
47 | * chips, we'll just pass throuth the v4l ioctl structs (v4l2 not | ||
48 | * yet...). It is a bit less flexible, but most/all used i2c chips | ||
49 | * make sense in v4l context only. So I think that's acceptable... | ||
50 | */ | ||
51 | |||
52 | /* misc stuff to pass around config info to i2c chips */ | ||
53 | #define AUDC_CONFIG_PINNACLE _IOW('m',32,int) | ||
54 | #endif /* AUDIOCHIP_H */ | 38 | #endif /* AUDIOCHIP_H */ |
diff --git a/include/media/saa7146_vv.h b/include/media/saa7146_vv.h index 16af9299315f..e5e749e984ee 100644 --- a/include/media/saa7146_vv.h +++ b/include/media/saa7146_vv.h | |||
@@ -178,6 +178,8 @@ struct saa7146_ext_vv | |||
178 | 178 | ||
179 | struct saa7146_extension_ioctls *ioctls; | 179 | struct saa7146_extension_ioctls *ioctls; |
180 | int (*ioctl)(struct saa7146_fh*, unsigned int cmd, void *arg); | 180 | int (*ioctl)(struct saa7146_fh*, unsigned int cmd, void *arg); |
181 | |||
182 | struct file_operations vbi_fops; | ||
181 | }; | 183 | }; |
182 | 184 | ||
183 | struct saa7146_use_ops { | 185 | struct saa7146_use_ops { |
diff --git a/include/media/tuner.h b/include/media/tuner.h index b37cde606692..7674b121ce8b 100644 --- a/include/media/tuner.h +++ b/include/media/tuner.h | |||
@@ -82,9 +82,9 @@ | |||
82 | #define TUNER_PHILIPS_FM1236_MK3 43 | 82 | #define TUNER_PHILIPS_FM1236_MK3 43 |
83 | 83 | ||
84 | #define TUNER_PHILIPS_4IN1 44 /* ATI TV Wonder Pro - Conexant */ | 84 | #define TUNER_PHILIPS_4IN1 44 /* ATI TV Wonder Pro - Conexant */ |
85 | /* Microtune mergeged with Temic 12/31/1999 partially financed by Alps - these may be similar to Temic */ | 85 | /* Microtune merged with Temic 12/31/1999 partially financed by Alps - these may be similar to Temic */ |
86 | #define TUNER_MICROTUNE_4049FM5 45 | 86 | #define TUNER_MICROTUNE_4049FM5 45 |
87 | #define TUNER_MICROTUNE_4042_FI5 46 | 87 | #define TUNER_PANASONIC_VP27 46 |
88 | #define TUNER_LG_NTSC_TAPE 47 | 88 | #define TUNER_LG_NTSC_TAPE 47 |
89 | 89 | ||
90 | #define TUNER_TNF_8831BGFF 48 | 90 | #define TUNER_TNF_8831BGFF 48 |
@@ -102,7 +102,7 @@ | |||
102 | #define TUNER_YMEC_TVF_8531MF 58 | 102 | #define TUNER_YMEC_TVF_8531MF 58 |
103 | #define TUNER_YMEC_TVF_5533MF 59 /* Pixelview Pro Ultra NTSC */ | 103 | #define TUNER_YMEC_TVF_5533MF 59 /* Pixelview Pro Ultra NTSC */ |
104 | 104 | ||
105 | #define TUNER_THOMSON_DTT7611 60 /* DViCO FusionHDTV 3 Gold-T */ | 105 | #define TUNER_THOMSON_DTT761X 60 /* DTT 7611 7611A 7612 7613 7613A 7614 7615 7615A */ |
106 | #define TUNER_TENA_9533_DI 61 | 106 | #define TUNER_TENA_9533_DI 61 |
107 | #define TUNER_TEA5767 62 /* Only FM Radio Tuner */ | 107 | #define TUNER_TEA5767 62 /* Only FM Radio Tuner */ |
108 | #define TUNER_PHILIPS_FMD1216ME_MK3 63 | 108 | #define TUNER_PHILIPS_FMD1216ME_MK3 63 |
@@ -115,47 +115,26 @@ | |||
115 | #define TUNER_PHILIPS_TUV1236D 68 /* ATI HDTV Wonder */ | 115 | #define TUNER_PHILIPS_TUV1236D 68 /* ATI HDTV Wonder */ |
116 | #define TUNER_TNF_5335MF 69 /* Sabrent Bt848 */ | 116 | #define TUNER_TNF_5335MF 69 /* Sabrent Bt848 */ |
117 | 117 | ||
118 | #define NOTUNER 0 | ||
119 | #define PAL 1 /* PAL_BG */ | ||
120 | #define PAL_I 2 | ||
121 | #define NTSC 3 | ||
122 | #define SECAM 4 | ||
123 | #define ATSC 5 | ||
124 | #define RADIO 6 | ||
125 | |||
126 | #define NoTuner 0 | ||
127 | #define Philips 1 | ||
128 | #define TEMIC 2 | ||
129 | #define Sony 3 | ||
130 | #define Alps 4 | ||
131 | #define LGINNOTEK 5 | ||
132 | #define SHARP 6 | ||
133 | #define Samsung 7 | ||
134 | #define Microtune 8 | ||
135 | #define HITACHI 9 | ||
136 | #define Panasonic 10 | ||
137 | #define TCL 11 | ||
138 | #define THOMSON 12 | ||
139 | |||
140 | #define TUNER_SET_TYPE_ADDR _IOW('T',3,int) | ||
141 | #define TUNER_SET_STANDBY _IOW('T',4,int) | ||
142 | #define TDA9887_SET_CONFIG _IOW('t',5,int) | ||
143 | |||
144 | /* tv card specific */ | 118 | /* tv card specific */ |
145 | # define TDA9887_PRESENT (1<<0) | 119 | #define TDA9887_PRESENT (1<<0) |
146 | # define TDA9887_PORT1_INACTIVE (1<<1) | 120 | #define TDA9887_PORT1_INACTIVE (1<<1) |
147 | # define TDA9887_PORT2_INACTIVE (1<<2) | 121 | #define TDA9887_PORT2_INACTIVE (1<<2) |
148 | # define TDA9887_QSS (1<<3) | 122 | #define TDA9887_QSS (1<<3) |
149 | # define TDA9887_INTERCARRIER (1<<4) | 123 | #define TDA9887_INTERCARRIER (1<<4) |
150 | # define TDA9887_PORT1_ACTIVE (1<<5) | 124 | #define TDA9887_PORT1_ACTIVE (1<<5) |
151 | # define TDA9887_PORT2_ACTIVE (1<<6) | 125 | #define TDA9887_PORT2_ACTIVE (1<<6) |
152 | # define TDA9887_INTERCARRIER_NTSC (1<<7) | 126 | #define TDA9887_INTERCARRIER_NTSC (1<<7) |
127 | /* Tuner takeover point adjustment, in dB, -16 <= top <= 15 */ | ||
128 | #define TDA9887_TOP_MASK (0x3f << 8) | ||
129 | #define TDA9887_TOP_SET (1 << 13) | ||
130 | #define TDA9887_TOP(top) (TDA9887_TOP_SET | (((16 + (top)) & 0x1f) << 8)) | ||
131 | |||
153 | /* config options */ | 132 | /* config options */ |
154 | # define TDA9887_DEEMPHASIS_MASK (3<<16) | 133 | #define TDA9887_DEEMPHASIS_MASK (3<<16) |
155 | # define TDA9887_DEEMPHASIS_NONE (1<<16) | 134 | #define TDA9887_DEEMPHASIS_NONE (1<<16) |
156 | # define TDA9887_DEEMPHASIS_50 (2<<16) | 135 | #define TDA9887_DEEMPHASIS_50 (2<<16) |
157 | # define TDA9887_DEEMPHASIS_75 (3<<16) | 136 | #define TDA9887_DEEMPHASIS_75 (3<<16) |
158 | # define TDA9887_AUTOMUTE (1<<18) | 137 | #define TDA9887_AUTOMUTE (1<<18) |
159 | 138 | ||
160 | #ifdef __KERNEL__ | 139 | #ifdef __KERNEL__ |
161 | 140 | ||
@@ -167,10 +146,26 @@ enum tuner_mode { | |||
167 | T_STANDBY = 1 << 31 | 146 | T_STANDBY = 1 << 31 |
168 | }; | 147 | }; |
169 | 148 | ||
149 | /* Older boards only had a single tuner device. Nowadays multiple tuner | ||
150 | devices may be present on a single board. Using TUNER_SET_TYPE_ADDR | ||
151 | to pass the tuner_setup structure it is possible to setup each tuner | ||
152 | device in turn. | ||
153 | |||
154 | Since multiple devices may be present it is no longer sufficient to | ||
155 | send a command to a single i2c device. Instead you should broadcast | ||
156 | the command to all i2c devices. | ||
157 | |||
158 | By setting the mode_mask correctly you can select which commands are | ||
159 | accepted by a specific tuner device. For example, set mode_mask to | ||
160 | T_RADIO if the device is a radio-only tuner. That specific tuner will | ||
161 | only accept commands when the tuner is in radio mode and ignore them | ||
162 | when the tuner is set to TV mode. | ||
163 | */ | ||
164 | |||
170 | struct tuner_setup { | 165 | struct tuner_setup { |
171 | unsigned short addr; | 166 | unsigned short addr; /* I2C address */ |
172 | unsigned int type; | 167 | unsigned int type; /* Tuner type */ |
173 | unsigned int mode_mask; | 168 | unsigned int mode_mask; /* Allowed tuner modes */ |
174 | }; | 169 | }; |
175 | 170 | ||
176 | struct tuner { | 171 | struct tuner { |
@@ -207,7 +202,6 @@ struct tuner { | |||
207 | void (*standby)(struct i2c_client *c); | 202 | void (*standby)(struct i2c_client *c); |
208 | }; | 203 | }; |
209 | 204 | ||
210 | extern unsigned int tuner_debug; | ||
211 | extern unsigned const int tuner_count; | 205 | extern unsigned const int tuner_count; |
212 | 206 | ||
213 | extern int microtune_init(struct i2c_client *c); | 207 | extern int microtune_init(struct i2c_client *c); |
@@ -219,15 +213,15 @@ extern int tea5767_autodetection(struct i2c_client *c); | |||
219 | 213 | ||
220 | #define tuner_warn(fmt, arg...) do {\ | 214 | #define tuner_warn(fmt, arg...) do {\ |
221 | printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ | 215 | printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ |
222 | t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) | 216 | i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0) |
223 | #define tuner_info(fmt, arg...) do {\ | 217 | #define tuner_info(fmt, arg...) do {\ |
224 | printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ | 218 | printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ |
225 | t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) | 219 | i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0) |
226 | #define tuner_dbg(fmt, arg...) do {\ | 220 | #define tuner_dbg(fmt, arg...) do {\ |
227 | if (tuner_debug) \ | 221 | extern int debug; \ |
228 | printk(KERN_DEBUG "%s %d-%04x: " fmt, \ | 222 | if (debug) \ |
229 | t->i2c.driver->driver.name, \ | 223 | printk(KERN_DEBUG "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ |
230 | t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) | 224 | i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0) |
231 | 225 | ||
232 | #endif /* __KERNEL__ */ | 226 | #endif /* __KERNEL__ */ |
233 | 227 | ||
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index d3fd48157eb8..3cc3132f391e 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
@@ -26,12 +26,57 @@ | |||
26 | #ifndef V4L2_COMMON_H_ | 26 | #ifndef V4L2_COMMON_H_ |
27 | #define V4L2_COMMON_H_ | 27 | #define V4L2_COMMON_H_ |
28 | 28 | ||
29 | /* VIDIOC_INT_AUDIO_CLOCK_FREQ */ | 29 | /* v4l debugging and diagnostics */ |
30 | enum v4l2_audio_clock_freq { | 30 | |
31 | V4L2_AUDCLK_32_KHZ = 32000, | 31 | /* Common printk constucts for v4l-i2c drivers. These macros create a unique |
32 | V4L2_AUDCLK_441_KHZ = 44100, | 32 | prefix consisting of the driver name, the adapter number and the i2c |
33 | V4L2_AUDCLK_48_KHZ = 48000, | 33 | address. */ |
34 | }; | 34 | #define v4l_printk(level, name, adapter, addr, fmt, arg...) \ |
35 | printk(level "%s %d-%04x: " fmt, name, i2c_adapter_id(adapter), addr , ## arg) | ||
36 | |||
37 | #define v4l_client_printk(level, client, fmt, arg...) \ | ||
38 | v4l_printk(level, (client)->driver->driver.name, (client)->adapter, \ | ||
39 | (client)->addr, fmt , ## arg) | ||
40 | |||
41 | #define v4l_err(client, fmt, arg...) \ | ||
42 | v4l_client_printk(KERN_ERR, client, fmt , ## arg) | ||
43 | |||
44 | #define v4l_warn(client, fmt, arg...) \ | ||
45 | v4l_client_printk(KERN_WARNING, client, fmt , ## arg) | ||
46 | |||
47 | #define v4l_info(client, fmt, arg...) \ | ||
48 | v4l_client_printk(KERN_INFO, client, fmt , ## arg) | ||
49 | |||
50 | /* These three macros assume that the debug level is set with a module | ||
51 | parameter called 'debug'. */ | ||
52 | #define v4l_dbg(level, client, fmt, arg...) \ | ||
53 | do { \ | ||
54 | extern int debug; \ | ||
55 | if (debug >= (level)) \ | ||
56 | v4l_client_printk(KERN_DEBUG, client, fmt , ## arg); \ | ||
57 | } while (0) | ||
58 | |||
59 | /* Prints the ioctl in a human-readable format */ | ||
60 | extern void v4l_printk_ioctl(unsigned int cmd); | ||
61 | |||
62 | /* Use this macro for non-I2C drivers. Pass the driver name as the first arg. */ | ||
63 | #define v4l_print_ioctl(name, cmd) \ | ||
64 | do { \ | ||
65 | printk(KERN_DEBUG "%s: ", name); \ | ||
66 | v4l_printk_ioctl(cmd); \ | ||
67 | } while (0) | ||
68 | |||
69 | /* Use this macro in I2C drivers where 'client' is the struct i2c_client | ||
70 | pointer */ | ||
71 | #define v4l_i2c_print_ioctl(client, cmd) \ | ||
72 | do { \ | ||
73 | v4l_client_printk(KERN_DEBUG, client, ""); \ | ||
74 | v4l_printk_ioctl(cmd); \ | ||
75 | } while (0) | ||
76 | |||
77 | /* ------------------------------------------------------------------------- */ | ||
78 | |||
79 | /* Internal ioctls */ | ||
35 | 80 | ||
36 | /* VIDIOC_INT_G_REGISTER and VIDIOC_INT_S_REGISTER */ | 81 | /* VIDIOC_INT_G_REGISTER and VIDIOC_INT_S_REGISTER */ |
37 | struct v4l2_register { | 82 | struct v4l2_register { |
@@ -70,6 +115,20 @@ enum v4l2_chip_ident { | |||
70 | V4L2_IDENT_CX25843 = 243, | 115 | V4L2_IDENT_CX25843 = 243, |
71 | }; | 116 | }; |
72 | 117 | ||
118 | /* audio ioctls */ | ||
119 | /* v4l device was opened in Radio mode */ | ||
120 | #define AUDC_SET_RADIO _IO('d',88) | ||
121 | /* select from TV,radio,extern,MUTE */ | ||
122 | #define AUDC_SET_INPUT _IOW('d',89,int) | ||
123 | |||
124 | /* tuner ioctls */ | ||
125 | /* Sets tuner type and its I2C addr */ | ||
126 | #define TUNER_SET_TYPE_ADDR _IOW('d',90,int) | ||
127 | /* Puts tuner on powersaving state, disabling it, except for i2c */ | ||
128 | #define TUNER_SET_STANDBY _IOW('d',91,int) | ||
129 | /* Sets tda9887 specific stuff, like port1, port2 and qss */ | ||
130 | #define TDA9887_SET_CONFIG _IOW('d',92,int) | ||
131 | |||
73 | /* only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ | 132 | /* only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ |
74 | #define VIDIOC_INT_S_REGISTER _IOR ('d', 100, struct v4l2_register) | 133 | #define VIDIOC_INT_S_REGISTER _IOR ('d', 100, struct v4l2_register) |
75 | #define VIDIOC_INT_G_REGISTER _IOWR('d', 101, struct v4l2_register) | 134 | #define VIDIOC_INT_G_REGISTER _IOWR('d', 101, struct v4l2_register) |
@@ -77,10 +136,12 @@ enum v4l2_chip_ident { | |||
77 | /* Reset the I2C chip */ | 136 | /* Reset the I2C chip */ |
78 | #define VIDIOC_INT_RESET _IO ('d', 102) | 137 | #define VIDIOC_INT_RESET _IO ('d', 102) |
79 | 138 | ||
80 | /* Set the frequency of the audio clock output. | 139 | /* Set the frequency (in Hz) of the audio clock output. |
81 | Used to slave an audio processor to the video decoder, ensuring that audio | 140 | Used to slave an audio processor to the video decoder, ensuring that audio |
82 | and video remain synchronized. */ | 141 | and video remain synchronized. |
83 | #define VIDIOC_INT_AUDIO_CLOCK_FREQ _IOR ('d', 103, enum v4l2_audio_clock_freq) | 142 | Usual values for the frequency are 48000, 44100 or 32000 Hz. |
143 | If the frequency is not supported, then -EINVAL is returned. */ | ||
144 | #define VIDIOC_INT_AUDIO_CLOCK_FREQ _IOW ('d', 103, u32) | ||
84 | 145 | ||
85 | /* Video decoders that support sliced VBI need to implement this ioctl. | 146 | /* Video decoders that support sliced VBI need to implement this ioctl. |
86 | Field p of the v4l2_sliced_vbi_line struct is set to the start of the VBI | 147 | Field p of the v4l2_sliced_vbi_line struct is set to the start of the VBI |
@@ -107,4 +168,10 @@ enum v4l2_chip_ident { | |||
107 | be made. */ | 168 | be made. */ |
108 | #define VIDIOC_INT_G_CHIP_IDENT _IOR ('d', 107, enum v4l2_chip_ident *) | 169 | #define VIDIOC_INT_G_CHIP_IDENT _IOR ('d', 107, enum v4l2_chip_ident *) |
109 | 170 | ||
171 | /* Sets I2S speed in bps. This is used to provide a standard way to select I2S | ||
172 | clock used by driving digital audio streams at some board designs. | ||
173 | Usual values for the frequency are 1024000 and 2048000. | ||
174 | If the frequency is not supported, then -EINVAL is returned. */ | ||
175 | #define VIDIOC_INT_I2S_CLOCK_FREQ _IOW ('d', 108, u32) | ||
176 | |||
110 | #endif /* V4L2_COMMON_H_ */ | 177 | #endif /* V4L2_COMMON_H_ */ |