diff options
Diffstat (limited to 'drivers/media/video/tuner-simple.c')
-rw-r--r-- | drivers/media/video/tuner-simple.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/media/video/tuner-simple.c b/drivers/media/video/tuner-simple.c index c40b92ce1fad..2d57e8bc0db3 100644 --- a/drivers/media/video/tuner-simple.c +++ b/drivers/media/video/tuner-simple.c | |||
@@ -8,6 +8,8 @@ | |||
8 | #include <linux/videodev.h> | 8 | #include <linux/videodev.h> |
9 | #include <media/tuner.h> | 9 | #include <media/tuner.h> |
10 | #include <media/v4l2-common.h> | 10 | #include <media/v4l2-common.h> |
11 | #include <media/tuner-types.h> | ||
12 | #include "tuner-driver.h" | ||
11 | 13 | ||
12 | static int offset = 0; | 14 | static int offset = 0; |
13 | module_param(offset, int, 0664); | 15 | module_param(offset, int, 0664); |
@@ -54,9 +56,9 @@ MODULE_PARM_DESC(offset,"Allows to specify an offset for tuner"); | |||
54 | sound 2 33.16 - - | 56 | sound 2 33.16 - - |
55 | NICAM 33.05 33.05 39.80 | 57 | NICAM 33.05 33.05 39.80 |
56 | */ | 58 | */ |
57 | #define PHILIPS_MF_SET_BG 0x01 /* Bit 2 must be zero, Bit 3 is system output */ | 59 | #define PHILIPS_MF_SET_STD_BG 0x01 /* Bit 2 must be zero, Bit 3 is system output */ |
58 | #define PHILIPS_MF_SET_PAL_L 0x03 // France | 60 | #define PHILIPS_MF_SET_STD_L 0x03 /* Used on Secam France */ |
59 | #define PHILIPS_MF_SET_PAL_L2 0x02 // L' | 61 | #define PHILIPS_MF_SET_STD_LC 0x02 /* Used on SECAM L' */ |
60 | 62 | ||
61 | /* Control byte */ | 63 | /* Control byte */ |
62 | 64 | ||
@@ -207,11 +209,11 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq) | |||
207 | /* 0x04 -> ??? PAL others / SECAM others ??? */ | 209 | /* 0x04 -> ??? PAL others / SECAM others ??? */ |
208 | cb &= ~0x03; | 210 | cb &= ~0x03; |
209 | if (t->std & V4L2_STD_SECAM_L) //also valid for V4L2_STD_SECAM | 211 | if (t->std & V4L2_STD_SECAM_L) //also valid for V4L2_STD_SECAM |
210 | cb |= PHILIPS_MF_SET_PAL_L; | 212 | cb |= PHILIPS_MF_SET_STD_L; |
211 | else if (t->std & V4L2_STD_SECAM_LC) | 213 | else if (t->std & V4L2_STD_SECAM_LC) |
212 | cb |= PHILIPS_MF_SET_PAL_L2; | 214 | cb |= PHILIPS_MF_SET_STD_LC; |
213 | else /* V4L2_STD_B|V4L2_STD_GH */ | 215 | else /* V4L2_STD_B|V4L2_STD_GH */ |
214 | cb |= PHILIPS_MF_SET_BG; | 216 | cb |= PHILIPS_MF_SET_STD_BG; |
215 | break; | 217 | break; |
216 | 218 | ||
217 | case TUNER_TEMIC_4046FM5: | 219 | case TUNER_TEMIC_4046FM5: |
@@ -479,6 +481,13 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq) | |||
479 | tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc); | 481 | tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc); |
480 | } | 482 | } |
481 | 483 | ||
484 | static struct tuner_operations simple_tuner_ops = { | ||
485 | .set_tv_freq = default_set_tv_freq, | ||
486 | .set_radio_freq = default_set_radio_freq, | ||
487 | .has_signal = tuner_signal, | ||
488 | .is_stereo = tuner_stereo, | ||
489 | }; | ||
490 | |||
482 | int default_tuner_init(struct i2c_client *c) | 491 | int default_tuner_init(struct i2c_client *c) |
483 | { | 492 | { |
484 | struct tuner *t = i2c_get_clientdata(c); | 493 | struct tuner *t = i2c_get_clientdata(c); |
@@ -487,11 +496,7 @@ int default_tuner_init(struct i2c_client *c) | |||
487 | t->type, tuners[t->type].name); | 496 | t->type, tuners[t->type].name); |
488 | strlcpy(c->name, tuners[t->type].name, sizeof(c->name)); | 497 | strlcpy(c->name, tuners[t->type].name, sizeof(c->name)); |
489 | 498 | ||
490 | t->set_tv_freq = default_set_tv_freq; | 499 | memcpy(&t->ops, &simple_tuner_ops, sizeof(struct tuner_operations)); |
491 | t->set_radio_freq = default_set_radio_freq; | ||
492 | t->has_signal = tuner_signal; | ||
493 | t->is_stereo = tuner_stereo; | ||
494 | t->standby = NULL; | ||
495 | 500 | ||
496 | return 0; | 501 | return 0; |
497 | } | 502 | } |