diff options
-rw-r--r-- | drivers/media/video/tda8290.c | 103 | ||||
-rw-r--r-- | drivers/media/video/tda8290.h | 24 | ||||
-rw-r--r-- | drivers/media/video/tda9887.c | 1 | ||||
-rw-r--r-- | drivers/media/video/tuner-core.c | 43 | ||||
-rw-r--r-- | drivers/media/video/tuner-driver.h | 27 | ||||
-rw-r--r-- | drivers/media/video/tuner-i2c.h | 2 | ||||
-rw-r--r-- | include/media/tuner.h | 2 |
7 files changed, 109 insertions, 93 deletions
diff --git a/drivers/media/video/tda8290.c b/drivers/media/video/tda8290.c index a39cb1f9e875..d0d13bc61250 100644 --- a/drivers/media/video/tda8290.c +++ b/drivers/media/video/tda8290.c | |||
@@ -23,12 +23,14 @@ | |||
23 | #include <linux/i2c.h> | 23 | #include <linux/i2c.h> |
24 | #include <linux/delay.h> | 24 | #include <linux/delay.h> |
25 | #include <linux/videodev.h> | 25 | #include <linux/videodev.h> |
26 | #include "tuner-driver.h" | ||
27 | #include "tuner-i2c.h" | ||
26 | #include "tda8290.h" | 28 | #include "tda8290.h" |
27 | #include "tda827x.h" | 29 | #include "tda827x.h" |
28 | #include "tda18271.h" | 30 | #include "tda18271.h" |
29 | 31 | ||
30 | static int tuner_debug; | 32 | static int debug; |
31 | module_param_named(debug, tuner_debug, int, 0644); | 33 | module_param(debug, int, 0644); |
32 | MODULE_PARM_DESC(debug, "enable verbose debug messages"); | 34 | MODULE_PARM_DESC(debug, "enable verbose debug messages"); |
33 | 35 | ||
34 | #define PREFIX "tda8290" | 36 | #define PREFIX "tda8290" |
@@ -50,8 +52,6 @@ struct tda8290_priv { | |||
50 | #define TDA18271 16 | 52 | #define TDA18271 16 |
51 | 53 | ||
52 | struct tda827x_config cfg; | 54 | struct tda827x_config cfg; |
53 | |||
54 | struct tuner *t; | ||
55 | }; | 55 | }; |
56 | 56 | ||
57 | /*---------------------------------------------------------------------*/ | 57 | /*---------------------------------------------------------------------*/ |
@@ -114,7 +114,6 @@ static void set_audio(struct dvb_frontend *fe, | |||
114 | struct analog_parameters *params) | 114 | struct analog_parameters *params) |
115 | { | 115 | { |
116 | struct tda8290_priv *priv = fe->analog_demod_priv; | 116 | struct tda8290_priv *priv = fe->analog_demod_priv; |
117 | struct tuner *t = priv->t; | ||
118 | char* mode; | 117 | char* mode; |
119 | 118 | ||
120 | if (params->std & V4L2_STD_MN) { | 119 | if (params->std & V4L2_STD_MN) { |
@@ -150,7 +149,6 @@ static void tda8290_set_params(struct dvb_frontend *fe, | |||
150 | struct analog_parameters *params) | 149 | struct analog_parameters *params) |
151 | { | 150 | { |
152 | struct tda8290_priv *priv = fe->analog_demod_priv; | 151 | struct tda8290_priv *priv = fe->analog_demod_priv; |
153 | struct tuner *t = priv->t; | ||
154 | 152 | ||
155 | unsigned char soft_reset[] = { 0x00, 0x00 }; | 153 | unsigned char soft_reset[] = { 0x00, 0x00 }; |
156 | unsigned char easy_mode[] = { 0x01, priv->tda8290_easy_mode }; | 154 | unsigned char easy_mode[] = { 0x01, priv->tda8290_easy_mode }; |
@@ -176,7 +174,8 @@ static void tda8290_set_params(struct dvb_frontend *fe, | |||
176 | 174 | ||
177 | set_audio(fe, params); | 175 | set_audio(fe, params); |
178 | 176 | ||
179 | tuner_dbg("tda827xa config is 0x%02x\n", t->config); | 177 | if (priv->cfg.config) |
178 | tuner_dbg("tda827xa config is 0x%02x\n", *priv->cfg.config); | ||
180 | tuner_i2c_xfer_send(&priv->i2c_props, easy_mode, 2); | 179 | tuner_i2c_xfer_send(&priv->i2c_props, easy_mode, 2); |
181 | tuner_i2c_xfer_send(&priv->i2c_props, agc_out_on, 2); | 180 | tuner_i2c_xfer_send(&priv->i2c_props, agc_out_on, 2); |
182 | tuner_i2c_xfer_send(&priv->i2c_props, soft_reset, 2); | 181 | tuner_i2c_xfer_send(&priv->i2c_props, soft_reset, 2); |
@@ -362,7 +361,6 @@ static void tda8295_set_params(struct dvb_frontend *fe, | |||
362 | struct analog_parameters *params) | 361 | struct analog_parameters *params) |
363 | { | 362 | { |
364 | struct tda8290_priv *priv = fe->analog_demod_priv; | 363 | struct tda8290_priv *priv = fe->analog_demod_priv; |
365 | struct tuner *t = priv->t; | ||
366 | 364 | ||
367 | unsigned char blanking_mode[] = { 0x1d, 0x00 }; | 365 | unsigned char blanking_mode[] = { 0x1d, 0x00 }; |
368 | 366 | ||
@@ -442,13 +440,13 @@ static void tda8295_standby(struct dvb_frontend *fe) | |||
442 | static void tda8290_init_if(struct dvb_frontend *fe) | 440 | static void tda8290_init_if(struct dvb_frontend *fe) |
443 | { | 441 | { |
444 | struct tda8290_priv *priv = fe->analog_demod_priv; | 442 | struct tda8290_priv *priv = fe->analog_demod_priv; |
445 | struct tuner *t = priv->t; | ||
446 | 443 | ||
447 | unsigned char set_VS[] = { 0x30, 0x6F }; | 444 | unsigned char set_VS[] = { 0x30, 0x6F }; |
448 | unsigned char set_GP00_CF[] = { 0x20, 0x01 }; | 445 | unsigned char set_GP00_CF[] = { 0x20, 0x01 }; |
449 | unsigned char set_GP01_CF[] = { 0x20, 0x0B }; | 446 | unsigned char set_GP01_CF[] = { 0x20, 0x0B }; |
450 | 447 | ||
451 | if ((t->config == 1) || (t->config == 2)) | 448 | if ((priv->cfg.config) && |
449 | ((*priv->cfg.config == 1) || (*priv->cfg.config == 2))) | ||
452 | tuner_i2c_xfer_send(&priv->i2c_props, set_GP00_CF, 2); | 450 | tuner_i2c_xfer_send(&priv->i2c_props, set_GP00_CF, 2); |
453 | else | 451 | else |
454 | tuner_i2c_xfer_send(&priv->i2c_props, set_GP01_CF, 2); | 452 | tuner_i2c_xfer_send(&priv->i2c_props, set_GP01_CF, 2); |
@@ -516,7 +514,6 @@ static int tda829x_find_tuner(struct dvb_frontend *fe) | |||
516 | { | 514 | { |
517 | struct tda8290_priv *priv = fe->analog_demod_priv; | 515 | struct tda8290_priv *priv = fe->analog_demod_priv; |
518 | struct analog_tuner_ops *ops = fe->ops.analog_demod_ops; | 516 | struct analog_tuner_ops *ops = fe->ops.analog_demod_ops; |
519 | struct tuner *t = priv->t; | ||
520 | int i, ret, tuners_found; | 517 | int i, ret, tuners_found; |
521 | u32 tuner_addrs; | 518 | u32 tuner_addrs; |
522 | u8 data; | 519 | u8 data; |
@@ -595,29 +592,6 @@ static int tda829x_find_tuner(struct dvb_frontend *fe) | |||
595 | 592 | ||
596 | ops->i2c_gate_ctrl(fe, 0); | 593 | ops->i2c_gate_ctrl(fe, 0); |
597 | 594 | ||
598 | switch (priv->ver) { | ||
599 | case TDA8290 | TDA8275: | ||
600 | strlcpy(t->i2c->name, "tda8290+75", sizeof(t->i2c->name)); | ||
601 | break; | ||
602 | case TDA8295 | TDA8275: | ||
603 | strlcpy(t->i2c->name, "tda8295+75", sizeof(t->i2c->name)); | ||
604 | break; | ||
605 | case TDA8290 | TDA8275A: | ||
606 | strlcpy(t->i2c->name, "tda8290+75a", sizeof(t->i2c->name)); | ||
607 | break; | ||
608 | case TDA8295 | TDA8275A: | ||
609 | strlcpy(t->i2c->name, "tda8295+75a", sizeof(t->i2c->name)); | ||
610 | break; | ||
611 | case TDA8290 | TDA18271: | ||
612 | strlcpy(t->i2c->name, "tda8290+18271", sizeof(t->i2c->name)); | ||
613 | break; | ||
614 | case TDA8295 | TDA18271: | ||
615 | strlcpy(t->i2c->name, "tda8295+18271", sizeof(t->i2c->name)); | ||
616 | break; | ||
617 | default: | ||
618 | return -EINVAL; | ||
619 | } | ||
620 | |||
621 | return 0; | 595 | return 0; |
622 | } | 596 | } |
623 | 597 | ||
@@ -631,7 +605,7 @@ static int tda8290_probe(struct tuner_i2c_props *i2c_props) | |||
631 | tuner_i2c_xfer_recv(i2c_props, &tda8290_id[1], 1); | 605 | tuner_i2c_xfer_recv(i2c_props, &tda8290_id[1], 1); |
632 | 606 | ||
633 | if (tda8290_id[1] == TDA8290_ID) { | 607 | if (tda8290_id[1] == TDA8290_ID) { |
634 | if (tuner_debug) | 608 | if (debug) |
635 | printk(KERN_DEBUG "%s: tda8290 detected @ %d-%04x\n", | 609 | printk(KERN_DEBUG "%s: tda8290 detected @ %d-%04x\n", |
636 | __FUNCTION__, i2c_adapter_id(i2c_props->adap), | 610 | __FUNCTION__, i2c_adapter_id(i2c_props->adap), |
637 | i2c_props->addr); | 611 | i2c_props->addr); |
@@ -651,7 +625,7 @@ static int tda8295_probe(struct tuner_i2c_props *i2c_props) | |||
651 | tuner_i2c_xfer_recv(i2c_props, &tda8295_id[1], 1); | 625 | tuner_i2c_xfer_recv(i2c_props, &tda8295_id[1], 1); |
652 | 626 | ||
653 | if (tda8295_id[1] == TDA8295_ID) { | 627 | if (tda8295_id[1] == TDA8295_ID) { |
654 | if (tuner_debug) | 628 | if (debug) |
655 | printk(KERN_DEBUG "%s: tda8295 detected @ %d-%04x\n", | 629 | printk(KERN_DEBUG "%s: tda8295 detected @ %d-%04x\n", |
656 | __FUNCTION__, i2c_adapter_id(i2c_props->adap), | 630 | __FUNCTION__, i2c_adapter_id(i2c_props->adap), |
657 | i2c_props->addr); | 631 | i2c_props->addr); |
@@ -677,21 +651,24 @@ static struct analog_tuner_ops tda8295_tuner_ops = { | |||
677 | .i2c_gate_ctrl = tda8295_i2c_bridge, | 651 | .i2c_gate_ctrl = tda8295_i2c_bridge, |
678 | }; | 652 | }; |
679 | 653 | ||
680 | int tda829x_attach(struct tuner *t) | 654 | struct dvb_frontend *tda829x_attach(struct dvb_frontend *fe, |
655 | struct i2c_adapter *i2c_adap, u8 i2c_addr, | ||
656 | struct tda829x_config *cfg) | ||
681 | { | 657 | { |
682 | struct dvb_frontend *fe = &t->fe; | ||
683 | struct tda8290_priv *priv = NULL; | 658 | struct tda8290_priv *priv = NULL; |
659 | char *name; | ||
684 | 660 | ||
685 | priv = kzalloc(sizeof(struct tda8290_priv), GFP_KERNEL); | 661 | priv = kzalloc(sizeof(struct tda8290_priv), GFP_KERNEL); |
686 | if (priv == NULL) | 662 | if (priv == NULL) |
687 | return -ENOMEM; | 663 | return NULL; |
688 | fe->analog_demod_priv = priv; | 664 | fe->analog_demod_priv = priv; |
689 | 665 | ||
690 | priv->i2c_props.addr = t->i2c->addr; | 666 | priv->i2c_props.addr = i2c_addr; |
691 | priv->i2c_props.adap = t->i2c->adapter; | 667 | priv->i2c_props.adap = i2c_adap; |
692 | priv->cfg.config = &t->config; | 668 | if (cfg) { |
693 | priv->cfg.tuner_callback = t->tuner_callback; | 669 | priv->cfg.config = cfg->lna_cfg; |
694 | priv->t = t; | 670 | priv->cfg.tuner_callback = cfg->tuner_callback; |
671 | } | ||
695 | 672 | ||
696 | if (tda8290_probe(&priv->i2c_props) == 0) { | 673 | if (tda8290_probe(&priv->i2c_props) == 0) { |
697 | priv->ver = TDA8290; | 674 | priv->ver = TDA8290; |
@@ -706,30 +683,50 @@ int tda829x_attach(struct tuner *t) | |||
706 | if (tda829x_find_tuner(fe) < 0) | 683 | if (tda829x_find_tuner(fe) < 0) |
707 | goto fail; | 684 | goto fail; |
708 | 685 | ||
686 | switch (priv->ver) { | ||
687 | case TDA8290 | TDA8275: | ||
688 | name = "tda8290+75"; | ||
689 | break; | ||
690 | case TDA8295 | TDA8275: | ||
691 | name = "tda8295+75"; | ||
692 | break; | ||
693 | case TDA8290 | TDA8275A: | ||
694 | name = "tda8290+75a"; | ||
695 | break; | ||
696 | case TDA8295 | TDA8275A: | ||
697 | name = "tda8295+75a"; | ||
698 | break; | ||
699 | case TDA8290 | TDA18271: | ||
700 | name = "tda8290+18271"; | ||
701 | break; | ||
702 | case TDA8295 | TDA18271: | ||
703 | name = "tda8295+18271"; | ||
704 | break; | ||
705 | default: | ||
706 | goto fail; | ||
707 | } | ||
708 | tuner_info("type set to %s\n", name); | ||
709 | |||
709 | if (priv->ver & TDA8290) { | 710 | if (priv->ver & TDA8290) { |
710 | tda8290_init_tuner(fe); | 711 | tda8290_init_tuner(fe); |
711 | tda8290_init_if(fe); | 712 | tda8290_init_if(fe); |
712 | } else if (priv->ver & TDA8295) | 713 | } else if (priv->ver & TDA8295) |
713 | tda8295_init_if(fe); | 714 | tda8295_init_if(fe); |
714 | 715 | ||
715 | tuner_info("type set to %s\n", t->i2c->name); | 716 | return fe; |
716 | |||
717 | t->mode = V4L2_TUNER_ANALOG_TV; | ||
718 | |||
719 | return 0; | ||
720 | 717 | ||
721 | fail: | 718 | fail: |
722 | tda829x_release(fe); | 719 | tda829x_release(fe); |
723 | fe->ops.analog_demod_ops = NULL; | 720 | fe->ops.analog_demod_ops = NULL; |
724 | return -EINVAL; | 721 | return NULL; |
725 | } | 722 | } |
726 | EXPORT_SYMBOL_GPL(tda829x_attach); | 723 | EXPORT_SYMBOL_GPL(tda829x_attach); |
727 | 724 | ||
728 | int tda829x_probe(struct tuner *t) | 725 | int tda829x_probe(struct i2c_adapter *i2c_adap, u8 i2c_addr) |
729 | { | 726 | { |
730 | struct tuner_i2c_props i2c_props = { | 727 | struct tuner_i2c_props i2c_props = { |
731 | .adap = t->i2c->adapter, | 728 | .adap = i2c_adap, |
732 | .addr = t->i2c->addr | 729 | .addr = i2c_addr, |
733 | }; | 730 | }; |
734 | 731 | ||
735 | unsigned char soft_reset[] = { 0x00, 0x00 }; | 732 | unsigned char soft_reset[] = { 0x00, 0x00 }; |
diff --git a/drivers/media/video/tda8290.h b/drivers/media/video/tda8290.h index 3a1f04520615..4c547577e7ca 100644 --- a/drivers/media/video/tda8290.h +++ b/drivers/media/video/tda8290.h | |||
@@ -18,24 +18,36 @@ | |||
18 | #define __TDA8290_H__ | 18 | #define __TDA8290_H__ |
19 | 19 | ||
20 | #include <linux/i2c.h> | 20 | #include <linux/i2c.h> |
21 | #include "tuner-driver.h" | 21 | #include "dvb_frontend.h" |
22 | |||
23 | struct tda829x_config | ||
24 | { | ||
25 | unsigned int *lna_cfg; | ||
26 | int (*tuner_callback) (void *dev, int command, int arg); | ||
27 | }; | ||
22 | 28 | ||
23 | #if defined(CONFIG_TUNER_TDA8290) || (defined(CONFIG_TUNER_TDA8290_MODULE) && defined(MODULE)) | 29 | #if defined(CONFIG_TUNER_TDA8290) || (defined(CONFIG_TUNER_TDA8290_MODULE) && defined(MODULE)) |
24 | extern int tda829x_probe(struct tuner *t); | 30 | extern int tda829x_probe(struct i2c_adapter *i2c_adap, u8 i2c_addr); |
25 | 31 | ||
26 | extern int tda829x_attach(struct tuner *t); | 32 | extern struct dvb_frontend *tda829x_attach(struct dvb_frontend *fe, |
33 | struct i2c_adapter *i2c_adap, | ||
34 | u8 i2c_addr, | ||
35 | struct tda829x_config *cfg); | ||
27 | #else | 36 | #else |
28 | static inline int tda829x_probe(struct tuner *t) | 37 | static inline int tda829x_probe(struct i2c_adapter *i2c_adap, u8 i2c_addr) |
29 | { | 38 | { |
30 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__); | 39 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__); |
31 | return -EINVAL; | 40 | return -EINVAL; |
32 | } | 41 | } |
33 | 42 | ||
34 | static inline int tda829x_attach(struct tuner *t) | 43 | static inline struct dvb_frontend *tda829x_attach(struct dvb_frontend *fe, |
44 | struct i2c_adapter *i2c_adap, | ||
45 | u8 i2c_addr, | ||
46 | struct tda829x_config *cfg) | ||
35 | { | 47 | { |
36 | printk(KERN_INFO "%s: not probed - driver disabled by Kconfig\n", | 48 | printk(KERN_INFO "%s: not probed - driver disabled by Kconfig\n", |
37 | __FUNCTION__); | 49 | __FUNCTION__); |
38 | return -EINVAL; | 50 | return NULL; |
39 | } | 51 | } |
40 | #endif | 52 | #endif |
41 | 53 | ||
diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index d506d4bf8253..98d45c4912bd 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/videodev.h> | 9 | #include <linux/videodev.h> |
10 | #include <media/v4l2-common.h> | 10 | #include <media/v4l2-common.h> |
11 | #include <media/tuner.h> | 11 | #include <media/tuner.h> |
12 | #include "tuner-i2c.h" | ||
12 | #include "tda9887.h" | 13 | #include "tda9887.h" |
13 | 14 | ||
14 | 15 | ||
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index 5f8bffc8209b..0cc190761e24 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
@@ -52,7 +52,34 @@ static unsigned int no_autodetect = 0; | |||
52 | static unsigned int show_i2c = 0; | 52 | static unsigned int show_i2c = 0; |
53 | 53 | ||
54 | /* insmod options used at runtime => read/write */ | 54 | /* insmod options used at runtime => read/write */ |
55 | int tuner_debug = 0; | 55 | static int tuner_debug; |
56 | |||
57 | #define tuner_warn(fmt, arg...) do { \ | ||
58 | printk(KERN_WARNING "%s %d-%04x: " fmt, PREFIX, \ | ||
59 | i2c_adapter_id(t->i2c->adapter), \ | ||
60 | t->i2c->addr, ##arg); \ | ||
61 | } while (0) | ||
62 | |||
63 | #define tuner_info(fmt, arg...) do { \ | ||
64 | printk(KERN_INFO "%s %d-%04x: " fmt, PREFIX, \ | ||
65 | i2c_adapter_id(t->i2c->adapter), \ | ||
66 | t->i2c->addr, ##arg); \ | ||
67 | } while (0) | ||
68 | |||
69 | #define tuner_err(fmt, arg...) do { \ | ||
70 | printk(KERN_ERR "%s %d-%04x: " fmt, PREFIX, \ | ||
71 | i2c_adapter_id(t->i2c->adapter), \ | ||
72 | t->i2c->addr, ##arg); \ | ||
73 | } while (0) | ||
74 | |||
75 | #define tuner_dbg(fmt, arg...) do { \ | ||
76 | if (tuner_debug) \ | ||
77 | printk(KERN_DEBUG "%s %d-%04x: " fmt, PREFIX, \ | ||
78 | i2c_adapter_id(t->i2c->adapter), \ | ||
79 | t->i2c->addr, ##arg); \ | ||
80 | } while (0) | ||
81 | |||
82 | /* ------------------------------------------------------------------------ */ | ||
56 | 83 | ||
57 | static unsigned int tv_range[2] = { 44, 958 }; | 84 | static unsigned int tv_range[2] = { 44, 958 }; |
58 | static unsigned int radio_range[2] = { 65, 108 }; | 85 | static unsigned int radio_range[2] = { 65, 108 }; |
@@ -261,6 +288,15 @@ static void attach_simple_tuner(struct tuner *t) | |||
261 | simple_tuner_attach(&t->fe, t->i2c->adapter, t->i2c->addr, &cfg); | 288 | simple_tuner_attach(&t->fe, t->i2c->adapter, t->i2c->addr, &cfg); |
262 | } | 289 | } |
263 | 290 | ||
291 | static void attach_tda829x(struct tuner *t) | ||
292 | { | ||
293 | struct tda829x_config cfg = { | ||
294 | .lna_cfg = &t->config, | ||
295 | .tuner_callback = t->tuner_callback, | ||
296 | }; | ||
297 | tda829x_attach(&t->fe, t->i2c->adapter, t->i2c->addr, &cfg); | ||
298 | } | ||
299 | |||
264 | static void set_type(struct i2c_client *c, unsigned int type, | 300 | static void set_type(struct i2c_client *c, unsigned int type, |
265 | unsigned int new_mode_mask, unsigned int new_config, | 301 | unsigned int new_mode_mask, unsigned int new_config, |
266 | int (*tuner_callback) (void *dev, int command,int arg)) | 302 | int (*tuner_callback) (void *dev, int command,int arg)) |
@@ -303,7 +339,7 @@ static void set_type(struct i2c_client *c, unsigned int type, | |||
303 | break; | 339 | break; |
304 | case TUNER_PHILIPS_TDA8290: | 340 | case TUNER_PHILIPS_TDA8290: |
305 | { | 341 | { |
306 | tda829x_attach(t); | 342 | attach_tda829x(t); |
307 | break; | 343 | break; |
308 | } | 344 | } |
309 | case TUNER_TEA5767: | 345 | case TUNER_TEA5767: |
@@ -1045,7 +1081,8 @@ static int tuner_probe(struct i2c_client *client) | |||
1045 | case 0x4b: | 1081 | case 0x4b: |
1046 | /* If chip is not tda8290, don't register. | 1082 | /* If chip is not tda8290, don't register. |
1047 | since it can be tda9887*/ | 1083 | since it can be tda9887*/ |
1048 | if (tda829x_probe(t) == 0) { | 1084 | if (tda829x_probe(t->i2c->adapter, |
1085 | t->i2c->addr) == 0) { | ||
1049 | tuner_dbg("tda829x detected\n"); | 1086 | tuner_dbg("tda829x detected\n"); |
1050 | } else { | 1087 | } else { |
1051 | /* Default is being tda9887 */ | 1088 | /* Default is being tda9887 */ |
diff --git a/drivers/media/video/tuner-driver.h b/drivers/media/video/tuner-driver.h index 91913ee08a07..a215161d0241 100644 --- a/drivers/media/video/tuner-driver.h +++ b/drivers/media/video/tuner-driver.h | |||
@@ -24,13 +24,10 @@ | |||
24 | 24 | ||
25 | #include <linux/videodev2.h> | 25 | #include <linux/videodev2.h> |
26 | #include <linux/i2c.h> | 26 | #include <linux/i2c.h> |
27 | #include "tuner-i2c.h" | ||
28 | #include "dvb_frontend.h" | 27 | #include "dvb_frontend.h" |
29 | 28 | ||
30 | extern unsigned const int tuner_count; | 29 | extern unsigned const int tuner_count; |
31 | 30 | ||
32 | struct tuner; | ||
33 | |||
34 | struct analog_tuner_ops { | 31 | struct analog_tuner_ops { |
35 | void (*set_params)(struct dvb_frontend *fe, | 32 | void (*set_params)(struct dvb_frontend *fe, |
36 | struct analog_parameters *params); | 33 | struct analog_parameters *params); |
@@ -69,28 +66,4 @@ struct tuner { | |||
69 | int (*tuner_callback) (void *dev, int command,int arg); | 66 | int (*tuner_callback) (void *dev, int command,int arg); |
70 | }; | 67 | }; |
71 | 68 | ||
72 | /* ------------------------------------------------------------------------ */ | ||
73 | |||
74 | #define tuner_warn(fmt, arg...) do { \ | ||
75 | printk(KERN_WARNING "%s %d-%04x: " fmt, PREFIX, \ | ||
76 | i2c_adapter_id(t->i2c->adapter), t->i2c->addr, ##arg); \ | ||
77 | } while (0) | ||
78 | |||
79 | #define tuner_info(fmt, arg...) do { \ | ||
80 | printk(KERN_INFO "%s %d-%04x: " fmt, PREFIX, \ | ||
81 | i2c_adapter_id(t->i2c->adapter), t->i2c->addr , ##arg); \ | ||
82 | } while (0) | ||
83 | |||
84 | #define tuner_err(fmt, arg...) do { \ | ||
85 | printk(KERN_ERR "%s %d-%04x: " fmt, PREFIX, \ | ||
86 | i2c_adapter_id(t->i2c->adapter), t->i2c->addr , ##arg); \ | ||
87 | } while (0) | ||
88 | |||
89 | #define tuner_dbg(fmt, arg...) do { \ | ||
90 | extern int tuner_debug; \ | ||
91 | if (tuner_debug) \ | ||
92 | printk(KERN_DEBUG "%s %d-%04x: " fmt, PREFIX, \ | ||
93 | i2c_adapter_id(t->i2c->adapter), t->i2c->addr , ##arg); \ | ||
94 | } while (0) | ||
95 | |||
96 | #endif /* __TUNER_DRIVER_H__ */ | 69 | #endif /* __TUNER_DRIVER_H__ */ |
diff --git a/drivers/media/video/tuner-i2c.h b/drivers/media/video/tuner-i2c.h index d7cf72c3fd71..de52e8ffd347 100644 --- a/drivers/media/video/tuner-i2c.h +++ b/drivers/media/video/tuner-i2c.h | |||
@@ -59,7 +59,6 @@ static inline int tuner_i2c_xfer_send_recv(struct tuner_i2c_props *props, | |||
59 | return (ret == 2) ? ilen : ret; | 59 | return (ret == 2) ? ilen : ret; |
60 | } | 60 | } |
61 | 61 | ||
62 | #ifndef __TUNER_DRIVER_H__ | ||
63 | #define tuner_warn(fmt, arg...) do { \ | 62 | #define tuner_warn(fmt, arg...) do { \ |
64 | printk(KERN_WARNING "%s %d-%04x: " fmt, PREFIX, \ | 63 | printk(KERN_WARNING "%s %d-%04x: " fmt, PREFIX, \ |
65 | i2c_adapter_id(priv->i2c_props.adap), \ | 64 | i2c_adapter_id(priv->i2c_props.adap), \ |
@@ -84,6 +83,5 @@ static inline int tuner_i2c_xfer_send_recv(struct tuner_i2c_props *props, | |||
84 | i2c_adapter_id(priv->i2c_props.adap), \ | 83 | i2c_adapter_id(priv->i2c_props.adap), \ |
85 | priv->i2c_props.addr , ##arg); \ | 84 | priv->i2c_props.addr , ##arg); \ |
86 | } while (0) | 85 | } while (0) |
87 | #endif /* __TUNER_DRIVER_H__ */ | ||
88 | 86 | ||
89 | #endif /* __TUNER_I2C_H__ */ | 87 | #endif /* __TUNER_I2C_H__ */ |
diff --git a/include/media/tuner.h b/include/media/tuner.h index d49392d90e56..97be269afbee 100644 --- a/include/media/tuner.h +++ b/include/media/tuner.h | |||
@@ -24,8 +24,6 @@ | |||
24 | 24 | ||
25 | #include <linux/videodev2.h> | 25 | #include <linux/videodev2.h> |
26 | 26 | ||
27 | extern int tuner_debug; | ||
28 | |||
29 | #define ADDR_UNSET (255) | 27 | #define ADDR_UNSET (255) |
30 | 28 | ||
31 | #define TUNER_TEMIC_PAL 0 /* 4002 FH5 (3X 7756, 9483) */ | 29 | #define TUNER_TEMIC_PAL 0 /* 4002 FH5 (3X 7756, 9483) */ |