aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tea5761.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/tea5761.c')
-rw-r--r--drivers/media/video/tea5761.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/media/video/tea5761.c b/drivers/media/video/tea5761.c
index 5326eeceaacd..b93cdef9ac73 100644
--- a/drivers/media/video/tea5761.c
+++ b/drivers/media/video/tea5761.c
@@ -14,12 +14,10 @@
14#include "tuner-i2c.h" 14#include "tuner-i2c.h"
15#include "tea5761.h" 15#include "tea5761.h"
16 16
17static int debug = 0; 17static int debug;
18module_param(debug, int, 0644); 18module_param(debug, int, 0644);
19MODULE_PARM_DESC(debug, "enable verbose debug messages"); 19MODULE_PARM_DESC(debug, "enable verbose debug messages");
20 20
21#define PREFIX "tea5761"
22
23struct tea5761_priv { 21struct tea5761_priv {
24 struct tuner_i2c_props i2c_props; 22 struct tuner_i2c_props i2c_props;
25 23
@@ -131,7 +129,7 @@ static void tea5761_status_dump(unsigned char *buffer)
131 129
132 frq = 1000 * (div * 32768 / 1000 + FREQ_OFFSET + 225) / 4; /* Freq in KHz */ 130 frq = 1000 * (div * 32768 / 1000 + FREQ_OFFSET + 225) / 4; /* Freq in KHz */
133 131
134 printk(PREFIX "Frequency %d.%03d KHz (divider = 0x%04x)\n", 132 printk(KERN_INFO "tea5761: Frequency %d.%03d KHz (divider = 0x%04x)\n",
135 frq / 1000, frq % 1000, div); 133 frq / 1000, frq % 1000, div);
136} 134}
137 135
@@ -249,14 +247,19 @@ int tea5761_autodetection(struct i2c_adapter* i2c_adap, u8 i2c_addr)
249 247
250 if (16 != (rc = tuner_i2c_xfer_recv(&i2c, buffer, 16))) { 248 if (16 != (rc = tuner_i2c_xfer_recv(&i2c, buffer, 16))) {
251 printk(KERN_WARNING "it is not a TEA5761. Received %i chars.\n", rc); 249 printk(KERN_WARNING "it is not a TEA5761. Received %i chars.\n", rc);
252 return EINVAL; 250 return -EINVAL;
253 } 251 }
254 252
255 if (!((buffer[13] != 0x2b) || (buffer[14] != 0x57) || (buffer[15] != 0x061))) { 253 if ((buffer[13] != 0x2b) || (buffer[14] != 0x57) || (buffer[15] != 0x061)) {
256 printk(KERN_WARNING "Manufacturer ID= 0x%02x, Chip ID = %02x%02x. It is not a TEA5761\n",buffer[13],buffer[14],buffer[15]); 254 printk(KERN_WARNING "Manufacturer ID= 0x%02x, Chip ID = %02x%02x."
257 return EINVAL; 255 " It is not a TEA5761\n",
256 buffer[13], buffer[14], buffer[15]);
257 return -EINVAL;
258 } 258 }
259 printk(KERN_WARNING "TEA5761 detected.\n"); 259 printk(KERN_WARNING "tea5761: TEA%02x%02x detected. "
260 "Manufacturer ID= 0x%02x\n",
261 buffer[14], buffer[15], buffer[13]);
262
260 return 0; 263 return 0;
261} 264}
262 265
@@ -302,6 +305,7 @@ struct dvb_frontend *tea5761_attach(struct dvb_frontend *fe,
302 305
303 priv->i2c_props.addr = i2c_addr; 306 priv->i2c_props.addr = i2c_addr;
304 priv->i2c_props.adap = i2c_adap; 307 priv->i2c_props.adap = i2c_adap;
308 priv->i2c_props.name = "tea5761";
305 309
306 memcpy(&fe->ops.tuner_ops, &tea5761_tuner_ops, 310 memcpy(&fe->ops.tuner_ops, &tea5761_tuner_ops,
307 sizeof(struct dvb_tuner_ops)); 311 sizeof(struct dvb_tuner_ops));