Exemple #1
0
static int jpeg_hx_remove(struct platform_device *pdev)
{
	struct jpeg_dev *dev = platform_get_drvdata(pdev);

	del_timer_sync(&dev->watchdog_timer);
	flush_workqueue(dev->watchdog_workqueue);
	destroy_workqueue(dev->watchdog_workqueue);

	v4l2_m2m_release(dev->m2m_dev_enc);
	video_unregister_device(dev->vfd_enc);

	v4l2_m2m_release(dev->m2m_dev_dec);
	video_unregister_device(dev->vfd_dec);

	v4l2_device_unregister(&dev->v4l2_dev);

	dev->vb2->cleanup(dev->alloc_ctx);

	free_irq(dev->irq_no, pdev);
	mutex_destroy(&dev->lock);
	iounmap(dev->reg_base);

	clk_put(dev->clk);
	clk_put(dev->sclk_clk);
#ifdef CONFIG_BUSFREQ_OPP
	/* lock bus frequency */
	dev_unlock(dev->bus_dev, &pdev->dev);
#endif
	kfree(dev);
	return 0;
}
Exemple #2
0
static int jpeg_remove(struct platform_device *pdev)
{
	struct jpeg_dev *dev = platform_get_drvdata(pdev);

	del_timer_sync(&dev->watchdog_timer);
	flush_workqueue(dev->watchdog_workqueue);
	destroy_workqueue(dev->watchdog_workqueue);

	v4l2_m2m_release(dev->m2m_dev_enc);
	video_unregister_device(dev->vfd_enc);

	v4l2_m2m_release(dev->m2m_dev_dec);
	video_unregister_device(dev->vfd_dec);

	v4l2_device_unregister(&dev->v4l2_dev);

	dev->vb2->cleanup(dev->alloc_ctx);

	free_irq(dev->irq_no, pdev);
	mutex_destroy(&dev->lock);
	iounmap(dev->reg_base);

	clk_put(dev->clk);
#ifdef CONFIG_PM_RUNTIME
	pm_runtime_put_sync(&pdev->dev);
	pm_runtime_disable(&pdev->dev);
#endif
	kfree(dev);
	return 0;
}
static int __devexit msm_vidc_remove(struct platform_device *pdev)
{
	int rc = 0;
	struct msm_vidc_core *core;

	if (!pdev) {
		dprintk(VIDC_ERR, "%s invalid input %p", __func__, pdev);
		return -EINVAL;
	}
	core = pdev->dev.platform_data;

	if (!core) {
		dprintk(VIDC_ERR, "%s invalid core", __func__);
		return -EINVAL;
	}

	vidc_hfi_deinitialize(core->hfi_type, core->device);
	device_remove_file(&core->vdev[MSM_VIDC_ENCODER].vdev.dev,
				&dev_attr_link_name);
	video_unregister_device(&core->vdev[MSM_VIDC_ENCODER].vdev);
	device_remove_file(&core->vdev[MSM_VIDC_DECODER].vdev.dev,
				&dev_attr_link_name);
	video_unregister_device(&core->vdev[MSM_VIDC_DECODER].vdev);
	v4l2_device_unregister(&core->v4l2_dev);

	msm_vidc_free_platform_resources(&core->resources);
	kfree(core);
	return rc;
}
Exemple #4
0
static int s3c_camif_remove(struct platform_device *pdev)
{
	camif_cfg_t *codec, *preview;

	codec = s3c_camif_get_fimc_object(CODEC_MINOR);
	preview = s3c_camif_get_fimc_object(PREVIEW_MINOR);

	s3c_camif_release_irq(codec);
	s3c_camif_release_irq(preview);

	iounmap(codec->pp_virt_buf);
	codec->pp_virt_buf = 0;

	iounmap(preview->pp_virt_buf);
	preview->pp_virt_buf = 0;

	video_unregister_device(codec->v);
	video_unregister_device(preview->v);

	s3c_camif_set_priority(0);
	clk_disable(cam_clock);

	memset(codec, 0, sizeof(camif_cfg_t));
	memset(preview, 0, sizeof(camif_cfg_t));

	return 0;
}
Exemple #5
0
static void __exit cleanup_vloopback_module(void)
{
    int i;

    info("Unregistering video4linux loopback devices");

    for (i = 0; i < nr_o_pipes; i++) {
        if (loops[i]) {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)            
            priv_ptr ptr_in = (priv_ptr)dev_get_drvdata(&loops[i]->vloopin->dev);
            kfree(ptr_in);
            dev_set_drvdata(&loops[i]->vloopin->dev, NULL);
#else
            kfree(loops[i]->vloopin->vd_private_data);
#endif            
            video_unregister_device(loops[i]->vloopin);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)            
            priv_ptr ptr_out = (priv_ptr)dev_get_drvdata(&loops[i]->vloopout->dev);
            kfree(ptr_out);
            dev_set_drvdata(&loops[i]->vloopout->dev, NULL);
#else
            kfree(loops[i]->vloopout->vd_private_data);
#endif            
            video_unregister_device(loops[i]->vloopout);
            
            if (loops[i]->buffer) 
                rvfree(loops[i]->buffer, loops[i]->buflength * num_buffers);

            kfree(loops[i]->ioctldata);
            kfree(loops[i]->ioctlretdata);
            kfree(loops[i]);
        }
    }        
}
static void __exit vino_exit(void)
{
	video_unregister_device(&Vino->chA.vdev);
	video_unregister_device(&Vino->chB.vdev);
	vino_i2c_del_bus();
	free_irq(SGI_VINO_IRQ, NULL);
	pci_unmap_single(NULL, Vino->dummy_dma.dma, PAGE_SIZE,
			 PCI_DMA_FROMDEVICE);
	pci_free_consistent(NULL, 4 * sizeof(dma_addr_t),
			    (void *)Vino->dummy_dma.cpu, Vino->dummy_dma.dma);
	free_page(Vino->dummy_desc);
	kfree(Vino);
	iounmap(vino);
}
Exemple #7
0
static void
uvc_function_unbind(struct usb_configuration *c, struct usb_function *f)
{
	struct usb_composite_dev *cdev = c->cdev;
	struct uvc_device *uvc = to_uvc(f);

	INFO(cdev, "uvc_function_unbind\n");

	if (uvc->vdev) {
		if (uvc->vdev->minor == -1)
			video_device_release(uvc->vdev);
		else
			video_unregister_device(uvc->vdev);
		uvc->vdev = NULL;
	}

	if (uvc->control_ep)
		uvc->control_ep->driver_data = NULL;
	if (uvc->video.ep)
		uvc->video.ep->driver_data = NULL;

	if (uvc->control_req) {
		usb_ep_free_request(cdev->gadget->ep0, uvc->control_req);
		kfree(uvc->control_buf);
	}

	kfree(f->descriptors);
	kfree(f->hs_descriptors);

	kfree(uvc);
}
Exemple #8
0
static void at91sam9x5_video_unregister(struct at91sam9x5_video_priv *priv)
{
	unsigned long flags;

	spin_lock_irqsave(&priv->lock, flags);

	if (!priv->fbinfo) {
		spin_unlock_irqrestore(&priv->lock, flags);
		return;
	}
	/* XXX: handle fbinfo being NULL in various callbacks */
	priv->fbinfo = NULL;
	spin_unlock_irqrestore(&priv->lock, flags);

	/* silence DMA */
	at91sam9x5_video_write32(priv, REG_HEOIDR,
			REG_HEOIxR_ADD | REG_HEOIxR_DMA | REG_HEOIxR_UADD |
			REG_HEOIxR_UDMA | REG_HEOIxR_VADD | REG_HEOIxR_VDMA);

	video_unregister_device(priv->video_dev);
	free_irq(priv->irq, priv);
	vb2_queue_release(&priv->queue);
	vb2_dma_contig_cleanup_ctx(priv->alloc_ctx);
	video_device_release(priv->video_dev);
	iounmap(priv->regbase);
}
Exemple #9
0
void snd_tea575x_exit(struct snd_tea575x *tea)
{
	if (tea->vd) {
		video_unregister_device(tea->vd);
		tea->vd = NULL;
	}
}
Exemple #10
0
/*
 * si470x_fops_release - file release
 */
