diff options
Diffstat (limited to 'drivers/media/video/tea5767.c')
-rw-r--r-- | drivers/media/video/tea5767.c | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/drivers/media/video/tea5767.c b/drivers/media/video/tea5767.c index e1b48d87e7b7..f6e7d7ad8424 100644 --- a/drivers/media/video/tea5767.c +++ b/drivers/media/video/tea5767.c | |||
@@ -16,12 +16,10 @@ | |||
16 | #include "tuner-i2c.h" | 16 | #include "tuner-i2c.h" |
17 | #include "tea5767.h" | 17 | #include "tea5767.h" |
18 | 18 | ||
19 | static int debug = 0; | 19 | static int debug; |
20 | module_param(debug, int, 0644); | 20 | module_param(debug, int, 0644); |
21 | MODULE_PARM_DESC(debug, "enable verbose debug messages"); | 21 | MODULE_PARM_DESC(debug, "enable verbose debug messages"); |
22 | 22 | ||
23 | #define PREFIX "tea5767" | ||
24 | |||
25 | /*****************************************************************************/ | 23 | /*****************************************************************************/ |
26 | 24 | ||
27 | struct tea5767_priv { | 25 | struct tea5767_priv { |
@@ -137,14 +135,14 @@ static void tea5767_status_dump(struct tea5767_priv *priv, | |||
137 | unsigned int div, frq; | 135 | unsigned int div, frq; |
138 | 136 | ||
139 | if (TEA5767_READY_FLAG_MASK & buffer[0]) | 137 | if (TEA5767_READY_FLAG_MASK & buffer[0]) |
140 | printk(PREFIX "Ready Flag ON\n"); | 138 | tuner_info("Ready Flag ON\n"); |
141 | else | 139 | else |
142 | printk(PREFIX "Ready Flag OFF\n"); | 140 | tuner_info("Ready Flag OFF\n"); |
143 | 141 | ||
144 | if (TEA5767_BAND_LIMIT_MASK & buffer[0]) | 142 | if (TEA5767_BAND_LIMIT_MASK & buffer[0]) |
145 | printk(PREFIX "Tuner at band limit\n"); | 143 | tuner_info("Tuner at band limit\n"); |
146 | else | 144 | else |
147 | printk(PREFIX "Tuner not at band limit\n"); | 145 | tuner_info("Tuner not at band limit\n"); |
148 | 146 | ||
149 | div = ((buffer[0] & 0x3f) << 8) | buffer[1]; | 147 | div = ((buffer[0] & 0x3f) << 8) | buffer[1]; |
150 | 148 | ||
@@ -166,23 +164,23 @@ static void tea5767_status_dump(struct tea5767_priv *priv, | |||
166 | buffer[0] = (div >> 8) & 0x3f; | 164 | buffer[0] = (div >> 8) & 0x3f; |
167 | buffer[1] = div & 0xff; | 165 | buffer[1] = div & 0xff; |
168 | 166 | ||
169 | printk(PREFIX "Frequency %d.%03d KHz (divider = 0x%04x)\n", | 167 | tuner_info("Frequency %d.%03d KHz (divider = 0x%04x)\n", |
170 | frq / 1000, frq % 1000, div); | 168 | frq / 1000, frq % 1000, div); |
171 | 169 | ||
172 | if (TEA5767_STEREO_MASK & buffer[2]) | 170 | if (TEA5767_STEREO_MASK & buffer[2]) |
173 | printk(PREFIX "Stereo\n"); | 171 | tuner_info("Stereo\n"); |
174 | else | 172 | else |
175 | printk(PREFIX "Mono\n"); | 173 | tuner_info("Mono\n"); |
176 | 174 | ||
177 | printk(PREFIX "IF Counter = %d\n", buffer[2] & TEA5767_IF_CNTR_MASK); | 175 | tuner_info("IF Counter = %d\n", buffer[2] & TEA5767_IF_CNTR_MASK); |
178 | 176 | ||
179 | printk(PREFIX "ADC Level = %d\n", | 177 | tuner_info("ADC Level = %d\n", |
180 | (buffer[3] & TEA5767_ADC_LEVEL_MASK) >> 4); | 178 | (buffer[3] & TEA5767_ADC_LEVEL_MASK) >> 4); |
181 | 179 | ||
182 | printk(PREFIX "Chip ID = %d\n", (buffer[3] & TEA5767_CHIP_ID_MASK)); | 180 | tuner_info("Chip ID = %d\n", (buffer[3] & TEA5767_CHIP_ID_MASK)); |
183 | 181 | ||
184 | printk(PREFIX "Reserved = 0x%02x\n", | 182 | tuner_info("Reserved = 0x%02x\n", |
185 | (buffer[4] & TEA5767_RESERVED_MASK)); | 183 | (buffer[4] & TEA5767_RESERVED_MASK)); |
186 | } | 184 | } |
187 | 185 | ||
188 | /* Freq should be specifyed at 62.5 Hz */ | 186 | /* Freq should be specifyed at 62.5 Hz */ |
@@ -395,11 +393,6 @@ int tea5767_autodetection(struct i2c_adapter* i2c_adap, u8 i2c_addr) | |||
395 | return EINVAL; | 393 | return EINVAL; |
396 | } | 394 | } |
397 | 395 | ||
398 | /* It seems that tea5767 returns 0xff after the 5th byte */ | ||
399 | if ((buffer[5] != 0xff) || (buffer[6] != 0xff)) { | ||
400 | printk(KERN_WARNING "Returned more than 5 bytes. It is not a TEA5767\n"); | ||
401 | return EINVAL; | ||
402 | } | ||
403 | 396 | ||
404 | return 0; | 397 | return 0; |
405 | } | 398 | } |
@@ -456,6 +449,8 @@ struct dvb_frontend *tea5767_attach(struct dvb_frontend *fe, | |||
456 | 449 | ||
457 | priv->i2c_props.addr = i2c_addr; | 450 | priv->i2c_props.addr = i2c_addr; |
458 | priv->i2c_props.adap = i2c_adap; | 451 | priv->i2c_props.adap = i2c_adap; |
452 | priv->i2c_props.name = "tea5767"; | ||
453 | |||
459 | priv->ctrl.xtal_freq = TEA5767_HIGH_LO_32768; | 454 | priv->ctrl.xtal_freq = TEA5767_HIGH_LO_32768; |
460 | priv->ctrl.port1 = 1; | 455 | priv->ctrl.port1 = 1; |
461 | priv->ctrl.port2 = 1; | 456 | priv->ctrl.port2 = 1; |