diff options
author | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-03-21 14:05:45 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-03-21 14:05:45 -0500 |
commit | d04cdb64212eb5ae6a98026a97dda626e40e8e9a (patch) | |
tree | b6a7dbb21ccfceb915844e9a330b3d3dfcaf3c5b /drivers/media/video/tuner-core.c | |
parent | 2f8600dff2b140096a7df781884e918a16aa90e0 (diff) | |
parent | ec1248e70edc5cf7b485efcc7b41e44e10f422e5 (diff) |
Merge ../linux-2.6
Diffstat (limited to 'drivers/media/video/tuner-core.c')
-rw-r--r-- | drivers/media/video/tuner-core.c | 69 |
1 files changed, 33 insertions, 36 deletions
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index b6101bf446d4..32e1849441fb 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
@@ -173,7 +173,6 @@ static void set_type(struct i2c_client *c, unsigned int type, | |||
173 | } | 173 | } |
174 | 174 | ||
175 | t->type = type; | 175 | t->type = type; |
176 | |||
177 | switch (t->type) { | 176 | switch (t->type) { |
178 | case TUNER_MT2032: | 177 | case TUNER_MT2032: |
179 | microtune_init(c); | 178 | microtune_init(c); |
@@ -404,15 +403,16 @@ static void tuner_status(struct i2c_client *client) | |||
404 | tuner_info("Tuner mode: %s\n", p); | 403 | tuner_info("Tuner mode: %s\n", p); |
405 | tuner_info("Frequency: %lu.%02lu MHz\n", freq, freq_fraction); | 404 | tuner_info("Frequency: %lu.%02lu MHz\n", freq, freq_fraction); |
406 | tuner_info("Standard: 0x%08llx\n", t->std); | 405 | tuner_info("Standard: 0x%08llx\n", t->std); |
407 | if (t->mode == V4L2_TUNER_RADIO) { | 406 | if (t->mode != V4L2_TUNER_RADIO) |
408 | if (t->has_signal) { | 407 | return; |
409 | tuner_info("Signal strength: %d\n", t->has_signal(client)); | 408 | if (t->has_signal) { |
410 | } | 409 | tuner_info("Signal strength: %d\n", t->has_signal(client)); |
411 | if (t->is_stereo) { | 410 | } |
412 | tuner_info("Stereo: %s\n", t->is_stereo(client) ? "yes" : "no"); | 411 | if (t->is_stereo) { |
413 | } | 412 | tuner_info("Stereo: %s\n", t->is_stereo(client) ? "yes" : "no"); |
414 | } | 413 | } |
415 | } | 414 | } |
415 | |||
416 | /* ---------------------------------------------------------------------- */ | 416 | /* ---------------------------------------------------------------------- */ |
417 | 417 | ||
418 | /* static var Used only in tuner_attach and tuner_probe */ | 418 | /* static var Used only in tuner_attach and tuner_probe */ |
@@ -744,33 +744,29 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
744 | return 0; | 744 | return 0; |
745 | switch_v4l2(); | 745 | switch_v4l2(); |
746 | 746 | ||
747 | if (V4L2_TUNER_RADIO == t->mode) { | 747 | tuner->type = t->mode; |
748 | 748 | if (t->mode != V4L2_TUNER_RADIO) { | |
749 | if (t->has_signal) | ||
750 | tuner->signal = t->has_signal(client); | ||
751 | |||
752 | if (t->is_stereo) { | ||
753 | if (t->is_stereo(client)) { | ||
754 | tuner->rxsubchans = | ||
755 | V4L2_TUNER_SUB_STEREO | | ||
756 | V4L2_TUNER_SUB_MONO; | ||
757 | } else { | ||
758 | tuner->rxsubchans = | ||
759 | V4L2_TUNER_SUB_MONO; | ||
760 | } | ||
761 | } | ||
762 | |||
763 | tuner->capability |= | ||
764 | V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO; | ||
765 | |||
766 | tuner->audmode = t->audmode; | ||
767 | |||
768 | tuner->rangelow = radio_range[0] * 16000; | ||
769 | tuner->rangehigh = radio_range[1] * 16000; | ||
770 | } else { | ||
771 | tuner->rangelow = tv_range[0] * 16; | 749 | tuner->rangelow = tv_range[0] * 16; |
772 | tuner->rangehigh = tv_range[1] * 16; | 750 | tuner->rangehigh = tv_range[1] * 16; |
751 | break; | ||
773 | } | 752 | } |
753 | |||
754 | /* radio mode */ | ||
755 | if (t->has_signal) | ||
756 | tuner->signal = t->has_signal(client); | ||
757 | |||
758 | tuner->rxsubchans = | ||
759 | V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO; | ||
760 | if (t->is_stereo) { | ||
761 | tuner->rxsubchans = t->is_stereo(client) ? | ||
762 | V4L2_TUNER_SUB_STEREO : V4L2_TUNER_SUB_MONO; | ||
763 | } | ||
764 | |||
765 | tuner->capability |= | ||
766 | V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO; | ||
767 | tuner->audmode = t->audmode; | ||
768 | tuner->rangelow = radio_range[0] * 16000; | ||
769 | tuner->rangehigh = radio_range[1] * 16000; | ||
774 | break; | 770 | break; |
775 | } | 771 | } |
776 | case VIDIOC_S_TUNER: | 772 | case VIDIOC_S_TUNER: |
@@ -782,10 +778,11 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
782 | 778 | ||
783 | switch_v4l2(); | 779 | switch_v4l2(); |
784 | 780 | ||
785 | if (V4L2_TUNER_RADIO == t->mode) { | 781 | /* do nothing unless we're a radio tuner */ |
786 | t->audmode = tuner->audmode; | 782 | if (t->mode != V4L2_TUNER_RADIO) |
787 | set_radio_freq(client, t->radio_freq); | 783 | break; |
788 | } | 784 | t->audmode = tuner->audmode; |
785 | set_radio_freq(client, t->radio_freq); | ||
789 | break; | 786 | break; |
790 | } | 787 | } |
791 | case VIDIOC_LOG_STATUS: | 788 | case VIDIOC_LOG_STATUS: |