From patchwork Wed Sep 7 15:03:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 1127752 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p87Gltbq000624 for ; Wed, 7 Sep 2011 16:47:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753792Ab1IGQrO (ORCPT ); Wed, 7 Sep 2011 12:47:14 -0400 Received: from moutng.kundenserver.de ([212.227.126.187]:61955 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753512Ab1IGQrL (ORCPT ); Wed, 7 Sep 2011 12:47:11 -0400 Received: from axis700.grange (dslb-178-006-246-092.pools.arcor-ip.net [178.6.246.92]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0Lu0I6-1R8QMy1CiM-010qB3; Wed, 07 Sep 2011 17:03:10 +0200 Received: by axis700.grange (Postfix, from userid 1000) id 006A318B03C; Wed, 7 Sep 2011 17:03:09 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id F23F118B03B for ; Wed, 7 Sep 2011 17:03:09 +0200 (CEST) Date: Wed, 7 Sep 2011 17:03:09 +0200 (CEST) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: Linux Media Mailing List Subject: [PATCH 1/2] V4L: sh_mobile_ceu_camera: the host shall configure the pipeline In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Provags-ID: V02:K0:8xPdg9/KUxN8uLSV83eSoBzb+OXORjeZJyihp4yE5qg opU/eMQ8pi0XHcaLje11aQdLFmexDY9IEtNhp216XiHQwGkKnn iDy8kQjodRFEZd2IQfBKXkNBgbPlEZ9T0rVzAQZ8pq/51j/a5N 4e5z9MoOjAfnyWIMP0YwxTiI5DiXo9Cl/+cYr3QXZKU6sfAUzG XtpmiGCNkJED16lHYTmZBSQeKWvu1oXFKSxPacnquYN0WHM77e DJdHrjR5HilsdMHJ68Vb5/9JbaVFY2sp+O7aZL+o4Ty3uSBR5B JPLBi5YcJQGyQD7e3uCnngmnKTbLxJwBlMbF2o7SK1La3uISB6 KOlhzcORMIdh6xn7FBdggiK9Oh94LrIXyOGae/m8+63hS8Cof8 PgiE+uPHHH30A== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 07 Sep 2011 16:47:58 +0000 (UTC) >From 2ead2de80898ad53923a4fc4d4e1142ae414fd2f Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Wed, 7 Sep 2011 16:59:47 +0200 Subject: [PATCH] V4L: sh_mobile_ceu_camera: the host shall configure the pipeline It is a task of the host / bridge driver to bind single subdevices into a pipeline, not of respective subdevices. Eventually this might be handled by the Media Controller API. Signed-off-by: Guennadi Liakhovetski --- drivers/media/video/sh_mobile_ceu_camera.c | 20 +++++++++++++++----- 1 files changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/media/video/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c index 56bb82d..ddb3951 100644 --- a/drivers/media/video/sh_mobile_ceu_camera.c +++ b/drivers/media/video/sh_mobile_ceu_camera.c @@ -564,16 +564,24 @@ static int sh_mobile_ceu_add_device(struct soc_camera_device *icd) ret = sh_mobile_ceu_soft_reset(pcdev); csi2_sd = find_csi2(pcdev); + if (csi2_sd) + csi2_sd->grp_id = (long)icd; ret = v4l2_subdev_call(csi2_sd, core, s_power, 1); - if (ret != -ENODEV && ret != -ENOIOCTLCMD && ret < 0) { + if (ret < 0 && ret != -ENOIOCTLCMD && ret != -ENODEV) { pm_runtime_put_sync(ici->v4l2_dev.dev); - } else { - pcdev->icd = icd; - ret = 0; + return ret; } - return ret; + /* + * -ENODEV is special: either csi2_sd == NULL or the CSI-2 driver + * has not found this soc-camera device among its clients + */ + if (ret == -ENODEV && csi2_sd) + csi2_sd->grp_id = 0; + pcdev->icd = icd; + + return 0; } /* Called with .video_lock held */ @@ -586,6 +594,8 @@ static void sh_mobile_ceu_remove_device(struct soc_camera_device *icd) BUG_ON(icd != pcdev->icd); v4l2_subdev_call(csi2_sd, core, s_power, 0); + if (csi2_sd) + csi2_sd->grp_id = 0; /* disable capture, disable interrupts */ ceu_write(pcdev, CEIER, 0); sh_mobile_ceu_soft_reset(pcdev);