diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-02 10:50:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-02 10:50:49 -0400 |
commit | 49115b7cb1483a14c557666b61fe81d3c23780d6 (patch) | |
tree | 6854df6faed933afb1fabd85578e479d644f4e7f /drivers | |
parent | d200ccce6d01fde887aca08156cc875a9aa8b62b (diff) | |
parent | 044dfc99fe3e1e0fa85bbdd1936ee229e399250c (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
* git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb:
V4L/DVB (7486): radio-cadet: wrap PNP probe code in #ifdef CONFIG_PNP
V4L/DVB (7485): v4l2-int-device.c: add MODULE_LICENSE
V4L/DVB (7466): Avoid minor model number warning when an OEM HVR1250 board is detected
V4L/DVB (7465): Fix eeprom parsing and errors on the HVR1800 products
V4L/DVB (7464): Convert driver to use a single SRAM memory map
V4L/DVB (7461): bttv: fix missed index check
V4L/DVB (7400): bttv: Add a radio compat_ioctl file operation
V4L/DVB (7278): bttv: Re-enable radio tuner support for VIDIOCGFREQ/VIDIOCSFREQ ioctls
V4L/DVB (7277): bttv: Re-enabling radio support requires the use of struct bttv_fh
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/radio/radio-cadet.c | 6 | ||||
-rw-r--r-- | drivers/media/video/bt8xx/bttv-driver.c | 31 | ||||
-rw-r--r-- | drivers/media/video/cx23885/cx23885-cards.c | 6 | ||||
-rw-r--r-- | drivers/media/video/cx23885/cx23885-core.c | 134 | ||||
-rw-r--r-- | drivers/media/video/v4l2-int-device.c | 2 |
5 files changed, 38 insertions, 141 deletions
diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c index 34e317ced5a3..57b9e3adc8f0 100644 --- a/drivers/media/radio/radio-cadet.c +++ b/drivers/media/radio/radio-cadet.c | |||
@@ -587,6 +587,8 @@ static struct video_device cadet_radio= | |||
587 | .vidioc_s_input = vidioc_s_input, | 587 | .vidioc_s_input = vidioc_s_input, |
588 | }; | 588 | }; |
589 | 589 | ||
590 | #ifdef CONFIG_PNP | ||
591 | |||
590 | static struct pnp_device_id cadet_pnp_devices[] = { | 592 | static struct pnp_device_id cadet_pnp_devices[] = { |
591 | /* ADS Cadet AM/FM Radio Card */ | 593 | /* ADS Cadet AM/FM Radio Card */ |
592 | {.id = "MSM0c24", .driver_data = 0}, | 594 | {.id = "MSM0c24", .driver_data = 0}, |
@@ -621,6 +623,10 @@ static struct pnp_driver cadet_pnp_driver = { | |||
621 | .remove = NULL, | 623 | .remove = NULL, |
622 | }; | 624 | }; |
623 | 625 | ||
626 | #else | ||
627 | static struct pnp_driver cadet_pnp_driver; | ||
628 | #endif | ||
629 | |||
624 | static int cadet_probe(void) | 630 | static int cadet_probe(void) |
625 | { | 631 | { |
626 | static int iovals[8]={0x330,0x332,0x334,0x336,0x338,0x33a,0x33c,0x33e}; | 632 | static int iovals[8]={0x330,0x332,0x334,0x336,0x338,0x33a,0x33c,0x33e}; |
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index a080c149cc6c..fcf8f2d208a8 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c | |||
@@ -1990,7 +1990,7 @@ static int bttv_g_frequency(struct file *file, void *priv, | |||
1990 | if (0 != err) | 1990 | if (0 != err) |
1991 | return err; | 1991 | return err; |
1992 | 1992 | ||
1993 | f->type = V4L2_TUNER_ANALOG_TV; | 1993 | f->type = btv->radio_user ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; |
1994 | f->frequency = btv->freq; | 1994 | f->frequency = btv->freq; |
1995 | 1995 | ||
1996 | return 0; | 1996 | return 0; |
@@ -2009,7 +2009,8 @@ static int bttv_s_frequency(struct file *file, void *priv, | |||
2009 | 2009 | ||
2010 | if (unlikely(f->tuner != 0)) | 2010 | if (unlikely(f->tuner != 0)) |
2011 | return -EINVAL; | 2011 | return -EINVAL; |
2012 | if (unlikely(f->type != V4L2_TUNER_ANALOG_TV)) | 2012 | if (unlikely(f->type != (btv->radio_user |
2013 | ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV))) | ||
2013 | return -EINVAL; | 2014 | return -EINVAL; |
2014 | mutex_lock(&btv->lock); | 2015 | mutex_lock(&btv->lock); |
2015 | btv->freq = f->frequency; | 2016 | btv->freq = f->frequency; |
@@ -3415,6 +3416,7 @@ static int radio_open(struct inode *inode, struct file *file) | |||
3415 | { | 3416 | { |
3416 | int minor = iminor(inode); | 3417 | int minor = iminor(inode); |
3417 | struct bttv *btv = NULL; | 3418 | struct bttv *btv = NULL; |
3419 | struct bttv_fh *fh; | ||
3418 | unsigned int i; | 3420 | unsigned int i; |
3419 | 3421 | ||
3420 | dprintk("bttv: open minor=%d\n",minor); | 3422 | dprintk("bttv: open minor=%d\n",minor); |
@@ -3429,12 +3431,19 @@ static int radio_open(struct inode *inode, struct file *file) | |||
3429 | return -ENODEV; | 3431 | return -ENODEV; |
3430 | 3432 | ||
3431 | dprintk("bttv%d: open called (radio)\n",btv->c.nr); | 3433 | dprintk("bttv%d: open called (radio)\n",btv->c.nr); |
3434 | |||
3435 | /* allocate per filehandle data */ | ||
3436 | fh = kmalloc(sizeof(*fh), GFP_KERNEL); | ||
3437 | if (NULL == fh) | ||
3438 | return -ENOMEM; | ||
3439 | file->private_data = fh; | ||
3440 | *fh = btv->init; | ||
3441 | v4l2_prio_open(&btv->prio, &fh->prio); | ||
3442 | |||
3432 | mutex_lock(&btv->lock); | 3443 | mutex_lock(&btv->lock); |
3433 | 3444 | ||
3434 | btv->radio_user++; | 3445 | btv->radio_user++; |
3435 | 3446 | ||
3436 | file->private_data = btv; | ||
3437 | |||
3438 | bttv_call_i2c_clients(btv,AUDC_SET_RADIO,NULL); | 3447 | bttv_call_i2c_clients(btv,AUDC_SET_RADIO,NULL); |
3439 | audio_input(btv,TVAUDIO_INPUT_RADIO); | 3448 | audio_input(btv,TVAUDIO_INPUT_RADIO); |
3440 | 3449 | ||
@@ -3444,7 +3453,8 @@ static int radio_open(struct inode *inode, struct file *file) | |||
3444 | 3453 | ||
3445 | static int radio_release(struct inode *inode, struct file *file) | 3454 | static int radio_release(struct inode *inode, struct file *file) |
3446 | { | 3455 | { |
3447 | struct bttv *btv = file->private_data; | 3456 | struct bttv_fh *fh = file->private_data; |
3457 | struct bttv *btv = fh->btv; | ||
3448 | struct rds_command cmd; | 3458 | struct rds_command cmd; |
3449 | 3459 | ||
3450 | btv->radio_user--; | 3460 | btv->radio_user--; |
@@ -3508,8 +3518,12 @@ static int radio_enum_input(struct file *file, void *priv, | |||
3508 | static int radio_g_audio(struct file *file, void *priv, | 3518 | static int radio_g_audio(struct file *file, void *priv, |
3509 | struct v4l2_audio *a) | 3519 | struct v4l2_audio *a) |
3510 | { | 3520 | { |
3521 | if (a->index != 0) | ||
3522 | return -EINVAL; | ||
3523 | |||
3511 | memset(a, 0, sizeof(*a)); | 3524 | memset(a, 0, sizeof(*a)); |
3512 | strcpy(a->name, "Radio"); | 3525 | strcpy(a->name, "Radio"); |
3526 | |||
3513 | return 0; | 3527 | return 0; |
3514 | } | 3528 | } |
3515 | 3529 | ||
@@ -3569,7 +3583,8 @@ static int radio_g_input(struct file *filp, void *priv, unsigned int *i) | |||
3569 | static ssize_t radio_read(struct file *file, char __user *data, | 3583 | static ssize_t radio_read(struct file *file, char __user *data, |
3570 | size_t count, loff_t *ppos) | 3584 | size_t count, loff_t *ppos) |
3571 | { | 3585 | { |
3572 | struct bttv *btv = file->private_data; | 3586 | struct bttv_fh *fh = file->private_data; |
3587 | struct bttv *btv = fh->btv; | ||
3573 | struct rds_command cmd; | 3588 | struct rds_command cmd; |
3574 | cmd.block_count = count/3; | 3589 | cmd.block_count = count/3; |
3575 | cmd.buffer = data; | 3590 | cmd.buffer = data; |
@@ -3583,7 +3598,8 @@ static ssize_t radio_read(struct file *file, char __user *data, | |||
3583 | 3598 | ||
3584 | static unsigned int radio_poll(struct file *file, poll_table *wait) | 3599 | static unsigned int radio_poll(struct file *file, poll_table *wait) |
3585 | { | 3600 | { |
3586 | struct bttv *btv = file->private_data; | 3601 | struct bttv_fh *fh = file->private_data; |
3602 | struct bttv *btv = fh->btv; | ||
3587 | struct rds_command cmd; | 3603 | struct rds_command cmd; |
3588 | cmd.instance = file; | 3604 | cmd.instance = file; |
3589 | cmd.event_list = wait; | 3605 | cmd.event_list = wait; |
@@ -3599,6 +3615,7 @@ static const struct file_operations radio_fops = | |||
3599 | .open = radio_open, | 3615 | .open = radio_open, |
3600 | .read = radio_read, | 3616 | .read = radio_read, |
3601 | .release = radio_release, | 3617 | .release = radio_release, |
3618 | .compat_ioctl = v4l_compat_ioctl32, | ||
3602 | .ioctl = video_ioctl2, | 3619 | .ioctl = video_ioctl2, |
3603 | .llseek = no_llseek, | 3620 | .llseek = no_llseek, |
3604 | .poll = radio_poll, | 3621 | .poll = radio_poll, |
diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c index 2d414dad5c31..dfa269838e01 100644 --- a/drivers/media/video/cx23885/cx23885-cards.c +++ b/drivers/media/video/cx23885/cx23885-cards.c | |||
@@ -232,6 +232,7 @@ static void hauppauge_eeprom(struct cx23885_dev *dev, u8 *eeprom_data) | |||
232 | case 78631: /* WinTV-HVR1800 (PCIe, OEM, No IR, No FM, Dual channel ATSC and MPEG2 HW Encoder */ | 232 | case 78631: /* WinTV-HVR1800 (PCIe, OEM, No IR, No FM, Dual channel ATSC and MPEG2 HW Encoder */ |
233 | case 79001: /* WinTV-HVR1250 (PCIe, Retail, IR, full height, ATSC and Basic analog */ | 233 | case 79001: /* WinTV-HVR1250 (PCIe, Retail, IR, full height, ATSC and Basic analog */ |
234 | case 79101: /* WinTV-HVR1250 (PCIe, Retail, IR, half height, ATSC and Basic analog */ | 234 | case 79101: /* WinTV-HVR1250 (PCIe, Retail, IR, half height, ATSC and Basic analog */ |
235 | case 79561: /* WinTV-HVR1250 (PCIe, OEM, No IR, half height, ATSC and Basic analog */ | ||
235 | case 79571: /* WinTV-HVR1250 (PCIe, OEM, No IR, full height, ATSC and Basic analog */ | 236 | case 79571: /* WinTV-HVR1250 (PCIe, OEM, No IR, full height, ATSC and Basic analog */ |
236 | case 79671: /* WinTV-HVR1250 (PCIe, OEM, No IR, half height, ATSC and Basic analog */ | 237 | case 79671: /* WinTV-HVR1250 (PCIe, OEM, No IR, half height, ATSC and Basic analog */ |
237 | break; | 238 | break; |
@@ -347,10 +348,13 @@ void cx23885_card_setup(struct cx23885_dev *dev) | |||
347 | case CX23885_BOARD_HAUPPAUGE_HVR1250: | 348 | case CX23885_BOARD_HAUPPAUGE_HVR1250: |
348 | case CX23885_BOARD_HAUPPAUGE_HVR1500: | 349 | case CX23885_BOARD_HAUPPAUGE_HVR1500: |
349 | case CX23885_BOARD_HAUPPAUGE_HVR1500Q: | 350 | case CX23885_BOARD_HAUPPAUGE_HVR1500Q: |
351 | if (dev->i2c_bus[0].i2c_rc == 0) | ||
352 | hauppauge_eeprom(dev, eeprom+0x80); | ||
353 | break; | ||
350 | case CX23885_BOARD_HAUPPAUGE_HVR1800: | 354 | case CX23885_BOARD_HAUPPAUGE_HVR1800: |
351 | case CX23885_BOARD_HAUPPAUGE_HVR1800lp: | 355 | case CX23885_BOARD_HAUPPAUGE_HVR1800lp: |
352 | if (dev->i2c_bus[0].i2c_rc == 0) | 356 | if (dev->i2c_bus[0].i2c_rc == 0) |
353 | hauppauge_eeprom(dev, eeprom+0x80); | 357 | hauppauge_eeprom(dev, eeprom+0xc0); |
354 | break; | 358 | break; |
355 | } | 359 | } |
356 | 360 | ||
diff --git a/drivers/media/video/cx23885/cx23885-core.c b/drivers/media/video/cx23885/cx23885-core.c index 8e40c7bcc06d..7f10b273598f 100644 --- a/drivers/media/video/cx23885/cx23885-core.c +++ b/drivers/media/video/cx23885/cx23885-core.c | |||
@@ -56,137 +56,6 @@ LIST_HEAD(cx23885_devlist); | |||
56 | 56 | ||
57 | #define NO_SYNC_LINE (-1U) | 57 | #define NO_SYNC_LINE (-1U) |
58 | 58 | ||
59 | /* | ||
60 | * CX23885 Assumptions | ||
61 | * 1 line = 16 bytes of CDT | ||
62 | * cmds size = 80 | ||
63 | * cdt size = 16 * linesize | ||
64 | * iqsize = 64 | ||
65 | * maxlines = 6 | ||
66 | * | ||
67 | * Address Space: | ||
68 | * 0x00000000 0x00008fff FIFO clusters | ||
69 | * 0x00010000 0x000104af Channel Management Data Structures | ||
70 | * 0x000104b0 0x000104ff Free | ||
71 | * 0x00010500 0x000108bf 15 channels * iqsize | ||
72 | * 0x000108c0 0x000108ff Free | ||
73 | * 0x00010900 0x00010e9f IQ's + Cluster Descriptor Tables | ||
74 | * 15 channels * (iqsize + (maxlines * linesize)) | ||
75 | * 0x00010ea0 0x00010xxx Free | ||
76 | */ | ||
77 | |||
78 | static struct sram_channel cx23885_sram_channels[] = { | ||
79 | [SRAM_CH01] = { | ||
80 | .name = "VID A", | ||
81 | .cmds_start = 0x10000, | ||
82 | .ctrl_start = 0x105b0, | ||
83 | .cdt = 0x107b0, | ||
84 | .fifo_start = 0x40, | ||
85 | .fifo_size = 0x2800, | ||
86 | .ptr1_reg = DMA1_PTR1, | ||
87 | .ptr2_reg = DMA1_PTR2, | ||
88 | .cnt1_reg = DMA1_CNT1, | ||
89 | .cnt2_reg = DMA1_CNT2, | ||
90 | .jumponly = 1, | ||
91 | }, | ||
92 | [SRAM_CH02] = { | ||
93 | .name = "ch2", | ||
94 | .cmds_start = 0x0, | ||
95 | .ctrl_start = 0x0, | ||
96 | .cdt = 0x0, | ||
97 | .fifo_start = 0x0, | ||
98 | .fifo_size = 0x0, | ||
99 | .ptr1_reg = DMA2_PTR1, | ||
100 | .ptr2_reg = DMA2_PTR2, | ||
101 | .cnt1_reg = DMA2_CNT1, | ||
102 | .cnt2_reg = DMA2_CNT2, | ||
103 | }, | ||
104 | [SRAM_CH03] = { | ||
105 | .name = "TS1 B", | ||
106 | .cmds_start = 0x100A0, | ||
107 | .ctrl_start = 0x10630, | ||
108 | .cdt = 0x10870, | ||
109 | .fifo_start = 0x5000, | ||
110 | .fifo_size = 0x1000, | ||
111 | .ptr1_reg = DMA3_PTR1, | ||
112 | .ptr2_reg = DMA3_PTR2, | ||
113 | .cnt1_reg = DMA3_CNT1, | ||
114 | .cnt2_reg = DMA3_CNT2, | ||
115 | }, | ||
116 | [SRAM_CH04] = { | ||
117 | .name = "ch4", | ||
118 | .cmds_start = 0x0, | ||
119 | .ctrl_start = 0x0, | ||
120 | .cdt = 0x0, | ||
121 | .fifo_start = 0x0, | ||
122 | .fifo_size = 0x0, | ||
123 | .ptr1_reg = DMA4_PTR1, | ||
124 | .ptr2_reg = DMA4_PTR2, | ||
125 | .cnt1_reg = DMA4_CNT1, | ||
126 | .cnt2_reg = DMA4_CNT2, | ||
127 | }, | ||
128 | [SRAM_CH05] = { | ||
129 | .name = "ch5", | ||
130 | .cmds_start = 0x0, | ||
131 | .ctrl_start = 0x0, | ||
132 | .cdt = 0x0, | ||
133 | .fifo_start = 0x0, | ||
134 | .fifo_size = 0x0, | ||
135 | .ptr1_reg = DMA5_PTR1, | ||
136 | .ptr2_reg = DMA5_PTR2, | ||
137 | .cnt1_reg = DMA5_CNT1, | ||
138 | .cnt2_reg = DMA5_CNT2, | ||
139 | }, | ||
140 | [SRAM_CH06] = { | ||
141 | .name = "TS2 C", | ||
142 | .cmds_start = 0x10140, | ||
143 | .ctrl_start = 0x10680, | ||
144 | .cdt = 0x108d0, | ||
145 | .fifo_start = 0x6000, | ||
146 | .fifo_size = 0x1000, | ||
147 | .ptr1_reg = DMA5_PTR1, | ||
148 | .ptr2_reg = DMA5_PTR2, | ||
149 | .cnt1_reg = DMA5_CNT1, | ||
150 | .cnt2_reg = DMA5_CNT2, | ||
151 | }, | ||
152 | [SRAM_CH07] = { | ||
153 | .name = "ch7", | ||
154 | .cmds_start = 0x0, | ||
155 | .ctrl_start = 0x0, | ||
156 | .cdt = 0x0, | ||
157 | .fifo_start = 0x0, | ||
158 | .fifo_size = 0x0, | ||
159 | .ptr1_reg = DMA6_PTR1, | ||
160 | .ptr2_reg = DMA6_PTR2, | ||
161 | .cnt1_reg = DMA6_CNT1, | ||
162 | .cnt2_reg = DMA6_CNT2, | ||
163 | }, | ||
164 | [SRAM_CH08] = { | ||
165 | .name = "ch8", | ||
166 | .cmds_start = 0x0, | ||
167 | .ctrl_start = 0x0, | ||
168 | .cdt = 0x0, | ||
169 | .fifo_start = 0x0, | ||
170 | .fifo_size = 0x0, | ||
171 | .ptr1_reg = DMA7_PTR1, | ||
172 | .ptr2_reg = DMA7_PTR2, | ||
173 | .cnt1_reg = DMA7_CNT1, | ||
174 | .cnt2_reg = DMA7_CNT2, | ||
175 | }, | ||
176 | [SRAM_CH09] = { | ||
177 | .name = "ch9", | ||
178 | .cmds_start = 0x0, | ||
179 | .ctrl_start = 0x0, | ||
180 | .cdt = 0x0, | ||
181 | .fifo_start = 0x0, | ||
182 | .fifo_size = 0x0, | ||
183 | .ptr1_reg = DMA8_PTR1, | ||
184 | .ptr2_reg = DMA8_PTR2, | ||
185 | .cnt1_reg = DMA8_CNT1, | ||
186 | .cnt2_reg = DMA8_CNT2, | ||
187 | }, | ||
188 | }; | ||
189 | |||
190 | /* FIXME, these allocations will change when | 59 | /* FIXME, these allocations will change when |
191 | * analog arrives. The be reviewed. | 60 | * analog arrives. The be reviewed. |
192 | * CX23887 Assumptions | 61 | * CX23887 Assumptions |
@@ -754,6 +623,7 @@ static int cx23885_dev_setup(struct cx23885_dev *dev) | |||
754 | atomic_inc(&dev->refcount); | 623 | atomic_inc(&dev->refcount); |
755 | 624 | ||
756 | dev->nr = cx23885_devcount++; | 625 | dev->nr = cx23885_devcount++; |
626 | dev->sram_channels = cx23887_sram_channels; | ||
757 | sprintf(dev->name, "cx23885[%d]", dev->nr); | 627 | sprintf(dev->name, "cx23885[%d]", dev->nr); |
758 | 628 | ||
759 | mutex_lock(&devlist); | 629 | mutex_lock(&devlist); |
@@ -763,13 +633,11 @@ static int cx23885_dev_setup(struct cx23885_dev *dev) | |||
763 | /* Configure the internal memory */ | 633 | /* Configure the internal memory */ |
764 | if(dev->pci->device == 0x8880) { | 634 | if(dev->pci->device == 0x8880) { |
765 | dev->bridge = CX23885_BRIDGE_887; | 635 | dev->bridge = CX23885_BRIDGE_887; |
766 | dev->sram_channels = cx23887_sram_channels; | ||
767 | /* Apply a sensible clock frequency for the PCIe bridge */ | 636 | /* Apply a sensible clock frequency for the PCIe bridge */ |
768 | dev->clk_freq = 25000000; | 637 | dev->clk_freq = 25000000; |
769 | } else | 638 | } else |
770 | if(dev->pci->device == 0x8852) { | 639 | if(dev->pci->device == 0x8852) { |
771 | dev->bridge = CX23885_BRIDGE_885; | 640 | dev->bridge = CX23885_BRIDGE_885; |
772 | dev->sram_channels = cx23885_sram_channels; | ||
773 | /* Apply a sensible clock frequency for the PCIe bridge */ | 641 | /* Apply a sensible clock frequency for the PCIe bridge */ |
774 | dev->clk_freq = 28000000; | 642 | dev->clk_freq = 28000000; |
775 | } else | 643 | } else |
diff --git a/drivers/media/video/v4l2-int-device.c b/drivers/media/video/v4l2-int-device.c index a545dcaf857f..0e4549922f26 100644 --- a/drivers/media/video/v4l2-int-device.c +++ b/drivers/media/video/v4l2-int-device.c | |||
@@ -156,3 +156,5 @@ int v4l2_int_ioctl_1(struct v4l2_int_device *d, int cmd, void *arg) | |||
156 | find_ioctl(d->u.slave, cmd, | 156 | find_ioctl(d->u.slave, cmd, |
157 | (v4l2_int_ioctl_func *)no_such_ioctl_1))(d, arg); | 157 | (v4l2_int_ioctl_func *)no_such_ioctl_1))(d, arg); |
158 | } | 158 | } |
159 | |||
160 | MODULE_LICENSE("GPL"); | ||