diff options
Diffstat (limited to 'drivers/media/video')
54 files changed, 523 insertions, 363 deletions
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig index fe743aa7f645..89d8d37838a3 100644 --- a/drivers/media/video/Kconfig +++ b/drivers/media/video/Kconfig | |||
@@ -44,6 +44,10 @@ config VIDEO_TVEEPROM | |||
44 | tristate | 44 | tristate |
45 | depends on I2C | 45 | depends on I2C |
46 | 46 | ||
47 | config VIDEO_TUNER | ||
48 | tristate | ||
49 | depends on MEDIA_TUNER | ||
50 | |||
47 | # | 51 | # |
48 | # Multimedia Video device configuration | 52 | # Multimedia Video device configuration |
49 | # | 53 | # |
@@ -690,7 +694,7 @@ config VIDEO_MXB | |||
690 | tristate "Siemens-Nixdorf 'Multimedia eXtension Board'" | 694 | tristate "Siemens-Nixdorf 'Multimedia eXtension Board'" |
691 | depends on PCI && VIDEO_V4L1 && I2C | 695 | depends on PCI && VIDEO_V4L1 && I2C |
692 | select VIDEO_SAA7146_VV | 696 | select VIDEO_SAA7146_VV |
693 | select MEDIA_TUNER | 697 | select VIDEO_TUNER |
694 | select VIDEO_SAA7111 if VIDEO_HELPER_CHIPS_AUTO | 698 | select VIDEO_SAA7111 if VIDEO_HELPER_CHIPS_AUTO |
695 | select VIDEO_TDA9840 if VIDEO_HELPER_CHIPS_AUTO | 699 | select VIDEO_TDA9840 if VIDEO_HELPER_CHIPS_AUTO |
696 | select VIDEO_TEA6415C if VIDEO_HELPER_CHIPS_AUTO | 700 | select VIDEO_TEA6415C if VIDEO_HELPER_CHIPS_AUTO |
@@ -906,7 +910,7 @@ config SOC_CAMERA | |||
906 | 910 | ||
907 | config SOC_CAMERA_MT9M001 | 911 | config SOC_CAMERA_MT9M001 |
908 | tristate "mt9m001 support" | 912 | tristate "mt9m001 support" |
909 | depends on SOC_CAMERA | 913 | depends on SOC_CAMERA && I2C |
910 | select GPIO_PCA953X if MT9M001_PCA9536_SWITCH | 914 | select GPIO_PCA953X if MT9M001_PCA9536_SWITCH |
911 | help | 915 | help |
912 | This driver supports MT9M001 cameras from Micron, monochrome | 916 | This driver supports MT9M001 cameras from Micron, monochrome |
@@ -921,7 +925,7 @@ config MT9M001_PCA9536_SWITCH | |||
921 | 925 | ||
922 | config SOC_CAMERA_MT9V022 | 926 | config SOC_CAMERA_MT9V022 |
923 | tristate "mt9v022 support" | 927 | tristate "mt9v022 support" |
924 | depends on SOC_CAMERA | 928 | depends on SOC_CAMERA && I2C |
925 | select GPIO_PCA953X if MT9V022_PCA9536_SWITCH | 929 | select GPIO_PCA953X if MT9V022_PCA9536_SWITCH |
926 | help | 930 | help |
927 | This driver supports MT9V022 cameras from Micron | 931 | This driver supports MT9V022 cameras from Micron |
diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile index a352c6e31f0c..dff0d6abe917 100644 --- a/drivers/media/video/Makefile +++ b/drivers/media/video/Makefile | |||
@@ -84,7 +84,7 @@ obj-$(CONFIG_VIDEO_HEXIUM_GEMINI) += hexium_gemini.o | |||
84 | obj-$(CONFIG_VIDEO_DPC) += dpc7146.o | 84 | obj-$(CONFIG_VIDEO_DPC) += dpc7146.o |
85 | obj-$(CONFIG_TUNER_3036) += tuner-3036.o | 85 | obj-$(CONFIG_TUNER_3036) += tuner-3036.o |
86 | 86 | ||
87 | obj-$(CONFIG_MEDIA_TUNER) += tuner.o | 87 | obj-$(CONFIG_VIDEO_TUNER) += tuner.o |
88 | 88 | ||
89 | obj-$(CONFIG_VIDEOBUF_GEN) += videobuf-core.o | 89 | obj-$(CONFIG_VIDEOBUF_GEN) += videobuf-core.o |
90 | obj-$(CONFIG_VIDEOBUF_DMA_SG) += videobuf-dma-sg.o | 90 | obj-$(CONFIG_VIDEOBUF_DMA_SG) += videobuf-dma-sg.o |
diff --git a/drivers/media/video/au0828/Kconfig b/drivers/media/video/au0828/Kconfig index cab277fafa63..def10d086373 100644 --- a/drivers/media/video/au0828/Kconfig +++ b/drivers/media/video/au0828/Kconfig | |||
@@ -1,8 +1,9 @@ | |||
1 | 1 | ||
2 | config VIDEO_AU0828 | 2 | config VIDEO_AU0828 |
3 | tristate "Auvitek AU0828 support" | 3 | tristate "Auvitek AU0828 support" |
4 | depends on VIDEO_DEV && I2C && INPUT && DVB_CORE | 4 | depends on VIDEO_DEV && I2C && INPUT && DVB_CORE && USB |
5 | select I2C_ALGOBIT | 5 | select I2C_ALGOBIT |
6 | select VIDEO_TVEEPROM | ||
6 | select DVB_AU8522 if !DVB_FE_CUSTOMIZE | 7 | select DVB_AU8522 if !DVB_FE_CUSTOMIZE |
7 | select MEDIA_TUNER_XC5000 if !DVB_FE_CUSTOMIZE | 8 | select MEDIA_TUNER_XC5000 if !DVB_FE_CUSTOMIZE |
8 | ---help--- | 9 | ---help--- |
diff --git a/drivers/media/video/au0828/au0828-dvb.c b/drivers/media/video/au0828/au0828-dvb.c index 1371b4e4b5f1..c86a5f17eca8 100644 --- a/drivers/media/video/au0828/au0828-dvb.c +++ b/drivers/media/video/au0828/au0828-dvb.c | |||
@@ -337,12 +337,10 @@ int au0828_dvb_register(struct au0828_dev *dev) | |||
337 | dvb->frontend = dvb_attach(au8522_attach, | 337 | dvb->frontend = dvb_attach(au8522_attach, |
338 | &hauppauge_hvr950q_config, | 338 | &hauppauge_hvr950q_config, |
339 | &dev->i2c_adap); | 339 | &dev->i2c_adap); |
340 | if (dvb->frontend != NULL) { | 340 | if (dvb->frontend != NULL) |
341 | hauppauge_hvr950q_tunerconfig.priv = dev; | ||
342 | dvb_attach(xc5000_attach, dvb->frontend, | 341 | dvb_attach(xc5000_attach, dvb->frontend, |
343 | &dev->i2c_adap, | 342 | &dev->i2c_adap, |
344 | &hauppauge_hvr950q_tunerconfig); | 343 | &hauppauge_hvr950q_tunerconfig, dev); |
345 | } | ||
346 | break; | 344 | break; |
347 | default: | 345 | default: |
348 | printk(KERN_WARNING "The frontend of your DVB/ATSC card " | 346 | printk(KERN_WARNING "The frontend of your DVB/ATSC card " |
diff --git a/drivers/media/video/bt8xx/Kconfig b/drivers/media/video/bt8xx/Kconfig index 7431ef6de9f1..24a34fc1f2b3 100644 --- a/drivers/media/video/bt8xx/Kconfig +++ b/drivers/media/video/bt8xx/Kconfig | |||
@@ -1,12 +1,13 @@ | |||
1 | config VIDEO_BT848 | 1 | config VIDEO_BT848 |
2 | tristate "BT848 Video For Linux" | 2 | tristate "BT848 Video For Linux" |
3 | depends on VIDEO_DEV && PCI && I2C && VIDEO_V4L2 && INPUT | 3 | depends on VIDEO_DEV && PCI && I2C && VIDEO_V4L2 && INPUT |
4 | depends on HOTPLUG # due to FW_LOADER | ||
4 | select I2C_ALGOBIT | 5 | select I2C_ALGOBIT |
5 | select FW_LOADER | 6 | select FW_LOADER |
6 | select VIDEO_BTCX | 7 | select VIDEO_BTCX |
7 | select VIDEOBUF_DMA_SG | 8 | select VIDEOBUF_DMA_SG |
8 | select VIDEO_IR | 9 | select VIDEO_IR |
9 | select MEDIA_TUNER | 10 | select VIDEO_TUNER |
10 | select VIDEO_TVEEPROM | 11 | select VIDEO_TVEEPROM |
11 | select VIDEO_MSP3400 if VIDEO_HELPER_CHIPS_AUTO | 12 | select VIDEO_MSP3400 if VIDEO_HELPER_CHIPS_AUTO |
12 | select VIDEO_TVAUDIO if VIDEO_HELPER_CHIPS_AUTO | 13 | select VIDEO_TVAUDIO if VIDEO_HELPER_CHIPS_AUTO |
diff --git a/drivers/media/video/cx18/Kconfig b/drivers/media/video/cx18/Kconfig index acc4b47f1d1d..5f942690570c 100644 --- a/drivers/media/video/cx18/Kconfig +++ b/drivers/media/video/cx18/Kconfig | |||
@@ -1,14 +1,17 @@ | |||
1 | config VIDEO_CX18 | 1 | config VIDEO_CX18 |
2 | tristate "Conexant cx23418 MPEG encoder support" | 2 | tristate "Conexant cx23418 MPEG encoder support" |
3 | depends on VIDEO_V4L2 && DVB_CORE && PCI && I2C && EXPERIMENTAL | 3 | depends on VIDEO_V4L2 && DVB_CORE && PCI && I2C && EXPERIMENTAL |
4 | depends on INPUT # due to VIDEO_IR | ||
5 | depends on HOTPLUG # due to FW_LOADER | ||
4 | select I2C_ALGOBIT | 6 | select I2C_ALGOBIT |
5 | select FW_LOADER | 7 | select FW_LOADER |
6 | select VIDEO_IR | 8 | select VIDEO_IR |
7 | select MEDIA_TUNER | 9 | select VIDEO_TUNER |
8 | select VIDEO_TVEEPROM | 10 | select VIDEO_TVEEPROM |
9 | select VIDEO_CX2341X | 11 | select VIDEO_CX2341X |
10 | select VIDEO_CS5345 | 12 | select VIDEO_CS5345 |
11 | select DVB_S5H1409 | 13 | select DVB_S5H1409 |
14 | select MEDIA_TUNER_MXL5005S | ||
12 | ---help--- | 15 | ---help--- |
13 | This is a video4linux driver for Conexant cx23418 based | 16 | This is a video4linux driver for Conexant cx23418 based |
14 | PCI combo video recorder devices. | 17 | PCI combo video recorder devices. |
diff --git a/drivers/media/video/cx18/cx18-cards.c b/drivers/media/video/cx18/cx18-cards.c index f5e3ba1f5354..553adbf2cd44 100644 --- a/drivers/media/video/cx18/cx18-cards.c +++ b/drivers/media/video/cx18/cx18-cards.c | |||
@@ -47,11 +47,12 @@ static struct cx18_card_tuner_i2c cx18_i2c_std = { | |||
47 | static const struct cx18_card cx18_card_hvr1600_esmt = { | 47 | static const struct cx18_card cx18_card_hvr1600_esmt = { |
48 | .type = CX18_CARD_HVR_1600_ESMT, | 48 | .type = CX18_CARD_HVR_1600_ESMT, |
49 | .name = "Hauppauge HVR-1600", | 49 | .name = "Hauppauge HVR-1600", |
50 | .comment = "DVB & VBI are not yet supported\n", | 50 | .comment = "VBI is not yet supported\n", |
51 | .v4l2_capabilities = CX18_CAP_ENCODER, | 51 | .v4l2_capabilities = CX18_CAP_ENCODER, |
52 | .hw_audio_ctrl = CX18_HW_CX23418, | 52 | .hw_audio_ctrl = CX18_HW_CX23418, |
53 | .hw_muxer = CX18_HW_CS5345, | 53 | .hw_muxer = CX18_HW_CS5345, |
54 | .hw_all = CX18_HW_TVEEPROM | CX18_HW_TUNER | CX18_HW_CS5345, | 54 | .hw_all = CX18_HW_TVEEPROM | CX18_HW_TUNER | |
55 | CX18_HW_CS5345 | CX18_HW_DVB, | ||
55 | .video_inputs = { | 56 | .video_inputs = { |
56 | { CX18_CARD_INPUT_VID_TUNER, 0, CX23418_COMPOSITE7 }, | 57 | { CX18_CARD_INPUT_VID_TUNER, 0, CX23418_COMPOSITE7 }, |
57 | { CX18_CARD_INPUT_SVIDEO1, 1, CX23418_SVIDEO1 }, | 58 | { CX18_CARD_INPUT_SVIDEO1, 1, CX23418_SVIDEO1 }, |
@@ -86,11 +87,12 @@ static const struct cx18_card cx18_card_hvr1600_esmt = { | |||
86 | static const struct cx18_card cx18_card_hvr1600_samsung = { | 87 | static const struct cx18_card cx18_card_hvr1600_samsung = { |
87 | .type = CX18_CARD_HVR_1600_SAMSUNG, | 88 | .type = CX18_CARD_HVR_1600_SAMSUNG, |
88 | .name = "Hauppauge HVR-1600 (Preproduction)", | 89 | .name = "Hauppauge HVR-1600 (Preproduction)", |
89 | .comment = "DVB & VBI are not yet supported\n", | 90 | .comment = "VBI is not yet supported\n", |
90 | .v4l2_capabilities = CX18_CAP_ENCODER, | 91 | .v4l2_capabilities = CX18_CAP_ENCODER, |
91 | .hw_audio_ctrl = CX18_HW_CX23418, | 92 | .hw_audio_ctrl = CX18_HW_CX23418, |
92 | .hw_muxer = CX18_HW_CS5345, | 93 | .hw_muxer = CX18_HW_CS5345, |
93 | .hw_all = CX18_HW_TVEEPROM | CX18_HW_TUNER | CX18_HW_CS5345, | 94 | .hw_all = CX18_HW_TVEEPROM | CX18_HW_TUNER | |
95 | CX18_HW_CS5345 | CX18_HW_DVB, | ||
94 | .video_inputs = { | 96 | .video_inputs = { |
95 | { CX18_CARD_INPUT_VID_TUNER, 0, CX23418_COMPOSITE7 }, | 97 | { CX18_CARD_INPUT_VID_TUNER, 0, CX23418_COMPOSITE7 }, |
96 | { CX18_CARD_INPUT_SVIDEO1, 1, CX23418_SVIDEO1 }, | 98 | { CX18_CARD_INPUT_SVIDEO1, 1, CX23418_SVIDEO1 }, |
@@ -134,14 +136,15 @@ static const struct cx18_card_pci_info cx18_pci_h900[] = { | |||
134 | static const struct cx18_card cx18_card_h900 = { | 136 | static const struct cx18_card cx18_card_h900 = { |
135 | .type = CX18_CARD_COMPRO_H900, | 137 | .type = CX18_CARD_COMPRO_H900, |
136 | .name = "Compro VideoMate H900", | 138 | .name = "Compro VideoMate H900", |
137 | .comment = "Not yet supported!\n", | 139 | .comment = "DVB & VBI are not yet supported\n", |
138 | .v4l2_capabilities = 0, | 140 | .v4l2_capabilities = CX18_CAP_ENCODER, |
139 | .hw_audio_ctrl = CX18_HW_CX23418, | 141 | .hw_audio_ctrl = CX18_HW_CX23418, |
140 | .hw_all = CX18_HW_TUNER, | 142 | .hw_all = CX18_HW_TUNER, |
141 | .video_inputs = { | 143 | .video_inputs = { |
142 | { CX18_CARD_INPUT_VID_TUNER, 0, CX23418_COMPOSITE7 }, | 144 | { CX18_CARD_INPUT_VID_TUNER, 0, CX23418_COMPOSITE2 }, |
143 | { CX18_CARD_INPUT_SVIDEO1, 1, CX23418_SVIDEO1 }, | 145 | { CX18_CARD_INPUT_SVIDEO1, 1, |
144 | { CX18_CARD_INPUT_COMPOSITE1, 1, CX23418_COMPOSITE3 }, | 146 | CX23418_SVIDEO_LUMA3 | CX23418_SVIDEO_CHROMA4 }, |
147 | { CX18_CARD_INPUT_COMPOSITE1, 1, CX23418_COMPOSITE1 }, | ||
145 | }, | 148 | }, |
146 | .audio_inputs = { | 149 | .audio_inputs = { |
147 | { CX18_CARD_INPUT_AUD_TUNER, | 150 | { CX18_CARD_INPUT_AUD_TUNER, |
@@ -163,6 +166,7 @@ static const struct cx18_card cx18_card_h900 = { | |||
163 | .tune_lane = 0, | 166 | .tune_lane = 0, |
164 | .initial_emrs = 0, | 167 | .initial_emrs = 0, |
165 | }, | 168 | }, |
169 | .xceive_pin = 15, | ||
166 | .pci_list = cx18_pci_h900, | 170 | .pci_list = cx18_pci_h900, |
167 | .i2c = &cx18_i2c_std, | 171 | .i2c = &cx18_i2c_std, |
168 | }; | 172 | }; |
@@ -200,8 +204,6 @@ static const struct cx18_card cx18_card_mpc718 = { | |||
200 | /* XC3028 tuner */ | 204 | /* XC3028 tuner */ |
201 | { .std = V4L2_STD_ALL, .tuner = TUNER_XC2028 }, | 205 | { .std = V4L2_STD_ALL, .tuner = TUNER_XC2028 }, |
202 | }, | 206 | }, |
203 | /* tuner reset */ | ||
204 | .gpio_init = { .direction = 0x1000, .initial_value = 0x1000 }, | ||
205 | .ddr = { | 207 | .ddr = { |
206 | /* Probably Samsung K4D263238G-VC33 memory */ | 208 | /* Probably Samsung K4D263238G-VC33 memory */ |
207 | .chip_config = 0x003, | 209 | .chip_config = 0x003, |
@@ -211,6 +213,7 @@ static const struct cx18_card cx18_card_mpc718 = { | |||
211 | .tune_lane = 0, | 213 | .tune_lane = 0, |
212 | .initial_emrs = 2, | 214 | .initial_emrs = 2, |
213 | }, | 215 | }, |
216 | .xceive_pin = 15, | ||
214 | .pci_list = cx18_pci_mpc718, | 217 | .pci_list = cx18_pci_mpc718, |
215 | .i2c = &cx18_i2c_std, | 218 | .i2c = &cx18_i2c_std, |
216 | }; | 219 | }; |
diff --git a/drivers/media/video/cx18/cx18-cards.h b/drivers/media/video/cx18/cx18-cards.h index bca249bdd337..bccb67f0db16 100644 --- a/drivers/media/video/cx18/cx18-cards.h +++ b/drivers/media/video/cx18/cx18-cards.h | |||
@@ -114,8 +114,8 @@ struct cx18_card_pci_info { | |||
114 | /* The mask is the set of bits used by the operation */ | 114 | /* The mask is the set of bits used by the operation */ |
115 | 115 | ||
116 | struct cx18_gpio_init { /* set initial GPIO DIR and OUT values */ | 116 | struct cx18_gpio_init { /* set initial GPIO DIR and OUT values */ |
117 | u16 direction; /* DIR setting. Leave to 0 if no init is needed */ | 117 | u32 direction; /* DIR setting. Leave to 0 if no init is needed */ |
118 | u16 initial_value; | 118 | u32 initial_value; |
119 | }; | 119 | }; |
120 | 120 | ||
121 | struct cx18_card_tuner { | 121 | struct cx18_card_tuner { |
@@ -153,6 +153,7 @@ struct cx18_card { | |||
153 | struct cx18_card_audio_input radio_input; | 153 | struct cx18_card_audio_input radio_input; |
154 | 154 | ||
155 | /* GPIO card-specific settings */ | 155 | /* GPIO card-specific settings */ |
156 | u8 xceive_pin; /* XCeive tuner GPIO reset pin */ | ||
156 | struct cx18_gpio_init gpio_init; | 157 | struct cx18_gpio_init gpio_init; |
157 | 158 | ||
158 | struct cx18_card_tuner tuners[CX18_CARD_MAX_TUNERS]; | 159 | struct cx18_card_tuner tuners[CX18_CARD_MAX_TUNERS]; |
diff --git a/drivers/media/video/cx18/cx18-driver.c b/drivers/media/video/cx18/cx18-driver.c index 8f5ed9b4bf83..0dd4e0529970 100644 --- a/drivers/media/video/cx18/cx18-driver.c +++ b/drivers/media/video/cx18/cx18-driver.c | |||
@@ -164,16 +164,6 @@ MODULE_LICENSE("GPL"); | |||
164 | 164 | ||
165 | MODULE_VERSION(CX18_VERSION); | 165 | MODULE_VERSION(CX18_VERSION); |
166 | 166 | ||
167 | int cx18_waitq(wait_queue_head_t *waitq) | ||
168 | { | ||
169 | DEFINE_WAIT(wait); | ||
170 | |||
171 | prepare_to_wait(waitq, &wait, TASK_INTERRUPTIBLE); | ||
172 | schedule(); | ||
173 | finish_wait(waitq, &wait); | ||
174 | return signal_pending(current) ? -EINTR : 0; | ||
175 | } | ||
176 | |||
177 | /* Generic utility functions */ | 167 | /* Generic utility functions */ |
178 | int cx18_msleep_timeout(unsigned int msecs, int intr) | 168 | int cx18_msleep_timeout(unsigned int msecs, int intr) |
179 | { | 169 | { |
@@ -220,13 +210,13 @@ static void cx18_process_eeprom(struct cx18 *cx) | |||
220 | 210 | ||
221 | /* Many thanks to Steven Toth from Hauppauge for providing the | 211 | /* Many thanks to Steven Toth from Hauppauge for providing the |
222 | model numbers */ | 212 | model numbers */ |
213 | /* Note: the Samsung memory models cannot be reliably determined | ||
214 | from the model number. Use the cardtype module option if you | ||
215 | have one of these preproduction models. */ | ||
223 | switch (tv.model) { | 216 | switch (tv.model) { |
224 | case 74000 ... 74099: | 217 | case 74000 ... 74999: |
225 | cx->card = cx18_get_card(CX18_CARD_HVR_1600_ESMT); | 218 | cx->card = cx18_get_card(CX18_CARD_HVR_1600_ESMT); |
226 | break; | 219 | break; |
227 | case 74700 ... 74799: | ||
228 | cx->card = cx18_get_card(CX18_CARD_HVR_1600_SAMSUNG); | ||
229 | break; | ||
230 | case 0: | 220 | case 0: |
231 | CX18_ERR("Invalid EEPROM\n"); | 221 | CX18_ERR("Invalid EEPROM\n"); |
232 | return; | 222 | return; |
@@ -548,6 +538,7 @@ static int cx18_setup_pci(struct cx18 *cx, struct pci_dev *dev, | |||
548 | return 0; | 538 | return 0; |
549 | } | 539 | } |
550 | 540 | ||
541 | #ifdef MODULE | ||
551 | static u32 cx18_request_module(struct cx18 *cx, u32 hw, | 542 | static u32 cx18_request_module(struct cx18 *cx, u32 hw, |
552 | const char *name, u32 id) | 543 | const char *name, u32 id) |
553 | { | 544 | { |
@@ -560,12 +551,14 @@ static u32 cx18_request_module(struct cx18 *cx, u32 hw, | |||
560 | CX18_DEBUG_INFO("Loaded module %s\n", name); | 551 | CX18_DEBUG_INFO("Loaded module %s\n", name); |
561 | return hw; | 552 | return hw; |
562 | } | 553 | } |
554 | #endif | ||
563 | 555 | ||
564 | static void cx18_load_and_init_modules(struct cx18 *cx) | 556 | static void cx18_load_and_init_modules(struct cx18 *cx) |
565 | { | 557 | { |
566 | u32 hw = cx->card->hw_all; | 558 | u32 hw = cx->card->hw_all; |
567 | int i; | 559 | int i; |
568 | 560 | ||
561 | #ifdef MODULE | ||
569 | /* load modules */ | 562 | /* load modules */ |
570 | #ifndef CONFIG_MEDIA_TUNER | 563 | #ifndef CONFIG_MEDIA_TUNER |
571 | hw = cx18_request_module(cx, hw, "tuner", CX18_HW_TUNER); | 564 | hw = cx18_request_module(cx, hw, "tuner", CX18_HW_TUNER); |
@@ -573,6 +566,7 @@ static void cx18_load_and_init_modules(struct cx18 *cx) | |||
573 | #ifndef CONFIG_VIDEO_CS5345 | 566 | #ifndef CONFIG_VIDEO_CS5345 |
574 | hw = cx18_request_module(cx, hw, "cs5345", CX18_HW_CS5345); | 567 | hw = cx18_request_module(cx, hw, "cs5345", CX18_HW_CS5345); |
575 | #endif | 568 | #endif |
569 | #endif | ||
576 | 570 | ||
577 | /* check which i2c devices are actually found */ | 571 | /* check which i2c devices are actually found */ |
578 | for (i = 0; i < 32; i++) { | 572 | for (i = 0; i < 32; i++) { |
@@ -613,7 +607,7 @@ static int __devinit cx18_probe(struct pci_dev *dev, | |||
613 | } | 607 | } |
614 | 608 | ||
615 | cx = kzalloc(sizeof(struct cx18), GFP_ATOMIC); | 609 | cx = kzalloc(sizeof(struct cx18), GFP_ATOMIC); |
616 | if (cx == 0) { | 610 | if (!cx) { |
617 | spin_unlock(&cx18_cards_lock); | 611 | spin_unlock(&cx18_cards_lock); |
618 | return -ENOMEM; | 612 | return -ENOMEM; |
619 | } | 613 | } |
@@ -801,7 +795,7 @@ static int __devinit cx18_probe(struct pci_dev *dev, | |||
801 | return 0; | 795 | return 0; |
802 | 796 | ||
803 | free_streams: | 797 | free_streams: |
804 | cx18_streams_cleanup(cx); | 798 | cx18_streams_cleanup(cx, 1); |
805 | free_irq: | 799 | free_irq: |
806 | free_irq(cx->dev->irq, (void *)cx); | 800 | free_irq(cx->dev->irq, (void *)cx); |
807 | free_i2c: | 801 | free_i2c: |
@@ -904,14 +898,13 @@ static void cx18_remove(struct pci_dev *pci_dev) | |||
904 | 898 | ||
905 | cx18_halt_firmware(cx); | 899 | cx18_halt_firmware(cx); |
906 | 900 | ||
907 | cx18_streams_cleanup(cx); | 901 | cx18_streams_cleanup(cx, 1); |
908 | 902 | ||
909 | exit_cx18_i2c(cx); | 903 | exit_cx18_i2c(cx); |
910 | 904 | ||
911 | free_irq(cx->dev->irq, (void *)cx); | 905 | free_irq(cx->dev->irq, (void *)cx); |
912 | 906 | ||
913 | if (cx->dev) | 907 | cx18_iounmap(cx); |
914 | cx18_iounmap(cx); | ||
915 | 908 | ||
916 | release_mem_region(cx->base_addr, CX18_MEM_SIZE); | 909 | release_mem_region(cx->base_addr, CX18_MEM_SIZE); |
917 | 910 | ||
diff --git a/drivers/media/video/cx18/cx18-driver.h b/drivers/media/video/cx18/cx18-driver.h index 2ee939193bb7..a2a6c58d12fe 100644 --- a/drivers/media/video/cx18/cx18-driver.h +++ b/drivers/media/video/cx18/cx18-driver.h | |||
@@ -444,9 +444,6 @@ extern spinlock_t cx18_cards_lock; | |||
444 | /* Return non-zero if a signal is pending */ | 444 | /* Return non-zero if a signal is pending */ |
445 | int cx18_msleep_timeout(unsigned int msecs, int intr); | 445 | int cx18_msleep_timeout(unsigned int msecs, int intr); |
446 | 446 | ||
447 | /* Wait on queue, returns -EINTR if interrupted */ | ||
448 | int cx18_waitq(wait_queue_head_t *waitq); | ||
449 | |||
450 | /* Read Hauppauge eeprom */ | 447 | /* Read Hauppauge eeprom */ |
451 | struct tveeprom; /* forward reference */ | 448 | struct tveeprom; /* forward reference */ |
452 | void cx18_read_eeprom(struct cx18 *cx, struct tveeprom *tv); | 449 | void cx18_read_eeprom(struct cx18 *cx, struct tveeprom *tv); |
diff --git a/drivers/media/video/cx18/cx18-dvb.c b/drivers/media/video/cx18/cx18-dvb.c index 65efe69d939a..c9744173f969 100644 --- a/drivers/media/video/cx18/cx18-dvb.c +++ b/drivers/media/video/cx18/cx18-dvb.c | |||
@@ -24,25 +24,27 @@ | |||
24 | #include "cx18-streams.h" | 24 | #include "cx18-streams.h" |
25 | #include "cx18-cards.h" | 25 | #include "cx18-cards.h" |
26 | #include "s5h1409.h" | 26 | #include "s5h1409.h" |
27 | 27 | #include "mxl5005s.h" | |
28 | /* Wait until the MXL500X driver is merged */ | ||
29 | #ifdef HAVE_MXL500X | ||
30 | #include "mxl500x.h" | ||
31 | #endif | ||
32 | 28 | ||
33 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); | 29 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); |
34 | 30 | ||
35 | #define CX18_REG_DMUX_NUM_PORT_0_CONTROL 0xd5a000 | 31 | #define CX18_REG_DMUX_NUM_PORT_0_CONTROL 0xd5a000 |
36 | 32 | ||
37 | #ifdef HAVE_MXL500X | 33 | static struct mxl5005s_config hauppauge_hvr1600_tuner = { |
38 | static struct mxl500x_config hauppauge_hvr1600_tuner = { | 34 | .i2c_address = 0xC6 >> 1, |
39 | .delsys = MXL500x_MODE_ATSC, | 35 | .if_freq = IF_FREQ_5380000HZ, |
40 | .octf = MXL500x_OCTF_CH, | 36 | .xtal_freq = CRYSTAL_FREQ_16000000HZ, |
41 | .xtal_freq = 16000000, | 37 | .agc_mode = MXL_SINGLE_AGC, |
42 | .iflo_freq = 5380000, | 38 | .tracking_filter = MXL_TF_C_H, |
43 | .ref_freq = 322800000, | 39 | .rssi_enable = MXL_RSSI_ENABLE, |
44 | .rssi_ena = MXL_RSSI_ENABLE, | 40 | .cap_select = MXL_CAP_SEL_ENABLE, |
45 | .addr = 0xC6 >> 1, | 41 | .div_out = MXL_DIV_OUT_4, |
42 | .clock_out = MXL_CLOCK_OUT_DISABLE, | ||
43 | .output_load = MXL5005S_IF_OUTPUT_LOAD_200_OHM, | ||
44 | .top = MXL5005S_TOP_25P2, | ||
45 | .mod_mode = MXL_DIGITAL_MODE, | ||
46 | .if_mode = MXL_ZERO_IF, | ||
47 | .AgcMasterByte = 0x00, | ||
46 | }; | 48 | }; |
47 | 49 | ||
48 | static struct s5h1409_config hauppauge_hvr1600_config = { | 50 | static struct s5h1409_config hauppauge_hvr1600_config = { |
@@ -55,7 +57,6 @@ static struct s5h1409_config hauppauge_hvr1600_config = { | |||
55 | .mpeg_timing = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK | 57 | .mpeg_timing = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK |
56 | 58 | ||
57 | }; | 59 | }; |
58 | #endif | ||
59 | 60 | ||
60 | static int dvb_register(struct cx18_stream *stream); | 61 | static int dvb_register(struct cx18_stream *stream); |
61 | 62 | ||
@@ -252,21 +253,18 @@ static int dvb_register(struct cx18_stream *stream) | |||
252 | int ret = 0; | 253 | int ret = 0; |
253 | 254 | ||
254 | switch (cx->card->type) { | 255 | switch (cx->card->type) { |
255 | /* Wait until the MXL500X driver is merged */ | ||
256 | #ifdef HAVE_MXL500X | ||
257 | case CX18_CARD_HVR_1600_ESMT: | 256 | case CX18_CARD_HVR_1600_ESMT: |
258 | case CX18_CARD_HVR_1600_SAMSUNG: | 257 | case CX18_CARD_HVR_1600_SAMSUNG: |
259 | dvb->fe = dvb_attach(s5h1409_attach, | 258 | dvb->fe = dvb_attach(s5h1409_attach, |
260 | &hauppauge_hvr1600_config, | 259 | &hauppauge_hvr1600_config, |
261 | &cx->i2c_adap[0]); | 260 | &cx->i2c_adap[0]); |
262 | if (dvb->fe != NULL) { | 261 | if (dvb->fe != NULL) { |
263 | dvb_attach(mxl500x_attach, dvb->fe, | 262 | dvb_attach(mxl5005s_attach, dvb->fe, |
264 | &hauppauge_hvr1600_tuner, | 263 | &cx->i2c_adap[0], |
265 | &cx->i2c_adap[0]); | 264 | &hauppauge_hvr1600_tuner); |
266 | ret = 0; | 265 | ret = 0; |
267 | } | 266 | } |
268 | break; | 267 | break; |
269 | #endif | ||
270 | default: | 268 | default: |
271 | /* No Digital Tv Support */ | 269 | /* No Digital Tv Support */ |
272 | break; | 270 | break; |
diff --git a/drivers/media/video/cx18/cx18-fileops.c b/drivers/media/video/cx18/cx18-fileops.c index 69303065a294..0b3141db174b 100644 --- a/drivers/media/video/cx18/cx18-fileops.c +++ b/drivers/media/video/cx18/cx18-fileops.c | |||
@@ -39,7 +39,7 @@ | |||
39 | associated VBI streams are also automatically claimed. | 39 | associated VBI streams are also automatically claimed. |
40 | Possible error returns: -EBUSY if someone else has claimed | 40 | Possible error returns: -EBUSY if someone else has claimed |
41 | the stream or 0 on success. */ | 41 | the stream or 0 on success. */ |
42 | int cx18_claim_stream(struct cx18_open_id *id, int type) | 42 | static int cx18_claim_stream(struct cx18_open_id *id, int type) |
43 | { | 43 | { |
44 | struct cx18 *cx = id->cx; | 44 | struct cx18 *cx = id->cx; |
45 | struct cx18_stream *s = &cx->streams[type]; | 45 | struct cx18_stream *s = &cx->streams[type]; |
@@ -87,7 +87,7 @@ int cx18_claim_stream(struct cx18_open_id *id, int type) | |||
87 | 87 | ||
88 | /* This function releases a previously claimed stream. It will take into | 88 | /* This function releases a previously claimed stream. It will take into |
89 | account associated VBI streams. */ | 89 | account associated VBI streams. */ |
90 | void cx18_release_stream(struct cx18_stream *s) | 90 | static void cx18_release_stream(struct cx18_stream *s) |
91 | { | 91 | { |
92 | struct cx18 *cx = s->cx; | 92 | struct cx18 *cx = s->cx; |
93 | struct cx18_stream *s_vbi; | 93 | struct cx18_stream *s_vbi; |
@@ -662,6 +662,8 @@ int cx18_v4l2_open(struct inode *inode, struct file *filp) | |||
662 | for (x = 0; cx == NULL && x < cx18_cards_active; x++) { | 662 | for (x = 0; cx == NULL && x < cx18_cards_active; x++) { |
663 | /* find out which stream this open was on */ | 663 | /* find out which stream this open was on */ |
664 | for (y = 0; y < CX18_MAX_STREAMS; y++) { | 664 | for (y = 0; y < CX18_MAX_STREAMS; y++) { |
665 | if (cx18_cards[x] == NULL) | ||
666 | continue; | ||
665 | s = &cx18_cards[x]->streams[y]; | 667 | s = &cx18_cards[x]->streams[y]; |
666 | if (s->v4l2dev && s->v4l2dev->minor == minor) { | 668 | if (s->v4l2dev && s->v4l2dev->minor == minor) { |
667 | cx = cx18_cards[x]; | 669 | cx = cx18_cards[x]; |
diff --git a/drivers/media/video/cx18/cx18-fileops.h b/drivers/media/video/cx18/cx18-fileops.h index 16cdafbd24c5..46da0282fc7d 100644 --- a/drivers/media/video/cx18/cx18-fileops.h +++ b/drivers/media/video/cx18/cx18-fileops.h | |||
@@ -34,12 +34,3 @@ void cx18_stop_capture(struct cx18_open_id *id, int gop_end); | |||
34 | void cx18_mute(struct cx18 *cx); | 34 | void cx18_mute(struct cx18 *cx); |
35 | void cx18_unmute(struct cx18 *cx); | 35 | void cx18_unmute(struct cx18 *cx); |
36 | 36 | ||
37 | /* Utilities */ | ||
38 | |||
39 | /* Try to claim a stream for the filehandle. Return 0 on success, | ||
40 | -EBUSY if stream already claimed. Once a stream is claimed, it | ||
41 | remains claimed until the associated filehandle is closed. */ | ||
42 | int cx18_claim_stream(struct cx18_open_id *id, int type); | ||
43 | |||
44 | /* Release a previously claimed stream. */ | ||
45 | void cx18_release_stream(struct cx18_stream *s); | ||
diff --git a/drivers/media/video/cx18/cx18-gpio.c b/drivers/media/video/cx18/cx18-gpio.c index 19253e6b8673..bb8bc86086d0 100644 --- a/drivers/media/video/cx18/cx18-gpio.c +++ b/drivers/media/video/cx18/cx18-gpio.c | |||
@@ -35,6 +35,9 @@ | |||
35 | #define CX18_REG_GPIO_OUT2 0xc78104 | 35 | #define CX18_REG_GPIO_OUT2 0xc78104 |
36 | #define CX18_REG_GPIO_DIR2 0xc7810c | 36 | #define CX18_REG_GPIO_DIR2 0xc7810c |
37 | 37 | ||
38 | static u32 gpio_dir; | ||
39 | static u32 gpio_val; | ||
40 | |||
38 | /* | 41 | /* |
39 | * HVR-1600 GPIO pins, courtesy of Hauppauge: | 42 | * HVR-1600 GPIO pins, courtesy of Hauppauge: |
40 | * | 43 | * |
@@ -44,31 +47,53 @@ | |||
44 | * gpio13: cs5345 reset pin | 47 | * gpio13: cs5345 reset pin |
45 | */ | 48 | */ |
46 | 49 | ||
50 | static void gpio_write(struct cx18 *cx) | ||
51 | { | ||
52 | write_reg((gpio_dir & 0xffff) << 16, CX18_REG_GPIO_DIR1); | ||
53 | write_reg(((gpio_dir & 0xffff) << 16) | (gpio_val & 0xffff), | ||
54 | CX18_REG_GPIO_OUT1); | ||
55 | write_reg(gpio_dir & 0xffff0000, CX18_REG_GPIO_DIR2); | ||
56 | write_reg((gpio_dir & 0xffff0000) | ((gpio_val & 0xffff0000) >> 16), | ||
57 | CX18_REG_GPIO_OUT2); | ||
58 | } | ||
59 | |||
47 | void cx18_gpio_init(struct cx18 *cx) | 60 | void cx18_gpio_init(struct cx18 *cx) |
48 | { | 61 | { |
49 | if (cx->card->gpio_init.direction == 0) | 62 | gpio_dir = cx->card->gpio_init.direction; |
63 | gpio_val = cx->card->gpio_init.initial_value; | ||
64 | |||
65 | if (gpio_dir == 0) | ||
50 | return; | 66 | return; |
51 | 67 | ||
52 | CX18_DEBUG_INFO("GPIO initial dir: %08x out: %08x\n", | 68 | gpio_dir |= 1 << cx->card->xceive_pin; |
53 | read_reg(CX18_REG_GPIO_DIR1), read_reg(CX18_REG_GPIO_OUT1)); | 69 | gpio_val |= 1 << cx->card->xceive_pin; |
54 | 70 | ||
55 | /* init output data then direction */ | 71 | CX18_DEBUG_INFO("GPIO initial dir: %08x/%08x out: %08x/%08x\n", |
56 | write_reg(cx->card->gpio_init.direction << 16, CX18_REG_GPIO_DIR1); | 72 | read_reg(CX18_REG_GPIO_DIR1), read_reg(CX18_REG_GPIO_DIR2), |
57 | write_reg(0, CX18_REG_GPIO_DIR2); | 73 | read_reg(CX18_REG_GPIO_OUT1), read_reg(CX18_REG_GPIO_OUT2)); |
58 | write_reg((cx->card->gpio_init.direction << 16) | | 74 | |
59 | cx->card->gpio_init.initial_value, CX18_REG_GPIO_OUT1); | 75 | gpio_write(cx); |
60 | write_reg(0, CX18_REG_GPIO_OUT2); | ||
61 | } | 76 | } |
62 | 77 | ||
63 | /* Xceive tuner reset function */ | 78 | /* Xceive tuner reset function */ |
64 | int cx18_reset_tuner_gpio(void *dev, int cmd, int value) | 79 | int cx18_reset_tuner_gpio(void *dev, int cmd, int value) |
65 | { | 80 | { |
66 | struct i2c_algo_bit_data *algo = dev; | 81 | struct i2c_algo_bit_data *algo = dev; |
67 | struct cx18 *cx = algo->data; | 82 | struct cx18_i2c_algo_callback_data *cb_data = algo->data; |
68 | /* int curdir, curout;*/ | 83 | struct cx18 *cx = cb_data->cx; |
69 | 84 | ||
70 | if (cmd != XC2028_TUNER_RESET) | 85 | if (cmd != XC2028_TUNER_RESET) |
71 | return 0; | 86 | return 0; |
72 | CX18_DEBUG_INFO("Resetting tuner\n"); | 87 | CX18_DEBUG_INFO("Resetting tuner\n"); |
88 | |||
89 | gpio_dir |= 1 << cx->card->xceive_pin; | ||
90 | gpio_val &= ~(1 << cx->card->xceive_pin); | ||
91 | |||
92 | gpio_write(cx); | ||
93 | schedule_timeout_interruptible(msecs_to_jiffies(1)); | ||
94 | |||
95 | gpio_val |= 1 << cx->card->xceive_pin; | ||
96 | gpio_write(cx); | ||
97 | schedule_timeout_interruptible(msecs_to_jiffies(1)); | ||
73 | return 0; | 98 | return 0; |
74 | } | 99 | } |
diff --git a/drivers/media/video/cx18/cx18-i2c.c b/drivers/media/video/cx18/cx18-i2c.c index 18c88d1e4833..4f08a4058d1a 100644 --- a/drivers/media/video/cx18/cx18-i2c.c +++ b/drivers/media/video/cx18/cx18-i2c.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include "cx18-cards.h" | 25 | #include "cx18-cards.h" |
26 | #include "cx18-gpio.h" | 26 | #include "cx18-gpio.h" |
27 | #include "cx18-av-core.h" | 27 | #include "cx18-av-core.h" |
28 | #include "cx18-i2c.h" | ||
28 | 29 | ||
29 | #include <media/ir-kbd-i2c.h> | 30 | #include <media/ir-kbd-i2c.h> |
30 | 31 | ||
diff --git a/drivers/media/video/cx18/cx18-queue.c b/drivers/media/video/cx18/cx18-queue.c index 65af1bb507ca..6990b77c6200 100644 --- a/drivers/media/video/cx18/cx18-queue.c +++ b/drivers/media/video/cx18/cx18-queue.c | |||
@@ -26,17 +26,6 @@ | |||
26 | #include "cx18-queue.h" | 26 | #include "cx18-queue.h" |
27 | #include "cx18-scb.h" | 27 | #include "cx18-scb.h" |
28 | 28 | ||
29 | int cx18_buf_copy_from_user(struct cx18_stream *s, struct cx18_buffer *buf, | ||
30 | const char __user *src, int copybytes) | ||
31 | { | ||
32 | if (s->buf_size - buf->bytesused < copybytes) | ||
33 | copybytes = s->buf_size - buf->bytesused; | ||
34 | if (copy_from_user(buf->buf + buf->bytesused, src, copybytes)) | ||
35 | return -EFAULT; | ||
36 | buf->bytesused += copybytes; | ||
37 | return copybytes; | ||
38 | } | ||
39 | |||
40 | void cx18_buf_swap(struct cx18_buffer *buf) | 29 | void cx18_buf_swap(struct cx18_buffer *buf) |
41 | { | 30 | { |
42 | int i; | 31 | int i; |
@@ -159,8 +148,9 @@ static void cx18_queue_move_buf(struct cx18_stream *s, struct cx18_queue *from, | |||
159 | -ENOMEM is returned if the buffers could not be obtained, 0 if all | 148 | -ENOMEM is returned if the buffers could not be obtained, 0 if all |
160 | buffers where obtained from the 'from' list and if non-zero then | 149 | buffers where obtained from the 'from' list and if non-zero then |
161 | the number of stolen buffers is returned. */ | 150 | the number of stolen buffers is returned. */ |
162 | int cx18_queue_move(struct cx18_stream *s, struct cx18_queue *from, | 151 | static int cx18_queue_move(struct cx18_stream *s, struct cx18_queue *from, |
163 | struct cx18_queue *steal, struct cx18_queue *to, int needed_bytes) | 152 | struct cx18_queue *steal, struct cx18_queue *to, |
153 | int needed_bytes) | ||
164 | { | 154 | { |
165 | unsigned long flags; | 155 | unsigned long flags; |
166 | int rc = 0; | 156 | int rc = 0; |
@@ -239,12 +229,12 @@ int cx18_stream_alloc(struct cx18_stream *s) | |||
239 | 229 | ||
240 | /* allocate stream buffers. Initially all buffers are in q_free. */ | 230 | /* allocate stream buffers. Initially all buffers are in q_free. */ |
241 | for (i = 0; i < s->buffers; i++) { | 231 | for (i = 0; i < s->buffers; i++) { |
242 | struct cx18_buffer *buf = | 232 | struct cx18_buffer *buf = kzalloc(sizeof(struct cx18_buffer), |
243 | kzalloc(sizeof(struct cx18_buffer), GFP_KERNEL); | 233 | GFP_KERNEL|__GFP_NOWARN); |
244 | 234 | ||
245 | if (buf == NULL) | 235 | if (buf == NULL) |
246 | break; | 236 | break; |
247 | buf->buf = kmalloc(s->buf_size, GFP_KERNEL); | 237 | buf->buf = kmalloc(s->buf_size, GFP_KERNEL|__GFP_NOWARN); |
248 | if (buf->buf == NULL) { | 238 | if (buf->buf == NULL) { |
249 | kfree(buf); | 239 | kfree(buf); |
250 | break; | 240 | break; |
diff --git a/drivers/media/video/cx18/cx18-queue.h b/drivers/media/video/cx18/cx18-queue.h index f86c8a6fa6e7..91423b9863a4 100644 --- a/drivers/media/video/cx18/cx18-queue.h +++ b/drivers/media/video/cx18/cx18-queue.h | |||
@@ -39,8 +39,6 @@ static inline void cx18_buf_sync_for_device(struct cx18_stream *s, | |||
39 | s->buf_size, s->dma); | 39 | s->buf_size, s->dma); |
40 | } | 40 | } |
41 | 41 | ||
42 | int cx18_buf_copy_from_user(struct cx18_stream *s, struct cx18_buffer *buf, | ||
43 | const char __user *src, int copybytes); | ||
44 | void cx18_buf_swap(struct cx18_buffer *buf); | 42 | void cx18_buf_swap(struct cx18_buffer *buf); |
45 | 43 | ||
46 | /* cx18_queue utility functions */ | 44 | /* cx18_queue utility functions */ |
@@ -48,8 +46,6 @@ void cx18_queue_init(struct cx18_queue *q); | |||
48 | void cx18_enqueue(struct cx18_stream *s, struct cx18_buffer *buf, | 46 | void cx18_enqueue(struct cx18_stream *s, struct cx18_buffer *buf, |
49 | struct cx18_queue *q); | 47 | struct cx18_queue *q); |
50 | struct cx18_buffer *cx18_dequeue(struct cx18_stream *s, struct cx18_queue *q); | 48 | struct cx18_buffer *cx18_dequeue(struct cx18_stream *s, struct cx18_queue *q); |
51 | int cx18_queue_move(struct cx18_stream *s, struct cx18_queue *from, | ||
52 | struct cx18_queue *steal, struct cx18_queue *to, int needed_bytes); | ||
53 | struct cx18_buffer *cx18_queue_find_buf(struct cx18_stream *s, u32 id, | 49 | struct cx18_buffer *cx18_queue_find_buf(struct cx18_stream *s, u32 id, |
54 | u32 bytesused); | 50 | u32 bytesused); |
55 | void cx18_flush_queues(struct cx18_stream *s); | 51 | void cx18_flush_queues(struct cx18_stream *s); |
diff --git a/drivers/media/video/cx18/cx18-streams.c b/drivers/media/video/cx18/cx18-streams.c index afb141b2027a..4ca9d847f1b1 100644 --- a/drivers/media/video/cx18/cx18-streams.c +++ b/drivers/media/video/cx18/cx18-streams.c | |||
@@ -218,7 +218,7 @@ int cx18_streams_setup(struct cx18 *cx) | |||
218 | return 0; | 218 | return 0; |
219 | 219 | ||
220 | /* One or more streams could not be initialized. Clean 'em all up. */ | 220 | /* One or more streams could not be initialized. Clean 'em all up. */ |
221 | cx18_streams_cleanup(cx); | 221 | cx18_streams_cleanup(cx, 0); |
222 | return -ENOMEM; | 222 | return -ENOMEM; |
223 | } | 223 | } |
224 | 224 | ||
@@ -296,12 +296,12 @@ int cx18_streams_register(struct cx18 *cx) | |||
296 | return 0; | 296 | return 0; |
297 | 297 | ||
298 | /* One or more streams could not be initialized. Clean 'em all up. */ | 298 | /* One or more streams could not be initialized. Clean 'em all up. */ |
299 | cx18_streams_cleanup(cx); | 299 | cx18_streams_cleanup(cx, 1); |
300 | return -ENOMEM; | 300 | return -ENOMEM; |
301 | } | 301 | } |
302 | 302 | ||
303 | /* Unregister v4l2 devices */ | 303 | /* Unregister v4l2 devices */ |
304 | void cx18_streams_cleanup(struct cx18 *cx) | 304 | void cx18_streams_cleanup(struct cx18 *cx, int unregister) |
305 | { | 305 | { |
306 | struct video_device *vdev; | 306 | struct video_device *vdev; |
307 | int type; | 307 | int type; |
@@ -319,8 +319,11 @@ void cx18_streams_cleanup(struct cx18 *cx) | |||
319 | 319 | ||
320 | cx18_stream_free(&cx->streams[type]); | 320 | cx18_stream_free(&cx->streams[type]); |
321 | 321 | ||
322 | /* Unregister device */ | 322 | /* Unregister or release device */ |
323 | video_unregister_device(vdev); | 323 | if (unregister) |
324 | video_unregister_device(vdev); | ||
325 | else | ||
326 | video_device_release(vdev); | ||
324 | } | 327 | } |
325 | } | 328 | } |
326 | 329 | ||
diff --git a/drivers/media/video/cx18/cx18-streams.h b/drivers/media/video/cx18/cx18-streams.h index 8c7ba7d2fa79..f327e947b24f 100644 --- a/drivers/media/video/cx18/cx18-streams.h +++ b/drivers/media/video/cx18/cx18-streams.h | |||
@@ -24,7 +24,7 @@ | |||
24 | u32 cx18_find_handle(struct cx18 *cx); | 24 | u32 cx18_find_handle(struct cx18 *cx); |
25 | int cx18_streams_setup(struct cx18 *cx); | 25 | int cx18_streams_setup(struct cx18 *cx); |
26 | int cx18_streams_register(struct cx18 *cx); | 26 | int cx18_streams_register(struct cx18 *cx); |
27 | void cx18_streams_cleanup(struct cx18 *cx); | 27 | void cx18_streams_cleanup(struct cx18 *cx, int unregister); |
28 | 28 | ||
29 | /* Capture related */ | 29 | /* Capture related */ |
30 | int cx18_start_v4l2_encode_stream(struct cx18_stream *s); | 30 | int cx18_start_v4l2_encode_stream(struct cx18_stream *s); |
diff --git a/drivers/media/video/cx23885/Kconfig b/drivers/media/video/cx23885/Kconfig index cadf936c3673..7bf14c9a15c7 100644 --- a/drivers/media/video/cx23885/Kconfig +++ b/drivers/media/video/cx23885/Kconfig | |||
@@ -1,18 +1,20 @@ | |||
1 | config VIDEO_CX23885 | 1 | config VIDEO_CX23885 |
2 | tristate "Conexant cx23885 (2388x successor) support" | 2 | tristate "Conexant cx23885 (2388x successor) support" |
3 | depends on DVB_CORE && VIDEO_DEV && PCI && I2C && INPUT | 3 | depends on DVB_CORE && VIDEO_DEV && PCI && I2C && INPUT |
4 | depends on HOTPLUG # due to FW_LOADER | ||
4 | select I2C_ALGOBIT | 5 | select I2C_ALGOBIT |
5 | select FW_LOADER | 6 | select FW_LOADER |
6 | select VIDEO_BTCX | 7 | select VIDEO_BTCX |
7 | select MEDIA_TUNER | 8 | select VIDEO_TUNER |
8 | select VIDEO_TVEEPROM | 9 | select VIDEO_TVEEPROM |
9 | select VIDEO_IR | 10 | select VIDEO_IR |
10 | select VIDEOBUF_DVB | 11 | select VIDEOBUF_DVB |
11 | select VIDEO_CX25840 | 12 | select VIDEO_CX25840 |
13 | select VIDEO_CX2341X | ||
14 | select DVB_DIB7000P if !DVB_FE_CUSTOMISE | ||
12 | select MEDIA_TUNER_MT2131 if !DVB_FE_CUSTOMISE | 15 | select MEDIA_TUNER_MT2131 if !DVB_FE_CUSTOMISE |
13 | select DVB_S5H1409 if !DVB_FE_CUSTOMISE | 16 | select DVB_S5H1409 if !DVB_FE_CUSTOMISE |
14 | select DVB_LGDT330X if !DVB_FE_CUSTOMISE | 17 | select DVB_LGDT330X if !DVB_FE_CUSTOMISE |
15 | select DVB_PLL if !DVB_FE_CUSTOMISE | ||
16 | select MEDIA_TUNER_XC2028 if !DVB_FE_CUSTOMIZE | 18 | select MEDIA_TUNER_XC2028 if !DVB_FE_CUSTOMIZE |
17 | select MEDIA_TUNER_TDA8290 if !DVB_FE_CUSTOMIZE | 19 | select MEDIA_TUNER_TDA8290 if !DVB_FE_CUSTOMIZE |
18 | select MEDIA_TUNER_TDA18271 if !DVB_FE_CUSTOMIZE | 20 | select MEDIA_TUNER_TDA18271 if !DVB_FE_CUSTOMIZE |
diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c index 6ebf58724a01..20e05f230546 100644 --- a/drivers/media/video/cx23885/cx23885-cards.c +++ b/drivers/media/video/cx23885/cx23885-cards.c | |||
@@ -200,6 +200,10 @@ struct cx23885_subid cx23885_subids[] = { | |||
200 | .card = CX23885_BOARD_HAUPPAUGE_HVR1200, | 200 | .card = CX23885_BOARD_HAUPPAUGE_HVR1200, |
201 | }, { | 201 | }, { |
202 | .subvendor = 0x0070, | 202 | .subvendor = 0x0070, |
203 | .subdevice = 0x71d3, | ||
204 | .card = CX23885_BOARD_HAUPPAUGE_HVR1200, | ||
205 | }, { | ||
206 | .subvendor = 0x0070, | ||
203 | .subdevice = 0x8101, | 207 | .subdevice = 0x8101, |
204 | .card = CX23885_BOARD_HAUPPAUGE_HVR1700, | 208 | .card = CX23885_BOARD_HAUPPAUGE_HVR1700, |
205 | }, { | 209 | }, { |
@@ -245,6 +249,33 @@ static void hauppauge_eeprom(struct cx23885_dev *dev, u8 *eeprom_data) | |||
245 | /* Make sure we support the board model */ | 249 | /* Make sure we support the board model */ |
246 | switch (tv.model) | 250 | switch (tv.model) |
247 | { | 251 | { |
252 | case 71009: | ||
253 | /* WinTV-HVR1200 (PCIe, Retail, full height) | ||
254 | * DVB-T and basic analog */ | ||
255 | case 71359: | ||
256 | /* WinTV-HVR1200 (PCIe, OEM, half height) | ||
257 | * DVB-T and basic analog */ | ||
258 | case 71439: | ||
259 | /* WinTV-HVR1200 (PCIe, OEM, half height) | ||
260 | * DVB-T and basic analog */ | ||
261 | case 71449: | ||
262 | /* WinTV-HVR1200 (PCIe, OEM, full height) | ||
263 | * DVB-T and basic analog */ | ||
264 | case 71939: | ||
265 | /* WinTV-HVR1200 (PCIe, OEM, half height) | ||
266 | * DVB-T and basic analog */ | ||
267 | case 71949: | ||
268 | /* WinTV-HVR1200 (PCIe, OEM, full height) | ||
269 | * DVB-T and basic analog */ | ||
270 | case 71959: | ||
271 | /* WinTV-HVR1200 (PCIe, OEM, full height) | ||
272 | * DVB-T and basic analog */ | ||
273 | case 71979: | ||
274 | /* WinTV-HVR1200 (PCIe, OEM, half height) | ||
275 | * DVB-T and basic analog */ | ||
276 | case 71999: | ||
277 | /* WinTV-HVR1200 (PCIe, OEM, full height) | ||
278 | * DVB-T and basic analog */ | ||
248 | case 76601: /* WinTV-HVR1800lp (PCIe, Retail, No IR, Dual channel ATSC and MPEG2 HW Encoder */ | 279 | case 76601: /* WinTV-HVR1800lp (PCIe, Retail, No IR, Dual channel ATSC and MPEG2 HW Encoder */ |
249 | case 77001: /* WinTV-HVR1500 (Express Card, OEM, No IR, ATSC and Basic analog */ | 280 | case 77001: /* WinTV-HVR1500 (Express Card, OEM, No IR, ATSC and Basic analog */ |
250 | case 77011: /* WinTV-HVR1500 (Express Card, Retail, No IR, ATSC and Basic analog */ | 281 | case 77011: /* WinTV-HVR1500 (Express Card, Retail, No IR, ATSC and Basic analog */ |
@@ -263,8 +294,11 @@ static void hauppauge_eeprom(struct cx23885_dev *dev, u8 *eeprom_data) | |||
263 | case 80019: | 294 | case 80019: |
264 | /* WinTV-HVR1400 (Express Card, Retail, IR, | 295 | /* WinTV-HVR1400 (Express Card, Retail, IR, |
265 | * DVB-T and Basic analog */ | 296 | * DVB-T and Basic analog */ |
297 | case 81509: | ||
298 | /* WinTV-HVR1700 (PCIe, OEM, No IR, half height) | ||
299 | * DVB-T and MPEG2 HW Encoder */ | ||
266 | case 81519: | 300 | case 81519: |
267 | /* WinTV-HVR1700 (PCIe, Retail, No IR, half height, | 301 | /* WinTV-HVR1700 (PCIe, OEM, No IR, full height) |
268 | * DVB-T and MPEG2 HW Encoder */ | 302 | * DVB-T and MPEG2 HW Encoder */ |
269 | break; | 303 | break; |
270 | default: | 304 | default: |
diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c index f05649727b60..022aa391937a 100644 --- a/drivers/media/video/cx23885/cx23885-dvb.c +++ b/drivers/media/video/cx23885/cx23885-dvb.c | |||
@@ -37,7 +37,6 @@ | |||
37 | #include "lgdt330x.h" | 37 | #include "lgdt330x.h" |
38 | #include "xc5000.h" | 38 | #include "xc5000.h" |
39 | #include "tda10048.h" | 39 | #include "tda10048.h" |
40 | #include "dvb-pll.h" | ||
41 | #include "tuner-xc2028.h" | 40 | #include "tuner-xc2028.h" |
42 | #include "tuner-simple.h" | 41 | #include "tuner-simple.h" |
43 | #include "dib7000p.h" | 42 | #include "dib7000p.h" |
@@ -385,12 +384,10 @@ static int dvb_register(struct cx23885_tsport *port) | |||
385 | port->dvb.frontend = dvb_attach(s5h1409_attach, | 384 | port->dvb.frontend = dvb_attach(s5h1409_attach, |
386 | &hauppauge_hvr1500q_config, | 385 | &hauppauge_hvr1500q_config, |
387 | &dev->i2c_bus[0].i2c_adap); | 386 | &dev->i2c_bus[0].i2c_adap); |
388 | if (port->dvb.frontend != NULL) { | 387 | if (port->dvb.frontend != NULL) |
389 | hauppauge_hvr1500q_tunerconfig.priv = i2c_bus; | ||
390 | dvb_attach(xc5000_attach, port->dvb.frontend, | 388 | dvb_attach(xc5000_attach, port->dvb.frontend, |
391 | &i2c_bus->i2c_adap, | 389 | &i2c_bus->i2c_adap, |
392 | &hauppauge_hvr1500q_tunerconfig); | 390 | &hauppauge_hvr1500q_tunerconfig, i2c_bus); |
393 | } | ||
394 | break; | 391 | break; |
395 | case CX23885_BOARD_HAUPPAUGE_HVR1500: | 392 | case CX23885_BOARD_HAUPPAUGE_HVR1500: |
396 | i2c_bus = &dev->i2c_bus[1]; | 393 | i2c_bus = &dev->i2c_bus[1]; |
diff --git a/drivers/media/video/cx25840/Kconfig b/drivers/media/video/cx25840/Kconfig index 7cf29a03ed63..448f4cd0ce34 100644 --- a/drivers/media/video/cx25840/Kconfig +++ b/drivers/media/video/cx25840/Kconfig | |||
@@ -1,6 +1,7 @@ | |||
1 | config VIDEO_CX25840 | 1 | config VIDEO_CX25840 |
2 | tristate "Conexant CX2584x audio/video decoders" | 2 | tristate "Conexant CX2584x audio/video decoders" |
3 | depends on VIDEO_V4L2 && I2C && EXPERIMENTAL | 3 | depends on VIDEO_V4L2 && I2C && EXPERIMENTAL |
4 | depends on HOTPLUG # due to FW_LOADER | ||
4 | select FW_LOADER | 5 | select FW_LOADER |
5 | ---help--- | 6 | ---help--- |
6 | Support for the Conexant CX2584x audio/video decoders. | 7 | Support for the Conexant CX2584x audio/video decoders. |
diff --git a/drivers/media/video/cx88/Kconfig b/drivers/media/video/cx88/Kconfig index b0d7d6a7a4cc..10e20d8196dc 100644 --- a/drivers/media/video/cx88/Kconfig +++ b/drivers/media/video/cx88/Kconfig | |||
@@ -2,10 +2,9 @@ config VIDEO_CX88 | |||
2 | tristate "Conexant 2388x (bt878 successor) support" | 2 | tristate "Conexant 2388x (bt878 successor) support" |
3 | depends on VIDEO_DEV && PCI && I2C && INPUT | 3 | depends on VIDEO_DEV && PCI && I2C && INPUT |
4 | select I2C_ALGOBIT | 4 | select I2C_ALGOBIT |
5 | select FW_LOADER | ||
6 | select VIDEO_BTCX | 5 | select VIDEO_BTCX |
7 | select VIDEOBUF_DMA_SG | 6 | select VIDEOBUF_DMA_SG |
8 | select MEDIA_TUNER | 7 | select VIDEO_TUNER |
9 | select VIDEO_TVEEPROM | 8 | select VIDEO_TVEEPROM |
10 | select VIDEO_IR | 9 | select VIDEO_IR |
11 | select VIDEO_WM8775 if VIDEO_HELPER_CHIPS_AUTO | 10 | select VIDEO_WM8775 if VIDEO_HELPER_CHIPS_AUTO |
@@ -34,8 +33,9 @@ config VIDEO_CX88_ALSA | |||
34 | 33 | ||
35 | config VIDEO_CX88_BLACKBIRD | 34 | config VIDEO_CX88_BLACKBIRD |
36 | tristate "Blackbird MPEG encoder support (cx2388x + cx23416)" | 35 | tristate "Blackbird MPEG encoder support (cx2388x + cx23416)" |
37 | depends on VIDEO_CX88 | 36 | depends on VIDEO_CX88 && HOTPLUG |
38 | select VIDEO_CX2341X | 37 | select VIDEO_CX2341X |
38 | select FW_LOADER | ||
39 | ---help--- | 39 | ---help--- |
40 | This adds support for MPEG encoder cards based on the | 40 | This adds support for MPEG encoder cards based on the |
41 | Blackbird reference design, using the Conexant 2388x | 41 | Blackbird reference design, using the Conexant 2388x |
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 1c7fe6862a60..d96173ff1dba 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c | |||
@@ -509,9 +509,6 @@ static int attach_xc3028(u8 addr, struct cx8802_dev *dev) | |||
509 | if (!fe) { | 509 | if (!fe) { |
510 | printk(KERN_ERR "%s/2: xc3028 attach failed\n", | 510 | printk(KERN_ERR "%s/2: xc3028 attach failed\n", |
511 | dev->core->name); | 511 | dev->core->name); |
512 | dvb_frontend_detach(dev->dvb.frontend); | ||
513 | dvb_unregister_frontend(dev->dvb.frontend); | ||
514 | dev->dvb.frontend = NULL; | ||
515 | return -EINVAL; | 512 | return -EINVAL; |
516 | } | 513 | } |
517 | 514 | ||
@@ -523,20 +520,23 @@ static int attach_xc3028(u8 addr, struct cx8802_dev *dev) | |||
523 | 520 | ||
524 | static int dvb_register(struct cx8802_dev *dev) | 521 | static int dvb_register(struct cx8802_dev *dev) |
525 | { | 522 | { |
523 | struct cx88_core *core = dev->core; | ||
524 | |||
526 | /* init struct videobuf_dvb */ | 525 | /* init struct videobuf_dvb */ |
527 | dev->dvb.name = dev->core->name; | 526 | dev->dvb.name = core->name; |
528 | dev->ts_gen_cntrl = 0x0c; | 527 | dev->ts_gen_cntrl = 0x0c; |
529 | 528 | ||
530 | /* init frontend */ | 529 | /* init frontend */ |
531 | switch (dev->core->boardnr) { | 530 | switch (core->boardnr) { |
532 | case CX88_BOARD_HAUPPAUGE_DVB_T1: | 531 | case CX88_BOARD_HAUPPAUGE_DVB_T1: |
533 | dev->dvb.frontend = dvb_attach(cx22702_attach, | 532 | dev->dvb.frontend = dvb_attach(cx22702_attach, |
534 | &connexant_refboard_config, | 533 | &connexant_refboard_config, |
535 | &dev->core->i2c_adap); | 534 | &core->i2c_adap); |
536 | if (dev->dvb.frontend != NULL) { | 535 | if (dev->dvb.frontend != NULL) { |
537 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, | 536 | if (!dvb_attach(dvb_pll_attach, dev->dvb.frontend, |
538 | &dev->core->i2c_adap, | 537 | 0x61, &core->i2c_adap, |
539 | DVB_PLL_THOMSON_DTT759X); | 538 | DVB_PLL_THOMSON_DTT759X)) |
539 | goto frontend_detach; | ||
540 | } | 540 | } |
541 | break; | 541 | break; |
542 | case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1: | 542 | case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1: |
@@ -545,11 +545,12 @@ static int dvb_register(struct cx8802_dev *dev) | |||
545 | case CX88_BOARD_WINFAST_DTV1000: | 545 | case CX88_BOARD_WINFAST_DTV1000: |
546 | dev->dvb.frontend = dvb_attach(cx22702_attach, | 546 | dev->dvb.frontend = dvb_attach(cx22702_attach, |
547 | &connexant_refboard_config, | 547 | &connexant_refboard_config, |
548 | &dev->core->i2c_adap); | 548 | &core->i2c_adap); |
549 | if (dev->dvb.frontend != NULL) { | 549 | if (dev->dvb.frontend != NULL) { |
550 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x60, | 550 | if (!dvb_attach(dvb_pll_attach, dev->dvb.frontend, |
551 | &dev->core->i2c_adap, | 551 | 0x60, &core->i2c_adap, |
552 | DVB_PLL_THOMSON_DTT7579); | 552 | DVB_PLL_THOMSON_DTT7579)) |
553 | goto frontend_detach; | ||
553 | } | 554 | } |
554 | break; | 555 | break; |
555 | case CX88_BOARD_WINFAST_DTV2000H: | 556 | case CX88_BOARD_WINFAST_DTV2000H: |
@@ -559,29 +560,32 @@ static int dvb_register(struct cx8802_dev *dev) | |||
559 | case CX88_BOARD_HAUPPAUGE_HVR3000: | 560 | case CX88_BOARD_HAUPPAUGE_HVR3000: |
560 | dev->dvb.frontend = dvb_attach(cx22702_attach, | 561 | dev->dvb.frontend = dvb_attach(cx22702_attach, |
561 | &hauppauge_hvr_config, | 562 | &hauppauge_hvr_config, |
562 | &dev->core->i2c_adap); | 563 | &core->i2c_adap); |
563 | if (dev->dvb.frontend != NULL) { | 564 | if (dev->dvb.frontend != NULL) { |
564 | dvb_attach(simple_tuner_attach, dev->dvb.frontend, | 565 | if (!dvb_attach(simple_tuner_attach, dev->dvb.frontend, |
565 | &dev->core->i2c_adap, 0x61, | 566 | &core->i2c_adap, 0x61, |
566 | TUNER_PHILIPS_FMD1216ME_MK3); | 567 | TUNER_PHILIPS_FMD1216ME_MK3)) |
568 | goto frontend_detach; | ||
567 | } | 569 | } |
568 | break; | 570 | break; |
569 | case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS: | 571 | case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS: |
570 | dev->dvb.frontend = dvb_attach(mt352_attach, | 572 | dev->dvb.frontend = dvb_attach(mt352_attach, |
571 | &dvico_fusionhdtv, | 573 | &dvico_fusionhdtv, |
572 | &dev->core->i2c_adap); | 574 | &core->i2c_adap); |
573 | if (dev->dvb.frontend != NULL) { | 575 | if (dev->dvb.frontend != NULL) { |
574 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x60, | 576 | if (!dvb_attach(dvb_pll_attach, dev->dvb.frontend, |
575 | NULL, DVB_PLL_THOMSON_DTT7579); | 577 | 0x60, NULL, DVB_PLL_THOMSON_DTT7579)) |
578 | goto frontend_detach; | ||
576 | break; | 579 | break; |
577 | } | 580 | } |
578 | /* ZL10353 replaces MT352 on later cards */ | 581 | /* ZL10353 replaces MT352 on later cards */ |
579 | dev->dvb.frontend = dvb_attach(zl10353_attach, | 582 | dev->dvb.frontend = dvb_attach(zl10353_attach, |
580 | &dvico_fusionhdtv_plus_v1_1, | 583 | &dvico_fusionhdtv_plus_v1_1, |
581 | &dev->core->i2c_adap); | 584 | &core->i2c_adap); |
582 | if (dev->dvb.frontend != NULL) { | 585 | if (dev->dvb.frontend != NULL) { |
583 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x60, | 586 | if (!dvb_attach(dvb_pll_attach, dev->dvb.frontend, |
584 | NULL, DVB_PLL_THOMSON_DTT7579); | 587 | 0x60, NULL, DVB_PLL_THOMSON_DTT7579)) |
588 | goto frontend_detach; | ||
585 | } | 589 | } |
586 | break; | 590 | break; |
587 | case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL: | 591 | case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL: |
@@ -589,28 +593,31 @@ static int dvb_register(struct cx8802_dev *dev) | |||
589 | * compatible, with a slightly different MT352 AGC gain. */ | 593 | * compatible, with a slightly different MT352 AGC gain. */ |
590 | dev->dvb.frontend = dvb_attach(mt352_attach, | 594 | dev->dvb.frontend = dvb_attach(mt352_attach, |
591 | &dvico_fusionhdtv_dual, | 595 | &dvico_fusionhdtv_dual, |
592 | &dev->core->i2c_adap); | 596 | &core->i2c_adap); |
593 | if (dev->dvb.frontend != NULL) { | 597 | if (dev->dvb.frontend != NULL) { |
594 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, | 598 | if (!dvb_attach(dvb_pll_attach, dev->dvb.frontend, |
595 | NULL, DVB_PLL_THOMSON_DTT7579); | 599 | 0x61, NULL, DVB_PLL_THOMSON_DTT7579)) |
600 | goto frontend_detach; | ||
596 | break; | 601 | break; |
597 | } | 602 | } |
598 | /* ZL10353 replaces MT352 on later cards */ | 603 | /* ZL10353 replaces MT352 on later cards */ |
599 | dev->dvb.frontend = dvb_attach(zl10353_attach, | 604 | dev->dvb.frontend = dvb_attach(zl10353_attach, |
600 | &dvico_fusionhdtv_plus_v1_1, | 605 | &dvico_fusionhdtv_plus_v1_1, |
601 | &dev->core->i2c_adap); | 606 | &core->i2c_adap); |
602 | if (dev->dvb.frontend != NULL) { | 607 | if (dev->dvb.frontend != NULL) { |
603 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, | 608 | if (!dvb_attach(dvb_pll_attach, dev->dvb.frontend, |
604 | NULL, DVB_PLL_THOMSON_DTT7579); | 609 | 0x61, NULL, DVB_PLL_THOMSON_DTT7579)) |
610 | goto frontend_detach; | ||
605 | } | 611 | } |
606 | break; | 612 | break; |
607 | case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1: | 613 | case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1: |
608 | dev->dvb.frontend = dvb_attach(mt352_attach, | 614 | dev->dvb.frontend = dvb_attach(mt352_attach, |
609 | &dvico_fusionhdtv, | 615 | &dvico_fusionhdtv, |
610 | &dev->core->i2c_adap); | 616 | &core->i2c_adap); |
611 | if (dev->dvb.frontend != NULL) { | 617 | if (dev->dvb.frontend != NULL) { |
612 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, | 618 | if (!dvb_attach(dvb_pll_attach, dev->dvb.frontend, |
613 | NULL, DVB_PLL_LG_Z201); | 619 | 0x61, NULL, DVB_PLL_LG_Z201)) |
620 | goto frontend_detach; | ||
614 | } | 621 | } |
615 | break; | 622 | break; |
616 | case CX88_BOARD_KWORLD_DVB_T: | 623 | case CX88_BOARD_KWORLD_DVB_T: |
@@ -618,10 +625,11 @@ static int dvb_register(struct cx8802_dev *dev) | |||
618 | case CX88_BOARD_ADSTECH_DVB_T_PCI: | 625 | case CX88_BOARD_ADSTECH_DVB_T_PCI: |
619 | dev->dvb.frontend = dvb_attach(mt352_attach, | 626 | dev->dvb.frontend = dvb_attach(mt352_attach, |
620 | &dntv_live_dvbt_config, | 627 | &dntv_live_dvbt_config, |
621 | &dev->core->i2c_adap); | 628 | &core->i2c_adap); |
622 | if (dev->dvb.frontend != NULL) { | 629 | if (dev->dvb.frontend != NULL) { |
623 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, | 630 | if (!dvb_attach(dvb_pll_attach, dev->dvb.frontend, |
624 | NULL, DVB_PLL_UNKNOWN_1); | 631 | 0x61, NULL, DVB_PLL_UNKNOWN_1)) |
632 | goto frontend_detach; | ||
625 | } | 633 | } |
626 | break; | 634 | break; |
627 | case CX88_BOARD_DNTV_LIVE_DVB_T_PRO: | 635 | case CX88_BOARD_DNTV_LIVE_DVB_T_PRO: |
@@ -630,32 +638,35 @@ static int dvb_register(struct cx8802_dev *dev) | |||
630 | dev->dvb.frontend = dvb_attach(mt352_attach, &dntv_live_dvbt_pro_config, | 638 | dev->dvb.frontend = dvb_attach(mt352_attach, &dntv_live_dvbt_pro_config, |
631 | &dev->vp3054->adap); | 639 | &dev->vp3054->adap); |
632 | if (dev->dvb.frontend != NULL) { | 640 | if (dev->dvb.frontend != NULL) { |
633 | dvb_attach(simple_tuner_attach, dev->dvb.frontend, | 641 | if (!dvb_attach(simple_tuner_attach, dev->dvb.frontend, |
634 | &dev->core->i2c_adap, 0x61, | 642 | &core->i2c_adap, 0x61, |
635 | TUNER_PHILIPS_FMD1216ME_MK3); | 643 | TUNER_PHILIPS_FMD1216ME_MK3)) |
644 | goto frontend_detach; | ||
636 | } | 645 | } |
637 | #else | 646 | #else |
638 | printk(KERN_ERR "%s/2: built without vp3054 support\n", dev->core->name); | 647 | printk(KERN_ERR "%s/2: built without vp3054 support\n", |
648 | core->name); | ||
639 | #endif | 649 | #endif |
640 | break; | 650 | break; |
641 | case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID: | 651 | case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID: |
642 | dev->dvb.frontend = dvb_attach(zl10353_attach, | 652 | dev->dvb.frontend = dvb_attach(zl10353_attach, |
643 | &dvico_fusionhdtv_hybrid, | 653 | &dvico_fusionhdtv_hybrid, |
644 | &dev->core->i2c_adap); | 654 | &core->i2c_adap); |
645 | if (dev->dvb.frontend != NULL) { | 655 | if (dev->dvb.frontend != NULL) { |
646 | dvb_attach(simple_tuner_attach, dev->dvb.frontend, | 656 | if (!dvb_attach(simple_tuner_attach, dev->dvb.frontend, |
647 | &dev->core->i2c_adap, 0x61, | 657 | &core->i2c_adap, 0x61, |
648 | TUNER_THOMSON_FE6600); | 658 | TUNER_THOMSON_FE6600)) |
659 | goto frontend_detach; | ||
649 | } | 660 | } |
650 | break; | 661 | break; |
651 | case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO: | 662 | case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO: |
652 | dev->dvb.frontend = dvb_attach(zl10353_attach, | 663 | dev->dvb.frontend = dvb_attach(zl10353_attach, |
653 | &dvico_fusionhdtv_xc3028, | 664 | &dvico_fusionhdtv_xc3028, |
654 | &dev->core->i2c_adap); | 665 | &core->i2c_adap); |
655 | if (dev->dvb.frontend == NULL) | 666 | if (dev->dvb.frontend == NULL) |
656 | dev->dvb.frontend = dvb_attach(mt352_attach, | 667 | dev->dvb.frontend = dvb_attach(mt352_attach, |
657 | &dvico_fusionhdtv_mt352_xc3028, | 668 | &dvico_fusionhdtv_mt352_xc3028, |
658 | &dev->core->i2c_adap); | 669 | &core->i2c_adap); |
659 | /* | 670 | /* |
660 | * On this board, the demod provides the I2C bus pullup. | 671 | * On this board, the demod provides the I2C bus pullup. |
661 | * We must not permit gate_ctrl to be performed, or | 672 | * We must not permit gate_ctrl to be performed, or |
@@ -668,19 +679,18 @@ static int dvb_register(struct cx8802_dev *dev) | |||
668 | break; | 679 | break; |
669 | case CX88_BOARD_PCHDTV_HD3000: | 680 | case CX88_BOARD_PCHDTV_HD3000: |
670 | dev->dvb.frontend = dvb_attach(or51132_attach, &pchdtv_hd3000, | 681 | dev->dvb.frontend = dvb_attach(or51132_attach, &pchdtv_hd3000, |
671 | &dev->core->i2c_adap); | 682 | &core->i2c_adap); |
672 | if (dev->dvb.frontend != NULL) { | 683 | if (dev->dvb.frontend != NULL) { |
673 | dvb_attach(simple_tuner_attach, dev->dvb.frontend, | 684 | if (!dvb_attach(simple_tuner_attach, dev->dvb.frontend, |
674 | &dev->core->i2c_adap, 0x61, | 685 | &core->i2c_adap, 0x61, |
675 | TUNER_THOMSON_DTT761X); | 686 | TUNER_THOMSON_DTT761X)) |
687 | goto frontend_detach; | ||
676 | } | 688 | } |
677 | break; | 689 | break; |
678 | case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q: | 690 | case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q: |
679 | dev->ts_gen_cntrl = 0x08; | 691 | dev->ts_gen_cntrl = 0x08; |
680 | { | ||
681 | /* Do a hardware reset of chip before using it. */ | ||
682 | struct cx88_core *core = dev->core; | ||
683 | 692 | ||
693 | /* Do a hardware reset of chip before using it. */ | ||
684 | cx_clear(MO_GP0_IO, 1); | 694 | cx_clear(MO_GP0_IO, 1); |
685 | mdelay(100); | 695 | mdelay(100); |
686 | cx_set(MO_GP0_IO, 1); | 696 | cx_set(MO_GP0_IO, 1); |
@@ -690,139 +700,137 @@ static int dvb_register(struct cx8802_dev *dev) | |||
690 | fusionhdtv_3_gold.pll_rf_set = lgdt330x_pll_rf_set; | 700 | fusionhdtv_3_gold.pll_rf_set = lgdt330x_pll_rf_set; |
691 | dev->dvb.frontend = dvb_attach(lgdt330x_attach, | 701 | dev->dvb.frontend = dvb_attach(lgdt330x_attach, |
692 | &fusionhdtv_3_gold, | 702 | &fusionhdtv_3_gold, |
693 | &dev->core->i2c_adap); | 703 | &core->i2c_adap); |
694 | if (dev->dvb.frontend != NULL) { | 704 | if (dev->dvb.frontend != NULL) { |
695 | dvb_attach(simple_tuner_attach, dev->dvb.frontend, | 705 | if (!dvb_attach(simple_tuner_attach, dev->dvb.frontend, |
696 | &dev->core->i2c_adap, 0x61, | 706 | &core->i2c_adap, 0x61, |
697 | TUNER_MICROTUNE_4042FI5); | 707 | TUNER_MICROTUNE_4042FI5)) |
698 | } | 708 | goto frontend_detach; |
699 | } | 709 | } |
700 | break; | 710 | break; |
701 | case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T: | 711 | case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T: |
702 | dev->ts_gen_cntrl = 0x08; | 712 | dev->ts_gen_cntrl = 0x08; |
703 | { | ||
704 | /* Do a hardware reset of chip before using it. */ | ||
705 | struct cx88_core *core = dev->core; | ||
706 | 713 | ||
714 | /* Do a hardware reset of chip before using it. */ | ||
707 | cx_clear(MO_GP0_IO, 1); | 715 | cx_clear(MO_GP0_IO, 1); |
708 | mdelay(100); | 716 | mdelay(100); |
709 | cx_set(MO_GP0_IO, 9); | 717 | cx_set(MO_GP0_IO, 9); |
710 | mdelay(200); | 718 | mdelay(200); |
711 | dev->dvb.frontend = dvb_attach(lgdt330x_attach, | 719 | dev->dvb.frontend = dvb_attach(lgdt330x_attach, |
712 | &fusionhdtv_3_gold, | 720 | &fusionhdtv_3_gold, |
713 | &dev->core->i2c_adap); | 721 | &core->i2c_adap); |
714 | if (dev->dvb.frontend != NULL) { | 722 | if (dev->dvb.frontend != NULL) { |
715 | dvb_attach(simple_tuner_attach, dev->dvb.frontend, | 723 | if (!dvb_attach(simple_tuner_attach, dev->dvb.frontend, |
716 | &dev->core->i2c_adap, 0x61, | 724 | &core->i2c_adap, 0x61, |
717 | TUNER_THOMSON_DTT761X); | 725 | TUNER_THOMSON_DTT761X)) |
718 | } | 726 | goto frontend_detach; |
719 | } | 727 | } |
720 | break; | 728 | break; |
721 | case CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD: | 729 | case CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD: |
722 | dev->ts_gen_cntrl = 0x08; | 730 | dev->ts_gen_cntrl = 0x08; |
723 | { | ||
724 | /* Do a hardware reset of chip before using it. */ | ||
725 | struct cx88_core *core = dev->core; | ||
726 | 731 | ||
732 | /* Do a hardware reset of chip before using it. */ | ||
727 | cx_clear(MO_GP0_IO, 1); | 733 | cx_clear(MO_GP0_IO, 1); |
728 | mdelay(100); | 734 | mdelay(100); |
729 | cx_set(MO_GP0_IO, 1); | 735 | cx_set(MO_GP0_IO, 1); |
730 | mdelay(200); | 736 | mdelay(200); |
731 | dev->dvb.frontend = dvb_attach(lgdt330x_attach, | 737 | dev->dvb.frontend = dvb_attach(lgdt330x_attach, |
732 | &fusionhdtv_5_gold, | 738 | &fusionhdtv_5_gold, |
733 | &dev->core->i2c_adap); | 739 | &core->i2c_adap); |
734 | if (dev->dvb.frontend != NULL) { | 740 | if (dev->dvb.frontend != NULL) { |
735 | dvb_attach(simple_tuner_attach, dev->dvb.frontend, | 741 | if (!dvb_attach(simple_tuner_attach, dev->dvb.frontend, |
736 | &dev->core->i2c_adap, 0x61, | 742 | &core->i2c_adap, 0x61, |
737 | TUNER_LG_TDVS_H06XF); | 743 | TUNER_LG_TDVS_H06XF)) |
738 | dvb_attach(tda9887_attach, dev->dvb.frontend, | 744 | goto frontend_detach; |
739 | &dev->core->i2c_adap, 0x43); | 745 | if (!dvb_attach(tda9887_attach, dev->dvb.frontend, |
740 | } | 746 | &core->i2c_adap, 0x43)) |
747 | goto frontend_detach; | ||
741 | } | 748 | } |
742 | break; | 749 | break; |
743 | case CX88_BOARD_PCHDTV_HD5500: | 750 | case CX88_BOARD_PCHDTV_HD5500: |
744 | dev->ts_gen_cntrl = 0x08; | 751 | dev->ts_gen_cntrl = 0x08; |
745 | { | ||
746 | /* Do a hardware reset of chip before using it. */ | ||
747 | struct cx88_core *core = dev->core; | ||
748 | 752 | ||
753 | /* Do a hardware reset of chip before using it. */ | ||
749 | cx_clear(MO_GP0_IO, 1); | 754 | cx_clear(MO_GP0_IO, 1); |
750 | mdelay(100); | 755 | mdelay(100); |
751 | cx_set(MO_GP0_IO, 1); | 756 | cx_set(MO_GP0_IO, 1); |
752 | mdelay(200); | 757 | mdelay(200); |
753 | dev->dvb.frontend = dvb_attach(lgdt330x_attach, | 758 | dev->dvb.frontend = dvb_attach(lgdt330x_attach, |
754 | &pchdtv_hd5500, | 759 | &pchdtv_hd5500, |
755 | &dev->core->i2c_adap); | 760 | &core->i2c_adap); |
756 | if (dev->dvb.frontend != NULL) { | 761 | if (dev->dvb.frontend != NULL) { |
757 | dvb_attach(simple_tuner_attach, dev->dvb.frontend, | 762 | if (!dvb_attach(simple_tuner_attach, dev->dvb.frontend, |
758 | &dev->core->i2c_adap, 0x61, | 763 | &core->i2c_adap, 0x61, |
759 | TUNER_LG_TDVS_H06XF); | 764 | TUNER_LG_TDVS_H06XF)) |
760 | dvb_attach(tda9887_attach, dev->dvb.frontend, | 765 | goto frontend_detach; |
761 | &dev->core->i2c_adap, 0x43); | 766 | if (!dvb_attach(tda9887_attach, dev->dvb.frontend, |
762 | } | 767 | &core->i2c_adap, 0x43)) |
768 | goto frontend_detach; | ||
763 | } | 769 | } |
764 | break; | 770 | break; |
765 | case CX88_BOARD_ATI_HDTVWONDER: | 771 | case CX88_BOARD_ATI_HDTVWONDER: |
766 | dev->dvb.frontend = dvb_attach(nxt200x_attach, | 772 | dev->dvb.frontend = dvb_attach(nxt200x_attach, |
767 | &ati_hdtvwonder, | 773 | &ati_hdtvwonder, |
768 | &dev->core->i2c_adap); | 774 | &core->i2c_adap); |
769 | if (dev->dvb.frontend != NULL) { | 775 | if (dev->dvb.frontend != NULL) { |
770 | dvb_attach(simple_tuner_attach, dev->dvb.frontend, | 776 | if (!dvb_attach(simple_tuner_attach, dev->dvb.frontend, |
771 | &dev->core->i2c_adap, 0x61, | 777 | &core->i2c_adap, 0x61, |
772 | TUNER_PHILIPS_TUV1236D); | 778 | TUNER_PHILIPS_TUV1236D)) |
779 | goto frontend_detach; | ||
773 | } | 780 | } |
774 | break; | 781 | break; |
775 | case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1: | 782 | case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1: |
776 | case CX88_BOARD_HAUPPAUGE_NOVASE2_S1: | 783 | case CX88_BOARD_HAUPPAUGE_NOVASE2_S1: |
777 | dev->dvb.frontend = dvb_attach(cx24123_attach, | 784 | dev->dvb.frontend = dvb_attach(cx24123_attach, |
778 | &hauppauge_novas_config, | 785 | &hauppauge_novas_config, |
779 | &dev->core->i2c_adap); | 786 | &core->i2c_adap); |
780 | if (dev->dvb.frontend) { | 787 | if (dev->dvb.frontend) { |
781 | dvb_attach(isl6421_attach, dev->dvb.frontend, | 788 | if (!dvb_attach(isl6421_attach, dev->dvb.frontend, |
782 | &dev->core->i2c_adap, 0x08, 0x00, 0x00); | 789 | &core->i2c_adap, 0x08, 0x00, 0x00)) |
790 | goto frontend_detach; | ||
783 | } | 791 | } |
784 | break; | 792 | break; |
785 | case CX88_BOARD_KWORLD_DVBS_100: | 793 | case CX88_BOARD_KWORLD_DVBS_100: |
786 | dev->dvb.frontend = dvb_attach(cx24123_attach, | 794 | dev->dvb.frontend = dvb_attach(cx24123_attach, |
787 | &kworld_dvbs_100_config, | 795 | &kworld_dvbs_100_config, |
788 | &dev->core->i2c_adap); | 796 | &core->i2c_adap); |
789 | if (dev->dvb.frontend) { | 797 | if (dev->dvb.frontend) { |
790 | dev->core->prev_set_voltage = dev->dvb.frontend->ops.set_voltage; | 798 | core->prev_set_voltage = dev->dvb.frontend->ops.set_voltage; |
791 | dev->dvb.frontend->ops.set_voltage = kworld_dvbs_100_set_voltage; | 799 | dev->dvb.frontend->ops.set_voltage = kworld_dvbs_100_set_voltage; |
792 | } | 800 | } |
793 | break; | 801 | break; |
794 | case CX88_BOARD_GENIATECH_DVBS: | 802 | case CX88_BOARD_GENIATECH_DVBS: |
795 | dev->dvb.frontend = dvb_attach(cx24123_attach, | 803 | dev->dvb.frontend = dvb_attach(cx24123_attach, |
796 | &geniatech_dvbs_config, | 804 | &geniatech_dvbs_config, |
797 | &dev->core->i2c_adap); | 805 | &core->i2c_adap); |
798 | if (dev->dvb.frontend) { | 806 | if (dev->dvb.frontend) { |
799 | dev->core->prev_set_voltage = dev->dvb.frontend->ops.set_voltage; | 807 | core->prev_set_voltage = dev->dvb.frontend->ops.set_voltage; |
800 | dev->dvb.frontend->ops.set_voltage = geniatech_dvbs_set_voltage; | 808 | dev->dvb.frontend->ops.set_voltage = geniatech_dvbs_set_voltage; |
801 | } | 809 | } |
802 | break; | 810 | break; |
803 | case CX88_BOARD_PINNACLE_PCTV_HD_800i: | 811 | case CX88_BOARD_PINNACLE_PCTV_HD_800i: |
804 | dev->dvb.frontend = dvb_attach(s5h1409_attach, | 812 | dev->dvb.frontend = dvb_attach(s5h1409_attach, |
805 | &pinnacle_pctv_hd_800i_config, | 813 | &pinnacle_pctv_hd_800i_config, |
806 | &dev->core->i2c_adap); | 814 | &core->i2c_adap); |
807 | if (dev->dvb.frontend != NULL) { | 815 | if (dev->dvb.frontend != NULL) { |
808 | /* tuner_config.video_dev must point to | 816 | /* tuner_config.video_dev must point to |
809 | * i2c_adap.algo_data | 817 | * i2c_adap.algo_data |
810 | */ | 818 | */ |
811 | pinnacle_pctv_hd_800i_tuner_config.priv = | 819 | if (!dvb_attach(xc5000_attach, dev->dvb.frontend, |
812 | dev->core->i2c_adap.algo_data; | 820 | &core->i2c_adap, |
813 | dvb_attach(xc5000_attach, dev->dvb.frontend, | 821 | &pinnacle_pctv_hd_800i_tuner_config, |
814 | &dev->core->i2c_adap, | 822 | core->i2c_adap.algo_data)) |
815 | &pinnacle_pctv_hd_800i_tuner_config); | 823 | goto frontend_detach; |
816 | } | 824 | } |
817 | break; | 825 | break; |
818 | case CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO: | 826 | case CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO: |
819 | dev->dvb.frontend = dvb_attach(s5h1409_attach, | 827 | dev->dvb.frontend = dvb_attach(s5h1409_attach, |
820 | &dvico_hdtv5_pci_nano_config, | 828 | &dvico_hdtv5_pci_nano_config, |
821 | &dev->core->i2c_adap); | 829 | &core->i2c_adap); |
822 | if (dev->dvb.frontend != NULL) { | 830 | if (dev->dvb.frontend != NULL) { |
823 | struct dvb_frontend *fe; | 831 | struct dvb_frontend *fe; |
824 | struct xc2028_config cfg = { | 832 | struct xc2028_config cfg = { |
825 | .i2c_adap = &dev->core->i2c_adap, | 833 | .i2c_adap = &core->i2c_adap, |
826 | .i2c_addr = 0x61, | 834 | .i2c_addr = 0x61, |
827 | .callback = cx88_pci_nano_callback, | 835 | .callback = cx88_pci_nano_callback, |
828 | }; | 836 | }; |
@@ -841,50 +849,50 @@ static int dvb_register(struct cx8802_dev *dev) | |||
841 | case CX88_BOARD_PINNACLE_HYBRID_PCTV: | 849 | case CX88_BOARD_PINNACLE_HYBRID_PCTV: |
842 | dev->dvb.frontend = dvb_attach(zl10353_attach, | 850 | dev->dvb.frontend = dvb_attach(zl10353_attach, |
843 | &cx88_geniatech_x8000_mt, | 851 | &cx88_geniatech_x8000_mt, |
844 | &dev->core->i2c_adap); | 852 | &core->i2c_adap); |
845 | if (attach_xc3028(0x61, dev) < 0) | 853 | if (attach_xc3028(0x61, dev) < 0) |
846 | return -EINVAL; | 854 | goto frontend_detach; |
847 | break; | 855 | break; |
848 | case CX88_BOARD_GENIATECH_X8000_MT: | 856 | case CX88_BOARD_GENIATECH_X8000_MT: |
849 | dev->ts_gen_cntrl = 0x00; | 857 | dev->ts_gen_cntrl = 0x00; |
850 | 858 | ||
851 | dev->dvb.frontend = dvb_attach(zl10353_attach, | 859 | dev->dvb.frontend = dvb_attach(zl10353_attach, |
852 | &cx88_geniatech_x8000_mt, | 860 | &cx88_geniatech_x8000_mt, |
853 | &dev->core->i2c_adap); | 861 | &core->i2c_adap); |
854 | if (attach_xc3028(0x61, dev) < 0) | 862 | if (attach_xc3028(0x61, dev) < 0) |
855 | return -EINVAL; | 863 | goto frontend_detach; |
856 | break; | 864 | break; |
857 | case CX88_BOARD_KWORLD_ATSC_120: | 865 | case CX88_BOARD_KWORLD_ATSC_120: |
858 | dev->dvb.frontend = dvb_attach(s5h1409_attach, | 866 | dev->dvb.frontend = dvb_attach(s5h1409_attach, |
859 | &kworld_atsc_120_config, | 867 | &kworld_atsc_120_config, |
860 | &dev->core->i2c_adap); | 868 | &core->i2c_adap); |
861 | if (attach_xc3028(0x61, dev) < 0) | 869 | if (attach_xc3028(0x61, dev) < 0) |
862 | return -EINVAL; | 870 | goto frontend_detach; |
863 | break; | 871 | break; |
864 | case CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD: | 872 | case CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD: |
865 | dev->dvb.frontend = dvb_attach(s5h1411_attach, | 873 | dev->dvb.frontend = dvb_attach(s5h1411_attach, |
866 | &dvico_fusionhdtv7_config, | 874 | &dvico_fusionhdtv7_config, |
867 | &dev->core->i2c_adap); | 875 | &core->i2c_adap); |
868 | if (dev->dvb.frontend != NULL) { | 876 | if (dev->dvb.frontend != NULL) { |
869 | /* tuner_config.video_dev must point to | 877 | /* tuner_config.video_dev must point to |
870 | * i2c_adap.algo_data | 878 | * i2c_adap.algo_data |
871 | */ | 879 | */ |
872 | dvico_fusionhdtv7_tuner_config.priv = | 880 | if (!dvb_attach(xc5000_attach, dev->dvb.frontend, |
873 | dev->core->i2c_adap.algo_data; | 881 | &core->i2c_adap, |
874 | dvb_attach(xc5000_attach, dev->dvb.frontend, | 882 | &dvico_fusionhdtv7_tuner_config, |
875 | &dev->core->i2c_adap, | 883 | core->i2c_adap.algo_data)) |
876 | &dvico_fusionhdtv7_tuner_config); | 884 | goto frontend_detach; |
877 | } | 885 | } |
878 | break; | 886 | break; |
879 | default: | 887 | default: |
880 | printk(KERN_ERR "%s/2: The frontend of your DVB/ATSC card isn't supported yet\n", | 888 | printk(KERN_ERR "%s/2: The frontend of your DVB/ATSC card isn't supported yet\n", |
881 | dev->core->name); | 889 | core->name); |
882 | break; | 890 | break; |
883 | } | 891 | } |
884 | if (NULL == dev->dvb.frontend) { | 892 | if (NULL == dev->dvb.frontend) { |
885 | printk(KERN_ERR | 893 | printk(KERN_ERR |
886 | "%s/2: frontend initialization failed\n", | 894 | "%s/2: frontend initialization failed\n", |
887 | dev->core->name); | 895 | core->name); |
888 | return -EINVAL; | 896 | return -EINVAL; |
889 | } | 897 | } |
890 | 898 | ||
@@ -892,11 +900,18 @@ static int dvb_register(struct cx8802_dev *dev) | |||
892 | dev->dvb.frontend->ops.ts_bus_ctrl = cx88_dvb_bus_ctrl; | 900 | dev->dvb.frontend->ops.ts_bus_ctrl = cx88_dvb_bus_ctrl; |
893 | 901 | ||
894 | /* Put the analog decoder in standby to keep it quiet */ | 902 | /* Put the analog decoder in standby to keep it quiet */ |
895 | cx88_call_i2c_clients (dev->core, TUNER_SET_STANDBY, NULL); | 903 | cx88_call_i2c_clients(core, TUNER_SET_STANDBY, NULL); |
896 | 904 | ||
897 | /* register everything */ | 905 | /* register everything */ |
898 | return videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev, | 906 | return videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev, |
899 | &dev->pci->dev, adapter_nr); | 907 | &dev->pci->dev, adapter_nr); |
908 | |||
909 | frontend_detach: | ||
910 | if (dev->dvb.frontend) { | ||
911 | dvb_frontend_detach(dev->dvb.frontend); | ||
912 | dev->dvb.frontend = NULL; | ||
913 | } | ||
914 | return -EINVAL; | ||
900 | } | 915 | } |
901 | 916 | ||
902 | /* ----------------------------------------------------------- */ | 917 | /* ----------------------------------------------------------- */ |
diff --git a/drivers/media/video/em28xx/Kconfig b/drivers/media/video/em28xx/Kconfig index c7c2896bbd8b..16a5af30e9d1 100644 --- a/drivers/media/video/em28xx/Kconfig +++ b/drivers/media/video/em28xx/Kconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | config VIDEO_EM28XX | 1 | config VIDEO_EM28XX |
2 | tristate "Empia EM28xx USB video capture support" | 2 | tristate "Empia EM28xx USB video capture support" |
3 | depends on VIDEO_DEV && I2C && INPUT | 3 | depends on VIDEO_DEV && I2C && INPUT |
4 | select MEDIA_TUNER | 4 | select VIDEO_TUNER |
5 | select VIDEO_TVEEPROM | 5 | select VIDEO_TVEEPROM |
6 | select VIDEO_IR | 6 | select VIDEO_IR |
7 | select VIDEOBUF_VMALLOC | 7 | select VIDEOBUF_VMALLOC |
@@ -35,7 +35,6 @@ config VIDEO_EM28XX_DVB | |||
35 | select DVB_LGDT330X if !DVB_FE_CUSTOMISE | 35 | select DVB_LGDT330X if !DVB_FE_CUSTOMISE |
36 | select DVB_ZL10353 if !DVB_FE_CUSTOMISE | 36 | select DVB_ZL10353 if !DVB_FE_CUSTOMISE |
37 | select VIDEOBUF_DVB | 37 | select VIDEOBUF_DVB |
38 | select FW_LOADER | ||
39 | ---help--- | 38 | ---help--- |
40 | This adds support for DVB cards based on the | 39 | This adds support for DVB cards based on the |
41 | Empiatech em28xx chips. | 40 | Empiatech em28xx chips. |
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index 50ccf3771204..3e4f3c7e92e7 100644 --- a/drivers/media/video/em28xx/em28xx-cards.c +++ b/drivers/media/video/em28xx/em28xx-cards.c | |||
@@ -420,7 +420,13 @@ struct usb_device_id em28xx_id_table [] = { | |||
420 | .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 }, | 420 | .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 }, |
421 | { USB_DEVICE(0x2040, 0x6502), | 421 | { USB_DEVICE(0x2040, 0x6502), |
422 | .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 }, | 422 | .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 }, |
423 | { USB_DEVICE(0x2040, 0x6513), | 423 | { USB_DEVICE(0x2040, 0x6513), /* HCW HVR-980 */ |
424 | .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950 }, | ||
425 | { USB_DEVICE(0x2040, 0x6517), /* HP HVR-950 */ | ||
426 | .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950 }, | ||
427 | { USB_DEVICE(0x2040, 0x651b), /* RP HVR-950 */ | ||
428 | .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950 }, | ||
429 | { USB_DEVICE(0x2040, 0x651f), /* HCW HVR-850 */ | ||
424 | .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950 }, | 430 | .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950 }, |
425 | { USB_DEVICE(0x0ccd, 0x0042), | 431 | { USB_DEVICE(0x0ccd, 0x0042), |
426 | .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS }, | 432 | .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS }, |
diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c index 7df81575b7f2..8cf4983f0039 100644 --- a/drivers/media/video/em28xx/em28xx-dvb.c +++ b/drivers/media/video/em28xx/em28xx-dvb.c | |||
@@ -251,7 +251,6 @@ static int attach_xc3028(u8 addr, struct em28xx *dev) | |||
251 | printk(KERN_ERR "%s/2: xc3028 attach failed\n", | 251 | printk(KERN_ERR "%s/2: xc3028 attach failed\n", |
252 | dev->name); | 252 | dev->name); |
253 | dvb_frontend_detach(dev->dvb->frontend); | 253 | dvb_frontend_detach(dev->dvb->frontend); |
254 | dvb_unregister_frontend(dev->dvb->frontend); | ||
255 | dev->dvb->frontend = NULL; | 254 | dev->dvb->frontend = NULL; |
256 | return -EINVAL; | 255 | return -EINVAL; |
257 | } | 256 | } |
diff --git a/drivers/media/video/ivtv/Kconfig b/drivers/media/video/ivtv/Kconfig index eec115bf9517..5d7ee8fcdd50 100644 --- a/drivers/media/video/ivtv/Kconfig +++ b/drivers/media/video/ivtv/Kconfig | |||
@@ -1,10 +1,12 @@ | |||
1 | config VIDEO_IVTV | 1 | config VIDEO_IVTV |
2 | tristate "Conexant cx23416/cx23415 MPEG encoder/decoder support" | 2 | tristate "Conexant cx23416/cx23415 MPEG encoder/decoder support" |
3 | depends on VIDEO_V4L1 && VIDEO_V4L2 && PCI && I2C && EXPERIMENTAL | 3 | depends on VIDEO_V4L1 && VIDEO_V4L2 && PCI && I2C && EXPERIMENTAL |
4 | depends on INPUT # due to VIDEO_IR | ||
5 | depends on HOTPLUG # due to FW_LOADER | ||
4 | select I2C_ALGOBIT | 6 | select I2C_ALGOBIT |
5 | select FW_LOADER | 7 | select FW_LOADER |
6 | select VIDEO_IR | 8 | select VIDEO_IR |
7 | select MEDIA_TUNER | 9 | select VIDEO_TUNER |
8 | select VIDEO_TVEEPROM | 10 | select VIDEO_TVEEPROM |
9 | select VIDEO_CX2341X | 11 | select VIDEO_CX2341X |
10 | select VIDEO_CX25840 | 12 | select VIDEO_CX25840 |
diff --git a/drivers/media/video/ivtv/ivtv-controls.c b/drivers/media/video/ivtv/ivtv-controls.c index 8c02fa661591..c7e449f6397b 100644 --- a/drivers/media/video/ivtv/ivtv-controls.c +++ b/drivers/media/video/ivtv/ivtv-controls.c | |||
@@ -181,12 +181,12 @@ static int ivtv_setup_vbi_fmt(struct ivtv *itv, enum v4l2_mpeg_stream_vbi_fmt fm | |||
181 | return 0; | 181 | return 0; |
182 | } | 182 | } |
183 | /* Need sliced data for mpeg insertion */ | 183 | /* Need sliced data for mpeg insertion */ |
184 | if (get_service_set(itv->vbi.sliced_in) == 0) { | 184 | if (ivtv_get_service_set(itv->vbi.sliced_in) == 0) { |
185 | if (itv->is_60hz) | 185 | if (itv->is_60hz) |
186 | itv->vbi.sliced_in->service_set = V4L2_SLICED_CAPTION_525; | 186 | itv->vbi.sliced_in->service_set = V4L2_SLICED_CAPTION_525; |
187 | else | 187 | else |
188 | itv->vbi.sliced_in->service_set = V4L2_SLICED_WSS_625; | 188 | itv->vbi.sliced_in->service_set = V4L2_SLICED_WSS_625; |
189 | expand_service_set(itv->vbi.sliced_in, itv->is_50hz); | 189 | ivtv_expand_service_set(itv->vbi.sliced_in, itv->is_50hz); |
190 | } | 190 | } |
191 | return 0; | 191 | return 0; |
192 | } | 192 | } |
diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c index ed020f722b05..797e636771da 100644 --- a/drivers/media/video/ivtv/ivtv-driver.c +++ b/drivers/media/video/ivtv/ivtv-driver.c | |||
@@ -853,6 +853,7 @@ static int ivtv_setup_pci(struct ivtv *itv, struct pci_dev *dev, | |||
853 | return 0; | 853 | return 0; |
854 | } | 854 | } |
855 | 855 | ||
856 | #ifdef MODULE | ||
856 | static u32 ivtv_request_module(struct ivtv *itv, u32 hw, | 857 | static u32 ivtv_request_module(struct ivtv *itv, u32 hw, |
857 | const char *name, u32 id) | 858 | const char *name, u32 id) |
858 | { | 859 | { |
@@ -865,12 +866,14 @@ static u32 ivtv_request_module(struct ivtv *itv, u32 hw, | |||
865 | IVTV_DEBUG_INFO("Loaded module %s\n", name); | 866 | IVTV_DEBUG_INFO("Loaded module %s\n", name); |
866 | return hw; | 867 | return hw; |
867 | } | 868 | } |
869 | #endif | ||
868 | 870 | ||
869 | static void ivtv_load_and_init_modules(struct ivtv *itv) | 871 | static void ivtv_load_and_init_modules(struct ivtv *itv) |
870 | { | 872 | { |
871 | u32 hw = itv->card->hw_all; | 873 | u32 hw = itv->card->hw_all; |
872 | unsigned i; | 874 | unsigned i; |
873 | 875 | ||
876 | #ifdef MODULE | ||
874 | /* load modules */ | 877 | /* load modules */ |
875 | #ifndef CONFIG_MEDIA_TUNER | 878 | #ifndef CONFIG_MEDIA_TUNER |
876 | hw = ivtv_request_module(itv, hw, "tuner", IVTV_HW_TUNER); | 879 | hw = ivtv_request_module(itv, hw, "tuner", IVTV_HW_TUNER); |
@@ -911,6 +914,7 @@ static void ivtv_load_and_init_modules(struct ivtv *itv) | |||
911 | #ifndef CONFIG_VIDEO_M52790 | 914 | #ifndef CONFIG_VIDEO_M52790 |
912 | hw = ivtv_request_module(itv, hw, "m52790", IVTV_HW_M52790); | 915 | hw = ivtv_request_module(itv, hw, "m52790", IVTV_HW_M52790); |
913 | #endif | 916 | #endif |
917 | #endif | ||
914 | 918 | ||
915 | /* check which i2c devices are actually found */ | 919 | /* check which i2c devices are actually found */ |
916 | for (i = 0; i < 32; i++) { | 920 | for (i = 0; i < 32; i++) { |
@@ -1228,7 +1232,7 @@ static int __devinit ivtv_probe(struct pci_dev *dev, | |||
1228 | return 0; | 1232 | return 0; |
1229 | 1233 | ||
1230 | free_streams: | 1234 | free_streams: |
1231 | ivtv_streams_cleanup(itv); | 1235 | ivtv_streams_cleanup(itv, 1); |
1232 | free_irq: | 1236 | free_irq: |
1233 | free_irq(itv->dev->irq, (void *)itv); | 1237 | free_irq(itv->dev->irq, (void *)itv); |
1234 | free_i2c: | 1238 | free_i2c: |
@@ -1373,7 +1377,7 @@ static void ivtv_remove(struct pci_dev *pci_dev) | |||
1373 | flush_workqueue(itv->irq_work_queues); | 1377 | flush_workqueue(itv->irq_work_queues); |
1374 | destroy_workqueue(itv->irq_work_queues); | 1378 | destroy_workqueue(itv->irq_work_queues); |
1375 | 1379 | ||
1376 | ivtv_streams_cleanup(itv); | 1380 | ivtv_streams_cleanup(itv, 1); |
1377 | ivtv_udma_free(itv); | 1381 | ivtv_udma_free(itv); |
1378 | 1382 | ||
1379 | exit_ivtv_i2c(itv); | 1383 | exit_ivtv_i2c(itv); |
diff --git a/drivers/media/video/ivtv/ivtv-fileops.c b/drivers/media/video/ivtv/ivtv-fileops.c index 2b74b0ab1477..f2fa434b677b 100644 --- a/drivers/media/video/ivtv/ivtv-fileops.c +++ b/drivers/media/video/ivtv/ivtv-fileops.c | |||
@@ -987,6 +987,8 @@ int ivtv_v4l2_open(struct inode *inode, struct file *filp) | |||
987 | /* Find which card this open was on */ | 987 | /* Find which card this open was on */ |
988 | spin_lock(&ivtv_cards_lock); | 988 | spin_lock(&ivtv_cards_lock); |
989 | for (x = 0; itv == NULL && x < ivtv_cards_active; x++) { | 989 | for (x = 0; itv == NULL && x < ivtv_cards_active; x++) { |
990 | if (ivtv_cards[x] == NULL) | ||
991 | continue; | ||
990 | /* find out which stream this open was on */ | 992 | /* find out which stream this open was on */ |
991 | for (y = 0; y < IVTV_MAX_STREAMS; y++) { | 993 | for (y = 0; y < IVTV_MAX_STREAMS; y++) { |
992 | s = &ivtv_cards[x]->streams[y]; | 994 | s = &ivtv_cards[x]->streams[y]; |
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c index d508b5d0538c..26cc0f6699fd 100644 --- a/drivers/media/video/ivtv/ivtv-ioctl.c +++ b/drivers/media/video/ivtv/ivtv-ioctl.c | |||
@@ -38,7 +38,7 @@ | |||
38 | #include <linux/dvb/audio.h> | 38 | #include <linux/dvb/audio.h> |
39 | #include <linux/i2c-id.h> | 39 | #include <linux/i2c-id.h> |
40 | 40 | ||
41 | u16 service2vbi(int type) | 41 | u16 ivtv_service2vbi(int type) |
42 | { | 42 | { |
43 | switch (type) { | 43 | switch (type) { |
44 | case V4L2_SLICED_TELETEXT_B: | 44 | case V4L2_SLICED_TELETEXT_B: |
@@ -88,7 +88,7 @@ static u16 select_service_from_set(int field, int line, u16 set, int is_pal) | |||
88 | return 0; | 88 | return 0; |
89 | } | 89 | } |
90 | 90 | ||
91 | void expand_service_set(struct v4l2_sliced_vbi_format *fmt, int is_pal) | 91 | void ivtv_expand_service_set(struct v4l2_sliced_vbi_format *fmt, int is_pal) |
92 | { | 92 | { |
93 | u16 set = fmt->service_set; | 93 | u16 set = fmt->service_set; |
94 | int f, l; | 94 | int f, l; |
@@ -115,7 +115,7 @@ static int check_service_set(struct v4l2_sliced_vbi_format *fmt, int is_pal) | |||
115 | return set != 0; | 115 | return set != 0; |
116 | } | 116 | } |
117 | 117 | ||
118 | u16 get_service_set(struct v4l2_sliced_vbi_format *fmt) | 118 | u16 ivtv_get_service_set(struct v4l2_sliced_vbi_format *fmt) |
119 | { | 119 | { |
120 | int f, l; | 120 | int f, l; |
121 | u16 set = 0; | 121 | u16 set = 0; |
@@ -466,7 +466,7 @@ static int ivtv_get_fmt(struct ivtv *itv, int streamtype, struct v4l2_format *fm | |||
466 | vbifmt->service_lines[0][23] = V4L2_SLICED_WSS_625; | 466 | vbifmt->service_lines[0][23] = V4L2_SLICED_WSS_625; |
467 | vbifmt->service_lines[0][16] = V4L2_SLICED_VPS; | 467 | vbifmt->service_lines[0][16] = V4L2_SLICED_VPS; |
468 | } | 468 | } |
469 | vbifmt->service_set = get_service_set(vbifmt); | 469 | vbifmt->service_set = ivtv_get_service_set(vbifmt); |
470 | break; | 470 | break; |
471 | } | 471 | } |
472 | 472 | ||
@@ -481,12 +481,12 @@ static int ivtv_get_fmt(struct ivtv *itv, int streamtype, struct v4l2_format *fm | |||
481 | if (streamtype == IVTV_DEC_STREAM_TYPE_VBI) { | 481 | if (streamtype == IVTV_DEC_STREAM_TYPE_VBI) { |
482 | vbifmt->service_set = itv->is_50hz ? V4L2_SLICED_VBI_625 : | 482 | vbifmt->service_set = itv->is_50hz ? V4L2_SLICED_VBI_625 : |
483 | V4L2_SLICED_VBI_525; | 483 | V4L2_SLICED_VBI_525; |
484 | expand_service_set(vbifmt, itv->is_50hz); | 484 | ivtv_expand_service_set(vbifmt, itv->is_50hz); |
485 | break; | 485 | break; |
486 | } | 486 | } |
487 | 487 | ||
488 | itv->video_dec_func(itv, VIDIOC_G_FMT, fmt); | 488 | itv->video_dec_func(itv, VIDIOC_G_FMT, fmt); |
489 | vbifmt->service_set = get_service_set(vbifmt); | 489 | vbifmt->service_set = ivtv_get_service_set(vbifmt); |
490 | break; | 490 | break; |
491 | } | 491 | } |
492 | case V4L2_BUF_TYPE_VBI_OUTPUT: | 492 | case V4L2_BUF_TYPE_VBI_OUTPUT: |
@@ -640,9 +640,9 @@ static int ivtv_try_or_set_fmt(struct ivtv *itv, int streamtype, | |||
640 | memset(vbifmt->reserved, 0, sizeof(vbifmt->reserved)); | 640 | memset(vbifmt->reserved, 0, sizeof(vbifmt->reserved)); |
641 | 641 | ||
642 | if (vbifmt->service_set) | 642 | if (vbifmt->service_set) |
643 | expand_service_set(vbifmt, itv->is_50hz); | 643 | ivtv_expand_service_set(vbifmt, itv->is_50hz); |
644 | set = check_service_set(vbifmt, itv->is_50hz); | 644 | set = check_service_set(vbifmt, itv->is_50hz); |
645 | vbifmt->service_set = get_service_set(vbifmt); | 645 | vbifmt->service_set = ivtv_get_service_set(vbifmt); |
646 | 646 | ||
647 | if (!set_fmt) | 647 | if (!set_fmt) |
648 | return 0; | 648 | return 0; |
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.h b/drivers/media/video/ivtv/ivtv-ioctl.h index a03351b6853d..4e67f0ed1fc0 100644 --- a/drivers/media/video/ivtv/ivtv-ioctl.h +++ b/drivers/media/video/ivtv/ivtv-ioctl.h | |||
@@ -21,9 +21,9 @@ | |||
21 | #ifndef IVTV_IOCTL_H | 21 | #ifndef IVTV_IOCTL_H |
22 | #define IVTV_IOCTL_H | 22 | #define IVTV_IOCTL_H |
23 | 23 | ||
24 | u16 service2vbi(int type); | 24 | u16 ivtv_service2vbi(int type); |
25 | void expand_service_set(struct v4l2_sliced_vbi_format *fmt, int is_pal); | 25 | void ivtv_expand_service_set(struct v4l2_sliced_vbi_format *fmt, int is_pal); |
26 | u16 get_service_set(struct v4l2_sliced_vbi_format *fmt); | 26 | u16 ivtv_get_service_set(struct v4l2_sliced_vbi_format *fmt); |
27 | int ivtv_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | 27 | int ivtv_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, |
28 | unsigned long arg); | 28 | unsigned long arg); |
29 | int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void *arg); | 29 | int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void *arg); |
diff --git a/drivers/media/video/ivtv/ivtv-queue.c b/drivers/media/video/ivtv/ivtv-queue.c index 3e1deec67a5e..fc8b1eaa333b 100644 --- a/drivers/media/video/ivtv/ivtv-queue.c +++ b/drivers/media/video/ivtv/ivtv-queue.c | |||
@@ -203,14 +203,14 @@ int ivtv_stream_alloc(struct ivtv_stream *s) | |||
203 | s->dma != PCI_DMA_NONE ? "DMA " : "", | 203 | s->dma != PCI_DMA_NONE ? "DMA " : "", |
204 | s->name, s->buffers, s->buf_size, s->buffers * s->buf_size / 1024); | 204 | s->name, s->buffers, s->buf_size, s->buffers * s->buf_size / 1024); |
205 | 205 | ||
206 | s->sg_pending = kzalloc(SGsize, GFP_KERNEL); | 206 | s->sg_pending = kzalloc(SGsize, GFP_KERNEL|__GFP_NOWARN); |
207 | if (s->sg_pending == NULL) { | 207 | if (s->sg_pending == NULL) { |
208 | IVTV_ERR("Could not allocate sg_pending for %s stream\n", s->name); | 208 | IVTV_ERR("Could not allocate sg_pending for %s stream\n", s->name); |
209 | return -ENOMEM; | 209 | return -ENOMEM; |
210 | } | 210 | } |
211 | s->sg_pending_size = 0; | 211 | s->sg_pending_size = 0; |
212 | 212 | ||
213 | s->sg_processing = kzalloc(SGsize, GFP_KERNEL); | 213 | s->sg_processing = kzalloc(SGsize, GFP_KERNEL|__GFP_NOWARN); |
214 | if (s->sg_processing == NULL) { | 214 | if (s->sg_processing == NULL) { |
215 | IVTV_ERR("Could not allocate sg_processing for %s stream\n", s->name); | 215 | IVTV_ERR("Could not allocate sg_processing for %s stream\n", s->name); |
216 | kfree(s->sg_pending); | 216 | kfree(s->sg_pending); |
@@ -219,7 +219,8 @@ int ivtv_stream_alloc(struct ivtv_stream *s) | |||
219 | } | 219 | } |
220 | s->sg_processing_size = 0; | 220 | s->sg_processing_size = 0; |
221 | 221 | ||
222 | s->sg_dma = kzalloc(sizeof(struct ivtv_sg_element), GFP_KERNEL); | 222 | s->sg_dma = kzalloc(sizeof(struct ivtv_sg_element), |
223 | GFP_KERNEL|__GFP_NOWARN); | ||
223 | if (s->sg_dma == NULL) { | 224 | if (s->sg_dma == NULL) { |
224 | IVTV_ERR("Could not allocate sg_dma for %s stream\n", s->name); | 225 | IVTV_ERR("Could not allocate sg_dma for %s stream\n", s->name); |
225 | kfree(s->sg_pending); | 226 | kfree(s->sg_pending); |
@@ -235,11 +236,12 @@ int ivtv_stream_alloc(struct ivtv_stream *s) | |||
235 | 236 | ||
236 | /* allocate stream buffers. Initially all buffers are in q_free. */ | 237 | /* allocate stream buffers. Initially all buffers are in q_free. */ |
237 | for (i = 0; i < s->buffers; i++) { | 238 | for (i = 0; i < s->buffers; i++) { |
238 | struct ivtv_buffer *buf = kzalloc(sizeof(struct ivtv_buffer), GFP_KERNEL); | 239 | struct ivtv_buffer *buf = kzalloc(sizeof(struct ivtv_buffer), |
240 | GFP_KERNEL|__GFP_NOWARN); | ||
239 | 241 | ||
240 | if (buf == NULL) | 242 | if (buf == NULL) |
241 | break; | 243 | break; |
242 | buf->buf = kmalloc(s->buf_size + 256, GFP_KERNEL); | 244 | buf->buf = kmalloc(s->buf_size + 256, GFP_KERNEL|__GFP_NOWARN); |
243 | if (buf->buf == NULL) { | 245 | if (buf->buf == NULL) { |
244 | kfree(buf); | 246 | kfree(buf); |
245 | break; | 247 | break; |
diff --git a/drivers/media/video/ivtv/ivtv-streams.c b/drivers/media/video/ivtv/ivtv-streams.c index 4ab8d36831ba..c47c2b945147 100644 --- a/drivers/media/video/ivtv/ivtv-streams.c +++ b/drivers/media/video/ivtv/ivtv-streams.c | |||
@@ -244,7 +244,7 @@ int ivtv_streams_setup(struct ivtv *itv) | |||
244 | return 0; | 244 | return 0; |
245 | 245 | ||
246 | /* One or more streams could not be initialized. Clean 'em all up. */ | 246 | /* One or more streams could not be initialized. Clean 'em all up. */ |
247 | ivtv_streams_cleanup(itv); | 247 | ivtv_streams_cleanup(itv, 0); |
248 | return -ENOMEM; | 248 | return -ENOMEM; |
249 | } | 249 | } |
250 | 250 | ||
@@ -304,12 +304,12 @@ int ivtv_streams_register(struct ivtv *itv) | |||
304 | return 0; | 304 | return 0; |
305 | 305 | ||
306 | /* One or more streams could not be initialized. Clean 'em all up. */ | 306 | /* One or more streams could not be initialized. Clean 'em all up. */ |
307 | ivtv_streams_cleanup(itv); | 307 | ivtv_streams_cleanup(itv, 1); |
308 | return -ENOMEM; | 308 | return -ENOMEM; |
309 | } | 309 | } |
310 | 310 | ||
311 | /* Unregister v4l2 devices */ | 311 | /* Unregister v4l2 devices */ |
312 | void ivtv_streams_cleanup(struct ivtv *itv) | 312 | void ivtv_streams_cleanup(struct ivtv *itv, int unregister) |
313 | { | 313 | { |
314 | int type; | 314 | int type; |
315 | 315 | ||
@@ -322,8 +322,11 @@ void ivtv_streams_cleanup(struct ivtv *itv) | |||
322 | continue; | 322 | continue; |
323 | 323 | ||
324 | ivtv_stream_free(&itv->streams[type]); | 324 | ivtv_stream_free(&itv->streams[type]); |
325 | /* Unregister device */ | 325 | /* Unregister or release device */ |
326 | video_unregister_device(vdev); | 326 | if (unregister) |
327 | video_unregister_device(vdev); | ||
328 | else | ||
329 | video_device_release(vdev); | ||
327 | } | 330 | } |
328 | } | 331 | } |
329 | 332 | ||
diff --git a/drivers/media/video/ivtv/ivtv-streams.h b/drivers/media/video/ivtv/ivtv-streams.h index 3d76a415fbd8..a653a5136417 100644 --- a/drivers/media/video/ivtv/ivtv-streams.h +++ b/drivers/media/video/ivtv/ivtv-streams.h | |||
@@ -23,7 +23,7 @@ | |||
23 | 23 | ||
24 | int ivtv_streams_setup(struct ivtv *itv); | 24 | int ivtv_streams_setup(struct ivtv *itv); |
25 | int ivtv_streams_register(struct ivtv *itv); | 25 | int ivtv_streams_register(struct ivtv *itv); |
26 | void ivtv_streams_cleanup(struct ivtv *itv); | 26 | void ivtv_streams_cleanup(struct ivtv *itv, int unregister); |
27 | 27 | ||
28 | /* Capture related */ | 28 | /* Capture related */ |
29 | int ivtv_start_v4l2_encode_stream(struct ivtv_stream *s); | 29 | int ivtv_start_v4l2_encode_stream(struct ivtv_stream *s); |
diff --git a/drivers/media/video/ivtv/ivtv-vbi.c b/drivers/media/video/ivtv/ivtv-vbi.c index c151bcf5519a..71798f0da27f 100644 --- a/drivers/media/video/ivtv/ivtv-vbi.c +++ b/drivers/media/video/ivtv/ivtv-vbi.c | |||
@@ -169,7 +169,8 @@ static void copy_vbi_data(struct ivtv *itv, int lines, u32 pts_stamp) | |||
169 | linemask[0] |= (1 << l); | 169 | linemask[0] |= (1 << l); |
170 | else | 170 | else |
171 | linemask[1] |= (1 << (l - 32)); | 171 | linemask[1] |= (1 << (l - 32)); |
172 | dst[sd + 12 + line * 43] = service2vbi(itv->vbi.sliced_data[i].id); | 172 | dst[sd + 12 + line * 43] = |
173 | ivtv_service2vbi(itv->vbi.sliced_data[i].id); | ||
173 | memcpy(dst + sd + 12 + line * 43 + 1, itv->vbi.sliced_data[i].data, 42); | 174 | memcpy(dst + sd + 12 + line * 43 + 1, itv->vbi.sliced_data[i].data, 42); |
174 | line++; | 175 | line++; |
175 | } | 176 | } |
diff --git a/drivers/media/video/ivtv/ivtv-yuv.c b/drivers/media/video/ivtv/ivtv-yuv.c index 62f70bd5e3cb..a9417f6e4087 100644 --- a/drivers/media/video/ivtv/ivtv-yuv.c +++ b/drivers/media/video/ivtv/ivtv-yuv.c | |||
@@ -908,7 +908,7 @@ static void ivtv_yuv_init(struct ivtv *itv) | |||
908 | } | 908 | } |
909 | 909 | ||
910 | /* We need a buffer for blanking when Y plane is offset - non-fatal if we can't get one */ | 910 | /* We need a buffer for blanking when Y plane is offset - non-fatal if we can't get one */ |
911 | yi->blanking_ptr = kzalloc(720 * 16, GFP_KERNEL); | 911 | yi->blanking_ptr = kzalloc(720 * 16, GFP_KERNEL|__GFP_NOWARN); |
912 | if (yi->blanking_ptr) { | 912 | if (yi->blanking_ptr) { |
913 | yi->blanking_dmaptr = pci_map_single(itv->dev, yi->blanking_ptr, 720*16, PCI_DMA_TODEVICE); | 913 | yi->blanking_dmaptr = pci_map_single(itv->dev, yi->blanking_ptr, 720*16, PCI_DMA_TODEVICE); |
914 | } else { | 914 | } else { |
diff --git a/drivers/media/video/ivtv/ivtvfb.c b/drivers/media/video/ivtv/ivtvfb.c index df789f683e63..73be154f7f05 100644 --- a/drivers/media/video/ivtv/ivtvfb.c +++ b/drivers/media/video/ivtv/ivtvfb.c | |||
@@ -948,7 +948,8 @@ static int ivtvfb_init_vidmode(struct ivtv *itv) | |||
948 | } | 948 | } |
949 | 949 | ||
950 | /* Allocate the pseudo palette */ | 950 | /* Allocate the pseudo palette */ |
951 | oi->ivtvfb_info.pseudo_palette = kmalloc(sizeof(u32) * 16, GFP_KERNEL); | 951 | oi->ivtvfb_info.pseudo_palette = |
952 | kmalloc(sizeof(u32) * 16, GFP_KERNEL|__GFP_NOWARN); | ||
952 | 953 | ||
953 | if (!oi->ivtvfb_info.pseudo_palette) { | 954 | if (!oi->ivtvfb_info.pseudo_palette) { |
954 | IVTVFB_ERR("abort, unable to alloc pseudo pallete\n"); | 955 | IVTVFB_ERR("abort, unable to alloc pseudo pallete\n"); |
@@ -1056,7 +1057,8 @@ static int ivtvfb_init_card(struct ivtv *itv) | |||
1056 | return -EBUSY; | 1057 | return -EBUSY; |
1057 | } | 1058 | } |
1058 | 1059 | ||
1059 | itv->osd_info = kzalloc(sizeof(struct osd_info), GFP_ATOMIC); | 1060 | itv->osd_info = kzalloc(sizeof(struct osd_info), |
1061 | GFP_ATOMIC|__GFP_NOWARN); | ||
1060 | if (itv->osd_info == NULL) { | 1062 | if (itv->osd_info == NULL) { |
1061 | IVTVFB_ERR("Failed to allocate memory for osd_info\n"); | 1063 | IVTVFB_ERR("Failed to allocate memory for osd_info\n"); |
1062 | return -ENOMEM; | 1064 | return -ENOMEM; |
diff --git a/drivers/media/video/mt9m001.c b/drivers/media/video/mt9m001.c index 179e47049a45..ee43499544c1 100644 --- a/drivers/media/video/mt9m001.c +++ b/drivers/media/video/mt9m001.c | |||
@@ -12,15 +12,12 @@ | |||
12 | #include <linux/slab.h> | 12 | #include <linux/slab.h> |
13 | #include <linux/i2c.h> | 13 | #include <linux/i2c.h> |
14 | #include <linux/log2.h> | 14 | #include <linux/log2.h> |
15 | #include <linux/gpio.h> | ||
15 | 16 | ||
16 | #include <media/v4l2-common.h> | 17 | #include <media/v4l2-common.h> |
17 | #include <media/v4l2-chip-ident.h> | 18 | #include <media/v4l2-chip-ident.h> |
18 | #include <media/soc_camera.h> | 19 | #include <media/soc_camera.h> |
19 | 20 | ||
20 | #ifdef CONFIG_MT9M001_PCA9536_SWITCH | ||
21 | #include <asm/gpio.h> | ||
22 | #endif | ||
23 | |||
24 | /* mt9m001 i2c address 0x5d | 21 | /* mt9m001 i2c address 0x5d |
25 | * The platform has to define i2c_board_info | 22 | * The platform has to define i2c_board_info |
26 | * and call i2c_register_board_info() */ | 23 | * and call i2c_register_board_info() */ |
diff --git a/drivers/media/video/mt9v022.c b/drivers/media/video/mt9v022.c index d1391ac55096..1658fe590392 100644 --- a/drivers/media/video/mt9v022.c +++ b/drivers/media/video/mt9v022.c | |||
@@ -13,15 +13,12 @@ | |||
13 | #include <linux/i2c.h> | 13 | #include <linux/i2c.h> |
14 | #include <linux/delay.h> | 14 | #include <linux/delay.h> |
15 | #include <linux/log2.h> | 15 | #include <linux/log2.h> |
16 | #include <linux/gpio.h> | ||
16 | 17 | ||
17 | #include <media/v4l2-common.h> | 18 | #include <media/v4l2-common.h> |
18 | #include <media/v4l2-chip-ident.h> | 19 | #include <media/v4l2-chip-ident.h> |
19 | #include <media/soc_camera.h> | 20 | #include <media/soc_camera.h> |
20 | 21 | ||
21 | #ifdef CONFIG_MT9M001_PCA9536_SWITCH | ||
22 | #include <asm/gpio.h> | ||
23 | #endif | ||
24 | |||
25 | /* mt9v022 i2c address 0x48, 0x4c, 0x58, 0x5c | 22 | /* mt9v022 i2c address 0x48, 0x4c, 0x58, 0x5c |
26 | * The platform has to define i2c_board_info | 23 | * The platform has to define i2c_board_info |
27 | * and call i2c_register_board_info() */ | 24 | * and call i2c_register_board_info() */ |
@@ -91,7 +88,7 @@ static const struct soc_camera_data_format mt9v022_monochrome_formats[] = { | |||
91 | struct mt9v022 { | 88 | struct mt9v022 { |
92 | struct i2c_client *client; | 89 | struct i2c_client *client; |
93 | struct soc_camera_device icd; | 90 | struct soc_camera_device icd; |
94 | int model; /* V4L2_IDENT_MT9M001* codes from v4l2-chip-ident.h */ | 91 | int model; /* V4L2_IDENT_MT9V022* codes from v4l2-chip-ident.h */ |
95 | int switch_gpio; | 92 | int switch_gpio; |
96 | u16 chip_control; | 93 | u16 chip_control; |
97 | unsigned char datawidth; | 94 | unsigned char datawidth; |
diff --git a/drivers/media/video/pvrusb2/Kconfig b/drivers/media/video/pvrusb2/Kconfig index 9620c67fae77..4482b2c72ced 100644 --- a/drivers/media/video/pvrusb2/Kconfig +++ b/drivers/media/video/pvrusb2/Kconfig | |||
@@ -1,8 +1,10 @@ | |||
1 | config VIDEO_PVRUSB2 | 1 | config VIDEO_PVRUSB2 |
2 | tristate "Hauppauge WinTV-PVR USB2 support" | 2 | tristate "Hauppauge WinTV-PVR USB2 support" |
3 | depends on VIDEO_V4L2 && I2C | 3 | depends on VIDEO_V4L2 && I2C |
4 | depends on VIDEO_MEDIA # Avoids pvrusb = Y / DVB = M | ||
5 | depends on HOTPLUG # due to FW_LOADER | ||
4 | select FW_LOADER | 6 | select FW_LOADER |
5 | select MEDIA_TUNER | 7 | select VIDEO_TUNER |
6 | select VIDEO_TVEEPROM | 8 | select VIDEO_TVEEPROM |
7 | select VIDEO_CX2341X | 9 | select VIDEO_CX2341X |
8 | select VIDEO_SAA711X | 10 | select VIDEO_SAA711X |
diff --git a/drivers/media/video/saa7134/Kconfig b/drivers/media/video/saa7134/Kconfig index 40e4c3bd2cb9..83f076abce35 100644 --- a/drivers/media/video/saa7134/Kconfig +++ b/drivers/media/video/saa7134/Kconfig | |||
@@ -3,7 +3,7 @@ config VIDEO_SAA7134 | |||
3 | depends on VIDEO_DEV && PCI && I2C && INPUT | 3 | depends on VIDEO_DEV && PCI && I2C && INPUT |
4 | select VIDEOBUF_DMA_SG | 4 | select VIDEOBUF_DMA_SG |
5 | select VIDEO_IR | 5 | select VIDEO_IR |
6 | select MEDIA_TUNER | 6 | select VIDEO_TUNER |
7 | select VIDEO_TVEEPROM | 7 | select VIDEO_TVEEPROM |
8 | select CRC32 | 8 | select CRC32 |
9 | ---help--- | 9 | ---help--- |
@@ -27,6 +27,7 @@ config VIDEO_SAA7134_ALSA | |||
27 | config VIDEO_SAA7134_DVB | 27 | config VIDEO_SAA7134_DVB |
28 | tristate "DVB/ATSC Support for saa7134 based TV cards" | 28 | tristate "DVB/ATSC Support for saa7134 based TV cards" |
29 | depends on VIDEO_SAA7134 && DVB_CORE | 29 | depends on VIDEO_SAA7134 && DVB_CORE |
30 | depends on HOTPLUG # due to FW_LOADER | ||
30 | select VIDEOBUF_DVB | 31 | select VIDEOBUF_DVB |
31 | select FW_LOADER | 32 | select FW_LOADER |
32 | select DVB_PLL if !DVB_FE_CUSTOMISE | 33 | select DVB_PLL if !DVB_FE_CUSTOMISE |
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c index eec127864fe3..2c19cd0113c8 100644 --- a/drivers/media/video/saa7134/saa7134-core.c +++ b/drivers/media/video/saa7134/saa7134-core.c | |||
@@ -864,7 +864,6 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, | |||
864 | struct saa7134_dev *dev; | 864 | struct saa7134_dev *dev; |
865 | struct saa7134_mpeg_ops *mops; | 865 | struct saa7134_mpeg_ops *mops; |
866 | int err; | 866 | int err; |
867 | int mask; | ||
868 | 867 | ||
869 | if (saa7134_devcount == SAA7134_MAXBOARDS) | 868 | if (saa7134_devcount == SAA7134_MAXBOARDS) |
870 | return -ENOMEM; | 869 | return -ENOMEM; |
@@ -1065,11 +1064,6 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, | |||
1065 | if (TUNER_ABSENT != dev->tuner_type) | 1064 | if (TUNER_ABSENT != dev->tuner_type) |
1066 | saa7134_i2c_call_clients(dev, TUNER_SET_STANDBY, NULL); | 1065 | saa7134_i2c_call_clients(dev, TUNER_SET_STANDBY, NULL); |
1067 | 1066 | ||
1068 | if (card(dev).gpiomask != 0) { | ||
1069 | mask = card(dev).gpiomask; | ||
1070 | saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, mask, mask); | ||
1071 | saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, mask, 0); | ||
1072 | } | ||
1073 | return 0; | 1067 | return 0; |
1074 | 1068 | ||
1075 | fail4: | 1069 | fail4: |
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c index 2d16be2259db..469f93aac008 100644 --- a/drivers/media/video/saa7134/saa7134-dvb.c +++ b/drivers/media/video/saa7134/saa7134-dvb.c | |||
@@ -538,19 +538,23 @@ static int philips_tda827x_tuner_sleep(struct dvb_frontend *fe) | |||
538 | return 0; | 538 | return 0; |
539 | } | 539 | } |
540 | 540 | ||
541 | static void configure_tda827x_fe(struct saa7134_dev *dev, struct tda1004x_config *cdec_conf, | 541 | static int configure_tda827x_fe(struct saa7134_dev *dev, |
542 | struct tda827x_config *tuner_conf) | 542 | struct tda1004x_config *cdec_conf, |
543 | struct tda827x_config *tuner_conf) | ||
543 | { | 544 | { |
544 | dev->dvb.frontend = dvb_attach(tda10046_attach, cdec_conf, &dev->i2c_adap); | 545 | dev->dvb.frontend = dvb_attach(tda10046_attach, cdec_conf, &dev->i2c_adap); |
545 | if (dev->dvb.frontend) { | 546 | if (dev->dvb.frontend) { |
546 | if (cdec_conf->i2c_gate) | 547 | if (cdec_conf->i2c_gate) |
547 | dev->dvb.frontend->ops.i2c_gate_ctrl = tda8290_i2c_gate_ctrl; | 548 | dev->dvb.frontend->ops.i2c_gate_ctrl = tda8290_i2c_gate_ctrl; |
548 | if (dvb_attach(tda827x_attach, dev->dvb.frontend, cdec_conf->tuner_address, | 549 | if (dvb_attach(tda827x_attach, dev->dvb.frontend, |
549 | &dev->i2c_adap, tuner_conf) == NULL) { | 550 | cdec_conf->tuner_address, |
550 | wprintk("no tda827x tuner found at addr: %02x\n", | 551 | &dev->i2c_adap, tuner_conf)) |
552 | return 0; | ||
553 | |||
554 | wprintk("no tda827x tuner found at addr: %02x\n", | ||
551 | cdec_conf->tuner_address); | 555 | cdec_conf->tuner_address); |
552 | } | ||
553 | } | 556 | } |
557 | return -EINVAL; | ||
554 | } | 558 | } |
555 | 559 | ||
556 | /* ------------------------------------------------------------------ */ | 560 | /* ------------------------------------------------------------------ */ |
@@ -997,7 +1001,9 @@ static int dvb_init(struct saa7134_dev *dev) | |||
997 | break; | 1001 | break; |
998 | case SAA7134_BOARD_FLYDVBTDUO: | 1002 | case SAA7134_BOARD_FLYDVBTDUO: |
999 | case SAA7134_BOARD_FLYDVBT_DUO_CARDBUS: | 1003 | case SAA7134_BOARD_FLYDVBT_DUO_CARDBUS: |
1000 | configure_tda827x_fe(dev, &tda827x_lifeview_config, &tda827x_cfg_0); | 1004 | if (configure_tda827x_fe(dev, &tda827x_lifeview_config, |
1005 | &tda827x_cfg_0) < 0) | ||
1006 | goto dettach_frontend; | ||
1001 | break; | 1007 | break; |
1002 | case SAA7134_BOARD_PHILIPS_EUROPA: | 1008 | case SAA7134_BOARD_PHILIPS_EUROPA: |
1003 | case SAA7134_BOARD_VIDEOMATE_DVBT_300: | 1009 | case SAA7134_BOARD_VIDEOMATE_DVBT_300: |
@@ -1022,36 +1028,52 @@ static int dvb_init(struct saa7134_dev *dev) | |||
1022 | } | 1028 | } |
1023 | break; | 1029 | break; |
1024 | case SAA7134_BOARD_KWORLD_DVBT_210: | 1030 | case SAA7134_BOARD_KWORLD_DVBT_210: |
1025 | configure_tda827x_fe(dev, &kworld_dvb_t_210_config, &tda827x_cfg_2); | 1031 | if (configure_tda827x_fe(dev, &kworld_dvb_t_210_config, |
1032 | &tda827x_cfg_2) < 0) | ||
1033 | goto dettach_frontend; | ||
1026 | break; | 1034 | break; |
1027 | case SAA7134_BOARD_PHILIPS_TIGER: | 1035 | case SAA7134_BOARD_PHILIPS_TIGER: |
1028 | configure_tda827x_fe(dev, &philips_tiger_config, &tda827x_cfg_0); | 1036 | if (configure_tda827x_fe(dev, &philips_tiger_config, |
1037 | &tda827x_cfg_0) < 0) | ||
1038 | goto dettach_frontend; | ||
1029 | break; | 1039 | break; |
1030 | case SAA7134_BOARD_PINNACLE_PCTV_310i: | 1040 | case SAA7134_BOARD_PINNACLE_PCTV_310i: |
1031 | configure_tda827x_fe(dev, &pinnacle_pctv_310i_config, &tda827x_cfg_1); | 1041 | if (configure_tda827x_fe(dev, &pinnacle_pctv_310i_config, |
1042 | &tda827x_cfg_1) < 0) | ||
1043 | goto dettach_frontend; | ||
1032 | break; | 1044 | break; |
1033 | case SAA7134_BOARD_HAUPPAUGE_HVR1110: | 1045 | case SAA7134_BOARD_HAUPPAUGE_HVR1110: |
1034 | configure_tda827x_fe(dev, &hauppauge_hvr_1110_config, &tda827x_cfg_1); | 1046 | if (configure_tda827x_fe(dev, &hauppauge_hvr_1110_config, |
1047 | &tda827x_cfg_1) < 0) | ||
1048 | goto dettach_frontend; | ||
1035 | break; | 1049 | break; |
1036 | case SAA7134_BOARD_ASUSTeK_P7131_DUAL: | 1050 | case SAA7134_BOARD_ASUSTeK_P7131_DUAL: |
1037 | configure_tda827x_fe(dev, &asus_p7131_dual_config, &tda827x_cfg_0); | 1051 | if (configure_tda827x_fe(dev, &asus_p7131_dual_config, |
1052 | &tda827x_cfg_0) < 0) | ||
1053 | goto dettach_frontend; | ||
1038 | break; | 1054 | break; |
1039 | case SAA7134_BOARD_FLYDVBT_LR301: | 1055 | case SAA7134_BOARD_FLYDVBT_LR301: |
1040 | configure_tda827x_fe(dev, &tda827x_lifeview_config, &tda827x_cfg_0); | 1056 | if (configure_tda827x_fe(dev, &tda827x_lifeview_config, |
1057 | &tda827x_cfg_0) < 0) | ||
1058 | goto dettach_frontend; | ||
1041 | break; | 1059 | break; |
1042 | case SAA7134_BOARD_FLYDVB_TRIO: | 1060 | case SAA7134_BOARD_FLYDVB_TRIO: |
1043 | if(! use_frontend) { /* terrestrial */ | 1061 | if (!use_frontend) { /* terrestrial */ |
1044 | configure_tda827x_fe(dev, &lifeview_trio_config, &tda827x_cfg_0); | 1062 | if (configure_tda827x_fe(dev, &lifeview_trio_config, |
1063 | &tda827x_cfg_0) < 0) | ||
1064 | goto dettach_frontend; | ||
1045 | } else { /* satellite */ | 1065 | } else { /* satellite */ |
1046 | dev->dvb.frontend = dvb_attach(tda10086_attach, &flydvbs, &dev->i2c_adap); | 1066 | dev->dvb.frontend = dvb_attach(tda10086_attach, &flydvbs, &dev->i2c_adap); |
1047 | if (dev->dvb.frontend) { | 1067 | if (dev->dvb.frontend) { |
1048 | if (dvb_attach(tda826x_attach, dev->dvb.frontend, 0x63, | 1068 | if (dvb_attach(tda826x_attach, dev->dvb.frontend, 0x63, |
1049 | &dev->i2c_adap, 0) == NULL) { | 1069 | &dev->i2c_adap, 0) == NULL) { |
1050 | wprintk("%s: Lifeview Trio, No tda826x found!\n", __func__); | 1070 | wprintk("%s: Lifeview Trio, No tda826x found!\n", __func__); |
1071 | goto dettach_frontend; | ||
1051 | } | 1072 | } |
1052 | if (dvb_attach(isl6421_attach, dev->dvb.frontend, &dev->i2c_adap, | 1073 | if (dvb_attach(isl6421_attach, dev->dvb.frontend, &dev->i2c_adap, |
1053 | 0x08, 0, 0) == NULL) { | 1074 | 0x08, 0, 0) == NULL) { |
1054 | wprintk("%s: Lifeview Trio, No ISL6421 found!\n", __func__); | 1075 | wprintk("%s: Lifeview Trio, No ISL6421 found!\n", __func__); |
1076 | goto dettach_frontend; | ||
1055 | } | 1077 | } |
1056 | } | 1078 | } |
1057 | } | 1079 | } |
@@ -1067,15 +1089,20 @@ static int dvb_init(struct saa7134_dev *dev) | |||
1067 | &ads_duo_cfg) == NULL) { | 1089 | &ads_duo_cfg) == NULL) { |
1068 | wprintk("no tda827x tuner found at addr: %02x\n", | 1090 | wprintk("no tda827x tuner found at addr: %02x\n", |
1069 | ads_tech_duo_config.tuner_address); | 1091 | ads_tech_duo_config.tuner_address); |
1092 | goto dettach_frontend; | ||
1070 | } | 1093 | } |
1071 | } | 1094 | } |
1072 | break; | 1095 | break; |
1073 | case SAA7134_BOARD_TEVION_DVBT_220RF: | 1096 | case SAA7134_BOARD_TEVION_DVBT_220RF: |
1074 | configure_tda827x_fe(dev, &tevion_dvbt220rf_config, &tda827x_cfg_0); | 1097 | if (configure_tda827x_fe(dev, &tevion_dvbt220rf_config, |
1098 | &tda827x_cfg_0) < 0) | ||
1099 | goto dettach_frontend; | ||
1075 | break; | 1100 | break; |
1076 | case SAA7134_BOARD_MEDION_MD8800_QUADRO: | 1101 | case SAA7134_BOARD_MEDION_MD8800_QUADRO: |
1077 | if (!use_frontend) { /* terrestrial */ | 1102 | if (!use_frontend) { /* terrestrial */ |
1078 | configure_tda827x_fe(dev, &md8800_dvbt_config, &tda827x_cfg_0); | 1103 | if (configure_tda827x_fe(dev, &md8800_dvbt_config, |
1104 | &tda827x_cfg_0) < 0) | ||
1105 | goto dettach_frontend; | ||
1079 | } else { /* satellite */ | 1106 | } else { /* satellite */ |
1080 | dev->dvb.frontend = dvb_attach(tda10086_attach, | 1107 | dev->dvb.frontend = dvb_attach(tda10086_attach, |
1081 | &flydvbs, &dev->i2c_adap); | 1108 | &flydvbs, &dev->i2c_adap); |
@@ -1086,16 +1113,20 @@ static int dvb_init(struct saa7134_dev *dev) | |||
1086 | struct i2c_msg msg = {.addr = 0x08, .flags = 0, .len = 1}; | 1113 | struct i2c_msg msg = {.addr = 0x08, .flags = 0, .len = 1}; |
1087 | 1114 | ||
1088 | if (dvb_attach(tda826x_attach, dev->dvb.frontend, | 1115 | if (dvb_attach(tda826x_attach, dev->dvb.frontend, |
1089 | 0x60, &dev->i2c_adap, 0) == NULL) | 1116 | 0x60, &dev->i2c_adap, 0) == NULL) { |
1090 | wprintk("%s: Medion Quadro, no tda826x " | 1117 | wprintk("%s: Medion Quadro, no tda826x " |
1091 | "found !\n", __func__); | 1118 | "found !\n", __func__); |
1119 | goto dettach_frontend; | ||
1120 | } | ||
1092 | if (dev_id != 0x08) { | 1121 | if (dev_id != 0x08) { |
1093 | /* we need to open the i2c gate (we know it exists) */ | 1122 | /* we need to open the i2c gate (we know it exists) */ |
1094 | fe->ops.i2c_gate_ctrl(fe, 1); | 1123 | fe->ops.i2c_gate_ctrl(fe, 1); |
1095 | if (dvb_attach(isl6405_attach, fe, | 1124 | if (dvb_attach(isl6405_attach, fe, |
1096 | &dev->i2c_adap, 0x08, 0, 0) == NULL) | 1125 | &dev->i2c_adap, 0x08, 0, 0) == NULL) { |
1097 | wprintk("%s: Medion Quadro, no ISL6405 " | 1126 | wprintk("%s: Medion Quadro, no ISL6405 " |
1098 | "found !\n", __func__); | 1127 | "found !\n", __func__); |
1128 | goto dettach_frontend; | ||
1129 | } | ||
1099 | if (dev_id == 0x07) { | 1130 | if (dev_id == 0x07) { |
1100 | /* fire up the 2nd section of the LNB supply since | 1131 | /* fire up the 2nd section of the LNB supply since |
1101 | we can't do this from the other section */ | 1132 | we can't do this from the other section */ |
@@ -1117,19 +1148,17 @@ static int dvb_init(struct saa7134_dev *dev) | |||
1117 | case SAA7134_BOARD_AVERMEDIA_AVERTVHD_A180: | 1148 | case SAA7134_BOARD_AVERMEDIA_AVERTVHD_A180: |
1118 | dev->dvb.frontend = dvb_attach(nxt200x_attach, &avertvhda180, | 1149 | dev->dvb.frontend = dvb_attach(nxt200x_attach, &avertvhda180, |
1119 | &dev->i2c_adap); | 1150 | &dev->i2c_adap); |
1120 | if (dev->dvb.frontend) { | 1151 | if (dev->dvb.frontend) |
1121 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, | 1152 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, |
1122 | NULL, DVB_PLL_TDHU2); | 1153 | NULL, DVB_PLL_TDHU2); |
1123 | } | ||
1124 | break; | 1154 | break; |
1125 | case SAA7134_BOARD_KWORLD_ATSC110: | 1155 | case SAA7134_BOARD_KWORLD_ATSC110: |
1126 | dev->dvb.frontend = dvb_attach(nxt200x_attach, &kworldatsc110, | 1156 | dev->dvb.frontend = dvb_attach(nxt200x_attach, &kworldatsc110, |
1127 | &dev->i2c_adap); | 1157 | &dev->i2c_adap); |
1128 | if (dev->dvb.frontend) { | 1158 | if (dev->dvb.frontend) |
1129 | dvb_attach(simple_tuner_attach, dev->dvb.frontend, | 1159 | dvb_attach(simple_tuner_attach, dev->dvb.frontend, |
1130 | &dev->i2c_adap, 0x61, | 1160 | &dev->i2c_adap, 0x61, |
1131 | TUNER_PHILIPS_TUV1236D); | 1161 | TUNER_PHILIPS_TUV1236D); |
1132 | } | ||
1133 | break; | 1162 | break; |
1134 | case SAA7134_BOARD_FLYDVBS_LR300: | 1163 | case SAA7134_BOARD_FLYDVBS_LR300: |
1135 | dev->dvb.frontend = dvb_attach(tda10086_attach, &flydvbs, | 1164 | dev->dvb.frontend = dvb_attach(tda10086_attach, &flydvbs, |
@@ -1138,10 +1167,12 @@ static int dvb_init(struct saa7134_dev *dev) | |||
1138 | if (dvb_attach(tda826x_attach, dev->dvb.frontend, 0x60, | 1167 | if (dvb_attach(tda826x_attach, dev->dvb.frontend, 0x60, |
1139 | &dev->i2c_adap, 0) == NULL) { | 1168 | &dev->i2c_adap, 0) == NULL) { |
1140 | wprintk("%s: No tda826x found!\n", __func__); | 1169 | wprintk("%s: No tda826x found!\n", __func__); |
1170 | goto dettach_frontend; | ||
1141 | } | 1171 | } |
1142 | if (dvb_attach(isl6421_attach, dev->dvb.frontend, | 1172 | if (dvb_attach(isl6421_attach, dev->dvb.frontend, |
1143 | &dev->i2c_adap, 0x08, 0, 0) == NULL) { | 1173 | &dev->i2c_adap, 0x08, 0, 0) == NULL) { |
1144 | wprintk("%s: No ISL6421 found!\n", __func__); | 1174 | wprintk("%s: No ISL6421 found!\n", __func__); |
1175 | goto dettach_frontend; | ||
1145 | } | 1176 | } |
1146 | } | 1177 | } |
1147 | break; | 1178 | break; |
@@ -1168,43 +1199,65 @@ static int dvb_init(struct saa7134_dev *dev) | |||
1168 | } | 1199 | } |
1169 | break; | 1200 | break; |
1170 | case SAA7134_BOARD_CINERGY_HT_PCMCIA: | 1201 | case SAA7134_BOARD_CINERGY_HT_PCMCIA: |
1171 | configure_tda827x_fe(dev, &cinergy_ht_config, &tda827x_cfg_0); | 1202 | if (configure_tda827x_fe(dev, &cinergy_ht_config, |
1203 | &tda827x_cfg_0) < 0) | ||
1204 | goto dettach_frontend; | ||
1172 | break; | 1205 | break; |
1173 | case SAA7134_BOARD_CINERGY_HT_PCI: | 1206 | case SAA7134_BOARD_CINERGY_HT_PCI: |
1174 | configure_tda827x_fe(dev, &cinergy_ht_pci_config, &tda827x_cfg_0); | 1207 | if (configure_tda827x_fe(dev, &cinergy_ht_pci_config, |
1208 | &tda827x_cfg_0) < 0) | ||
1209 | goto dettach_frontend; | ||
1175 | break; | 1210 | break; |
1176 | case SAA7134_BOARD_PHILIPS_TIGER_S: | 1211 | case SAA7134_BOARD_PHILIPS_TIGER_S: |
1177 | configure_tda827x_fe(dev, &philips_tiger_s_config, &tda827x_cfg_2); | 1212 | if (configure_tda827x_fe(dev, &philips_tiger_s_config, |
1213 | &tda827x_cfg_2) < 0) | ||
1214 | goto dettach_frontend; | ||
1178 | break; | 1215 | break; |
1179 | case SAA7134_BOARD_ASUS_P7131_4871: | 1216 | case SAA7134_BOARD_ASUS_P7131_4871: |
1180 | configure_tda827x_fe(dev, &asus_p7131_4871_config, &tda827x_cfg_2); | 1217 | if (configure_tda827x_fe(dev, &asus_p7131_4871_config, |
1218 | &tda827x_cfg_2) < 0) | ||
1219 | goto dettach_frontend; | ||
1181 | break; | 1220 | break; |
1182 | case SAA7134_BOARD_ASUSTeK_P7131_HYBRID_LNA: | 1221 | case SAA7134_BOARD_ASUSTeK_P7131_HYBRID_LNA: |
1183 | configure_tda827x_fe(dev, &asus_p7131_hybrid_lna_config, &tda827x_cfg_2); | 1222 | if (configure_tda827x_fe(dev, &asus_p7131_hybrid_lna_config, |
1223 | &tda827x_cfg_2) < 0) | ||
1224 | goto dettach_frontend; | ||
1184 | break; | 1225 | break; |
1185 | case SAA7134_BOARD_AVERMEDIA_SUPER_007: | 1226 | case SAA7134_BOARD_AVERMEDIA_SUPER_007: |
1186 | configure_tda827x_fe(dev, &avermedia_super_007_config, &tda827x_cfg_0); | 1227 | if (configure_tda827x_fe(dev, &avermedia_super_007_config, |
1228 | &tda827x_cfg_0) < 0) | ||
1229 | goto dettach_frontend; | ||
1187 | break; | 1230 | break; |
1188 | case SAA7134_BOARD_TWINHAN_DTV_DVB_3056: | 1231 | case SAA7134_BOARD_TWINHAN_DTV_DVB_3056: |
1189 | configure_tda827x_fe(dev, &twinhan_dtv_dvb_3056_config, &tda827x_cfg_2_sw42); | 1232 | if (configure_tda827x_fe(dev, &twinhan_dtv_dvb_3056_config, |
1233 | &tda827x_cfg_2_sw42) < 0) | ||
1234 | goto dettach_frontend; | ||
1190 | break; | 1235 | break; |
1191 | case SAA7134_BOARD_PHILIPS_SNAKE: | 1236 | case SAA7134_BOARD_PHILIPS_SNAKE: |
1192 | dev->dvb.frontend = dvb_attach(tda10086_attach, &flydvbs, | 1237 | dev->dvb.frontend = dvb_attach(tda10086_attach, &flydvbs, |
1193 | &dev->i2c_adap); | 1238 | &dev->i2c_adap); |
1194 | if (dev->dvb.frontend) { | 1239 | if (dev->dvb.frontend) { |
1195 | if (dvb_attach(tda826x_attach, dev->dvb.frontend, 0x60, | 1240 | if (dvb_attach(tda826x_attach, dev->dvb.frontend, 0x60, |
1196 | &dev->i2c_adap, 0) == NULL) | 1241 | &dev->i2c_adap, 0) == NULL) { |
1197 | wprintk("%s: No tda826x found!\n", __func__); | 1242 | wprintk("%s: No tda826x found!\n", __func__); |
1243 | goto dettach_frontend; | ||
1244 | } | ||
1198 | if (dvb_attach(lnbp21_attach, dev->dvb.frontend, | 1245 | if (dvb_attach(lnbp21_attach, dev->dvb.frontend, |
1199 | &dev->i2c_adap, 0, 0) == NULL) | 1246 | &dev->i2c_adap, 0, 0) == NULL) { |
1200 | wprintk("%s: No lnbp21 found!\n", __func__); | 1247 | wprintk("%s: No lnbp21 found!\n", __func__); |
1248 | goto dettach_frontend; | ||
1249 | } | ||
1201 | } | 1250 | } |
1202 | break; | 1251 | break; |
1203 | case SAA7134_BOARD_CREATIX_CTX953: | 1252 | case SAA7134_BOARD_CREATIX_CTX953: |
1204 | configure_tda827x_fe(dev, &md8800_dvbt_config, &tda827x_cfg_0); | 1253 | if (configure_tda827x_fe(dev, &md8800_dvbt_config, |
1254 | &tda827x_cfg_0) < 0) | ||
1255 | goto dettach_frontend; | ||
1205 | break; | 1256 | break; |
1206 | case SAA7134_BOARD_MSI_TVANYWHERE_AD11: | 1257 | case SAA7134_BOARD_MSI_TVANYWHERE_AD11: |
1207 | configure_tda827x_fe(dev, &philips_tiger_s_config, &tda827x_cfg_2); | 1258 | if (configure_tda827x_fe(dev, &philips_tiger_s_config, |
1259 | &tda827x_cfg_2) < 0) | ||
1260 | goto dettach_frontend; | ||
1208 | break; | 1261 | break; |
1209 | case SAA7134_BOARD_AVERMEDIA_CARDBUS_506: | 1262 | case SAA7134_BOARD_AVERMEDIA_CARDBUS_506: |
1210 | dev->dvb.frontend = dvb_attach(mt352_attach, | 1263 | dev->dvb.frontend = dvb_attach(mt352_attach, |
@@ -1218,16 +1271,20 @@ static int dvb_init(struct saa7134_dev *dev) | |||
1218 | if (dev->dvb.frontend) { | 1271 | if (dev->dvb.frontend) { |
1219 | struct dvb_frontend *fe; | 1272 | struct dvb_frontend *fe; |
1220 | if (dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x60, | 1273 | if (dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x60, |
1221 | &dev->i2c_adap, DVB_PLL_PHILIPS_SD1878_TDA8261) == NULL) | 1274 | &dev->i2c_adap, DVB_PLL_PHILIPS_SD1878_TDA8261) == NULL) { |
1222 | wprintk("%s: MD7134 DVB-S, no SD1878 " | 1275 | wprintk("%s: MD7134 DVB-S, no SD1878 " |
1223 | "found !\n", __func__); | 1276 | "found !\n", __func__); |
1277 | goto dettach_frontend; | ||
1278 | } | ||
1224 | /* we need to open the i2c gate (we know it exists) */ | 1279 | /* we need to open the i2c gate (we know it exists) */ |
1225 | fe = dev->dvb.frontend; | 1280 | fe = dev->dvb.frontend; |
1226 | fe->ops.i2c_gate_ctrl(fe, 1); | 1281 | fe->ops.i2c_gate_ctrl(fe, 1); |
1227 | if (dvb_attach(isl6405_attach, fe, | 1282 | if (dvb_attach(isl6405_attach, fe, |
1228 | &dev->i2c_adap, 0x08, 0, 0) == NULL) | 1283 | &dev->i2c_adap, 0x08, 0, 0) == NULL) { |
1229 | wprintk("%s: MD7134 DVB-S, no ISL6405 " | 1284 | wprintk("%s: MD7134 DVB-S, no ISL6405 " |
1230 | "found !\n", __func__); | 1285 | "found !\n", __func__); |
1286 | goto dettach_frontend; | ||
1287 | } | ||
1231 | fe->ops.i2c_gate_ctrl(fe, 0); | 1288 | fe->ops.i2c_gate_ctrl(fe, 0); |
1232 | dev->original_set_voltage = fe->ops.set_voltage; | 1289 | dev->original_set_voltage = fe->ops.set_voltage; |
1233 | fe->ops.set_voltage = md8800_set_voltage; | 1290 | fe->ops.set_voltage = md8800_set_voltage; |
@@ -1254,10 +1311,7 @@ static int dvb_init(struct saa7134_dev *dev) | |||
1254 | if (!fe) { | 1311 | if (!fe) { |
1255 | printk(KERN_ERR "%s/2: xc3028 attach failed\n", | 1312 | printk(KERN_ERR "%s/2: xc3028 attach failed\n", |
1256 | dev->name); | 1313 | dev->name); |
1257 | dvb_frontend_detach(dev->dvb.frontend); | 1314 | goto dettach_frontend; |
1258 | dvb_unregister_frontend(dev->dvb.frontend); | ||
1259 | dev->dvb.frontend = NULL; | ||
1260 | return -1; | ||
1261 | } | 1315 | } |
1262 | } | 1316 | } |
1263 | 1317 | ||
@@ -1282,6 +1336,12 @@ static int dvb_init(struct saa7134_dev *dev) | |||
1282 | dev->dvb.frontend->ops.tuner_ops.sleep(dev->dvb.frontend); | 1336 | dev->dvb.frontend->ops.tuner_ops.sleep(dev->dvb.frontend); |
1283 | } | 1337 | } |
1284 | return ret; | 1338 | return ret; |
1339 | |||
1340 | dettach_frontend: | ||
1341 | dvb_frontend_detach(dev->dvb.frontend); | ||
1342 | dev->dvb.frontend = NULL; | ||
1343 | |||
1344 | return -1; | ||
1285 | } | 1345 | } |
1286 | 1346 | ||
1287 | static int dvb_fini(struct saa7134_dev *dev) | 1347 | static int dvb_fini(struct saa7134_dev *dev) |
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c index a0baf2d0ba7f..48e1a01718ec 100644 --- a/drivers/media/video/saa7134/saa7134-video.c +++ b/drivers/media/video/saa7134/saa7134-video.c | |||
@@ -1634,7 +1634,7 @@ static int saa7134_s_fmt_overlay(struct file *file, void *priv, | |||
1634 | struct saa7134_fh *fh = priv; | 1634 | struct saa7134_fh *fh = priv; |
1635 | struct saa7134_dev *dev = fh->dev; | 1635 | struct saa7134_dev *dev = fh->dev; |
1636 | int err; | 1636 | int err; |
1637 | unsigned int flags; | 1637 | unsigned long flags; |
1638 | 1638 | ||
1639 | if (saa7134_no_overlay > 0) { | 1639 | if (saa7134_no_overlay > 0) { |
1640 | printk(KERN_ERR "V4L2_BUF_TYPE_VIDEO_OVERLAY: no_overlay\n"); | 1640 | printk(KERN_ERR "V4L2_BUF_TYPE_VIDEO_OVERLAY: no_overlay\n"); |
diff --git a/drivers/media/video/stk-webcam.c b/drivers/media/video/stk-webcam.c index 9276ed997388..b12c60cf5a09 100644 --- a/drivers/media/video/stk-webcam.c +++ b/drivers/media/video/stk-webcam.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/kref.h> | 30 | #include <linux/kref.h> |
31 | 31 | ||
32 | #include <linux/usb.h> | 32 | #include <linux/usb.h> |
33 | #include <linux/mm.h> | ||
33 | #include <linux/vmalloc.h> | 34 | #include <linux/vmalloc.h> |
34 | #include <linux/videodev2.h> | 35 | #include <linux/videodev2.h> |
35 | #include <media/v4l2-common.h> | 36 | #include <media/v4l2-common.h> |
@@ -245,6 +246,8 @@ static int stk_initialise(struct stk_camera *dev) | |||
245 | return -1; | 246 | return -1; |
246 | } | 247 | } |
247 | 248 | ||
249 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
250 | |||
248 | /* sysfs functions */ | 251 | /* sysfs functions */ |
249 | /*FIXME cleanup this */ | 252 | /*FIXME cleanup this */ |
250 | 253 | ||
@@ -350,6 +353,10 @@ static void stk_remove_sysfs_files(struct video_device *vdev) | |||
350 | video_device_remove_file(vdev, &dev_attr_vflip); | 353 | video_device_remove_file(vdev, &dev_attr_vflip); |
351 | } | 354 | } |
352 | 355 | ||
356 | #else | ||
357 | #define stk_create_sysfs_files(a) | ||
358 | #define stk_remove_sysfs_files(a) | ||
359 | #endif | ||
353 | 360 | ||
354 | /* *********************************************** */ | 361 | /* *********************************************** */ |
355 | /* | 362 | /* |
diff --git a/drivers/media/video/tcm825x.c b/drivers/media/video/tcm825x.c index e57a64605778..8f0100f67a91 100644 --- a/drivers/media/video/tcm825x.c +++ b/drivers/media/video/tcm825x.c | |||
@@ -885,12 +885,19 @@ static int __exit tcm825x_remove(struct i2c_client *client) | |||
885 | return 0; | 885 | return 0; |
886 | } | 886 | } |
887 | 887 | ||
888 | static const struct i2c_device_id tcm825x_id[] = { | ||
889 | { "tcm825x", 0 }, | ||
890 | { } | ||
891 | }; | ||
892 | MODULE_DEVICE_TABLE(i2c, tcm825x_id); | ||
893 | |||
888 | static struct i2c_driver tcm825x_i2c_driver = { | 894 | static struct i2c_driver tcm825x_i2c_driver = { |
889 | .driver = { | 895 | .driver = { |
890 | .name = TCM825X_NAME, | 896 | .name = TCM825X_NAME, |
891 | }, | 897 | }, |
892 | .probe = tcm825x_probe, | 898 | .probe = tcm825x_probe, |
893 | .remove = __exit_p(tcm825x_remove), | 899 | .remove = __exit_p(tcm825x_remove), |
900 | .id_table = tcm825x_id, | ||
894 | }; | 901 | }; |
895 | 902 | ||
896 | static struct tcm825x_sensor tcm825x = { | 903 | static struct tcm825x_sensor tcm825x = { |
diff --git a/drivers/media/video/tlv320aic23b.c b/drivers/media/video/tlv320aic23b.c index f1db54202dea..28ab9f9d760a 100644 --- a/drivers/media/video/tlv320aic23b.c +++ b/drivers/media/video/tlv320aic23b.c | |||
@@ -168,6 +168,11 @@ static int tlv320aic23b_remove(struct i2c_client *client) | |||
168 | 168 | ||
169 | /* ----------------------------------------------------------------------- */ | 169 | /* ----------------------------------------------------------------------- */ |
170 | 170 | ||
171 | static const struct i2c_device_id tlv320aic23b_id[] = { | ||
172 | { "tlv320aic23b", 0 }, | ||
173 | { } | ||
174 | }; | ||
175 | MODULE_DEVICE_TABLE(i2c, tlv320aic23b_id); | ||
171 | 176 | ||
172 | static struct v4l2_i2c_driver_data v4l2_i2c_data = { | 177 | static struct v4l2_i2c_driver_data v4l2_i2c_data = { |
173 | .name = "tlv320aic23b", | 178 | .name = "tlv320aic23b", |
@@ -175,4 +180,5 @@ static struct v4l2_i2c_driver_data v4l2_i2c_data = { | |||
175 | .command = tlv320aic23b_command, | 180 | .command = tlv320aic23b_command, |
176 | .probe = tlv320aic23b_probe, | 181 | .probe = tlv320aic23b_probe, |
177 | .remove = tlv320aic23b_remove, | 182 | .remove = tlv320aic23b_remove, |
183 | .id_table = tlv320aic23b_id, | ||
178 | }; | 184 | }; |
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index 6bf104ea051d..5a75788b92ae 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
@@ -40,11 +40,11 @@ | |||
40 | typeof(&FUNCTION) __a = symbol_request(FUNCTION); \ | 40 | typeof(&FUNCTION) __a = symbol_request(FUNCTION); \ |
41 | if (__a) { \ | 41 | if (__a) { \ |
42 | __r = (int) __a(ARGS); \ | 42 | __r = (int) __a(ARGS); \ |
43 | symbol_put(FUNCTION); \ | ||
43 | } else { \ | 44 | } else { \ |
44 | printk(KERN_ERR "TUNER: Unable to find " \ | 45 | printk(KERN_ERR "TUNER: Unable to find " \ |
45 | "symbol "#FUNCTION"()\n"); \ | 46 | "symbol "#FUNCTION"()\n"); \ |
46 | } \ | 47 | } \ |
47 | symbol_put(FUNCTION); \ | ||
48 | __r; \ | 48 | __r; \ |
49 | }) | 49 | }) |
50 | 50 | ||
@@ -340,16 +340,6 @@ static void tuner_i2c_address_check(struct tuner *t) | |||
340 | tuner_warn("====================== WARNING! ======================\n"); | 340 | tuner_warn("====================== WARNING! ======================\n"); |
341 | } | 341 | } |
342 | 342 | ||
343 | static void attach_tda829x(struct tuner *t) | ||
344 | { | ||
345 | struct tda829x_config cfg = { | ||
346 | .lna_cfg = t->config, | ||
347 | .tuner_callback = t->tuner_callback, | ||
348 | }; | ||
349 | dvb_attach(tda829x_attach, | ||
350 | &t->fe, t->i2c->adapter, t->i2c->addr, &cfg); | ||
351 | } | ||
352 | |||
353 | static struct xc5000_config xc5000_cfg; | 343 | static struct xc5000_config xc5000_cfg; |
354 | 344 | ||
355 | static void set_type(struct i2c_client *c, unsigned int type, | 345 | static void set_type(struct i2c_client *c, unsigned int type, |
@@ -385,12 +375,19 @@ static void set_type(struct i2c_client *c, unsigned int type, | |||
385 | 375 | ||
386 | switch (t->type) { | 376 | switch (t->type) { |
387 | case TUNER_MT2032: | 377 | case TUNER_MT2032: |
388 | dvb_attach(microtune_attach, | 378 | if (!dvb_attach(microtune_attach, |
389 | &t->fe, t->i2c->adapter, t->i2c->addr); | 379 | &t->fe, t->i2c->adapter, t->i2c->addr)) |
380 | goto attach_failed; | ||
390 | break; | 381 | break; |
391 | case TUNER_PHILIPS_TDA8290: | 382 | case TUNER_PHILIPS_TDA8290: |
392 | { | 383 | { |
393 | attach_tda829x(t); | 384 | struct tda829x_config cfg = { |
385 | .lna_cfg = t->config, | ||
386 | .tuner_callback = t->tuner_callback, | ||
387 | }; | ||
388 | if (!dvb_attach(tda829x_attach, &t->fe, t->i2c->adapter, | ||
389 | t->i2c->addr, &cfg)) | ||
390 | goto attach_failed; | ||
394 | break; | 391 | break; |
395 | } | 392 | } |
396 | case TUNER_TEA5767: | 393 | case TUNER_TEA5767: |
@@ -441,8 +438,9 @@ static void set_type(struct i2c_client *c, unsigned int type, | |||
441 | break; | 438 | break; |
442 | } | 439 | } |
443 | case TUNER_TDA9887: | 440 | case TUNER_TDA9887: |
444 | dvb_attach(tda9887_attach, | 441 | if (!dvb_attach(tda9887_attach, |
445 | &t->fe, t->i2c->adapter, t->i2c->addr); | 442 | &t->fe, t->i2c->adapter, t->i2c->addr)) |
443 | goto attach_failed; | ||
446 | break; | 444 | break; |
447 | case TUNER_XC5000: | 445 | case TUNER_XC5000: |
448 | { | 446 | { |
@@ -450,10 +448,10 @@ static void set_type(struct i2c_client *c, unsigned int type, | |||
450 | 448 | ||
451 | xc5000_cfg.i2c_address = t->i2c->addr; | 449 | xc5000_cfg.i2c_address = t->i2c->addr; |
452 | xc5000_cfg.if_khz = 5380; | 450 | xc5000_cfg.if_khz = 5380; |
453 | xc5000_cfg.priv = c->adapter->algo_data; | ||
454 | xc5000_cfg.tuner_callback = t->tuner_callback; | 451 | xc5000_cfg.tuner_callback = t->tuner_callback; |
455 | if (!dvb_attach(xc5000_attach, | 452 | if (!dvb_attach(xc5000_attach, |
456 | &t->fe, t->i2c->adapter, &xc5000_cfg)) | 453 | &t->fe, t->i2c->adapter, &xc5000_cfg, |
454 | c->adapter->algo_data)) | ||
457 | goto attach_failed; | 455 | goto attach_failed; |
458 | 456 | ||
459 | xc_tuner_ops = &t->fe.ops.tuner_ops; | 457 | xc_tuner_ops = &t->fe.ops.tuner_ops; |
@@ -1167,7 +1165,7 @@ static int tuner_probe(struct i2c_client *client, | |||
1167 | /* If chip is not tda8290, don't register. | 1165 | /* If chip is not tda8290, don't register. |
1168 | since it can be tda9887*/ | 1166 | since it can be tda9887*/ |
1169 | if (tuner_symbol_probe(tda829x_probe, t->i2c->adapter, | 1167 | if (tuner_symbol_probe(tda829x_probe, t->i2c->adapter, |
1170 | t->i2c->addr) == 0) { | 1168 | t->i2c->addr) >= 0) { |
1171 | tuner_dbg("tda829x detected\n"); | 1169 | tuner_dbg("tda829x detected\n"); |
1172 | } else { | 1170 | } else { |
1173 | /* Default is being tda9887 */ | 1171 | /* Default is being tda9887 */ |
@@ -1181,7 +1179,7 @@ static int tuner_probe(struct i2c_client *client, | |||
1181 | case 0x60: | 1179 | case 0x60: |
1182 | if (tuner_symbol_probe(tea5767_autodetection, | 1180 | if (tuner_symbol_probe(tea5767_autodetection, |
1183 | t->i2c->adapter, t->i2c->addr) | 1181 | t->i2c->adapter, t->i2c->addr) |
1184 | != EINVAL) { | 1182 | >= 0) { |
1185 | t->type = TUNER_TEA5767; | 1183 | t->type = TUNER_TEA5767; |
1186 | t->mode_mask = T_RADIO; | 1184 | t->mode_mask = T_RADIO; |
1187 | t->mode = T_STANDBY; | 1185 | t->mode = T_STANDBY; |
diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c index 6f9945b04e1f..c77914d99d15 100644 --- a/drivers/media/video/tvaudio.c +++ b/drivers/media/video/tvaudio.c | |||
@@ -1505,7 +1505,8 @@ static int chip_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
1505 | } | 1505 | } |
1506 | 1506 | ||
1507 | /* fill required data structures */ | 1507 | /* fill required data structures */ |
1508 | strcpy(client->name, desc->name); | 1508 | if (!id) |
1509 | strlcpy(client->name, desc->name, I2C_NAME_SIZE); | ||
1509 | chip->type = desc-chiplist; | 1510 | chip->type = desc-chiplist; |
1510 | chip->shadow.count = desc->registers+1; | 1511 | chip->shadow.count = desc->registers+1; |
1511 | chip->prevmode = -1; | 1512 | chip->prevmode = -1; |
@@ -1830,6 +1831,15 @@ static int chip_legacy_probe(struct i2c_adapter *adap) | |||
1830 | return 0; | 1831 | return 0; |
1831 | } | 1832 | } |
1832 | 1833 | ||
1834 | /* This driver supports many devices and the idea is to let the driver | ||
1835 | detect which device is present. So rather than listing all supported | ||
1836 | devices here, we pretend to support a single, fake device type. */ | ||
1837 | static const struct i2c_device_id chip_id[] = { | ||
1838 | { "tvaudio", 0 }, | ||
1839 | { } | ||
1840 | }; | ||
1841 | MODULE_DEVICE_TABLE(i2c, chip_id); | ||
1842 | |||
1833 | static struct v4l2_i2c_driver_data v4l2_i2c_data = { | 1843 | static struct v4l2_i2c_driver_data v4l2_i2c_data = { |
1834 | .name = "tvaudio", | 1844 | .name = "tvaudio", |
1835 | .driverid = I2C_DRIVERID_TVAUDIO, | 1845 | .driverid = I2C_DRIVERID_TVAUDIO, |
@@ -1837,6 +1847,7 @@ static struct v4l2_i2c_driver_data v4l2_i2c_data = { | |||
1837 | .probe = chip_probe, | 1847 | .probe = chip_probe, |
1838 | .remove = chip_remove, | 1848 | .remove = chip_remove, |
1839 | .legacy_probe = chip_legacy_probe, | 1849 | .legacy_probe = chip_legacy_probe, |
1850 | .id_table = chip_id, | ||
1840 | }; | 1851 | }; |
1841 | 1852 | ||
1842 | /* | 1853 | /* |
diff --git a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c index 3cf8a8e801e5..9da0e1807ffb 100644 --- a/drivers/media/video/tveeprom.c +++ b/drivers/media/video/tveeprom.c | |||
@@ -319,10 +319,12 @@ audioIC[] = | |||
319 | {AUDIO_CHIP_INTERNAL, "CX25843"}, | 319 | {AUDIO_CHIP_INTERNAL, "CX25843"}, |
320 | {AUDIO_CHIP_INTERNAL, "CX23418"}, | 320 | {AUDIO_CHIP_INTERNAL, "CX23418"}, |
321 | {AUDIO_CHIP_INTERNAL, "CX23885"}, | 321 | {AUDIO_CHIP_INTERNAL, "CX23885"}, |
322 | /* 40-42 */ | 322 | /* 40-44 */ |
323 | {AUDIO_CHIP_INTERNAL, "CX23888"}, | 323 | {AUDIO_CHIP_INTERNAL, "CX23888"}, |
324 | {AUDIO_CHIP_INTERNAL, "SAA7131"}, | 324 | {AUDIO_CHIP_INTERNAL, "SAA7131"}, |
325 | {AUDIO_CHIP_INTERNAL, "CX23887"}, | 325 | {AUDIO_CHIP_INTERNAL, "CX23887"}, |
326 | {AUDIO_CHIP_INTERNAL, "SAA7164"}, | ||
327 | {AUDIO_CHIP_INTERNAL, "AU8522"}, | ||
326 | }; | 328 | }; |
327 | 329 | ||
328 | /* This list is supplied by Hauppauge. Thanks! */ | 330 | /* This list is supplied by Hauppauge. Thanks! */ |
@@ -341,8 +343,10 @@ static const char *decoderIC[] = { | |||
341 | "CX882", "TVP5150A", "CX25840", "CX25841", "CX25842", | 343 | "CX882", "TVP5150A", "CX25840", "CX25841", "CX25842", |
342 | /* 30-34 */ | 344 | /* 30-34 */ |
343 | "CX25843", "CX23418", "NEC61153", "CX23885", "CX23888", | 345 | "CX25843", "CX23418", "NEC61153", "CX23885", "CX23888", |
344 | /* 35-37 */ | 346 | /* 35-39 */ |
345 | "SAA7131", "CX25837", "CX23887" | 347 | "SAA7131", "CX25837", "CX23887", "CX23885A", "CX23887A", |
348 | /* 40-42 */ | ||
349 | "SAA7164", "CX23885B", "AU8522" | ||
346 | }; | 350 | }; |
347 | 351 | ||
348 | static int hasRadioTuner(int tunerType) | 352 | static int hasRadioTuner(int tunerType) |
diff --git a/drivers/media/video/usbvision/Kconfig b/drivers/media/video/usbvision/Kconfig index 74e1d3075a20..fc24ef05b3f3 100644 --- a/drivers/media/video/usbvision/Kconfig +++ b/drivers/media/video/usbvision/Kconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | config VIDEO_USBVISION | 1 | config VIDEO_USBVISION |
2 | tristate "USB video devices based on Nogatech NT1003/1004/1005" | 2 | tristate "USB video devices based on Nogatech NT1003/1004/1005" |
3 | depends on I2C && VIDEO_V4L2 | 3 | depends on I2C && VIDEO_V4L2 |
4 | select MEDIA_TUNER | 4 | select VIDEO_TUNER |
5 | select VIDEO_SAA711X if VIDEO_HELPER_CHIPS_AUTO | 5 | select VIDEO_SAA711X if VIDEO_HELPER_CHIPS_AUTO |
6 | ---help--- | 6 | ---help--- |
7 | There are more than 50 different USB video devices based on | 7 | There are more than 50 different USB video devices based on |