diff options
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/mem2mem_testdev.c | 2 | ||||
-rw-r--r-- | drivers/media/video/mx1_camera.c | 4 | ||||
-rw-r--r-- | drivers/media/video/mx2_camera.c | 47 | ||||
-rw-r--r-- | drivers/media/video/mx3_camera.c | 22 | ||||
-rw-r--r-- | drivers/media/video/soc_camera.c | 3 | ||||
-rw-r--r-- | drivers/media/video/soc_mediabus.c | 6 | ||||
-rw-r--r-- | drivers/media/video/uvc/uvc_queue.c | 1 | ||||
-rw-r--r-- | drivers/media/video/v4l2-ioctl.c | 10 |
8 files changed, 58 insertions, 37 deletions
diff --git a/drivers/media/video/mem2mem_testdev.c b/drivers/media/video/mem2mem_testdev.c index 7efe9ad7acc7..0b91a5cd38eb 100644 --- a/drivers/media/video/mem2mem_testdev.c +++ b/drivers/media/video/mem2mem_testdev.c | |||
@@ -431,7 +431,7 @@ static int vidioc_querycap(struct file *file, void *priv, | |||
431 | strncpy(cap->driver, MEM2MEM_NAME, sizeof(cap->driver) - 1); | 431 | strncpy(cap->driver, MEM2MEM_NAME, sizeof(cap->driver) - 1); |
432 | strncpy(cap->card, MEM2MEM_NAME, sizeof(cap->card) - 1); | 432 | strncpy(cap->card, MEM2MEM_NAME, sizeof(cap->card) - 1); |
433 | strlcpy(cap->bus_info, MEM2MEM_NAME, sizeof(cap->bus_info)); | 433 | strlcpy(cap->bus_info, MEM2MEM_NAME, sizeof(cap->bus_info)); |
434 | cap->capabilities = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING; | 434 | cap->device_caps = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING; |
435 | cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; | 435 | cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; |
436 | return 0; | 436 | return 0; |
437 | } | 437 | } |
diff --git a/drivers/media/video/mx1_camera.c b/drivers/media/video/mx1_camera.c index d2e6f82ecfac..560a65aa7038 100644 --- a/drivers/media/video/mx1_camera.c +++ b/drivers/media/video/mx1_camera.c | |||
@@ -403,7 +403,7 @@ static void mx1_camera_activate(struct mx1_camera_dev *pcdev) | |||
403 | 403 | ||
404 | dev_dbg(pcdev->icd->parent, "Activate device\n"); | 404 | dev_dbg(pcdev->icd->parent, "Activate device\n"); |
405 | 405 | ||
406 | clk_enable(pcdev->clk); | 406 | clk_prepare_enable(pcdev->clk); |
407 | 407 | ||
408 | /* enable CSI before doing anything else */ | 408 | /* enable CSI before doing anything else */ |
409 | __raw_writel(csicr1, pcdev->base + CSICR1); | 409 | __raw_writel(csicr1, pcdev->base + CSICR1); |
@@ -422,7 +422,7 @@ static void mx1_camera_deactivate(struct mx1_camera_dev *pcdev) | |||
422 | /* Disable all CSI interface */ | 422 | /* Disable all CSI interface */ |
423 | __raw_writel(0x00, pcdev->base + CSICR1); | 423 | __raw_writel(0x00, pcdev->base + CSICR1); |
424 | 424 | ||
425 | clk_disable(pcdev->clk); | 425 | clk_disable_unprepare(pcdev->clk); |
426 | } | 426 | } |
427 | 427 | ||
428 | /* | 428 | /* |
diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c index 637bde8aca28..ac175406e582 100644 --- a/drivers/media/video/mx2_camera.c +++ b/drivers/media/video/mx2_camera.c | |||
@@ -272,7 +272,7 @@ struct mx2_camera_dev { | |||
272 | struct device *dev; | 272 | struct device *dev; |
273 | struct soc_camera_host soc_host; | 273 | struct soc_camera_host soc_host; |
274 | struct soc_camera_device *icd; | 274 | struct soc_camera_device *icd; |
275 | struct clk *clk_csi, *clk_emma; | 275 | struct clk *clk_csi, *clk_emma_ahb, *clk_emma_ipg; |
276 | 276 | ||
277 | unsigned int irq_csi, irq_emma; | 277 | unsigned int irq_csi, irq_emma; |
278 | void __iomem *base_csi, *base_emma; | 278 | void __iomem *base_csi, *base_emma; |
@@ -407,7 +407,7 @@ static void mx2_camera_deactivate(struct mx2_camera_dev *pcdev) | |||
407 | { | 407 | { |
408 | unsigned long flags; | 408 | unsigned long flags; |
409 | 409 | ||
410 | clk_disable(pcdev->clk_csi); | 410 | clk_disable_unprepare(pcdev->clk_csi); |
411 | writel(0, pcdev->base_csi + CSICR1); | 411 | writel(0, pcdev->base_csi + CSICR1); |
412 | if (cpu_is_mx27()) { | 412 | if (cpu_is_mx27()) { |
413 | writel(0, pcdev->base_emma + PRP_CNTL); | 413 | writel(0, pcdev->base_emma + PRP_CNTL); |
@@ -435,7 +435,7 @@ static int mx2_camera_add_device(struct soc_camera_device *icd) | |||
435 | if (pcdev->icd) | 435 | if (pcdev->icd) |
436 | return -EBUSY; | 436 | return -EBUSY; |
437 | 437 | ||
438 | ret = clk_enable(pcdev->clk_csi); | 438 | ret = clk_prepare_enable(pcdev->clk_csi); |
439 | if (ret < 0) | 439 | if (ret < 0) |
440 | return ret; | 440 | return ret; |
441 | 441 | ||
@@ -1633,23 +1633,34 @@ static int __devinit mx27_camera_emma_init(struct mx2_camera_dev *pcdev) | |||
1633 | goto exit_iounmap; | 1633 | goto exit_iounmap; |
1634 | } | 1634 | } |
1635 | 1635 | ||
1636 | pcdev->clk_emma = clk_get(NULL, "emma"); | 1636 | pcdev->clk_emma_ipg = clk_get(pcdev->dev, "emma-ipg"); |
1637 | if (IS_ERR(pcdev->clk_emma)) { | 1637 | if (IS_ERR(pcdev->clk_emma_ipg)) { |
1638 | err = PTR_ERR(pcdev->clk_emma); | 1638 | err = PTR_ERR(pcdev->clk_emma_ipg); |
1639 | goto exit_free_irq; | 1639 | goto exit_free_irq; |
1640 | } | 1640 | } |
1641 | 1641 | ||
1642 | clk_enable(pcdev->clk_emma); | 1642 | clk_prepare_enable(pcdev->clk_emma_ipg); |
1643 | |||
1644 | pcdev->clk_emma_ahb = clk_get(pcdev->dev, "emma-ahb"); | ||
1645 | if (IS_ERR(pcdev->clk_emma_ahb)) { | ||
1646 | err = PTR_ERR(pcdev->clk_emma_ahb); | ||
1647 | goto exit_clk_emma_ipg_put; | ||
1648 | } | ||
1649 | |||
1650 | clk_prepare_enable(pcdev->clk_emma_ahb); | ||
1643 | 1651 | ||
1644 | err = mx27_camera_emma_prp_reset(pcdev); | 1652 | err = mx27_camera_emma_prp_reset(pcdev); |
1645 | if (err) | 1653 | if (err) |
1646 | goto exit_clk_emma_put; | 1654 | goto exit_clk_emma_ahb_put; |
1647 | 1655 | ||
1648 | return err; | 1656 | return err; |
1649 | 1657 | ||
1650 | exit_clk_emma_put: | 1658 | exit_clk_emma_ahb_put: |
1651 | clk_disable(pcdev->clk_emma); | 1659 | clk_disable_unprepare(pcdev->clk_emma_ahb); |
1652 | clk_put(pcdev->clk_emma); | 1660 | clk_put(pcdev->clk_emma_ahb); |
1661 | exit_clk_emma_ipg_put: | ||
1662 | clk_disable_unprepare(pcdev->clk_emma_ipg); | ||
1663 | clk_put(pcdev->clk_emma_ipg); | ||
1653 | exit_free_irq: | 1664 | exit_free_irq: |
1654 | free_irq(pcdev->irq_emma, pcdev); | 1665 | free_irq(pcdev->irq_emma, pcdev); |
1655 | exit_iounmap: | 1666 | exit_iounmap: |
@@ -1685,7 +1696,7 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev) | |||
1685 | goto exit; | 1696 | goto exit; |
1686 | } | 1697 | } |
1687 | 1698 | ||
1688 | pcdev->clk_csi = clk_get(&pdev->dev, NULL); | 1699 | pcdev->clk_csi = clk_get(&pdev->dev, "ahb"); |
1689 | if (IS_ERR(pcdev->clk_csi)) { | 1700 | if (IS_ERR(pcdev->clk_csi)) { |
1690 | dev_err(&pdev->dev, "Could not get csi clock\n"); | 1701 | dev_err(&pdev->dev, "Could not get csi clock\n"); |
1691 | err = PTR_ERR(pcdev->clk_csi); | 1702 | err = PTR_ERR(pcdev->clk_csi); |
@@ -1785,8 +1796,10 @@ exit_free_emma: | |||
1785 | eallocctx: | 1796 | eallocctx: |
1786 | if (cpu_is_mx27()) { | 1797 | if (cpu_is_mx27()) { |
1787 | free_irq(pcdev->irq_emma, pcdev); | 1798 | free_irq(pcdev->irq_emma, pcdev); |
1788 | clk_disable(pcdev->clk_emma); | 1799 | clk_disable_unprepare(pcdev->clk_emma_ipg); |
1789 | clk_put(pcdev->clk_emma); | 1800 | clk_put(pcdev->clk_emma_ipg); |
1801 | clk_disable_unprepare(pcdev->clk_emma_ahb); | ||
1802 | clk_put(pcdev->clk_emma_ahb); | ||
1790 | iounmap(pcdev->base_emma); | 1803 | iounmap(pcdev->base_emma); |
1791 | release_mem_region(pcdev->res_emma->start, resource_size(pcdev->res_emma)); | 1804 | release_mem_region(pcdev->res_emma->start, resource_size(pcdev->res_emma)); |
1792 | } | 1805 | } |
@@ -1825,8 +1838,10 @@ static int __devexit mx2_camera_remove(struct platform_device *pdev) | |||
1825 | iounmap(pcdev->base_csi); | 1838 | iounmap(pcdev->base_csi); |
1826 | 1839 | ||
1827 | if (cpu_is_mx27()) { | 1840 | if (cpu_is_mx27()) { |
1828 | clk_disable(pcdev->clk_emma); | 1841 | clk_disable_unprepare(pcdev->clk_emma_ipg); |
1829 | clk_put(pcdev->clk_emma); | 1842 | clk_put(pcdev->clk_emma_ipg); |
1843 | clk_disable_unprepare(pcdev->clk_emma_ahb); | ||
1844 | clk_put(pcdev->clk_emma_ahb); | ||
1830 | iounmap(pcdev->base_emma); | 1845 | iounmap(pcdev->base_emma); |
1831 | res = pcdev->res_emma; | 1846 | res = pcdev->res_emma; |
1832 | release_mem_region(res->start, resource_size(res)); | 1847 | release_mem_region(res->start, resource_size(res)); |
diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c index f13643d31353..af2297dd49c8 100644 --- a/drivers/media/video/mx3_camera.c +++ b/drivers/media/video/mx3_camera.c | |||
@@ -61,15 +61,9 @@ | |||
61 | 61 | ||
62 | #define MAX_VIDEO_MEM 16 | 62 | #define MAX_VIDEO_MEM 16 |
63 | 63 | ||
64 | enum csi_buffer_state { | ||
65 | CSI_BUF_NEEDS_INIT, | ||
66 | CSI_BUF_PREPARED, | ||
67 | }; | ||
68 | |||
69 | struct mx3_camera_buffer { | 64 | struct mx3_camera_buffer { |
70 | /* common v4l buffer stuff -- must be first */ | 65 | /* common v4l buffer stuff -- must be first */ |
71 | struct vb2_buffer vb; | 66 | struct vb2_buffer vb; |
72 | enum csi_buffer_state state; | ||
73 | struct list_head queue; | 67 | struct list_head queue; |
74 | 68 | ||
75 | /* One descriptot per scatterlist (per frame) */ | 69 | /* One descriptot per scatterlist (per frame) */ |
@@ -285,7 +279,7 @@ static void mx3_videobuf_queue(struct vb2_buffer *vb) | |||
285 | goto error; | 279 | goto error; |
286 | } | 280 | } |
287 | 281 | ||
288 | if (buf->state == CSI_BUF_NEEDS_INIT) { | 282 | if (!buf->txd) { |
289 | sg_dma_address(sg) = vb2_dma_contig_plane_dma_addr(vb, 0); | 283 | sg_dma_address(sg) = vb2_dma_contig_plane_dma_addr(vb, 0); |
290 | sg_dma_len(sg) = new_size; | 284 | sg_dma_len(sg) = new_size; |
291 | 285 | ||
@@ -298,7 +292,6 @@ static void mx3_videobuf_queue(struct vb2_buffer *vb) | |||
298 | txd->callback_param = txd; | 292 | txd->callback_param = txd; |
299 | txd->callback = mx3_cam_dma_done; | 293 | txd->callback = mx3_cam_dma_done; |
300 | 294 | ||
301 | buf->state = CSI_BUF_PREPARED; | ||
302 | buf->txd = txd; | 295 | buf->txd = txd; |
303 | } else { | 296 | } else { |
304 | txd = buf->txd; | 297 | txd = buf->txd; |
@@ -385,7 +378,6 @@ static void mx3_videobuf_release(struct vb2_buffer *vb) | |||
385 | 378 | ||
386 | /* Doesn't hurt also if the list is empty */ | 379 | /* Doesn't hurt also if the list is empty */ |
387 | list_del_init(&buf->queue); | 380 | list_del_init(&buf->queue); |
388 | buf->state = CSI_BUF_NEEDS_INIT; | ||
389 | 381 | ||
390 | if (txd) { | 382 | if (txd) { |
391 | buf->txd = NULL; | 383 | buf->txd = NULL; |
@@ -405,13 +397,13 @@ static int mx3_videobuf_init(struct vb2_buffer *vb) | |||
405 | struct mx3_camera_dev *mx3_cam = ici->priv; | 397 | struct mx3_camera_dev *mx3_cam = ici->priv; |
406 | struct mx3_camera_buffer *buf = to_mx3_vb(vb); | 398 | struct mx3_camera_buffer *buf = to_mx3_vb(vb); |
407 | 399 | ||
408 | /* This is for locking debugging only */ | 400 | if (!buf->txd) { |
409 | INIT_LIST_HEAD(&buf->queue); | 401 | /* This is for locking debugging only */ |
410 | sg_init_table(&buf->sg, 1); | 402 | INIT_LIST_HEAD(&buf->queue); |
403 | sg_init_table(&buf->sg, 1); | ||
411 | 404 | ||
412 | buf->state = CSI_BUF_NEEDS_INIT; | 405 | mx3_cam->buf_total += vb2_plane_size(vb, 0); |
413 | 406 | } | |
414 | mx3_cam->buf_total += vb2_plane_size(vb, 0); | ||
415 | 407 | ||
416 | return 0; | 408 | return 0; |
417 | } | 409 | } |
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c index b03ffecb7438..1bde255e45df 100644 --- a/drivers/media/video/soc_camera.c +++ b/drivers/media/video/soc_camera.c | |||
@@ -171,7 +171,8 @@ static int soc_camera_try_fmt(struct soc_camera_device *icd, | |||
171 | dev_dbg(icd->pdev, "TRY_FMT(%c%c%c%c, %ux%u)\n", | 171 | dev_dbg(icd->pdev, "TRY_FMT(%c%c%c%c, %ux%u)\n", |
172 | pixfmtstr(pix->pixelformat), pix->width, pix->height); | 172 | pixfmtstr(pix->pixelformat), pix->width, pix->height); |
173 | 173 | ||
174 | if (!(ici->capabilities & SOCAM_HOST_CAP_STRIDE)) { | 174 | if (pix->pixelformat != V4L2_PIX_FMT_JPEG && |
175 | !(ici->capabilities & SOCAM_HOST_CAP_STRIDE)) { | ||
175 | pix->bytesperline = 0; | 176 | pix->bytesperline = 0; |
176 | pix->sizeimage = 0; | 177 | pix->sizeimage = 0; |
177 | } | 178 | } |
diff --git a/drivers/media/video/soc_mediabus.c b/drivers/media/video/soc_mediabus.c index 89dce097a827..a397812635d6 100644 --- a/drivers/media/video/soc_mediabus.c +++ b/drivers/media/video/soc_mediabus.c | |||
@@ -378,6 +378,9 @@ EXPORT_SYMBOL(soc_mbus_samples_per_pixel); | |||
378 | 378 | ||
379 | s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf) | 379 | s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf) |
380 | { | 380 | { |
381 | if (mf->fourcc == V4L2_PIX_FMT_JPEG) | ||
382 | return 0; | ||
383 | |||
381 | if (mf->layout != SOC_MBUS_LAYOUT_PACKED) | 384 | if (mf->layout != SOC_MBUS_LAYOUT_PACKED) |
382 | return width * mf->bits_per_sample / 8; | 385 | return width * mf->bits_per_sample / 8; |
383 | 386 | ||
@@ -400,6 +403,9 @@ EXPORT_SYMBOL(soc_mbus_bytes_per_line); | |||
400 | s32 soc_mbus_image_size(const struct soc_mbus_pixelfmt *mf, | 403 | s32 soc_mbus_image_size(const struct soc_mbus_pixelfmt *mf, |
401 | u32 bytes_per_line, u32 height) | 404 | u32 bytes_per_line, u32 height) |
402 | { | 405 | { |
406 | if (mf->fourcc == V4L2_PIX_FMT_JPEG) | ||
407 | return 0; | ||
408 | |||
403 | if (mf->layout == SOC_MBUS_LAYOUT_PACKED) | 409 | if (mf->layout == SOC_MBUS_LAYOUT_PACKED) |
404 | return bytes_per_line * height; | 410 | return bytes_per_line * height; |
405 | 411 | ||
diff --git a/drivers/media/video/uvc/uvc_queue.c b/drivers/media/video/uvc/uvc_queue.c index 9288fbd5001b..5577381b5bf0 100644 --- a/drivers/media/video/uvc/uvc_queue.c +++ b/drivers/media/video/uvc/uvc_queue.c | |||
@@ -338,6 +338,7 @@ struct uvc_buffer *uvc_queue_next_buffer(struct uvc_video_queue *queue, | |||
338 | if ((queue->flags & UVC_QUEUE_DROP_CORRUPTED) && buf->error) { | 338 | if ((queue->flags & UVC_QUEUE_DROP_CORRUPTED) && buf->error) { |
339 | buf->error = 0; | 339 | buf->error = 0; |
340 | buf->state = UVC_BUF_STATE_QUEUED; | 340 | buf->state = UVC_BUF_STATE_QUEUED; |
341 | buf->bytesused = 0; | ||
341 | vb2_set_plane_payload(&buf->buf, 0, 0); | 342 | vb2_set_plane_payload(&buf->buf, 0, 0); |
342 | return buf; | 343 | return buf; |
343 | } | 344 | } |
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c index c3b7b5f59b32..6bc47fc82fe2 100644 --- a/drivers/media/video/v4l2-ioctl.c +++ b/drivers/media/video/v4l2-ioctl.c | |||
@@ -402,8 +402,10 @@ static void v4l_print_hw_freq_seek(const void *arg, bool write_only) | |||
402 | { | 402 | { |
403 | const struct v4l2_hw_freq_seek *p = arg; | 403 | const struct v4l2_hw_freq_seek *p = arg; |
404 | 404 | ||
405 | pr_cont("tuner=%u, type=%u, seek_upward=%u, wrap_around=%u, spacing=%u\n", | 405 | pr_cont("tuner=%u, type=%u, seek_upward=%u, wrap_around=%u, spacing=%u, " |
406 | p->tuner, p->type, p->seek_upward, p->wrap_around, p->spacing); | 406 | "rangelow=%u, rangehigh=%u\n", |
407 | p->tuner, p->type, p->seek_upward, p->wrap_around, p->spacing, | ||
408 | p->rangelow, p->rangehigh); | ||
407 | } | 409 | } |
408 | 410 | ||
409 | static void v4l_print_requestbuffers(const void *arg, bool write_only) | 411 | static void v4l_print_requestbuffers(const void *arg, bool write_only) |
@@ -1853,6 +1855,8 @@ static int v4l_enum_freq_bands(const struct v4l2_ioctl_ops *ops, | |||
1853 | .type = type, | 1855 | .type = type, |
1854 | }; | 1856 | }; |
1855 | 1857 | ||
1858 | if (p->index) | ||
1859 | return -EINVAL; | ||
1856 | err = ops->vidioc_g_tuner(file, fh, &t); | 1860 | err = ops->vidioc_g_tuner(file, fh, &t); |
1857 | if (err) | 1861 | if (err) |
1858 | return err; | 1862 | return err; |
@@ -1870,6 +1874,8 @@ static int v4l_enum_freq_bands(const struct v4l2_ioctl_ops *ops, | |||
1870 | 1874 | ||
1871 | if (type != V4L2_TUNER_RADIO) | 1875 | if (type != V4L2_TUNER_RADIO) |
1872 | return -EINVAL; | 1876 | return -EINVAL; |
1877 | if (p->index) | ||
1878 | return -EINVAL; | ||
1873 | err = ops->vidioc_g_modulator(file, fh, &m); | 1879 | err = ops->vidioc_g_modulator(file, fh, &m); |
1874 | if (err) | 1880 | if (err) |
1875 | return err; | 1881 | return err; |