aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2006-01-15 12:04:52 -0500
committerMauro Carvalho Chehab <mchehab@brturbo.com.br>2006-01-15 18:25:32 -0500
commit27487d44712aaa37710cc508d5bd6119f5e9f976 (patch)
tree474acfb51469cc730cd76ebdf6f34680b3809442 /include
parent8f0bb9c069fc487dadebe4cdd1e03f0df5ebf0e6 (diff)
V4L/DVB (3384): Separate tv & radio freqs, fix cb/freq transmit order for tuners that need this.
- Moved MSP_SET_MATRIX to v4l2-common.h - Fix typos and integer overflows in tea5767.c - Split old freq field into a tv_freq and a radio_freq. Prevents that a radio tuner is initialized with a tv frequency or vice versa. - When switching to radio mode initialize the tuner with the last used radio frequency (this was already done for the TV mode). As a result of these changes the tuner module now remembers the last set radio and TV frequencies, which is what you would expect to happen. - Move out of range frequencies to the closest valid frequency as per v4l2 API spec. - Fix incorrect initial radio frequency (multiplier is 16000, not 16) - Add boundary check for out of range frequencies. - Use new flag to check if the order of the CB and freq. depends on the last set frequency. That is needed for some tuners or you can get static as a result. The flag is added for those tuners where I know that the datasheet indicates that this is necessary. - For this new check use the last set div value, not the last frequency as radio frequencies are always much higher due to the 16000 multiplier. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'include')
-rw-r--r--include/media/tuner-types.h18
-rw-r--r--include/media/tuner.h8
-rw-r--r--include/media/v4l2-common.h7
3 files changed, 30 insertions, 3 deletions
diff --git a/include/media/tuner-types.h b/include/media/tuner-types.h
index 756693188991..b37d59d5a103 100644
--- a/include/media/tuner-types.h
+++ b/include/media/tuner-types.h
@@ -20,6 +20,24 @@ struct tuner_range {
20struct tuner_params { 20struct tuner_params {
21 enum param_type type; 21 enum param_type type;
22 unsigned int tda988x; 22 unsigned int tda988x;
23 /* Many Philips based tuners have a comment like this in their
24 * datasheet:
25 *
26 * For channel selection involving band switching, and to ensure
27 * smooth tuning to the desired channel without causing
28 * unnecessary charge pump action, it is recommended to consider
29 * the difference between wanted channel frequency and the
30 * current channel frequency. Unnecessary charge pump action
31 * will result in very low tuning voltage which may drive the
32 * oscillator to extreme conditions.
33 *
34 * Set this flag to 1 if this tuner needs this check.
35 *
36 * I tested this for PAL by first setting the TV frequency to
37 * 203 MHz and then switching to 96.6 MHz FM radio. The result was
38 * static unless the control byte was sent first.
39 */
40 unsigned int cb_first_if_lower_freq:1;
23 unsigned char config; /* to be moved into struct tuner_range for dvb-pll merge */ 41 unsigned char config; /* to be moved into struct tuner_range for dvb-pll merge */
24 42
25 unsigned int count; 43 unsigned int count;
diff --git a/include/media/tuner.h b/include/media/tuner.h
index a1d63787bc08..a5beeac495c7 100644
--- a/include/media/tuner.h
+++ b/include/media/tuner.h
@@ -179,7 +179,9 @@ struct tuner {
179 unsigned int mode; 179 unsigned int mode;
180 unsigned int mode_mask; /* Combination of allowable modes */ 180 unsigned int mode_mask; /* Combination of allowable modes */
181 181
182 unsigned int freq; /* keep track of the current settings */ 182 unsigned int tv_freq; /* keep track of the current settings */
183 unsigned int radio_freq;
184 u16 last_div;
183 unsigned int audmode; 185 unsigned int audmode;
184 v4l2_std_id std; 186 v4l2_std_id std;
185 187
@@ -197,8 +199,8 @@ struct tuner {
197 unsigned int sgIF; 199 unsigned int sgIF;
198 200
199 /* function ptrs */ 201 /* function ptrs */
200 void (*tv_freq)(struct i2c_client *c, unsigned int freq); 202 void (*set_tv_freq)(struct i2c_client *c, unsigned int freq);
201 void (*radio_freq)(struct i2c_client *c, unsigned int freq); 203 void (*set_radio_freq)(struct i2c_client *c, unsigned int freq);
202 int (*has_signal)(struct i2c_client *c); 204 int (*has_signal)(struct i2c_client *c);
203 int (*is_stereo)(struct i2c_client *c); 205 int (*is_stereo)(struct i2c_client *c);
204 void (*standby)(struct i2c_client *c); 206 void (*standby)(struct i2c_client *c);
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index c74052abb189..d4030a7e16e0 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -120,6 +120,13 @@ enum v4l2_chip_ident {
120/* select from TV,radio,extern,MUTE */ 120/* select from TV,radio,extern,MUTE */
121#define AUDC_SET_INPUT _IOW('d',89,int) 121#define AUDC_SET_INPUT _IOW('d',89,int)
122 122
123/* msp3400 ioctl: will be removed in the near future */
124struct msp_matrix {
125 int input;
126 int output;
127};
128#define MSP_SET_MATRIX _IOW('m',17,struct msp_matrix)
129
123/* tuner ioctls */ 130/* tuner ioctls */
124/* Sets tuner type and its I2C addr */ 131/* Sets tuner type and its I2C addr */
125#define TUNER_SET_TYPE_ADDR _IOW('d',90,int) 132#define TUNER_SET_TYPE_ADDR _IOW('d',90,int)