diff options
Diffstat (limited to 'drivers/media/platform/soc_camera')
-rw-r--r-- | drivers/media/platform/soc_camera/Kconfig | 16 | ||||
-rw-r--r-- | drivers/media/platform/soc_camera/atmel-isi.c | 13 | ||||
-rw-r--r-- | drivers/media/platform/soc_camera/mx2_camera.c | 5 | ||||
-rw-r--r-- | drivers/media/platform/soc_camera/mx3_camera.c | 6 | ||||
-rw-r--r-- | drivers/media/platform/soc_camera/pxa_camera.c | 2 | ||||
-rw-r--r-- | drivers/media/platform/soc_camera/rcar_vin.c | 4 | ||||
-rw-r--r-- | drivers/media/platform/soc_camera/soc_camera.c | 21 |
7 files changed, 44 insertions, 23 deletions
diff --git a/drivers/media/platform/soc_camera/Kconfig b/drivers/media/platform/soc_camera/Kconfig index 6540847f4e1d..f2776cd415ca 100644 --- a/drivers/media/platform/soc_camera/Kconfig +++ b/drivers/media/platform/soc_camera/Kconfig @@ -20,6 +20,8 @@ config SOC_CAMERA_PLATFORM config VIDEO_MX3 tristate "i.MX3x Camera Sensor Interface driver" depends on VIDEO_DEV && MX3_IPU && SOC_CAMERA + depends on MX3_IPU || COMPILE_TEST + depends on HAS_DMA select VIDEOBUF2_DMA_CONTIG ---help--- This is a v4l2 driver for the i.MX3x Camera Sensor Interface @@ -35,6 +37,7 @@ config VIDEO_RCAR_VIN tristate "R-Car Video Input (VIN) support" depends on VIDEO_DEV && SOC_CAMERA depends on ARCH_SHMOBILE || COMPILE_TEST + depends on HAS_DMA select VIDEOBUF2_DMA_CONTIG select SOC_CAMERA_SCALE_CROP ---help--- @@ -51,6 +54,7 @@ config VIDEO_SH_MOBILE_CEU tristate "SuperH Mobile CEU Interface driver" depends on VIDEO_DEV && SOC_CAMERA && HAS_DMA && HAVE_CLK depends on ARCH_SHMOBILE || SUPERH || COMPILE_TEST + depends on HAS_DMA select VIDEOBUF2_DMA_CONTIG select SOC_CAMERA_SCALE_CROP ---help--- @@ -58,7 +62,9 @@ config VIDEO_SH_MOBILE_CEU config VIDEO_OMAP1 tristate "OMAP1 Camera Interface driver" - depends on VIDEO_DEV && ARCH_OMAP1 && SOC_CAMERA + depends on VIDEO_DEV && SOC_CAMERA + depends on ARCH_OMAP1 + depends on HAS_DMA select VIDEOBUF_DMA_CONTIG select VIDEOBUF_DMA_SG ---help--- @@ -66,14 +72,18 @@ config VIDEO_OMAP1 config VIDEO_MX2 tristate "i.MX27 Camera Sensor Interface driver" - depends on VIDEO_DEV && SOC_CAMERA && SOC_IMX27 + depends on VIDEO_DEV && SOC_CAMERA + depends on SOC_IMX27 || COMPILE_TEST + depends on HAS_DMA select VIDEOBUF2_DMA_CONTIG ---help--- This is a v4l2 driver for the i.MX27 Camera Sensor Interface config VIDEO_ATMEL_ISI tristate "ATMEL Image Sensor Interface (ISI) support" - depends on VIDEO_DEV && SOC_CAMERA && ARCH_AT91 + depends on VIDEO_DEV && SOC_CAMERA + depends on ARCH_AT91 || COMPILE_TEST + depends on HAS_DMA select VIDEOBUF2_DMA_CONTIG ---help--- This module makes the ATMEL Image Sensor Interface available diff --git a/drivers/media/platform/soc_camera/atmel-isi.c b/drivers/media/platform/soc_camera/atmel-isi.c index 3408b045b3f1..c5291b001057 100644 --- a/drivers/media/platform/soc_camera/atmel-isi.c +++ b/drivers/media/platform/soc_camera/atmel-isi.c @@ -54,7 +54,7 @@ static void set_dma_ctrl(struct fbd *fb_desc, u32 ctrl) struct isi_dma_desc { struct list_head list; struct fbd *p_fbd; - u32 fbd_phys; + dma_addr_t fbd_phys; }; /* Frame buffer data */ @@ -75,7 +75,7 @@ struct atmel_isi { /* Allocate descriptors for dma buffer use */ struct fbd *p_fb_descriptors; - u32 fb_descriptors_phys; + dma_addr_t fb_descriptors_phys; struct list_head dma_desc_head; struct isi_dma_desc dma_desc[MAX_BUFFER_NUM]; @@ -169,7 +169,7 @@ static irqreturn_t atmel_isi_handle_streaming(struct atmel_isi *isi) isi->active = list_entry(isi->video_buffer_list.next, struct frame_buffer, list); isi_writel(isi, ISI_DMA_C_DSCR, - isi->active->p_dma_desc->fbd_phys); + (u32)isi->active->p_dma_desc->fbd_phys); isi_writel(isi, ISI_DMA_C_CTRL, ISI_DMA_CTRL_FETCH | ISI_DMA_CTRL_DONE); isi_writel(isi, ISI_DMA_CHER, ISI_DMA_CHSR_C_CH); @@ -346,7 +346,7 @@ static void start_dma(struct atmel_isi *isi, struct frame_buffer *buffer) return; } - isi_writel(isi, ISI_DMA_C_DSCR, buffer->p_dma_desc->fbd_phys); + isi_writel(isi, ISI_DMA_C_DSCR, (u32)buffer->p_dma_desc->fbd_phys); isi_writel(isi, ISI_DMA_C_CTRL, ISI_DMA_CTRL_FETCH | ISI_DMA_CTRL_DONE); isi_writel(isi, ISI_DMA_CHER, ISI_DMA_CHSR_C_CH); @@ -384,7 +384,6 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count) struct soc_camera_device *icd = soc_camera_from_vb2q(vq); struct soc_camera_host *ici = to_soc_camera_host(icd->parent); struct atmel_isi *isi = ici->priv; - u32 sr = 0; int ret; /* Reset ISI */ @@ -394,11 +393,11 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count) return ret; } /* Disable all interrupts */ - isi_writel(isi, ISI_INTDIS, ~0UL); + isi_writel(isi, ISI_INTDIS, (u32)~0UL); spin_lock_irq(&isi->lock); /* Clear any pending interrupt */ - sr = isi_readl(isi, ISI_STATUS); + isi_readl(isi, ISI_STATUS); if (count) start_dma(isi, isi->active); diff --git a/drivers/media/platform/soc_camera/mx2_camera.c b/drivers/media/platform/soc_camera/mx2_camera.c index b40bc2e5ba47..2347612a4cc1 100644 --- a/drivers/media/platform/soc_camera/mx2_camera.c +++ b/drivers/media/platform/soc_camera/mx2_camera.c @@ -809,10 +809,9 @@ static int mx2_camera_init_videobuf(struct vb2_queue *q, static int mx27_camera_emma_prp_reset(struct mx2_camera_dev *pcdev) { - u32 cntl; int count = 0; - cntl = readl(pcdev->base_emma + PRP_CNTL); + readl(pcdev->base_emma + PRP_CNTL); writel(PRP_CNTL_SWRST, pcdev->base_emma + PRP_CNTL); while (count++ < 100) { if (!(readl(pcdev->base_emma + PRP_CNTL) & PRP_CNTL_SWRST)) @@ -1003,7 +1002,7 @@ static int mx2_emmaprp_resize(struct mx2_camera_dev *pcdev, struct v4l2_mbus_framefmt *mf_in, struct v4l2_pix_format *pix_out, bool apply) { - int num, den; + unsigned int num, den; unsigned long m; int i, dir; diff --git a/drivers/media/platform/soc_camera/mx3_camera.c b/drivers/media/platform/soc_camera/mx3_camera.c index 83315dfeef62..7696a873510d 100644 --- a/drivers/media/platform/soc_camera/mx3_camera.c +++ b/drivers/media/platform/soc_camera/mx3_camera.c @@ -415,10 +415,8 @@ static void mx3_stop_streaming(struct vb2_queue *q) struct mx3_camera_buffer *buf, *tmp; unsigned long flags; - if (ichan) { - struct dma_chan *chan = &ichan->dma_chan; - chan->device->device_control(chan, DMA_PAUSE, 0); - } + if (ichan) + dmaengine_pause(&ichan->dma_chan); spin_lock_irqsave(&mx3_cam->lock, flags); diff --git a/drivers/media/platform/soc_camera/pxa_camera.c b/drivers/media/platform/soc_camera/pxa_camera.c index 64dc80ccd6f9..66178fc9f9eb 100644 --- a/drivers/media/platform/soc_camera/pxa_camera.c +++ b/drivers/media/platform/soc_camera/pxa_camera.c @@ -1694,7 +1694,7 @@ static int pxa_camera_pdata_from_dt(struct device *dev, break; default: break; - }; + } if (ep.bus.parallel.flags & V4L2_MBUS_MASTER) pcdev->platform_flags |= PXA_CAMERA_MASTER; diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c index 85d579f65f52..20defcb8b31b 100644 --- a/drivers/media/platform/soc_camera/rcar_vin.c +++ b/drivers/media/platform/soc_camera/rcar_vin.c @@ -981,7 +981,7 @@ static int rcar_vin_get_formats(struct soc_camera_device *icd, unsigned int idx, if (shift == 3) { dev_err(dev, - "Failed to configure the client below %ux%x\n", + "Failed to configure the client below %ux%u\n", mf.width, mf.height); return -EIO; } @@ -1502,7 +1502,7 @@ static int rcar_vin_probe(struct platform_device *pdev) } else { priv->ici.nr = of_alias_get_id(pdev->dev.of_node, "vin"); priv->chip = (enum chip_id)match->data; - }; + } spin_lock_init(&priv->lock); INIT_LIST_HEAD(&priv->capture); diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c index f4308fed5431..8e61b976da19 100644 --- a/drivers/media/platform/soc_camera/soc_camera.c +++ b/drivers/media/platform/soc_camera/soc_camera.c @@ -437,6 +437,22 @@ static int soc_camera_prepare_buf(struct file *file, void *priv, return vb2_prepare_buf(&icd->vb2_vidq, b); } +static int soc_camera_expbuf(struct file *file, void *priv, + struct v4l2_exportbuffer *p) +{ + struct soc_camera_device *icd = file->private_data; + struct soc_camera_host *ici = to_soc_camera_host(icd->parent); + + if (icd->streamer != file) + return -EBUSY; + + /* videobuf2 only */ + if (ici->ops->init_videobuf) + return -EINVAL; + else + return vb2_expbuf(&icd->vb2_vidq, p); +} + /* Always entered with .host_lock held */ static int soc_camera_init_user_formats(struct soc_camera_device *icd) { @@ -1347,13 +1363,11 @@ static int soc_camera_i2c_init(struct soc_camera_device *icd, return -ENODEV; } - ssdd = kzalloc(sizeof(*ssdd), GFP_KERNEL); + ssdd = kmemdup(&sdesc->subdev_desc, sizeof(*ssdd), GFP_KERNEL); if (!ssdd) { ret = -ENOMEM; goto ealloc; } - - memcpy(ssdd, &sdesc->subdev_desc, sizeof(*ssdd)); /* * In synchronous case we request regulators ourselves in * soc_camera_pdrv_probe(), make sure the subdevice driver doesn't try @@ -2085,6 +2099,7 @@ static const struct v4l2_ioctl_ops soc_camera_ioctl_ops = { .vidioc_dqbuf = soc_camera_dqbuf, .vidioc_create_bufs = soc_camera_create_bufs, .vidioc_prepare_buf = soc_camera_prepare_buf, + .vidioc_expbuf = soc_camera_expbuf, .vidioc_streamon = soc_camera_streamon, .vidioc_streamoff = soc_camera_streamoff, .vidioc_cropcap = soc_camera_cropcap, |