diff options
Diffstat (limited to 'drivers/media/platform/pxa_camera.c')
-rw-r--r-- | drivers/media/platform/pxa_camera.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/drivers/media/platform/pxa_camera.c b/drivers/media/platform/pxa_camera.c index 295f34ad1080..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> @@ -647,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; }; @@ -693,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; @@ -743,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; @@ -755,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++; @@ -1722,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; @@ -1794,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); @@ -1883,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 = { @@ -1947,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, @@ -2336,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); @@ -2492,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; @@ -2528,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: |