diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2007-10-21 12:40:56 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-25 16:01:07 -0500 |
commit | 1dde7a4fa2b197d298c3f1b97a7f78fd1c3a1bda (patch) | |
tree | d197c9d1fc5fc0d4ad99481621a9fd99b567e27b /drivers/media | |
parent | 5bea1cd3871351d70cc7624af138f8aa68b7be77 (diff) |
V4L/DVB (6436): tuner: move analog_tuner_ops into dvb_frontend_ops
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_frontend.h | 3 | ||||
-rw-r--r-- | drivers/media/video/tda8290.c | 8 | ||||
-rw-r--r-- | drivers/media/video/tda9887.c | 4 | ||||
-rw-r--r-- | drivers/media/video/tuner-core.c | 91 | ||||
-rw-r--r-- | drivers/media/video/tuner-driver.h | 4 |
5 files changed, 63 insertions, 47 deletions
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.h b/drivers/media/dvb/dvb-core/dvb_frontend.h index c49fa049717e..0dd0c6728979 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.h +++ b/drivers/media/dvb/dvb-core/dvb_frontend.h | |||
@@ -62,6 +62,8 @@ struct dvb_tuner_info { | |||
62 | u32 bandwidth_step; | 62 | u32 bandwidth_step; |
63 | }; | 63 | }; |
64 | 64 | ||
65 | struct analog_tuner_ops; | ||
66 | |||
65 | struct analog_parameters { | 67 | struct analog_parameters { |
66 | unsigned int frequency; | 68 | unsigned int frequency; |
67 | unsigned int mode; | 69 | unsigned int mode; |
@@ -146,6 +148,7 @@ struct dvb_frontend_ops { | |||
146 | int (*ts_bus_ctrl)(struct dvb_frontend* fe, int acquire); | 148 | int (*ts_bus_ctrl)(struct dvb_frontend* fe, int acquire); |
147 | 149 | ||
148 | struct dvb_tuner_ops tuner_ops; | 150 | struct dvb_tuner_ops tuner_ops; |
151 | struct analog_tuner_ops *analog_demod_ops; | ||
149 | }; | 152 | }; |
150 | 153 | ||
151 | #define MAX_EVENT 8 | 154 | #define MAX_EVENT 8 |
diff --git a/drivers/media/video/tda8290.c b/drivers/media/video/tda8290.c index a38ed9db6403..da5e5a8169fa 100644 --- a/drivers/media/video/tda8290.c +++ b/drivers/media/video/tda8290.c | |||
@@ -519,7 +519,7 @@ static void tda829x_release(struct tuner *t) | |||
519 | t->priv = NULL; | 519 | t->priv = NULL; |
520 | } | 520 | } |
521 | 521 | ||
522 | static struct tuner_operations tda8290_tuner_ops = { | 522 | static struct analog_tuner_ops tda8290_tuner_ops = { |
523 | .set_tv_freq = tda8290_set_freq, | 523 | .set_tv_freq = tda8290_set_freq, |
524 | .set_radio_freq = tda8290_set_freq, | 524 | .set_radio_freq = tda8290_set_freq, |
525 | .has_signal = tda8290_has_signal, | 525 | .has_signal = tda8290_has_signal, |
@@ -527,7 +527,7 @@ static struct tuner_operations tda8290_tuner_ops = { | |||
527 | .release = tda829x_release, | 527 | .release = tda829x_release, |
528 | }; | 528 | }; |
529 | 529 | ||
530 | static struct tuner_operations tda8295_tuner_ops = { | 530 | static struct analog_tuner_ops tda8295_tuner_ops = { |
531 | .set_tv_freq = tda8295_set_freq, | 531 | .set_tv_freq = tda8295_set_freq, |
532 | .set_radio_freq = tda8295_set_freq, | 532 | .set_radio_freq = tda8295_set_freq, |
533 | .has_signal = tda8295_has_signal, | 533 | .has_signal = tda8295_has_signal, |
@@ -612,7 +612,7 @@ int tda8290_attach(struct tuner *t) | |||
612 | if (t->fe.ops.tuner_ops.sleep) | 612 | if (t->fe.ops.tuner_ops.sleep) |
613 | t->fe.ops.tuner_ops.sleep(&t->fe); | 613 | t->fe.ops.tuner_ops.sleep(&t->fe); |
614 | 614 | ||
615 | memcpy(&t->ops, &tda8290_tuner_ops, sizeof(struct tuner_operations)); | 615 | t->fe.ops.analog_demod_ops = &tda8290_tuner_ops; |
616 | 616 | ||
617 | tuner_info("type set to %s\n", t->i2c.name); | 617 | tuner_info("type set to %s\n", t->i2c.name); |
618 | 618 | ||
@@ -703,7 +703,7 @@ int tda8295_attach(struct tuner *t) | |||
703 | priv->tda827x_ver |= 1; /* signifies 8295 vs 8290 */ | 703 | priv->tda827x_ver |= 1; /* signifies 8295 vs 8290 */ |
704 | tuner_info("type set to %s\n", t->i2c.name); | 704 | tuner_info("type set to %s\n", t->i2c.name); |
705 | 705 | ||
706 | memcpy(&t->ops, &tda8295_tuner_ops, sizeof(struct tuner_operations)); | 706 | t->fe.ops.analog_demod_ops = &tda8295_tuner_ops; |
707 | 707 | ||
708 | priv->cfg.tda827x_lpsel = 0; | 708 | priv->cfg.tda827x_lpsel = 0; |
709 | t->mode = V4L2_TUNER_ANALOG_TV; | 709 | t->mode = V4L2_TUNER_ANALOG_TV; |
diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index be5387f11afb..d9bfa812ffe8 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c | |||
@@ -610,7 +610,7 @@ static void tda9887_release(struct tuner *t) | |||
610 | t->priv = NULL; | 610 | t->priv = NULL; |
611 | } | 611 | } |
612 | 612 | ||
613 | static struct tuner_operations tda9887_tuner_ops = { | 613 | static struct analog_tuner_ops tda9887_tuner_ops = { |
614 | .set_tv_freq = tda9887_set_freq, | 614 | .set_tv_freq = tda9887_set_freq, |
615 | .set_radio_freq = tda9887_set_freq, | 615 | .set_radio_freq = tda9887_set_freq, |
616 | .standby = tda9887_standby, | 616 | .standby = tda9887_standby, |
@@ -636,7 +636,7 @@ int tda9887_tuner_init(struct tuner *t) | |||
636 | tda9887_info("tda988[5/6/7] found @ 0x%x (%s)\n", t->i2c.addr, | 636 | tda9887_info("tda988[5/6/7] found @ 0x%x (%s)\n", t->i2c.addr, |
637 | t->i2c.driver->driver.name); | 637 | t->i2c.driver->driver.name); |
638 | 638 | ||
639 | memcpy(&t->ops, &tda9887_tuner_ops, sizeof(struct tuner_operations)); | 639 | t->fe.ops.analog_demod_ops = &tda9887_tuner_ops; |
640 | 640 | ||
641 | return 0; | 641 | return 0; |
642 | } | 642 | } |
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index 6ae8cb205d8e..f31de98bbfa5 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
@@ -122,16 +122,28 @@ static int fe_has_signal(struct tuner *t) | |||
122 | return strength; | 122 | return strength; |
123 | } | 123 | } |
124 | 124 | ||
125 | static void tuner_status(struct tuner *t); | ||
126 | |||
127 | static struct analog_tuner_ops tuner_core_ops = { | ||
128 | .set_tv_freq = fe_set_freq, | ||
129 | .set_radio_freq = fe_set_freq, | ||
130 | .standby = fe_standby, | ||
131 | .release = fe_release, | ||
132 | .has_signal = fe_has_signal, | ||
133 | .tuner_status = tuner_status | ||
134 | }; | ||
135 | |||
125 | /* Set tuner frequency, freq in Units of 62.5kHz = 1/16MHz */ | 136 | /* Set tuner frequency, freq in Units of 62.5kHz = 1/16MHz */ |
126 | static void set_tv_freq(struct i2c_client *c, unsigned int freq) | 137 | static void set_tv_freq(struct i2c_client *c, unsigned int freq) |
127 | { | 138 | { |
128 | struct tuner *t = i2c_get_clientdata(c); | 139 | struct tuner *t = i2c_get_clientdata(c); |
140 | struct analog_tuner_ops *ops = t->fe.ops.analog_demod_ops; | ||
129 | 141 | ||
130 | if (t->type == UNSET) { | 142 | if (t->type == UNSET) { |
131 | tuner_warn ("tuner type not set\n"); | 143 | tuner_warn ("tuner type not set\n"); |
132 | return; | 144 | return; |
133 | } | 145 | } |
134 | if (NULL == t->ops.set_tv_freq) { | 146 | if ((NULL == ops) || (NULL == ops->set_tv_freq)) { |
135 | tuner_warn ("Tuner has no way to set tv freq\n"); | 147 | tuner_warn ("Tuner has no way to set tv freq\n"); |
136 | return; | 148 | return; |
137 | } | 149 | } |
@@ -146,18 +158,19 @@ static void set_tv_freq(struct i2c_client *c, unsigned int freq) | |||
146 | else | 158 | else |
147 | freq = tv_range[1] * 16; | 159 | freq = tv_range[1] * 16; |
148 | } | 160 | } |
149 | t->ops.set_tv_freq(t, freq); | 161 | ops->set_tv_freq(t, freq); |
150 | } | 162 | } |
151 | 163 | ||
152 | static void set_radio_freq(struct i2c_client *c, unsigned int freq) | 164 | static void set_radio_freq(struct i2c_client *c, unsigned int freq) |
153 | { | 165 | { |
154 | struct tuner *t = i2c_get_clientdata(c); | 166 | struct tuner *t = i2c_get_clientdata(c); |
167 | struct analog_tuner_ops *ops = t->fe.ops.analog_demod_ops; | ||
155 | 168 | ||
156 | if (t->type == UNSET) { | 169 | if (t->type == UNSET) { |
157 | tuner_warn ("tuner type not set\n"); | 170 | tuner_warn ("tuner type not set\n"); |
158 | return; | 171 | return; |
159 | } | 172 | } |
160 | if (NULL == t->ops.set_radio_freq) { | 173 | if ((NULL == ops) || (NULL == ops->set_radio_freq)) { |
161 | tuner_warn ("tuner has no way to set radio frequency\n"); | 174 | tuner_warn ("tuner has no way to set radio frequency\n"); |
162 | return; | 175 | return; |
163 | } | 176 | } |
@@ -173,7 +186,7 @@ static void set_radio_freq(struct i2c_client *c, unsigned int freq) | |||
173 | freq = radio_range[1] * 16000; | 186 | freq = radio_range[1] * 16000; |
174 | } | 187 | } |
175 | 188 | ||
176 | t->ops.set_radio_freq(t, freq); | 189 | ops->set_radio_freq(t, freq); |
177 | } | 190 | } |
178 | 191 | ||
179 | static void set_freq(struct i2c_client *c, unsigned long freq) | 192 | static void set_freq(struct i2c_client *c, unsigned long freq) |
@@ -235,6 +248,7 @@ static void set_type(struct i2c_client *c, unsigned int type, | |||
235 | { | 248 | { |
236 | struct tuner *t = i2c_get_clientdata(c); | 249 | struct tuner *t = i2c_get_clientdata(c); |
237 | struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops; | 250 | struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops; |
251 | struct analog_tuner_ops *ops = t->fe.ops.analog_demod_ops; | ||
238 | unsigned char buffer[4]; | 252 | unsigned char buffer[4]; |
239 | 253 | ||
240 | if (type == UNSET || type == TUNER_ABSENT) { | 254 | if (type == UNSET || type == TUNER_ABSENT) { |
@@ -262,8 +276,8 @@ static void set_type(struct i2c_client *c, unsigned int type, | |||
262 | } | 276 | } |
263 | 277 | ||
264 | /* discard private data, in case set_type() was previously called */ | 278 | /* discard private data, in case set_type() was previously called */ |
265 | if (t->ops.release) | 279 | if ((ops) && (ops->release)) |
266 | t->ops.release(t); | 280 | ops->release(t); |
267 | else { | 281 | else { |
268 | kfree(t->priv); | 282 | kfree(t->priv); |
269 | t->priv = NULL; | 283 | t->priv = NULL; |
@@ -339,15 +353,12 @@ static void set_type(struct i2c_client *c, unsigned int type, | |||
339 | break; | 353 | break; |
340 | } | 354 | } |
341 | 355 | ||
342 | if ((fe_tuner_ops->set_analog_params) && | 356 | if (((NULL == ops) || |
343 | ((NULL == t->ops.set_tv_freq) && (NULL == t->ops.set_radio_freq))) { | 357 | ((NULL == ops->set_tv_freq) && (NULL == ops->set_radio_freq))) && |
358 | (fe_tuner_ops->set_analog_params)) { | ||
344 | strlcpy(t->i2c.name, fe_tuner_ops->info.name, sizeof(t->i2c.name)); | 359 | strlcpy(t->i2c.name, fe_tuner_ops->info.name, sizeof(t->i2c.name)); |
345 | 360 | ||
346 | t->ops.set_tv_freq = fe_set_freq; | 361 | t->fe.ops.analog_demod_ops = &tuner_core_ops; |
347 | t->ops.set_radio_freq = fe_set_freq; | ||
348 | t->ops.standby = fe_standby; | ||
349 | t->ops.release = fe_release; | ||
350 | t->ops.has_signal = fe_has_signal; | ||
351 | } | 362 | } |
352 | 363 | ||
353 | tuner_info("type set to %s\n", t->i2c.name); | 364 | tuner_info("type set to %s\n", t->i2c.name); |
@@ -524,6 +535,7 @@ static void tuner_status(struct tuner *t) | |||
524 | { | 535 | { |
525 | unsigned long freq, freq_fraction; | 536 | unsigned long freq, freq_fraction; |
526 | struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops; | 537 | struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops; |
538 | struct analog_tuner_ops *ops = t->fe.ops.analog_demod_ops; | ||
527 | const char *p; | 539 | const char *p; |
528 | 540 | ||
529 | switch (t->mode) { | 541 | switch (t->mode) { |
@@ -553,11 +565,11 @@ static void tuner_status(struct tuner *t) | |||
553 | if (tuner_status & TUNER_STATUS_STEREO) | 565 | if (tuner_status & TUNER_STATUS_STEREO) |
554 | tuner_info("Stereo: yes\n"); | 566 | tuner_info("Stereo: yes\n"); |
555 | } | 567 | } |
556 | if (t->ops.has_signal) { | 568 | if ((ops) && (ops->has_signal)) { |
557 | tuner_info("Signal strength: %d\n", t->ops.has_signal(t)); | 569 | tuner_info("Signal strength: %d\n", ops->has_signal(t)); |
558 | } | 570 | } |
559 | if (t->ops.is_stereo) { | 571 | if ((ops) && (ops->is_stereo)) { |
560 | tuner_info("Stereo: %s\n", t->ops.is_stereo(t) ? "yes" : "no"); | 572 | tuner_info("Stereo: %s\n", ops->is_stereo(t) ? "yes" : "no"); |
561 | } | 573 | } |
562 | } | 574 | } |
563 | 575 | ||
@@ -584,7 +596,6 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind) | |||
584 | t->type = UNSET; | 596 | t->type = UNSET; |
585 | t->audmode = V4L2_TUNER_MODE_STEREO; | 597 | t->audmode = V4L2_TUNER_MODE_STEREO; |
586 | t->mode_mask = T_UNINITIALIZED; | 598 | t->mode_mask = T_UNINITIALIZED; |
587 | t->ops.tuner_status = tuner_status; | ||
588 | 599 | ||
589 | if (show_i2c) { | 600 | if (show_i2c) { |
590 | unsigned char buffer[16]; | 601 | unsigned char buffer[16]; |
@@ -701,6 +712,7 @@ static int tuner_probe(struct i2c_adapter *adap) | |||
701 | static int tuner_detach(struct i2c_client *client) | 712 | static int tuner_detach(struct i2c_client *client) |
702 | { | 713 | { |
703 | struct tuner *t = i2c_get_clientdata(client); | 714 | struct tuner *t = i2c_get_clientdata(client); |
715 | struct analog_tuner_ops *ops = t->fe.ops.analog_demod_ops; | ||
704 | int err; | 716 | int err; |
705 | 717 | ||
706 | err = i2c_detach_client(&t->i2c); | 718 | err = i2c_detach_client(&t->i2c); |
@@ -710,8 +722,8 @@ static int tuner_detach(struct i2c_client *client) | |||
710 | return err; | 722 | return err; |
711 | } | 723 | } |
712 | 724 | ||
713 | if (t->ops.release) | 725 | if ((ops) && (ops->release)) |
714 | t->ops.release(t); | 726 | ops->release(t); |
715 | else { | 727 | else { |
716 | kfree(t->priv); | 728 | kfree(t->priv); |
717 | } | 729 | } |
@@ -728,6 +740,8 @@ static int tuner_detach(struct i2c_client *client) | |||
728 | 740 | ||
729 | static inline int set_mode(struct i2c_client *client, struct tuner *t, int mode, char *cmd) | 741 | static inline int set_mode(struct i2c_client *client, struct tuner *t, int mode, char *cmd) |
730 | { | 742 | { |
743 | struct analog_tuner_ops *ops = t->fe.ops.analog_demod_ops; | ||
744 | |||
731 | if (mode == t->mode) | 745 | if (mode == t->mode) |
732 | return 0; | 746 | return 0; |
733 | 747 | ||
@@ -735,8 +749,8 @@ static inline int set_mode(struct i2c_client *client, struct tuner *t, int mode, | |||
735 | 749 | ||
736 | if (check_mode(t, cmd) == EINVAL) { | 750 | if (check_mode(t, cmd) == EINVAL) { |
737 | t->mode = T_STANDBY; | 751 | t->mode = T_STANDBY; |
738 | if (t->ops.standby) | 752 | if ((ops) && (ops->standby)) |
739 | t->ops.standby(t); | 753 | ops->standby(t); |
740 | return EINVAL; | 754 | return EINVAL; |
741 | } | 755 | } |
742 | return 0; | 756 | return 0; |
@@ -759,6 +773,7 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
759 | { | 773 | { |
760 | struct tuner *t = i2c_get_clientdata(client); | 774 | struct tuner *t = i2c_get_clientdata(client); |
761 | struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops; | 775 | struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops; |
776 | struct analog_tuner_ops *ops = t->fe.ops.analog_demod_ops; | ||
762 | 777 | ||
763 | if (tuner_debug>1) | 778 | if (tuner_debug>1) |
764 | v4l_i2c_print_ioctl(&(t->i2c),cmd); | 779 | v4l_i2c_print_ioctl(&(t->i2c),cmd); |
@@ -785,8 +800,8 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
785 | if (check_mode(t, "TUNER_SET_STANDBY") == EINVAL) | 800 | if (check_mode(t, "TUNER_SET_STANDBY") == EINVAL) |
786 | return 0; | 801 | return 0; |
787 | t->mode = T_STANDBY; | 802 | t->mode = T_STANDBY; |
788 | if (t->ops.standby) | 803 | if ((ops) && (ops->standby)) |
789 | t->ops.standby(t); | 804 | ops->standby(t); |
790 | break; | 805 | break; |
791 | #ifdef CONFIG_VIDEO_V4L1 | 806 | #ifdef CONFIG_VIDEO_V4L1 |
792 | case VIDIOCSAUDIO: | 807 | case VIDIOCSAUDIO: |
@@ -854,8 +869,8 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
854 | else | 869 | else |
855 | vt->flags &= ~VIDEO_TUNER_STEREO_ON; | 870 | vt->flags &= ~VIDEO_TUNER_STEREO_ON; |
856 | } else { | 871 | } else { |
857 | if (t->ops.is_stereo) { | 872 | if ((ops) && (ops->is_stereo)) { |
858 | if (t->ops.is_stereo(t)) | 873 | if (ops->is_stereo(t)) |
859 | vt->flags |= | 874 | vt->flags |= |
860 | VIDEO_TUNER_STEREO_ON; | 875 | VIDEO_TUNER_STEREO_ON; |
861 | else | 876 | else |
@@ -863,8 +878,8 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
863 | ~VIDEO_TUNER_STEREO_ON; | 878 | ~VIDEO_TUNER_STEREO_ON; |
864 | } | 879 | } |
865 | } | 880 | } |
866 | if (t->ops.has_signal) | 881 | if ((ops) && (ops->has_signal)) |
867 | vt->signal = t->ops.has_signal(t); | 882 | vt->signal = ops->has_signal(t); |
868 | 883 | ||
869 | vt->flags |= VIDEO_TUNER_LOW; /* Allow freqs at 62.5 Hz */ | 884 | vt->flags |= VIDEO_TUNER_LOW; /* Allow freqs at 62.5 Hz */ |
870 | 885 | ||
@@ -894,8 +909,8 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
894 | fe_tuner_ops->get_status(&t->fe, &tuner_status); | 909 | fe_tuner_ops->get_status(&t->fe, &tuner_status); |
895 | va->mode = (tuner_status & TUNER_STATUS_STEREO) | 910 | va->mode = (tuner_status & TUNER_STATUS_STEREO) |
896 | ? VIDEO_SOUND_STEREO : VIDEO_SOUND_MONO; | 911 | ? VIDEO_SOUND_STEREO : VIDEO_SOUND_MONO; |
897 | } else if (t->ops.is_stereo) | 912 | } else if ((ops) && (ops->is_stereo)) |
898 | va->mode = t->ops.is_stereo(t) | 913 | va->mode = ops->is_stereo(t) |
899 | ? VIDEO_SOUND_STEREO : VIDEO_SOUND_MONO; | 914 | ? VIDEO_SOUND_STEREO : VIDEO_SOUND_MONO; |
900 | } | 915 | } |
901 | return 0; | 916 | return 0; |
@@ -985,8 +1000,8 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
985 | switch_v4l2(); | 1000 | switch_v4l2(); |
986 | 1001 | ||
987 | tuner->type = t->mode; | 1002 | tuner->type = t->mode; |
988 | if (t->ops.get_afc) | 1003 | if ((ops) && (ops->get_afc)) |
989 | tuner->afc=t->ops.get_afc(t); | 1004 | tuner->afc = ops->get_afc(t); |
990 | if (t->mode == V4L2_TUNER_ANALOG_TV) | 1005 | if (t->mode == V4L2_TUNER_ANALOG_TV) |
991 | tuner->capability |= V4L2_TUNER_CAP_NORM; | 1006 | tuner->capability |= V4L2_TUNER_CAP_NORM; |
992 | if (t->mode != V4L2_TUNER_RADIO) { | 1007 | if (t->mode != V4L2_TUNER_RADIO) { |
@@ -1005,13 +1020,13 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
1005 | tuner->rxsubchans = (tuner_status & TUNER_STATUS_STEREO) ? | 1020 | tuner->rxsubchans = (tuner_status & TUNER_STATUS_STEREO) ? |
1006 | V4L2_TUNER_SUB_STEREO : V4L2_TUNER_SUB_MONO; | 1021 | V4L2_TUNER_SUB_STEREO : V4L2_TUNER_SUB_MONO; |
1007 | } else { | 1022 | } else { |
1008 | if (t->ops.is_stereo) { | 1023 | if ((ops) && (ops->is_stereo)) { |
1009 | tuner->rxsubchans = t->ops.is_stereo(t) ? | 1024 | tuner->rxsubchans = ops->is_stereo(t) ? |
1010 | V4L2_TUNER_SUB_STEREO : V4L2_TUNER_SUB_MONO; | 1025 | V4L2_TUNER_SUB_STEREO : V4L2_TUNER_SUB_MONO; |
1011 | } | 1026 | } |
1012 | } | 1027 | } |
1013 | if (t->ops.has_signal) | 1028 | if ((ops) && (ops->has_signal)) |
1014 | tuner->signal = t->ops.has_signal(t); | 1029 | tuner->signal = ops->has_signal(t); |
1015 | tuner->capability |= | 1030 | tuner->capability |= |
1016 | V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO; | 1031 | V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO; |
1017 | tuner->audmode = t->audmode; | 1032 | tuner->audmode = t->audmode; |
@@ -1036,8 +1051,8 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
1036 | break; | 1051 | break; |
1037 | } | 1052 | } |
1038 | case VIDIOC_LOG_STATUS: | 1053 | case VIDIOC_LOG_STATUS: |
1039 | if (t->ops.tuner_status) | 1054 | if ((ops) && (ops->tuner_status)) |
1040 | t->ops.tuner_status(t); | 1055 | ops->tuner_status(t); |
1041 | break; | 1056 | break; |
1042 | } | 1057 | } |
1043 | 1058 | ||
diff --git a/drivers/media/video/tuner-driver.h b/drivers/media/video/tuner-driver.h index 28a10da76d12..f2a9c29f1f09 100644 --- a/drivers/media/video/tuner-driver.h +++ b/drivers/media/video/tuner-driver.h | |||
@@ -31,7 +31,7 @@ extern unsigned const int tuner_count; | |||
31 | 31 | ||
32 | struct tuner; | 32 | struct tuner; |
33 | 33 | ||
34 | struct tuner_operations { | 34 | struct analog_tuner_ops { |
35 | void (*set_tv_freq)(struct tuner *t, unsigned int freq); | 35 | void (*set_tv_freq)(struct tuner *t, unsigned int freq); |
36 | void (*set_radio_freq)(struct tuner *t, unsigned int freq); | 36 | void (*set_radio_freq)(struct tuner *t, unsigned int freq); |
37 | int (*has_signal)(struct tuner *t); | 37 | int (*has_signal)(struct tuner *t); |
@@ -66,8 +66,6 @@ struct tuner { | |||
66 | 66 | ||
67 | unsigned int config; | 67 | unsigned int config; |
68 | int (*tuner_callback) (void *dev, int command,int arg); | 68 | int (*tuner_callback) (void *dev, int command,int arg); |
69 | |||
70 | struct tuner_operations ops; | ||
71 | }; | 69 | }; |
72 | 70 | ||
73 | /* ------------------------------------------------------------------------ */ | 71 | /* ------------------------------------------------------------------------ */ |