summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2012-12-26 13:13:46 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-06-21 16:36:15 -0300
commitee17608d6aa04a86e253a9130d6c6d00892f132b (patch)
tree326a84f479cd6e3872f1406461127b787cdb09e5 /drivers/media
parent676d2d4f08ccdfab45867aaf1edeeb923b45bdc1 (diff)
downloadlinux-ee17608d6aa04a86e253a9130d6c6d00892f132b.tar.gz
linux-ee17608d6aa04a86e253a9130d6c6d00892f132b.tar.bz2
linux-ee17608d6aa04a86e253a9130d6c6d00892f132b.zip
[media] imx074: support asynchronous probing
Both synchronous and asynchronous imx074 subdevice probing is supported by this patch. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/i2c/soc_camera/imx074.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/media/i2c/soc_camera/imx074.c b/drivers/media/i2c/soc_camera/imx074.c
index 2d8367891801..1d384a371b41 100644
--- a/drivers/media/i2c/soc_camera/imx074.c
+++ b/drivers/media/i2c/soc_camera/imx074.c
@@ -18,6 +18,7 @@
#include <linux/module.h>
#include <media/soc_camera.h>
+#include <media/v4l2-async.h>
#include <media/v4l2-clk.h>
#include <media/v4l2-subdev.h>
@@ -437,13 +438,24 @@ static int imx074_probe(struct i2c_client *client,
priv->fmt = &imx074_colour_fmts[0];
priv->clk = v4l2_clk_get(&client->dev, "mclk");
- if (IS_ERR(priv->clk))
- return PTR_ERR(priv->clk);
+ if (IS_ERR(priv->clk)) {
+ dev_info(&client->dev, "Error %ld getting clock\n", PTR_ERR(priv->clk));
+ return -EPROBE_DEFER;
+ }
+
+ ret = soc_camera_power_init(&client->dev, ssdd);
+ if (ret < 0)
+ goto epwrinit;
ret = imx074_video_probe(client);
if (ret < 0)
- v4l2_clk_put(priv->clk);
+ goto eprobe;
+ return v4l2_async_register_subdev(&priv->subdev);
+
+epwrinit:
+eprobe:
+ v4l2_clk_put(priv->clk);
return ret;
}
@@ -452,7 +464,9 @@ static int imx074_remove(struct i2c_client *client)
struct soc_camera_subdev_desc *ssdd = soc_camera_i2c_to_desc(client);
struct imx074 *priv = to_imx074(client);
+ v4l2_async_unregister_subdev(&priv->subdev);
v4l2_clk_put(priv->clk);
+
if (ssdd->free_bus)
ssdd->free_bus(ssdd);