Message ID | 1370252210-4994-6-git-send-email-hverkuil@xs4all.nl (mailing list archive) |
---|---|
State | Rejected, archived |
Delegated to: | Guennadi Liakhovetski |
Headers |
Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from <linux-media-owner@vger.kernel.org>) id 1UjRCn-0007l9-9C; Mon, 03 Jun 2013 11:37:33 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.72/mailfrontend-7) with esmtp id 1UjRCl-0005mD-1E; Mon, 03 Jun 2013 11:37:33 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755720Ab3FCJh0 (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Mon, 3 Jun 2013 05:37:26 -0400 Received: from smtp-vbr4.xs4all.nl ([194.109.24.24]:2320 "EHLO smtp-vbr4.xs4all.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754523Ab3FCJhZ (ORCPT <rfc822; linux-media@vger.kernel.org>); Mon, 3 Jun 2013 05:37:25 -0400 Received: from alastor.dyndns.org (166.80-203-20.nextgentel.com [80.203.20.166]) (authenticated bits=0) by smtp-vbr4.xs4all.nl (8.13.8/8.13.8) with ESMTP id r539bAC6088786 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 3 Jun 2013 11:37:12 +0200 (CEST) (envelope-from hverkuil@xs4all.nl) Received: from tschai.cisco.com (64-103-25-233.cisco.com [64.103.25.233]) (Authenticated sender: hans) by alastor.dyndns.org (Postfix) with ESMTPSA id 0CB6835E0067; Mon, 3 Jun 2013 11:36:57 +0200 (CEST) From: Hans Verkuil <hverkuil@xs4all.nl> To: linux-media@vger.kernel.org Cc: Hans Verkuil <hans.verkuil@cisco.com>, Guennadi Liakhovetski <g.liakhovetski@gmx.de> Subject: [RFC PATCH 05/13] soc_camera: replace vdev->parent by vdev->v4l2_dev. Date: Mon, 3 Jun 2013 11:36:42 +0200 Message-Id: <1370252210-4994-6-git-send-email-hverkuil@xs4all.nl> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1370252210-4994-1-git-send-email-hverkuil@xs4all.nl> References: <1370252210-4994-1-git-send-email-hverkuil@xs4all.nl> X-Virus-Scanned: by XS4ALL Virus Scanner Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.6.3.92724 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1500_1599 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __FRAUD_BODY_WEBMAIL 0, __FRAUD_WEBMAIL 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' |
Commit Message
Hans Verkuil
June 3, 2013, 9:36 a.m. UTC
From: Hans Verkuil <hans.verkuil@cisco.com> The parent field will eventually disappear to be replaced by v4l2_dev. soc_camera does provide a v4l2_device struct but did not point to it in struct video_device. This is now fixed. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> --- drivers/media/platform/soc_camera/soc_camera.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On Mon, 3 Jun 2013, Hans Verkuil wrote: > From: Hans Verkuil <hans.verkuil@cisco.com> > > The parent field will eventually disappear to be replaced by v4l2_dev. > soc_camera does provide a v4l2_device struct but did not point to it in > struct video_device. This is now fixed. > > Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> > Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> > --- > drivers/media/platform/soc_camera/soc_camera.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c > index 96645e9..ea951ec 100644 > --- a/drivers/media/platform/soc_camera/soc_camera.c > +++ b/drivers/media/platform/soc_camera/soc_camera.c > @@ -524,7 +524,7 @@ static int soc_camera_open(struct file *file) > return -ENODEV; > } > > - icd = dev_get_drvdata(vdev->parent); > + icd = dev_get_drvdata(vdev->v4l2_dev->dev); > ici = to_soc_camera_host(icd->parent); > > ret = try_module_get(ici->ops->owner) ? 0 : -ENODEV; > @@ -1511,7 +1511,7 @@ static int video_dev_create(struct soc_camera_device *icd) > > strlcpy(vdev->name, ici->drv_name, sizeof(vdev->name)); > > - vdev->parent = icd->pdev; > + vdev->v4l2_dev = &ici->v4l2_dev; > vdev->fops = &soc_camera_fops; > vdev->ioctl_ops = &soc_camera_ioctl_ops; > vdev->release = video_device_release; Doesn't it break soc-camera?... I think those are 2 absolutely different devices, so, you're not getting icd from dev_get_drvdata(vdev->v4l2_dev->dev). Thanks Guennadi --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri June 7 2013 11:33:16 Guennadi Liakhovetski wrote: > On Mon, 3 Jun 2013, Hans Verkuil wrote: > > > From: Hans Verkuil <hans.verkuil@cisco.com> > > > > The parent field will eventually disappear to be replaced by v4l2_dev. > > soc_camera does provide a v4l2_device struct but did not point to it in > > struct video_device. This is now fixed. > > > > Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> > > Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> > > --- > > drivers/media/platform/soc_camera/soc_camera.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c > > index 96645e9..ea951ec 100644 > > --- a/drivers/media/platform/soc_camera/soc_camera.c > > +++ b/drivers/media/platform/soc_camera/soc_camera.c > > @@ -524,7 +524,7 @@ static int soc_camera_open(struct file *file) > > return -ENODEV; > > } > > > > - icd = dev_get_drvdata(vdev->parent); > > + icd = dev_get_drvdata(vdev->v4l2_dev->dev); > > ici = to_soc_camera_host(icd->parent); > > > > ret = try_module_get(ici->ops->owner) ? 0 : -ENODEV; > > @@ -1511,7 +1511,7 @@ static int video_dev_create(struct soc_camera_device *icd) > > > > strlcpy(vdev->name, ici->drv_name, sizeof(vdev->name)); > > > > - vdev->parent = icd->pdev; > > + vdev->v4l2_dev = &ici->v4l2_dev; > > vdev->fops = &soc_camera_fops; > > vdev->ioctl_ops = &soc_camera_ioctl_ops; > > vdev->release = video_device_release; > > Doesn't it break soc-camera?... I think those are 2 absolutely different > devices, so, you're not getting icd from > dev_get_drvdata(vdev->v4l2_dev->dev). I'm looking into this today. I managed to get my renesas board up and running again yesterday, so I have a decent soc-camera test environment. This was the one patch that I wasn't sure about, so it definitely needs more analysis. I'll remove it from the patch series anyway, since it is unrelated to the current_norm changes. Regards, Hans -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri June 7 2013 11:41:30 Hans Verkuil wrote: > On Fri June 7 2013 11:33:16 Guennadi Liakhovetski wrote: > > On Mon, 3 Jun 2013, Hans Verkuil wrote: > > > > > From: Hans Verkuil <hans.verkuil@cisco.com> > > > > > > The parent field will eventually disappear to be replaced by v4l2_dev. > > > soc_camera does provide a v4l2_device struct but did not point to it in > > > struct video_device. This is now fixed. > > > > > > Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> > > > Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> > > > --- > > > drivers/media/platform/soc_camera/soc_camera.c | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c > > > index 96645e9..ea951ec 100644 > > > --- a/drivers/media/platform/soc_camera/soc_camera.c > > > +++ b/drivers/media/platform/soc_camera/soc_camera.c > > > @@ -524,7 +524,7 @@ static int soc_camera_open(struct file *file) > > > return -ENODEV; > > > } > > > > > > - icd = dev_get_drvdata(vdev->parent); > > > + icd = dev_get_drvdata(vdev->v4l2_dev->dev); > > > ici = to_soc_camera_host(icd->parent); > > > > > > ret = try_module_get(ici->ops->owner) ? 0 : -ENODEV; > > > @@ -1511,7 +1511,7 @@ static int video_dev_create(struct soc_camera_device *icd) > > > > > > strlcpy(vdev->name, ici->drv_name, sizeof(vdev->name)); > > > > > > - vdev->parent = icd->pdev; > > > + vdev->v4l2_dev = &ici->v4l2_dev; > > > vdev->fops = &soc_camera_fops; > > > vdev->ioctl_ops = &soc_camera_ioctl_ops; > > > vdev->release = video_device_release; > > > > Doesn't it break soc-camera?... I think those are 2 absolutely different > > devices, so, you're not getting icd from > > dev_get_drvdata(vdev->v4l2_dev->dev). > > I'm looking into this today. I managed to get my renesas board up and running > again yesterday, so I have a decent soc-camera test environment. > > This was the one patch that I wasn't sure about, so it definitely needs more > analysis. I'll remove it from the patch series anyway, since it is unrelated > to the current_norm changes. Yes, it breaks soc_camera. I have a proper fix for this, but I'm postponing this. Stupid question perhaps, but why is soc_camera_device a platform_device? It's weird. The camera host device is definitely a platform_device, and the video nodes are childs of that platform_device, but soc_camera_device doesn't map to any hardware. Regards, Hans -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri, 7 Jun 2013, Hans Verkuil wrote: > Stupid question perhaps, but why is soc_camera_device a platform_device? Partially that's historic. > It's weird. The camera host device is definitely a platform_device, and > the video nodes are childs of that platform_device, but soc_camera_device > doesn't map to any hardware. Using platform devices for camera sensors etc. is a way to inform the soc-camera core about them. Soc-camera core registers a platform driver, which probes those devices, and then, once soc-camera hosts register with the soc-camera core, they are matched against those platform devices. Yes, this could also be done differently - hosts could just pass lists of respective camera sensor descriptors, but soc-camera is currently using a different approach. This anyway is going to disappear once we convert to asynchronous probing... Thanks Guennadi --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c index 96645e9..ea951ec 100644 --- a/drivers/media/platform/soc_camera/soc_camera.c +++ b/drivers/media/platform/soc_camera/soc_camera.c @@ -524,7 +524,7 @@ static int soc_camera_open(struct file *file) return -ENODEV; } - icd = dev_get_drvdata(vdev->parent); + icd = dev_get_drvdata(vdev->v4l2_dev->dev); ici = to_soc_camera_host(icd->parent); ret = try_module_get(ici->ops->owner) ? 0 : -ENODEV; @@ -1511,7 +1511,7 @@ static int video_dev_create(struct soc_camera_device *icd) strlcpy(vdev->name, ici->drv_name, sizeof(vdev->name)); - vdev->parent = icd->pdev; + vdev->v4l2_dev = &ici->v4l2_dev; vdev->fops = &soc_camera_fops; vdev->ioctl_ops = &soc_camera_ioctl_ops; vdev->release = video_device_release;