aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/au0828
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2012-12-04 09:30:00 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-12-17 11:31:26 -0500
commit8a4e786660f512b029b56d94d1b8f0201e67aab3 (patch)
treef7d2f1d9ec023a20773cbb28e8e572946892774c /drivers/media/usb/au0828
parentc70ffd5968476ffe9fe2a8bfdc88956ecef92d2a (diff)
[media] au0828: remove forced dependency of VIDEO_AU0828 on VIDEO_V4L2
This patch removes the dependendency of VIDEO_AU0828 on VIDEO_V4L2 by creating a new Kconfig option, VIDEO_AU0828_V4L2, which enables analog video capture support and depends on VIDEO_V4L2 itself. With VIDEO_AU0828_V4L2 disabled, the driver will only support digital television and will not depend on the v4l2-core. With VIDEO_AU0828_V4L2 enabled, the driver will be built with the analog v4l2 support included. By default, the VIDEO_AU0828_V4L2 option will be set to Y, so as to preserve the original behavior. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb/au0828')
-rw-r--r--drivers/media/usb/au0828/Kconfig17
-rw-r--r--drivers/media/usb/au0828/Makefile6
-rw-r--r--drivers/media/usb/au0828/au0828-cards.c4
-rw-r--r--drivers/media/usb/au0828/au0828-core.c13
-rw-r--r--drivers/media/usb/au0828/au0828-i2c.c4
-rw-r--r--drivers/media/usb/au0828/au0828.h2
6 files changed, 41 insertions, 5 deletions
diff --git a/drivers/media/usb/au0828/Kconfig b/drivers/media/usb/au0828/Kconfig
index 1766c0ce93be..953a37c613b1 100644
--- a/drivers/media/usb/au0828/Kconfig
+++ b/drivers/media/usb/au0828/Kconfig
@@ -1,17 +1,28 @@
1 1
2config VIDEO_AU0828 2config VIDEO_AU0828
3 tristate "Auvitek AU0828 support" 3 tristate "Auvitek AU0828 support"
4 depends on I2C && INPUT && DVB_CORE && USB && VIDEO_V4L2 4 depends on I2C && INPUT && DVB_CORE && USB
5 select I2C_ALGOBIT 5 select I2C_ALGOBIT
6 select VIDEO_TVEEPROM 6 select VIDEO_TVEEPROM
7 select VIDEOBUF_VMALLOC 7 select VIDEOBUF_VMALLOC
8 select DVB_AU8522_DTV if MEDIA_SUBDRV_AUTOSELECT 8 select DVB_AU8522_DTV if MEDIA_SUBDRV_AUTOSELECT
9 select DVB_AU8522_V4L if MEDIA_SUBDRV_AUTOSELECT
10 select MEDIA_TUNER_XC5000 if MEDIA_SUBDRV_AUTOSELECT 9 select MEDIA_TUNER_XC5000 if MEDIA_SUBDRV_AUTOSELECT
11 select MEDIA_TUNER_MXL5007T if MEDIA_SUBDRV_AUTOSELECT 10 select MEDIA_TUNER_MXL5007T if MEDIA_SUBDRV_AUTOSELECT
12 select MEDIA_TUNER_TDA18271 if MEDIA_SUBDRV_AUTOSELECT 11 select MEDIA_TUNER_TDA18271 if MEDIA_SUBDRV_AUTOSELECT
13 ---help--- 12 ---help---
14 This is a video4linux driver for Auvitek's USB device. 13 This is a hybrid analog/digital tv capture driver for
14 Auvitek's AU0828 USB device.
15 15
16 To compile this driver as a module, choose M here: the 16 To compile this driver as a module, choose M here: the
17 module will be called au0828 17 module will be called au0828
18
19config VIDEO_AU0828_V4L2
20 bool "Auvitek AU0828 v4l2 analog video support"
21 depends on VIDEO_AU0828 && VIDEO_V4L2
22 select DVB_AU8522_V4L if MEDIA_SUBDRV_AUTOSELECT
23 default y
24 ---help---
25 This is a video4linux driver for Auvitek's USB device.
26
27 Choose Y here to include support for v4l2 analog video
28 capture within the au0828 driver.
diff --git a/drivers/media/usb/au0828/Makefile b/drivers/media/usb/au0828/Makefile
index 98cc20cc0ffb..be3bdf698022 100644
--- a/drivers/media/usb/au0828/Makefile
+++ b/drivers/media/usb/au0828/Makefile
@@ -1,4 +1,8 @@
1au0828-objs := au0828-core.o au0828-i2c.o au0828-cards.o au0828-dvb.o au0828-video.o au0828-vbi.o 1au0828-objs := au0828-core.o au0828-i2c.o au0828-cards.o au0828-dvb.o
2
3ifeq ($(CONFIG_VIDEO_AU0828_V4L2),y)
4 au0828-objs += au0828-video.o au0828-vbi.o
5endif
2 6
3obj-$(CONFIG_VIDEO_AU0828) += au0828.o 7obj-$(CONFIG_VIDEO_AU0828) += au0828.o
4 8
diff --git a/drivers/media/usb/au0828/au0828-cards.c b/drivers/media/usb/au0828/au0828-cards.c
index cf309d8102c0..7b5b7420066d 100644
--- a/drivers/media/usb/au0828/au0828-cards.c
+++ b/drivers/media/usb/au0828/au0828-cards.c
@@ -188,9 +188,11 @@ static void hauppauge_eeprom(struct au0828_dev *dev, u8 *eeprom_data)
188void au0828_card_setup(struct au0828_dev *dev) 188void au0828_card_setup(struct au0828_dev *dev)
189{ 189{
190 static u8 eeprom[256]; 190 static u8 eeprom[256];
191#ifdef CONFIG_VIDEO_AU0828_V4L2
191 struct tuner_setup tun_setup; 192 struct tuner_setup tun_setup;
192 struct v4l2_subdev *sd; 193 struct v4l2_subdev *sd;
193 unsigned int mode_mask = T_ANALOG_TV; 194 unsigned int mode_mask = T_ANALOG_TV;
195#endif
194 196
195 dprintk(1, "%s()\n", __func__); 197 dprintk(1, "%s()\n", __func__);
196 198
@@ -211,6 +213,7 @@ void au0828_card_setup(struct au0828_dev *dev)
211 break; 213 break;
212 } 214 }
213 215
216#ifdef CONFIG_VIDEO_AU0828_V4L2
214 if (AUVI_INPUT(0).type != AU0828_VMUX_UNDEFINED) { 217 if (AUVI_INPUT(0).type != AU0828_VMUX_UNDEFINED) {
215 /* Load the analog demodulator driver (note this would need to 218 /* Load the analog demodulator driver (note this would need to
216 be abstracted out if we ever need to support a different 219 be abstracted out if we ever need to support a different
@@ -236,6 +239,7 @@ void au0828_card_setup(struct au0828_dev *dev)
236 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_type_addr, 239 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_type_addr,
237 &tun_setup); 240 &tun_setup);
238 } 241 }
242#endif
239} 243}
240 244
241/* 245/*
diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c
index 745a80a798c8..1e6f40ef1c6b 100644
--- a/drivers/media/usb/au0828/au0828-core.c
+++ b/drivers/media/usb/au0828/au0828-core.c
@@ -134,13 +134,17 @@ static void au0828_usb_disconnect(struct usb_interface *interface)
134 /* Digital TV */ 134 /* Digital TV */
135 au0828_dvb_unregister(dev); 135 au0828_dvb_unregister(dev);
136 136
137#ifdef CONFIG_VIDEO_AU0828_V4L2
137 if (AUVI_INPUT(0).type != AU0828_VMUX_UNDEFINED) 138 if (AUVI_INPUT(0).type != AU0828_VMUX_UNDEFINED)
138 au0828_analog_unregister(dev); 139 au0828_analog_unregister(dev);
140#endif
139 141
140 /* I2C */ 142 /* I2C */
141 au0828_i2c_unregister(dev); 143 au0828_i2c_unregister(dev);
142 144
145#ifdef CONFIG_VIDEO_AU0828_V4L2
143 v4l2_device_unregister(&dev->v4l2_dev); 146 v4l2_device_unregister(&dev->v4l2_dev);
147#endif
144 148
145 usb_set_intfdata(interface, NULL); 149 usb_set_intfdata(interface, NULL);
146 150
@@ -155,7 +159,10 @@ static void au0828_usb_disconnect(struct usb_interface *interface)
155static int au0828_usb_probe(struct usb_interface *interface, 159static int au0828_usb_probe(struct usb_interface *interface,
156 const struct usb_device_id *id) 160 const struct usb_device_id *id)
157{ 161{
158 int ifnum, retval; 162 int ifnum;
163#ifdef CONFIG_VIDEO_AU0828_V4L2
164 int retval;
165#endif
159 struct au0828_dev *dev; 166 struct au0828_dev *dev;
160 struct usb_device *usbdev = interface_to_usbdev(interface); 167 struct usb_device *usbdev = interface_to_usbdev(interface);
161 168
@@ -194,6 +201,7 @@ static int au0828_usb_probe(struct usb_interface *interface,
194 dev->usbdev = usbdev; 201 dev->usbdev = usbdev;
195 dev->boardnr = id->driver_info; 202 dev->boardnr = id->driver_info;
196 203
204#ifdef CONFIG_VIDEO_AU0828_V4L2
197 /* Create the v4l2_device */ 205 /* Create the v4l2_device */
198 retval = v4l2_device_register(&interface->dev, &dev->v4l2_dev); 206 retval = v4l2_device_register(&interface->dev, &dev->v4l2_dev);
199 if (retval) { 207 if (retval) {
@@ -203,6 +211,7 @@ static int au0828_usb_probe(struct usb_interface *interface,
203 kfree(dev); 211 kfree(dev);
204 return -EIO; 212 return -EIO;
205 } 213 }
214#endif
206 215
207 /* Power Up the bridge */ 216 /* Power Up the bridge */
208 au0828_write(dev, REG_600, 1 << 4); 217 au0828_write(dev, REG_600, 1 << 4);
@@ -216,9 +225,11 @@ static int au0828_usb_probe(struct usb_interface *interface,
216 /* Setup */ 225 /* Setup */
217 au0828_card_setup(dev); 226 au0828_card_setup(dev);
218 227
228#ifdef CONFIG_VIDEO_AU0828_V4L2
219 /* Analog TV */ 229 /* Analog TV */
220 if (AUVI_INPUT(0).type != AU0828_VMUX_UNDEFINED) 230 if (AUVI_INPUT(0).type != AU0828_VMUX_UNDEFINED)
221 au0828_analog_register(dev, interface); 231 au0828_analog_register(dev, interface);
232#endif
222 233
223 /* Digital TV */ 234 /* Digital TV */
224 au0828_dvb_register(dev); 235 au0828_dvb_register(dev);
diff --git a/drivers/media/usb/au0828/au0828-i2c.c b/drivers/media/usb/au0828/au0828-i2c.c
index 4ded17fe1957..20d69b565255 100644
--- a/drivers/media/usb/au0828/au0828-i2c.c
+++ b/drivers/media/usb/au0828/au0828-i2c.c
@@ -378,7 +378,11 @@ int au0828_i2c_register(struct au0828_dev *dev)
378 378
379 dev->i2c_adap.algo = &dev->i2c_algo; 379 dev->i2c_adap.algo = &dev->i2c_algo;
380 dev->i2c_adap.algo_data = dev; 380 dev->i2c_adap.algo_data = dev;
381#ifdef CONFIG_VIDEO_AU0828_V4L2
381 i2c_set_adapdata(&dev->i2c_adap, &dev->v4l2_dev); 382 i2c_set_adapdata(&dev->i2c_adap, &dev->v4l2_dev);
383#else
384 i2c_set_adapdata(&dev->i2c_adap, dev);
385#endif
382 i2c_add_adapter(&dev->i2c_adap); 386 i2c_add_adapter(&dev->i2c_adap);
383 387
384 dev->i2c_client.adapter = &dev->i2c_adap; 388 dev->i2c_client.adapter = &dev->i2c_adap;
diff --git a/drivers/media/usb/au0828/au0828.h b/drivers/media/usb/au0828/au0828.h
index 66a56ef7bbe4..e579ff69ca4a 100644
--- a/drivers/media/usb/au0828/au0828.h
+++ b/drivers/media/usb/au0828/au0828.h
@@ -199,8 +199,10 @@ struct au0828_dev {
199 struct au0828_dvb dvb; 199 struct au0828_dvb dvb;
200 struct work_struct restart_streaming; 200 struct work_struct restart_streaming;
201 201
202#ifdef CONFIG_VIDEO_AU0828_V4L2
202 /* Analog */ 203 /* Analog */
203 struct v4l2_device v4l2_dev; 204 struct v4l2_device v4l2_dev;
205#endif
204 int users; 206 int users;
205 unsigned int resources; /* resources in use */ 207 unsigned int resources; /* resources in use */
206 struct video_device *vdev; 208 struct video_device *vdev;