diff options
Diffstat (limited to 'drivers/media/platform/pxa_camera.c')
-rw-r--r-- | drivers/media/platform/pxa_camera.c | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/drivers/media/platform/pxa_camera.c b/drivers/media/platform/pxa_camera.c index 9d3f0cb1d95a..c71a00736541 100644 --- a/drivers/media/platform/pxa_camera.c +++ b/drivers/media/platform/pxa_camera.c @@ -32,7 +32,6 @@ #include <linux/sched.h> #include <linux/slab.h> #include <linux/dmaengine.h> -#include <linux/dma-mapping.h> #include <linux/dma/pxa-dma.h> #include <media/v4l2-async.h> @@ -235,6 +234,7 @@ enum pxa_mbus_layout { * stored in memory in the following way: * @packing: Type of sample-packing, that has to be used * @order: Sample order when storing in memory + * @layout: Planes layout in memory * @bits_per_sample: How many bits the bridge has to sample */ struct pxa_mbus_pixelfmt { @@ -646,16 +646,16 @@ static unsigned int pxa_mbus_config_compatible(const struct v4l2_mbus_config *cf } /** - * struct soc_camera_format_xlate - match between host and sensor formats + * struct pxa_camera_format_xlate - match between host and sensor formats * @code: code of a sensor provided format * @host_fmt: host format after host translation from code * * Host and sensor translation structure. Used in table of host and sensor - * formats matchings in soc_camera_device. A host can override the generic list + * formats matchings in pxa_camera_device. A host can override the generic list * generation by implementing get_formats(), and use it for format checks and * format setup. */ -struct soc_camera_format_xlate { +struct pxa_camera_format_xlate { u32 code; const struct pxa_mbus_pixelfmt *host_fmt; }; @@ -692,8 +692,8 @@ struct pxa_camera_dev { struct v4l2_async_notifier notifier; struct vb2_queue vb2_vq; struct v4l2_subdev *sensor; - struct soc_camera_format_xlate *user_formats; - const struct soc_camera_format_xlate *current_fmt; + struct pxa_camera_format_xlate *user_formats; + const struct pxa_camera_format_xlate *current_fmt; struct v4l2_pix_format current_pix; struct v4l2_async_subdev asd; @@ -742,8 +742,8 @@ static const char *pxa_cam_driver_description = "PXA_Camera"; /* * Format translation functions */ -static const struct soc_camera_format_xlate -*pxa_mbus_xlate_by_fourcc(struct soc_camera_format_xlate *user_formats, +static const struct pxa_camera_format_xlate +*pxa_mbus_xlate_by_fourcc(struct pxa_camera_format_xlate *user_formats, unsigned int fourcc) { unsigned int i; @@ -754,17 +754,17 @@ static const struct soc_camera_format_xlate return NULL; } -static struct soc_camera_format_xlate *pxa_mbus_build_fmts_xlate( +static struct pxa_camera_format_xlate *pxa_mbus_build_fmts_xlate( struct v4l2_device *v4l2_dev, struct v4l2_subdev *subdev, int (*get_formats)(struct v4l2_device *, unsigned int, - struct soc_camera_format_xlate *xlate)) + struct pxa_camera_format_xlate *xlate)) { unsigned int i, fmts = 0, raw_fmts = 0; int ret; struct v4l2_subdev_mbus_code_enum code = { .which = V4L2_SUBDEV_FORMAT_ACTIVE, }; - struct soc_camera_format_xlate *user_formats; + struct pxa_camera_format_xlate *user_formats; while (!v4l2_subdev_call(subdev, pad, enum_mbus_code, NULL, &code)) { raw_fmts++; @@ -852,10 +852,10 @@ static void pxa_camera_dma_irq_v(void *data) /** * pxa_init_dma_channel - init dma descriptors * @pcdev: pxa camera device - * @vb: videobuffer2 buffer - * @dma: dma video buffer + * @buf: pxa camera buffer * @channel: dma channel (0 => 'Y', 1 => 'U', 2 => 'V') - * @cibr: camera Receive Buffer Register + * @sg: dma scatter list + * @sglen: dma scatter list length * * Prepares the pxa dma descriptors to transfer one camera channel. * @@ -1010,6 +1010,8 @@ static void pxa_camera_wakeup(struct pxa_camera_dev *pcdev, /** * pxa_camera_check_link_miss - check missed DMA linking * @pcdev: camera device + * @last_submitted: an opaque DMA cookie for last submitted + * @last_issued: an opaque DMA cookie for last issued * * The DMA chaining is done with DMA running. This means a tiny temporal window * remains, where a buffer is queued on the chain, while the chain is already @@ -1719,7 +1721,7 @@ static bool pxa_camera_packing_supported(const struct pxa_mbus_pixelfmt *fmt) static int pxa_camera_get_formats(struct v4l2_device *v4l2_dev, unsigned int idx, - struct soc_camera_format_xlate *xlate) + struct pxa_camera_format_xlate *xlate) { struct pxa_camera_dev *pcdev = v4l2_dev_to_pcdev(v4l2_dev); int formats = 0, ret; @@ -1791,7 +1793,7 @@ static int pxa_camera_get_formats(struct v4l2_device *v4l2_dev, static int pxa_camera_build_formats(struct pxa_camera_dev *pcdev) { - struct soc_camera_format_xlate *xlate; + struct pxa_camera_format_xlate *xlate; xlate = pxa_mbus_build_fmts_xlate(&pcdev->v4l2_dev, pcdev->sensor, pxa_camera_get_formats); @@ -1880,7 +1882,7 @@ static int pxac_vidioc_try_fmt_vid_cap(struct file *filp, void *priv, struct v4l2_format *f) { struct pxa_camera_dev *pcdev = video_drvdata(filp); - const struct soc_camera_format_xlate *xlate; + const struct pxa_camera_format_xlate *xlate; struct v4l2_pix_format *pix = &f->fmt.pix; struct v4l2_subdev_pad_config pad_cfg; struct v4l2_subdev_format format = { @@ -1944,7 +1946,7 @@ static int pxac_vidioc_s_fmt_vid_cap(struct file *filp, void *priv, struct v4l2_format *f) { struct pxa_camera_dev *pcdev = video_drvdata(filp); - const struct soc_camera_format_xlate *xlate; + const struct pxa_camera_format_xlate *xlate; struct v4l2_pix_format *pix = &f->fmt.pix; struct v4l2_subdev_format format = { .which = V4L2_SUBDEV_FORMAT_ACTIVE, @@ -2333,7 +2335,7 @@ static int pxa_camera_pdata_from_dt(struct device *dev, asd->match_type = V4L2_ASYNC_MATCH_FWNODE; remote = of_graph_get_remote_port(np); if (remote) { - asd->match.fwnode.fwnode = of_fwnode_handle(remote); + asd->match.fwnode = of_fwnode_handle(remote); of_node_put(remote); } else { dev_notice(dev, "no remote for %pOF\n", np); @@ -2489,7 +2491,7 @@ static int pxa_camera_probe(struct platform_device *pdev) dev_set_drvdata(&pdev->dev, pcdev); err = v4l2_device_register(&pdev->dev, &pcdev->v4l2_dev); if (err) - goto exit_free_dma; + goto exit_deactivate; pcdev->asds[0] = &pcdev->asd; pcdev->notifier.subdevs = pcdev->asds; @@ -2525,6 +2527,8 @@ exit_free_clk: v4l2_clk_unregister(pcdev->mclk_clk); exit_free_v4l2dev: v4l2_device_unregister(&pcdev->v4l2_dev); +exit_deactivate: + pxa_camera_deactivate(pcdev); exit_free_dma: dma_release_channel(pcdev->dma_chans[2]); exit_free_dma_u: |