diff options
-rw-r--r-- | drivers/media/radio/radio-sf16fmi.c | 16 | ||||
-rw-r--r-- | drivers/media/radio/radio-sf16fmr2.c | 16 |
2 files changed, 8 insertions, 24 deletions
diff --git a/drivers/media/radio/radio-sf16fmi.c b/drivers/media/radio/radio-sf16fmi.c index 5cf6c45b91fe..e598b5471d8a 100644 --- a/drivers/media/radio/radio-sf16fmi.c +++ b/drivers/media/radio/radio-sf16fmi.c | |||
@@ -49,7 +49,6 @@ struct fmi | |||
49 | int io; | 49 | int io; |
50 | int curvol; /* 1 or 0 */ | 50 | int curvol; /* 1 or 0 */ |
51 | unsigned long curfreq; /* freq in kHz */ | 51 | unsigned long curfreq; /* freq in kHz */ |
52 | __u32 flags; | ||
53 | struct mutex lock; | 52 | struct mutex lock; |
54 | }; | 53 | }; |
55 | 54 | ||
@@ -57,7 +56,7 @@ static struct fmi fmi_card; | |||
57 | static struct pnp_dev *dev; | 56 | static struct pnp_dev *dev; |
58 | 57 | ||
59 | /* freq is in 1/16 kHz to internal number, hw precision is 50 kHz */ | 58 | /* freq is in 1/16 kHz to internal number, hw precision is 50 kHz */ |
60 | /* It is only useful to give freq in intervall of 800 (=0.05Mhz), | 59 | /* It is only useful to give freq in interval of 800 (=0.05Mhz), |
61 | * other bits will be truncated, e.g 92.7400016 -> 92.7, but | 60 | * other bits will be truncated, e.g 92.7400016 -> 92.7, but |
62 | * 92.7400017 -> 92.75 | 61 | * 92.7400017 -> 92.75 |
63 | */ | 62 | */ |
@@ -142,7 +141,6 @@ static int vidioc_querycap(struct file *file, void *priv, | |||
142 | static int vidioc_g_tuner(struct file *file, void *priv, | 141 | static int vidioc_g_tuner(struct file *file, void *priv, |
143 | struct v4l2_tuner *v) | 142 | struct v4l2_tuner *v) |
144 | { | 143 | { |
145 | int mult; | ||
146 | struct fmi *fmi = video_drvdata(file); | 144 | struct fmi *fmi = video_drvdata(file); |
147 | 145 | ||
148 | if (v->index > 0) | 146 | if (v->index > 0) |
@@ -150,11 +148,10 @@ static int vidioc_g_tuner(struct file *file, void *priv, | |||
150 | 148 | ||
151 | strlcpy(v->name, "FM", sizeof(v->name)); | 149 | strlcpy(v->name, "FM", sizeof(v->name)); |
152 | v->type = V4L2_TUNER_RADIO; | 150 | v->type = V4L2_TUNER_RADIO; |
153 | mult = (fmi->flags & V4L2_TUNER_CAP_LOW) ? 1 : 1000; | 151 | v->rangelow = RSF16_MINFREQ; |
154 | v->rangelow = RSF16_MINFREQ / mult; | 152 | v->rangehigh = RSF16_MAXFREQ; |
155 | v->rangehigh = RSF16_MAXFREQ / mult; | ||
156 | v->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO; | 153 | v->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO; |
157 | v->capability = fmi->flags & V4L2_TUNER_CAP_LOW; | 154 | v->capability = V4L2_TUNER_CAP_LOW; |
158 | v->audmode = V4L2_TUNER_MODE_STEREO; | 155 | v->audmode = V4L2_TUNER_MODE_STEREO; |
159 | v->signal = fmi_getsigstr(fmi); | 156 | v->signal = fmi_getsigstr(fmi); |
160 | return 0; | 157 | return 0; |
@@ -171,8 +168,6 @@ static int vidioc_s_frequency(struct file *file, void *priv, | |||
171 | { | 168 | { |
172 | struct fmi *fmi = video_drvdata(file); | 169 | struct fmi *fmi = video_drvdata(file); |
173 | 170 | ||
174 | if (!(fmi->flags & V4L2_TUNER_CAP_LOW)) | ||
175 | f->frequency *= 1000; | ||
176 | if (f->frequency < RSF16_MINFREQ || | 171 | if (f->frequency < RSF16_MINFREQ || |
177 | f->frequency > RSF16_MAXFREQ) | 172 | f->frequency > RSF16_MAXFREQ) |
178 | return -EINVAL; | 173 | return -EINVAL; |
@@ -189,8 +184,6 @@ static int vidioc_g_frequency(struct file *file, void *priv, | |||
189 | 184 | ||
190 | f->type = V4L2_TUNER_RADIO; | 185 | f->type = V4L2_TUNER_RADIO; |
191 | f->frequency = fmi->curfreq; | 186 | f->frequency = fmi->curfreq; |
192 | if (!(fmi->flags & V4L2_TUNER_CAP_LOW)) | ||
193 | f->frequency /= 1000; | ||
194 | return 0; | 187 | return 0; |
195 | } | 188 | } |
196 | 189 | ||
@@ -347,7 +340,6 @@ static int __init fmi_init(void) | |||
347 | return res; | 340 | return res; |
348 | } | 341 | } |
349 | 342 | ||
350 | fmi->flags = V4L2_TUNER_CAP_LOW; | ||
351 | strlcpy(fmi->vdev.name, v4l2_dev->name, sizeof(fmi->vdev.name)); | 343 | strlcpy(fmi->vdev.name, v4l2_dev->name, sizeof(fmi->vdev.name)); |
352 | fmi->vdev.v4l2_dev = v4l2_dev; | 344 | fmi->vdev.v4l2_dev = v4l2_dev; |
353 | fmi->vdev.fops = &fmi_fops; | 345 | fmi->vdev.fops = &fmi_fops; |
diff --git a/drivers/media/radio/radio-sf16fmr2.c b/drivers/media/radio/radio-sf16fmr2.c index 935ff9bcdfcc..87e01c556d88 100644 --- a/drivers/media/radio/radio-sf16fmr2.c +++ b/drivers/media/radio/radio-sf16fmr2.c | |||
@@ -61,13 +61,12 @@ struct fmr2 | |||
61 | int stereo; /* card is producing stereo audio */ | 61 | int stereo; /* card is producing stereo audio */ |
62 | unsigned long curfreq; /* freq in kHz */ | 62 | unsigned long curfreq; /* freq in kHz */ |
63 | int card_type; | 63 | int card_type; |
64 | u32 flags; | ||
65 | }; | 64 | }; |
66 | 65 | ||
67 | static struct fmr2 fmr2_card; | 66 | static struct fmr2 fmr2_card; |
68 | 67 | ||
69 | /* hw precision is 12.5 kHz | 68 | /* hw precision is 12.5 kHz |
70 | * It is only useful to give freq in intervall of 200 (=0.0125Mhz), | 69 | * It is only useful to give freq in interval of 200 (=0.0125Mhz), |
71 | * other bits will be truncated | 70 | * other bits will be truncated |
72 | */ | 71 | */ |
73 | #define RSF16_ENCODE(x) ((x) / 200 + 856) | 72 | #define RSF16_ENCODE(x) ((x) / 200 + 856) |
@@ -221,7 +220,6 @@ static int vidioc_querycap(struct file *file, void *priv, | |||
221 | static int vidioc_g_tuner(struct file *file, void *priv, | 220 | static int vidioc_g_tuner(struct file *file, void *priv, |
222 | struct v4l2_tuner *v) | 221 | struct v4l2_tuner *v) |
223 | { | 222 | { |
224 | int mult; | ||
225 | struct fmr2 *fmr2 = video_drvdata(file); | 223 | struct fmr2 *fmr2 = video_drvdata(file); |
226 | 224 | ||
227 | if (v->index > 0) | 225 | if (v->index > 0) |
@@ -230,11 +228,10 @@ static int vidioc_g_tuner(struct file *file, void *priv, | |||
230 | strlcpy(v->name, "FM", sizeof(v->name)); | 228 | strlcpy(v->name, "FM", sizeof(v->name)); |
231 | v->type = V4L2_TUNER_RADIO; | 229 | v->type = V4L2_TUNER_RADIO; |
232 | 230 | ||
233 | mult = (fmr2->flags & V4L2_TUNER_CAP_LOW) ? 1 : 1000; | 231 | v->rangelow = RSF16_MINFREQ; |
234 | v->rangelow = RSF16_MINFREQ / mult; | 232 | v->rangehigh = RSF16_MAXFREQ; |
235 | v->rangehigh = RSF16_MAXFREQ / mult; | ||
236 | v->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO; | 233 | v->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO; |
237 | v->capability = fmr2->flags&V4L2_TUNER_CAP_LOW; | 234 | v->capability = V4L2_TUNER_CAP_LOW; |
238 | v->audmode = fmr2->stereo ? V4L2_TUNER_MODE_STEREO: | 235 | v->audmode = fmr2->stereo ? V4L2_TUNER_MODE_STEREO: |
239 | V4L2_TUNER_MODE_MONO; | 236 | V4L2_TUNER_MODE_MONO; |
240 | mutex_lock(&fmr2->lock); | 237 | mutex_lock(&fmr2->lock); |
@@ -254,8 +251,6 @@ static int vidioc_s_frequency(struct file *file, void *priv, | |||
254 | { | 251 | { |
255 | struct fmr2 *fmr2 = video_drvdata(file); | 252 | struct fmr2 *fmr2 = video_drvdata(file); |
256 | 253 | ||
257 | if (!(fmr2->flags & V4L2_TUNER_CAP_LOW)) | ||
258 | f->frequency *= 1000; | ||
259 | if (f->frequency < RSF16_MINFREQ || | 254 | if (f->frequency < RSF16_MINFREQ || |
260 | f->frequency > RSF16_MAXFREQ) | 255 | f->frequency > RSF16_MAXFREQ) |
261 | return -EINVAL; | 256 | return -EINVAL; |
@@ -279,8 +274,6 @@ static int vidioc_g_frequency(struct file *file, void *priv, | |||
279 | 274 | ||
280 | f->type = V4L2_TUNER_RADIO; | 275 | f->type = V4L2_TUNER_RADIO; |
281 | f->frequency = fmr2->curfreq; | 276 | f->frequency = fmr2->curfreq; |
282 | if (!(fmr2->flags & V4L2_TUNER_CAP_LOW)) | ||
283 | f->frequency /= 1000; | ||
284 | return 0; | 277 | return 0; |
285 | } | 278 | } |
286 | 279 | ||
@@ -406,7 +399,6 @@ static int __init fmr2_init(void) | |||
406 | strlcpy(v4l2_dev->name, "sf16fmr2", sizeof(v4l2_dev->name)); | 399 | strlcpy(v4l2_dev->name, "sf16fmr2", sizeof(v4l2_dev->name)); |
407 | fmr2->io = io; | 400 | fmr2->io = io; |
408 | fmr2->stereo = 1; | 401 | fmr2->stereo = 1; |
409 | fmr2->flags = V4L2_TUNER_CAP_LOW; | ||
410 | mutex_init(&fmr2->lock); | 402 | mutex_init(&fmr2->lock); |
411 | 403 | ||
412 | if (!request_region(fmr2->io, 2, "sf16fmr2")) { | 404 | if (!request_region(fmr2->io, 2, "sf16fmr2")) { |