From patchwork Fri Jun 14 19:08:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2724081 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 72760C0AB1 for ; Fri, 14 Jun 2013 19:42:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6129F20365 for ; Fri, 14 Jun 2013 19:42:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 74D772019D for ; Fri, 14 Jun 2013 19:42:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752717Ab3FNTmp (ORCPT ); Fri, 14 Jun 2013 15:42:45 -0400 Received: from moutng.kundenserver.de ([212.227.17.10]:61904 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751126Ab3FNTmo (ORCPT ); Fri, 14 Jun 2013 15:42:44 -0400 Received: from axis700.grange (dslb-188-109-039-013.pools.arcor-ip.net [188.109.39.13]) by mrelayeu.kundenserver.de (node=mrbap3) with ESMTP (Nemesis) id 0LsywU-1UKRfm0Vh4-012bdI; Fri, 14 Jun 2013 21:12:08 +0200 Received: from 6a.grange (6a.grange [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id 64B6540BD2; Fri, 14 Jun 2013 21:08:46 +0200 (CEST) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1UnZMc-0003xT-9O; Fri, 14 Jun 2013 21:08:46 +0200 From: Guennadi Liakhovetski To: linux-media@vger.kernel.org Cc: Laurent Pinchart , Sylwester Nawrocki , Hans Verkuil , linux-sh@vger.kernel.org, Magnus Damm , Sakari Ailus , Prabhakar Lad , Sascha Hauer , Guennadi Liakhovetski Subject: [PATCH v11 20/21] imx074: support asynchronous probing Date: Fri, 14 Jun 2013 21:08:30 +0200 Message-Id: <1371236911-15131-21-git-send-email-g.liakhovetski@gmx.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1371236911-15131-1-git-send-email-g.liakhovetski@gmx.de> References: <1371236911-15131-1-git-send-email-g.liakhovetski@gmx.de> X-Provags-ID: V02:K0:7e4j3UfpoiXOFAv8icwHFWAzNjSjA6V+OKFy56sio53 gIiMrxb8rlMEKCwdyuEQ7nopjACLEcKNb70uwvcUxMQgzLCNRo T0YKVH5PWaXQW+rDna6/VwRKfAUj0yOp6DGWgNkzUpT6iSKfQz cF1f4542yL0bSFNJIzSgrG5mWo2f1aYCyp9eYsvd3usVkDkGVV 4LRDovgaBLOKLCK18JhNRbfQ40h7lR+58K+58CiKZAtgutP7sN j1CrGB/ZvJ1bGb16rmutS8KA78fhZw4EYi/TSSgTijKbHbYNGh /2g4Hocun/nQSAZ6lMxn5xd4//aLl+NC2LK7C0ANhIm/34z/QC PlUXptwXuATIJKgUYrufKEeweBF1TqaDmqRMAoecnqVDFHOg7S jjyK9yvy6D5VOOHuoPJxH841TFtUO4pcXw= Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Both synchronous and asynchronous imx074 subdevice probing is supported by this patch. Signed-off-by: Guennadi Liakhovetski --- drivers/media/i2c/soc_camera/imx074.c | 20 +++++++++++++++++--- 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 a6a5060..84245e1 100644 --- a/drivers/media/i2c/soc_camera/imx074.c +++ b/drivers/media/i2c/soc_camera/imx074.c @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -456,13 +457,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; } @@ -471,7 +483,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);