diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-13 17:03:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-13 17:03:59 -0400 |
commit | cf2fa66055d718ae13e62451bb546505f63906a2 (patch) | |
tree | e206d3f04e74a34e9aa88d21af6c26eea21d4121 /drivers/media/radio/radio-maestro.c | |
parent | 4501a466f28788485604ee42641d7a5fe7258d16 (diff) | |
parent | 57f51dbc45f65f7ee1e8c8f77200bb8000e3e271 (diff) |
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (313 commits)
V4L/DVB (9186): Added support for Prof 7300 DVB-S/S2 cards
V4L/DVB (9185): S2API: Ensure we have a reasonable ROLLOFF default
V4L/DVB (9184): cx24116: Change the default SNR units back to percentage by default.
V4L/DVB (9183): S2API: Return error of the caller provides 0 commands.
V4L/DVB (9182): S2API: Added support for DTV_HIERARCHY
V4L/DVB (9181): S2API: Add support fot DTV_GUARD_INTERVAL and DTV_TRANSMISSION_MODE
V4L/DVB (9180): S2API: Added support for DTV_CODE_RATE_HP/LP
V4L/DVB (9179): S2API: frontend.h cleanup
V4L/DVB (9178): cx24116: Add module parameter to return SNR as ESNO.
V4L/DVB (9177): S2API: Change _8PSK / _16APSK to PSK_8 and APSK_16
V4L/DVB (9176): Add support for DvbWorld USB cards with STV0288 demodulator.
V4L/DVB (9175): Remove NULL pointer in stb6000 driver.
V4L/DVB (9174): Allow custom inittab for ST STV0288 demodulator.
V4L/DVB (9173): S2API: Remove the hardcoded command limit during validation
V4L/DVB (9172): S2API: Bugfix related to DVB-S / DVB-S2 tuning for the legacy API.
V4L/DVB (9171): S2API: Stop an OOPS if illegal commands are dumped in S2API.
V4L/DVB (9170): cx24116: Sanity checking to data input via S2API to the cx24116 demod.
V4L/DVB (9169): uvcvideo: Support two new Bison Electronics webcams.
V4L/DVB (9168): Add support for MSI TV@nywhere Plus remote
V4L/DVB: v4l2-dev: remove duplicated #include
...
Diffstat (limited to 'drivers/media/radio/radio-maestro.c')
-rw-r--r-- | drivers/media/radio/radio-maestro.c | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/drivers/media/radio/radio-maestro.c b/drivers/media/radio/radio-maestro.c index 9ef0a763eeb7..4bf4d007bcfa 100644 --- a/drivers/media/radio/radio-maestro.c +++ b/drivers/media/radio/radio-maestro.c | |||
@@ -75,7 +75,21 @@ static struct v4l2_queryctrl radio_qctrl[] = { | |||
75 | static int radio_nr = -1; | 75 | static int radio_nr = -1; |
76 | module_param(radio_nr, int, 0); | 76 | module_param(radio_nr, int, 0); |
77 | 77 | ||
78 | static unsigned long in_use; | ||
79 | |||
78 | static int maestro_probe(struct pci_dev *pdev, const struct pci_device_id *ent); | 80 | static int maestro_probe(struct pci_dev *pdev, const struct pci_device_id *ent); |
81 | |||
82 | static int maestro_exclusive_open(struct inode *inode, struct file *file) | ||
83 | { | ||
84 | return test_and_set_bit(0, &in_use) ? -EBUSY : 0; | ||
85 | } | ||
86 | |||
87 | static int maestro_exclusive_release(struct inode *inode, struct file *file) | ||
88 | { | ||
89 | clear_bit(0, &in_use); | ||
90 | return 0; | ||
91 | } | ||
92 | |||
79 | static void maestro_remove(struct pci_dev *pdev); | 93 | static void maestro_remove(struct pci_dev *pdev); |
80 | 94 | ||
81 | static struct pci_device_id maestro_r_pci_tbl[] = { | 95 | static struct pci_device_id maestro_r_pci_tbl[] = { |
@@ -98,8 +112,8 @@ static struct pci_driver maestro_r_driver = { | |||
98 | 112 | ||
99 | static const struct file_operations maestro_fops = { | 113 | static const struct file_operations maestro_fops = { |
100 | .owner = THIS_MODULE, | 114 | .owner = THIS_MODULE, |
101 | .open = video_exclusive_open, | 115 | .open = maestro_exclusive_open, |
102 | .release = video_exclusive_release, | 116 | .release = maestro_exclusive_release, |
103 | .ioctl = video_ioctl2, | 117 | .ioctl = video_ioctl2, |
104 | #ifdef CONFIG_COMPAT | 118 | #ifdef CONFIG_COMPAT |
105 | .compat_ioctl = v4l_compat_ioctl32, | 119 | .compat_ioctl = v4l_compat_ioctl32, |
@@ -196,8 +210,7 @@ static int vidioc_querycap(struct file *file, void *priv, | |||
196 | static int vidioc_g_tuner(struct file *file, void *priv, | 210 | static int vidioc_g_tuner(struct file *file, void *priv, |
197 | struct v4l2_tuner *v) | 211 | struct v4l2_tuner *v) |
198 | { | 212 | { |
199 | struct video_device *dev = video_devdata(file); | 213 | struct radio_device *card = video_drvdata(file); |
200 | struct radio_device *card = video_get_drvdata(dev); | ||
201 | 214 | ||
202 | if (v->index > 0) | 215 | if (v->index > 0) |
203 | return -EINVAL; | 216 | return -EINVAL; |
@@ -229,8 +242,7 @@ static int vidioc_s_tuner(struct file *file, void *priv, | |||
229 | static int vidioc_s_frequency(struct file *file, void *priv, | 242 | static int vidioc_s_frequency(struct file *file, void *priv, |
230 | struct v4l2_frequency *f) | 243 | struct v4l2_frequency *f) |
231 | { | 244 | { |
232 | struct video_device *dev = video_devdata(file); | 245 | struct radio_device *card = video_drvdata(file); |
233 | struct radio_device *card = video_get_drvdata(dev); | ||
234 | 246 | ||
235 | if (f->frequency < FREQ_LO || f->frequency > FREQ_HI) | 247 | if (f->frequency < FREQ_LO || f->frequency > FREQ_HI) |
236 | return -EINVAL; | 248 | return -EINVAL; |
@@ -241,8 +253,7 @@ static int vidioc_s_frequency(struct file *file, void *priv, | |||
241 | static int vidioc_g_frequency(struct file *file, void *priv, | 253 | static int vidioc_g_frequency(struct file *file, void *priv, |
242 | struct v4l2_frequency *f) | 254 | struct v4l2_frequency *f) |
243 | { | 255 | { |
244 | struct video_device *dev = video_devdata(file); | 256 | struct radio_device *card = video_drvdata(file); |
245 | struct radio_device *card = video_get_drvdata(dev); | ||
246 | 257 | ||
247 | f->type = V4L2_TUNER_RADIO; | 258 | f->type = V4L2_TUNER_RADIO; |
248 | f->frequency = BITS2FREQ(radio_bits_get(card)); | 259 | f->frequency = BITS2FREQ(radio_bits_get(card)); |
@@ -267,8 +278,7 @@ static int vidioc_queryctrl(struct file *file, void *priv, | |||
267 | static int vidioc_g_ctrl(struct file *file, void *priv, | 278 | static int vidioc_g_ctrl(struct file *file, void *priv, |
268 | struct v4l2_control *ctrl) | 279 | struct v4l2_control *ctrl) |
269 | { | 280 | { |
270 | struct video_device *dev = video_devdata(file); | 281 | struct radio_device *card = video_drvdata(file); |
271 | struct radio_device *card = video_get_drvdata(dev); | ||
272 | 282 | ||
273 | switch (ctrl->id) { | 283 | switch (ctrl->id) { |
274 | case V4L2_CID_AUDIO_MUTE: | 284 | case V4L2_CID_AUDIO_MUTE: |
@@ -281,8 +291,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv, | |||
281 | static int vidioc_s_ctrl(struct file *file, void *priv, | 291 | static int vidioc_s_ctrl(struct file *file, void *priv, |
282 | struct v4l2_control *ctrl) | 292 | struct v4l2_control *ctrl) |
283 | { | 293 | { |
284 | struct video_device *dev = video_devdata(file); | 294 | struct radio_device *card = video_drvdata(file); |
285 | struct radio_device *card = video_get_drvdata(dev); | ||
286 | register u16 io = card->io; | 295 | register u16 io = card->io; |
287 | register u16 omask = inw(io + IO_MASK); | 296 | register u16 omask = inw(io + IO_MASK); |
288 | 297 | ||
@@ -374,6 +383,7 @@ static struct video_device maestro_radio = { | |||
374 | .name = "Maestro radio", | 383 | .name = "Maestro radio", |
375 | .fops = &maestro_fops, | 384 | .fops = &maestro_fops, |
376 | .ioctl_ops = &maestro_ioctl_ops, | 385 | .ioctl_ops = &maestro_ioctl_ops, |
386 | .release = video_device_release, | ||
377 | }; | 387 | }; |
378 | 388 | ||
379 | static int __devinit maestro_probe(struct pci_dev *pdev, | 389 | static int __devinit maestro_probe(struct pci_dev *pdev, |