Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 01c28193 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

[media] em28xx: make em28xx-video to be a separate module



Now that all analog-specific code are at em28xx-video, convert
it into an em28xx extension and load it as a separate module.

Reviewed-by: default avatarFrank Schäfer <fschaefer.oss@googlemail.com>
Tested-by: default avatarFrank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 1f0ee65a
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
config VIDEO_EM28XX
	tristate "Empia EM28xx USB video capture support"
	tristate "Empia EM28xx USB devices support"
	depends on VIDEO_DEV && I2C
	select VIDEO_TUNER
	select VIDEO_TVEEPROM

config VIDEO_EM28XX_V4L2
	tristate "Empia EM28xx analog TV, video capture and/or webcam support"
	depends on VIDEO_EM28XX
	select VIDEOBUF2_VMALLOC
	select VIDEO_SAA711X if MEDIA_SUBDRV_AUTOSELECT
	select VIDEO_TVP5150 if MEDIA_SUBDRV_AUTOSELECT
+3 −2
Original line number Diff line number Diff line
em28xx-y +=	em28xx-video.o em28xx-i2c.o em28xx-cards.o
em28xx-y +=	em28xx-core.o  em28xx-vbi.o em28xx-camera.o
em28xx-y +=	em28xx-core.o em28xx-i2c.o em28xx-cards.o em28xx-camera.o

em28xx-v4l-objs := em28xx-video.o em28xx-vbi.o
em28xx-alsa-objs := em28xx-audio.o
em28xx-rc-objs := em28xx-input.o

obj-$(CONFIG_VIDEO_EM28XX) += em28xx.o
obj-$(CONFIG_VIDEO_EM28XX_V4L2) += em28xx-v4l.o
obj-$(CONFIG_VIDEO_EM28XX_ALSA) += em28xx-alsa.o
obj-$(CONFIG_VIDEO_EM28XX_DVB) += em28xx-dvb.o
obj-$(CONFIG_VIDEO_EM28XX_RC) += em28xx-rc.o
+1 −0
Original line number Diff line number Diff line
@@ -454,3 +454,4 @@ int em28xx_init_camera(struct em28xx *dev)

	return ret;
}
EXPORT_SYMBOL_GPL(em28xx_init_camera);
+7 −25
Original line number Diff line number Diff line
@@ -2159,6 +2159,8 @@ struct em28xx_board em28xx_boards[] = {
		.ir_codes      = RC_MAP_PINNACLE_PCTV_HD,
	},
};
EXPORT_SYMBOL_GPL(em28xx_boards);

const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);

/* table of devices that work with this driver */
@@ -2780,11 +2782,12 @@ static void request_module_async(struct work_struct *work)
	em28xx_init_extension(dev);

#if defined(CONFIG_MODULES) && defined(MODULE)
	if (dev->has_video)
		request_module("em28xx-v4l");
	if (dev->has_audio_class)
		request_module("snd-usb-audio");
	else if (dev->has_alsa_audio)
		request_module("em28xx-alsa");

	if (dev->board.has_dvb)
		request_module("em28xx-dvb");
	if (dev->board.buttons ||
@@ -2813,18 +2816,12 @@ void em28xx_release_resources(struct em28xx *dev)
{
	/*FIXME: I2C IR should be disconnected */

	em28xx_release_analog_resources(dev);

	if (dev->def_i2c_bus)
		em28xx_i2c_unregister(dev, 1);
	em28xx_i2c_unregister(dev, 0);
	if (dev->clk)
		v4l2_clk_unregister_fixed(dev->clk);

	v4l2_ctrl_handler_free(&dev->ctrl_handler);

	v4l2_device_unregister(&dev->v4l2_dev);

	usb_put_dev(dev->udev);

	/* Mark device as unused */
@@ -2999,18 +2996,7 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
	/* Do board specific init and eeprom reading */
	em28xx_card_setup(dev);

	retval = em28xx_register_analog_devices(dev);
	if (retval < 0)
		goto fail;

	return 0;

fail:
	if (dev->def_i2c_bus)
		em28xx_i2c_unregister(dev, 1);
	em28xx_i2c_unregister(dev, 0);

	return retval;
}

/* high bandwidth multiplier, as encoded in highspeed endpoint descriptors */
@@ -3213,6 +3199,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
	dev->alt   = -1;
	dev->is_audio_only = has_audio && !(has_video || has_dvb);
	dev->has_alsa_audio = has_audio;
	dev->has_video = has_video;
	dev->audio_ifnum = ifnum;

	/* Checks if audio is provided by some interface */
@@ -3252,10 +3239,9 @@ static int em28xx_usb_probe(struct usb_interface *interface,

	/* allocate device struct */
	mutex_init(&dev->lock);
	mutex_lock(&dev->lock);
	retval = em28xx_init_dev(dev, udev, interface, nr);
	if (retval) {
		goto unlock_and_free;
		goto err_free;
	}

	if (usb_xfer_mode < 0) {
@@ -3298,7 +3284,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
		if (retval) {
			printk(DRIVER_NAME
			       ": Failed to pre-allocate USB transfer buffers for DVB.\n");
			goto unlock_and_free;
			goto err_free;
		}
	}

@@ -3307,13 +3293,9 @@ static int em28xx_usb_probe(struct usb_interface *interface,
	/* Should be the last thing to do, to avoid newer udev's to
	   open the device before fully initializing it
	 */
	mutex_unlock(&dev->lock);

	return 0;

unlock_and_free:
	mutex_unlock(&dev->lock);

err_free:
	kfree(dev->alt_max_pkt_size_isoc);
	kfree(dev);
+12 −0
Original line number Diff line number Diff line
@@ -33,6 +33,18 @@

#include "em28xx.h"

#define DRIVER_AUTHOR "Ludovico Cavedon <cavedon@sssup.it>, " \
		      "Markus Rechberger <mrechberger@gmail.com>, " \
		      "Mauro Carvalho Chehab <mchehab@infradead.org>, " \
		      "Sascha Sommer <saschasommer@freenet.de>"

#define DRIVER_DESC         "Empia em28xx based USB core driver"

MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL");
MODULE_VERSION(EM28XX_VERSION);

/* #define ENABLE_DEBUG_ISOC_FRAMES */

static unsigned int core_debug;
Loading