static int si470x_fops_release(struct inode *inode, struct file *file)
{
	struct si470x_device *radio = video_get_drvdata(video_devdata(file));
       int retval = 0;

	if (!radio)
		return -ENODEV;

       mutex_lock(&open_close_lock);
	radio->users--;
	if (radio->users == 0) {
	       if (radio->disconnected) {
		       video_unregister_device(radio->videodev);
		       kfree(radio->buffer);
		       kfree(radio);
		       goto done;
	       }

		/* stop rds reception */
		cancel_delayed_work_sync(&radio->work);

		/* cancel read processes */
		wake_up_interruptible(&radio->read_queue);

		retval = si470x_stop(radio);
		usb_autopm_put_interface(radio->intf);
	}

done:
       mutex_unlock(&open_close_lock);
       return retval;
}
Exemple #11
0
static void __exit smartcam_exit(void)
{
    SCAM_MSG("(%s) %s called\n", current->comm, __FUNCTION__);
    frame_sequence = 0;
    vfree(frame_data);
    video_unregister_device(&smartcam_vid);
}
Exemple #12
0
// Module cleanup
static void w99685_mod_term(void)
{
#if 0
	w99685_v4l1_release(&w685dev);
	video_unregister_device(&w685dev);
#endif
}
void snd_tea575x_exit(struct snd_tea575x *tea)
{
	if (tea->vd_registered) {
		video_unregister_device(&tea->vd);
		tea->vd_registered = 0;
	}
}
void isp_video_unregister(struct isp_video *video)
{
	if (video_is_registered(&video->video)) {
		media_entity_cleanup(&video->video.entity);
		video_unregister_device(&video->video);
	}
}
Exemple #15
0
// Terminate everything gracefully
static void w9966_term(struct w9966_dev* cam)
{
// Delete allocated buffer if needed
	if (cam->buffer != NULL) {
		kfree(cam->buffer);
		cam->buffer = NULL;
	}

// Unregister from v4l
	if (w9966_getState(cam, W9966_STATE_VDEV, W9966_STATE_VDEV)) {
		video_unregister_device(&cam->vdev);
		w9966_setState(cam, W9966_STATE_VDEV, 0);
	}

// Terminate from IEEE1284 mode and release pdev block
	if (w9966_getState(cam, W9966_STATE_PDEV, W9966_STATE_PDEV)) {
		w9966_pdev_claim(cam);
		parport_negotiate(cam->pport, IEEE1284_MODE_COMPAT);
		w9966_pdev_release(cam);
	}

// Unregister from parport
	if (w9966_getState(cam, W9966_STATE_PDEV, W9966_STATE_PDEV)) {
		parport_unregister_device(cam->pdev);
		w9966_setState(cam, W9966_STATE_PDEV, 0);
	}
}
Exemple #16
0
void gsc_unregister_m2m_device(struct gsc_dev *gsc)
{
	if (gsc) {
		v4l2_m2m_release(gsc->m2m.m2m_dev);
		video_unregister_device(&gsc->vdev);
	}
}
void atomisp_video_unregister(struct atomisp_video_pipe *video)
{
	if (video_is_registered(&video->vdev)) {
		media_entity_cleanup(&video->vdev.entity);
		video_unregister_device(&video->vdev);
	}
}
Exemple #18
0
static void omap24xxcam_device_unregister(struct v4l2_int_device *s)
{
	struct omap24xxcam_device *cam = s->u.slave->master->priv;

	omap24xxcam_sensor_exit(cam);

	if (cam->vfd) {
		if (!video_is_registered(cam->vfd)) {
			/*
			 * The device was never registered, so release the
			 * video_device struct directly.
			 */
			video_device_release(cam->vfd);
		} else {
			/*
			 * The unregister function will release the
			 * video_device struct as well as
			 * unregistering it.
			 */
			video_unregister_device(cam->vfd);
		}
		cam->vfd = NULL;
	}

	device_remove_file(cam->dev, &dev_attr_streaming);

	cam->sdev = NULL;
}
Exemple #19
0
/* Unregister v4l2 devices */
void cx18_streams_cleanup(struct cx18 *cx, int unregister)
{
	struct video_device *vdev;
	int type;

	/* Teardown all streams */
	for (type = 0; type < CX18_MAX_STREAMS; type++) {
		if (cx->streams[type].dvb.enabled) {
			cx18_dvb_unregister(&cx->streams[type]);
			cx->streams[type].dvb.enabled = false;
		}

		vdev = cx->streams[type].video_dev;

		cx->streams[type].video_dev = NULL;
		if (vdev == NULL)
			continue;

		cx18_stream_free(&cx->streams[type]);

		/* Unregister or release device */
		if (unregister)
			video_unregister_device(vdev);
		else
			video_device_release(vdev);
	}
}
Exemple #20
0
/* The user yanked out the cable... */
static void usb_pwc_disconnect(struct usb_interface *intf)
{
	struct v4l2_device *v = usb_get_intfdata(intf);
	struct pwc_device *pdev = container_of(v, struct pwc_device, v4l2_dev);

	mutex_lock(&pdev->vb_queue_lock);
	mutex_lock(&pdev->v4l2_lock);
	/* No need to keep the urbs around after disconnection */
	if (pdev->vb_queue.streaming)
		pwc_isoc_cleanup(pdev);
	pdev->udev = NULL;
	pwc_cleanup_queued_bufs(pdev);

	v4l2_device_disconnect(&pdev->v4l2_dev);
	video_unregister_device(&pdev->vdev);
	mutex_unlock(&pdev->v4l2_lock);
	mutex_unlock(&pdev->vb_queue_lock);

#ifdef CONFIG_USB_PWC_INPUT_EVDEV
	if (pdev->button_dev)
		input_unregister_device(pdev->button_dev);
#endif

	v4l2_device_put(&pdev->v4l2_dev);
}
Exemple #21
0
static void vsp1_histogram_cleanup(struct vsp1_histogram *histo)
{
	if (video_is_registered(&histo->video))
		video_unregister_device(&histo->video);

	media_entity_cleanup(&histo->video.entity);
}
Exemple #22
0
int register_nxp_video(struct nxp_video *me)
{
    int ret;

    me->vdev.v4l2_dev = me->v4l2_dev;

    pr_debug("%s: entered\n", __func__);
    ret = video_register_device(&me->vdev, VFL_TYPE_GRABBER, -1);
    if (ret < 0) {
        pr_err("%s: failed to video_register_device()\n", __func__);
        return ret;
    }

#if 0
    if (me->m2m_dev) {
        me->m2m_ctx = v4l2_m2m_ctx_init(me->m2m_dev, me, m2m_queue_init);
        if (IS_ERR(me->m2m_ctx)) {
            pr_err("%s: failed to v4l2_m2m_ctx_init()\n", __func__);
            video_unregister_device(&me->vdev);
            return -EINVAL;
        }
    }
#endif

    pr_debug("%s: success!!!\n", __func__);
    return 0;
}
void solo_v4l2_exit(struct solo6010_dev *solo_dev)
{
	solo6010_irq_off(solo_dev, SOLO_IRQ_VIDEO_IN);
	if (solo_dev->vfd) {
		video_unregister_device(solo_dev->vfd);
		solo_dev->vfd = NULL;
	}
}
Exemple #24
0
void solo_v4l2_exit(struct solo_dev *solo_dev)
{
	if (solo_dev->vfd == NULL)
		return;

	video_unregister_device(solo_dev->vfd);
	solo_dev->vfd = NULL;
}
Exemple #25
0
static void __exit rtrack_exit(void)
{
	struct rtrack *rt = &rtrack_card;

	video_unregister_device(&rt->vdev);
	v4l2_device_unregister(&rt->v4l2_dev);
	release_region(rt->io, 2);
}
static void __exit rtrack2_exit(void)
{
	struct rtrack2 *dev = &rtrack2_card;

	video_unregister_device(&dev->vdev);
	v4l2_device_unregister(&dev->v4l2_dev);
	release_region(dev->io, 4);
}
static void __exit zoltrix_exit(void)
{
	struct zoltrix *zol = &zoltrix_card;

	video_unregister_device(&zol->vdev);
	v4l2_device_unregister(&zol->v4l2_dev);
	release_region(zol->io, 2);
}
Exemple #28
0
void fthd_v4l2_unregister(struct fthd_private *dev_priv)
{

	v4l2_ctrl_handler_free(&dev_priv->v4l2_ctrl_handler);
	vb2_dma_sg_cleanup_ctx(dev_priv->alloc_ctx);
	video_unregister_device(dev_priv->videodev);
	v4l2_device_unregister(&dev_priv->v4l2_dev);
}
Exemple #29
0
// 二,出口函数
static void myvivi_exit(void)
{
	/* 2.1, 释放注册的结构体*/
	video_unregister_device(myvivi_device);

	/* 2.2,上面有分配,则出口函数就注销 */
	video_device_release(myvivi_device);
}
Exemple #30
0
static void
msmv4l2_exit (void)
{

	DLOG("mmsv4l2_exit+++\n");

	video_unregister_device(&msmv4l2_vid_device0);
	video_unregister_device(&msmv4l2_vid_device1);

	platform_driver_unregister(&msmv4l2_platform_driver);

	kfree(saved_vout0);
	kfree(saved_vout1);
	saved_vout0 = NULL;
	saved_vout1 = NULL;
	return;
}