Message ID | 1256799064-25031-1-git-send-email-hvaibhav@ti.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Return-path: <linux-media-owner@vger.kernel.org> Envelope-to: mchehab@infradead.org Delivery-date: Thu, 29 Oct 2009 06:51:12 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra.chehab.org with IMAP (fetchmail-6.3.6) for <mchehab@localhost> (single-drop); Thu, 29 Oct 2009 04:53:42 -0200 (BRST) Received: from vger.kernel.org ([209.132.176.167]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1N3Oqm-0002sP-KW; Thu, 29 Oct 2009 06:51:12 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756520AbZJ2GvG (ORCPT <rfc822; kmpark@infradead.org> + 1 other); Thu, 29 Oct 2009 02:51:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756516AbZJ2GvF (ORCPT <rfc822;linux-media-outgoing>); Thu, 29 Oct 2009 02:51:05 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:55705 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756509AbZJ2GvF (ORCPT <rfc822;linux-media@vger.kernel.org>); Thu, 29 Oct 2009 02:51:05 -0400 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id n9T6p657013744 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for <linux-media@vger.kernel.org>; Thu, 29 Oct 2009 01:51:08 -0500 Received: from localhost.localdomain (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id n9T6p4gh015277; Thu, 29 Oct 2009 12:21:05 +0530 (IST) From: hvaibhav@ti.com To: linux-media@vger.kernel.org Cc: Vaibhav Hiremath <hvaibhav@ti.com> Subject: [PATCH V2] Davinci VPFE Capture: Add support for Control ioctls Date: Thu, 29 Oct 2009 12:21:04 +0530 Message-Id: <1256799064-25031-1-git-send-email-hvaibhav@ti.com> X-Mailer: git-send-email 1.6.2.4 In-Reply-To: <hvaibhav@ti.com> References: <hvaibhav@ti.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org |
Commit Message
Hiremath, Vaibhav
Oct. 29, 2009, 6:51 a.m. UTC
From: Vaibhav Hiremath <hvaibhav@ti.com> Added support for Control IOCTL, - s_ctrl - g_ctrl - queryctrl Change from last patch: - added room for error return in queryctrl function. Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com> --- drivers/media/video/davinci/vpfe_capture.c | 43 ++++++++++++++++++++++++++++ 1 files changed, 43 insertions(+), 0 deletions(-) -- 1.6.2.4 -- 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
Comments
Acked-by Muralidharan Karicheri <m-karicheri2@ti.com> Mauro, could you please merge this to your v4l-dvb tree? Murali Karicheri Software Design Engineer Texas Instruments Inc. Germantown, MD 20874 email: m-karicheri2@ti.com >-----Original Message----- >From: linux-media-owner@vger.kernel.org [mailto:linux-media- >owner@vger.kernel.org] On Behalf Of hvaibhav@ti.com >Sent: Thursday, October 29, 2009 2:51 AM >To: linux-media@vger.kernel.org >Cc: Hiremath, Vaibhav >Subject: [PATCH V2] Davinci VPFE Capture: Add support for Control ioctls > >From: Vaibhav Hiremath <hvaibhav@ti.com> > >Added support for Control IOCTL, > - s_ctrl > - g_ctrl > - queryctrl > >Change from last patch: > - added room for error return in queryctrl function. > >Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com> >--- > drivers/media/video/davinci/vpfe_capture.c | 43 >++++++++++++++++++++++++++++ > 1 files changed, 43 insertions(+), 0 deletions(-) > >diff --git a/drivers/media/video/davinci/vpfe_capture.c >b/drivers/media/video/davinci/vpfe_capture.c >index abe21e4..8275d02 100644 >--- a/drivers/media/video/davinci/vpfe_capture.c >+++ b/drivers/media/video/davinci/vpfe_capture.c >@@ -1368,6 +1368,46 @@ static int vpfe_g_std(struct file *file, void *priv, >v4l2_std_id *std_id) > return 0; > } > >+static int vpfe_queryctrl(struct file *file, void *priv, >+ struct v4l2_queryctrl *qctrl) >+{ >+ struct vpfe_device *vpfe_dev = video_drvdata(file); >+ struct vpfe_subdev_info *sdinfo; >+ int ret = 0; >+ >+ sdinfo = vpfe_dev->current_subdev; >+ >+ ret = v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo->grp_id, >+ core, queryctrl, qctrl); >+ >+ if (ret) >+ qctrl->flags |= V4L2_CTRL_FLAG_DISABLED; >+ >+ return ret; >+} >+ >+static int vpfe_g_ctrl(struct file *file, void *priv, struct v4l2_control >*ctrl) >+{ >+ struct vpfe_device *vpfe_dev = video_drvdata(file); >+ struct vpfe_subdev_info *sdinfo; >+ >+ sdinfo = vpfe_dev->current_subdev; >+ >+ return v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo->grp_id, >+ core, g_ctrl, ctrl); >+} >+ >+static int vpfe_s_ctrl(struct file *file, void *priv, struct v4l2_control >*ctrl) >+{ >+ struct vpfe_device *vpfe_dev = video_drvdata(file); >+ struct vpfe_subdev_info *sdinfo; >+ >+ sdinfo = vpfe_dev->current_subdev; >+ >+ return v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo->grp_id, >+ core, s_ctrl, ctrl); >+} >+ > /* > * Videobuf operations > */ >@@ -1939,6 +1979,9 @@ static const struct v4l2_ioctl_ops vpfe_ioctl_ops = { > .vidioc_querystd = vpfe_querystd, > .vidioc_s_std = vpfe_s_std, > .vidioc_g_std = vpfe_g_std, >+ .vidioc_queryctrl = vpfe_queryctrl, >+ .vidioc_g_ctrl = vpfe_g_ctrl, >+ .vidioc_s_ctrl = vpfe_s_ctrl, > .vidioc_reqbufs = vpfe_reqbufs, > .vidioc_querybuf = vpfe_querybuf, > .vidioc_qbuf = vpfe_qbuf, >-- >1.6.2.4 > >-- >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 -- 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 Thursday 29 October 2009 07:51:04 hvaibhav@ti.com wrote: > From: Vaibhav Hiremath <hvaibhav@ti.com> > > Added support for Control IOCTL, > - s_ctrl > - g_ctrl > - queryctrl > > Change from last patch: > - added room for error return in queryctrl function. > > Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com> > --- > drivers/media/video/davinci/vpfe_capture.c | 43 ++++++++++++++++++++++++++++ > 1 files changed, 43 insertions(+), 0 deletions(-) > > diff --git a/drivers/media/video/davinci/vpfe_capture.c b/drivers/media/video/davinci/vpfe_capture.c > index abe21e4..8275d02 100644 > --- a/drivers/media/video/davinci/vpfe_capture.c > +++ b/drivers/media/video/davinci/vpfe_capture.c > @@ -1368,6 +1368,46 @@ static int vpfe_g_std(struct file *file, void *priv, v4l2_std_id *std_id) > return 0; > } > > +static int vpfe_queryctrl(struct file *file, void *priv, > + struct v4l2_queryctrl *qctrl) > +{ > + struct vpfe_device *vpfe_dev = video_drvdata(file); > + struct vpfe_subdev_info *sdinfo; > + int ret = 0; > + > + sdinfo = vpfe_dev->current_subdev; > + > + ret = v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo->grp_id, > + core, queryctrl, qctrl); > + > + if (ret) > + qctrl->flags |= V4L2_CTRL_FLAG_DISABLED; Please remove this bogus flag. Just do: return v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo->grp_id, core, queryctrl, qctrl); Simple and effective. Regards, Hans > + > + return ret; > +} > + > +static int vpfe_g_ctrl(struct file *file, void *priv, struct v4l2_control *ctrl) > +{ > + struct vpfe_device *vpfe_dev = video_drvdata(file); > + struct vpfe_subdev_info *sdinfo; > + > + sdinfo = vpfe_dev->current_subdev; > + > + return v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo->grp_id, > + core, g_ctrl, ctrl); > +} > + > +static int vpfe_s_ctrl(struct file *file, void *priv, struct v4l2_control *ctrl) > +{ > + struct vpfe_device *vpfe_dev = video_drvdata(file); > + struct vpfe_subdev_info *sdinfo; > + > + sdinfo = vpfe_dev->current_subdev; > + > + return v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo->grp_id, > + core, s_ctrl, ctrl); > +} > + > /* > * Videobuf operations > */ > @@ -1939,6 +1979,9 @@ static const struct v4l2_ioctl_ops vpfe_ioctl_ops = { > .vidioc_querystd = vpfe_querystd, > .vidioc_s_std = vpfe_s_std, > .vidioc_g_std = vpfe_g_std, > + .vidioc_queryctrl = vpfe_queryctrl, > + .vidioc_g_ctrl = vpfe_g_ctrl, > + .vidioc_s_ctrl = vpfe_s_ctrl, > .vidioc_reqbufs = vpfe_reqbufs, > .vidioc_querybuf = vpfe_querybuf, > .vidioc_qbuf = vpfe_qbuf, > -- > 1.6.2.4 > > -- > 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 >
> -----Original Message----- > From: linux-media-owner@vger.kernel.org [mailto:linux-media- > owner@vger.kernel.org] On Behalf Of Hans Verkuil > Sent: Thursday, November 05, 2009 9:48 PM > To: Hiremath, Vaibhav > Cc: linux-media@vger.kernel.org > Subject: Re: [PATCH V2] Davinci VPFE Capture: Add support for > Control ioctls > > On Thursday 29 October 2009 07:51:04 hvaibhav@ti.com wrote: > > From: Vaibhav Hiremath <hvaibhav@ti.com> > > > > Added support for Control IOCTL, > > - s_ctrl > > - g_ctrl > > - queryctrl > > > > Change from last patch: > > - added room for error return in queryctrl function. > > > > Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com> > > --- > > drivers/media/video/davinci/vpfe_capture.c | 43 > ++++++++++++++++++++++++++++ > > 1 files changed, 43 insertions(+), 0 deletions(-) > > > > diff --git a/drivers/media/video/davinci/vpfe_capture.c > b/drivers/media/video/davinci/vpfe_capture.c > > index abe21e4..8275d02 100644 > > --- a/drivers/media/video/davinci/vpfe_capture.c > > +++ b/drivers/media/video/davinci/vpfe_capture.c > > @@ -1368,6 +1368,46 @@ static int vpfe_g_std(struct file *file, > void *priv, v4l2_std_id *std_id) > > return 0; > > } > > > > +static int vpfe_queryctrl(struct file *file, void *priv, > > + struct v4l2_queryctrl *qctrl) > > +{ > > + struct vpfe_device *vpfe_dev = video_drvdata(file); > > + struct vpfe_subdev_info *sdinfo; > > + int ret = 0; > > + > > + sdinfo = vpfe_dev->current_subdev; > > + > > + ret = v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo- > >grp_id, > > + core, queryctrl, qctrl); > > + > > + if (ret) > > + qctrl->flags |= V4L2_CTRL_FLAG_DISABLED; > > Please remove this bogus flag. Just do: > [Hiremath, Vaibhav] Hans, while implementing this ioctl I was also thinking the same, but v4l2_ctrl_check do check this flag and also in V4L2 spec it has been mentioned that "This control is permanently disabled and should be ignored by the application." So I thought this may be useful for standard applications, we still have some drivers do use this flag actually. Thanks, Vaibhav > return v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo- > >grp_id, > core, queryctrl, qctrl); > > Simple and effective. > > Regards, > > Hans > > > + > > + return ret; > > +} > > + > > +static int vpfe_g_ctrl(struct file *file, void *priv, struct > v4l2_control *ctrl) > > +{ > > + struct vpfe_device *vpfe_dev = video_drvdata(file); > > + struct vpfe_subdev_info *sdinfo; > > + > > + sdinfo = vpfe_dev->current_subdev; > > + > > + return v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo- > >grp_id, > > + core, g_ctrl, ctrl); > > +} > > + > > +static int vpfe_s_ctrl(struct file *file, void *priv, struct > v4l2_control *ctrl) > > +{ > > + struct vpfe_device *vpfe_dev = video_drvdata(file); > > + struct vpfe_subdev_info *sdinfo; > > + > > + sdinfo = vpfe_dev->current_subdev; > > + > > + return v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo- > >grp_id, > > + core, s_ctrl, ctrl); > > +} > > + > > /* > > * Videobuf operations > > */ > > @@ -1939,6 +1979,9 @@ static const struct v4l2_ioctl_ops > vpfe_ioctl_ops = { > > .vidioc_querystd = vpfe_querystd, > > .vidioc_s_std = vpfe_s_std, > > .vidioc_g_std = vpfe_g_std, > > + .vidioc_queryctrl = vpfe_queryctrl, > > + .vidioc_g_ctrl = vpfe_g_ctrl, > > + .vidioc_s_ctrl = vpfe_s_ctrl, > > .vidioc_reqbufs = vpfe_reqbufs, > > .vidioc_querybuf = vpfe_querybuf, > > .vidioc_qbuf = vpfe_qbuf, > > -- > > 1.6.2.4 > > > > -- > > 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 > > > > > > -- > Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom > -- > 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 -- 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 Friday 06 November 2009 06:30:42 Hiremath, Vaibhav wrote: > > -----Original Message----- > > From: linux-media-owner@vger.kernel.org [mailto:linux-media- > > owner@vger.kernel.org] On Behalf Of Hans Verkuil > > Sent: Thursday, November 05, 2009 9:48 PM > > To: Hiremath, Vaibhav > > Cc: linux-media@vger.kernel.org > > Subject: Re: [PATCH V2] Davinci VPFE Capture: Add support for > > Control ioctls > > > > On Thursday 29 October 2009 07:51:04 hvaibhav@ti.com wrote: > > > From: Vaibhav Hiremath <hvaibhav@ti.com> > > > > > > Added support for Control IOCTL, > > > - s_ctrl > > > - g_ctrl > > > - queryctrl > > > > > > Change from last patch: > > > - added room for error return in queryctrl function. > > > > > > Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com> > > > --- > > > drivers/media/video/davinci/vpfe_capture.c | 43 > > ++++++++++++++++++++++++++++ > > > 1 files changed, 43 insertions(+), 0 deletions(-) > > > > > > diff --git a/drivers/media/video/davinci/vpfe_capture.c > > b/drivers/media/video/davinci/vpfe_capture.c > > > index abe21e4..8275d02 100644 > > > --- a/drivers/media/video/davinci/vpfe_capture.c > > > +++ b/drivers/media/video/davinci/vpfe_capture.c > > > @@ -1368,6 +1368,46 @@ static int vpfe_g_std(struct file *file, > > void *priv, v4l2_std_id *std_id) > > > return 0; > > > } > > > > > > +static int vpfe_queryctrl(struct file *file, void *priv, > > > + struct v4l2_queryctrl *qctrl) > > > +{ > > > + struct vpfe_device *vpfe_dev = video_drvdata(file); > > > + struct vpfe_subdev_info *sdinfo; > > > + int ret = 0; > > > + > > > + sdinfo = vpfe_dev->current_subdev; > > > + > > > + ret = v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo- > > >grp_id, > > > + core, queryctrl, qctrl); > > > + > > > + if (ret) > > > + qctrl->flags |= V4L2_CTRL_FLAG_DISABLED; > > > > Please remove this bogus flag. Just do: > > > [Hiremath, Vaibhav] Hans, while implementing this ioctl I was also thinking the same, but v4l2_ctrl_check do check this flag and also in V4L2 spec it has been mentioned that > "This control is permanently disabled and should be ignored by the application." > > So I thought this may be useful for standard applications, we still have some drivers do use this flag actually. The use of this flag is for very specific cases as is documented in a footnote in the v4l2 spec: "V4L2_CTRL_FLAG_DISABLED was intended for two purposes: Drivers can skip predefined controls not supported by the hardware (although returning EINVAL would do as well), or disable predefined and private controls after hardware detection without the trouble of reordering control arrays and indices (EINVAL cannot be used to skip private controls because it would prematurely end the enumeration)." In both cases you would only check for this flag if queryctrl returns 0, so setting the flag AND returning an error is unnecessary. Regards, Hans > > Thanks, > Vaibhav > > > return v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo- > > >grp_id, > > core, queryctrl, qctrl); > > > > Simple and effective. > > > > Regards, > > > > Hans > > > > > + > > > + return ret; > > > +} > > > + > > > +static int vpfe_g_ctrl(struct file *file, void *priv, struct > > v4l2_control *ctrl) > > > +{ > > > + struct vpfe_device *vpfe_dev = video_drvdata(file); > > > + struct vpfe_subdev_info *sdinfo; > > > + > > > + sdinfo = vpfe_dev->current_subdev; > > > + > > > + return v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo- > > >grp_id, > > > + core, g_ctrl, ctrl); > > > +} > > > + > > > +static int vpfe_s_ctrl(struct file *file, void *priv, struct > > v4l2_control *ctrl) > > > +{ > > > + struct vpfe_device *vpfe_dev = video_drvdata(file); > > > + struct vpfe_subdev_info *sdinfo; > > > + > > > + sdinfo = vpfe_dev->current_subdev; > > > + > > > + return v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo- > > >grp_id, > > > + core, s_ctrl, ctrl); > > > +} > > > + > > > /* > > > * Videobuf operations > > > */ > > > @@ -1939,6 +1979,9 @@ static const struct v4l2_ioctl_ops > > vpfe_ioctl_ops = { > > > .vidioc_querystd = vpfe_querystd, > > > .vidioc_s_std = vpfe_s_std, > > > .vidioc_g_std = vpfe_g_std, > > > + .vidioc_queryctrl = vpfe_queryctrl, > > > + .vidioc_g_ctrl = vpfe_g_ctrl, > > > + .vidioc_s_ctrl = vpfe_s_ctrl, > > > .vidioc_reqbufs = vpfe_reqbufs, > > > .vidioc_querybuf = vpfe_querybuf, > > > .vidioc_qbuf = vpfe_qbuf, > > > -- > > > 1.6.2.4 > > > > > > -- > > > 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 > > > > > > > > > > > -- > > Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom > > -- > > 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 > > >
> -----Original Message----- > From: Hans Verkuil [mailto:hverkuil@xs4all.nl] > Sent: Friday, November 06, 2009 12:03 PM > To: Hiremath, Vaibhav > Cc: linux-media@vger.kernel.org > Subject: Re: [PATCH V2] Davinci VPFE Capture: Add support for > Control ioctls > > On Friday 06 November 2009 06:30:42 Hiremath, Vaibhav wrote: > > > -----Original Message----- > > > From: linux-media-owner@vger.kernel.org [mailto:linux-media- > > > owner@vger.kernel.org] On Behalf Of Hans Verkuil > > > Sent: Thursday, November 05, 2009 9:48 PM > > > To: Hiremath, Vaibhav > > > Cc: linux-media@vger.kernel.org > > > Subject: Re: [PATCH V2] Davinci VPFE Capture: Add support for > > > Control ioctls > > > > > > On Thursday 29 October 2009 07:51:04 hvaibhav@ti.com wrote: <snip> > > > > > > Please remove this bogus flag. Just do: > > > > > [Hiremath, Vaibhav] Hans, while implementing this ioctl I was also > thinking the same, but v4l2_ctrl_check do check this flag and also > in V4L2 spec it has been mentioned that > > "This control is permanently disabled and should be ignored by the > application." > > > > So I thought this may be useful for standard applications, we > still have some drivers do use this flag actually. > > The use of this flag is for very specific cases as is documented in > a footnote > in the v4l2 spec: > > "V4L2_CTRL_FLAG_DISABLED was intended for two purposes: Drivers can > skip predefined > controls not supported by the hardware (although returning EINVAL > would do as well), > or disable predefined and private controls after hardware detection > without the > trouble of reordering control arrays and indices (EINVAL cannot be > used to skip > private controls because it would prematurely end the enumeration)." > > In both cases you would only check for this flag if queryctrl > returns 0, so > setting the flag AND returning an error is unnecessary. > [Hiremath, Vaibhav] Make sense. I will update the patch and submit it again. Thanks, Vaibhav > Regards, > > Hans > > > > > Thanks, > > Vaibhav > > > > > return v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo- > > > >grp_id, > > > core, queryctrl, qctrl); > > > > > > Simple and effective. > > > > > > Regards, > > > > > > Hans > > > > > > > + > > > > + return ret; > > > > +} > > > > + > > > > +static int vpfe_g_ctrl(struct file *file, void *priv, struct > > > v4l2_control *ctrl) > > > > +{ > > > > + struct vpfe_device *vpfe_dev = video_drvdata(file); > > > > + struct vpfe_subdev_info *sdinfo; > > > > + > > > > + sdinfo = vpfe_dev->current_subdev; > > > > + > > > > + return v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, > sdinfo- > > > >grp_id, > > > > + core, g_ctrl, ctrl); > > > > +} > > > > + > > > > +static int vpfe_s_ctrl(struct file *file, void *priv, struct > > > v4l2_control *ctrl) > > > > +{ > > > > + struct vpfe_device *vpfe_dev = video_drvdata(file); > > > > + struct vpfe_subdev_info *sdinfo; > > > > + > > > > + sdinfo = vpfe_dev->current_subdev; > > > > + > > > > + return v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, > sdinfo- > > > >grp_id, > > > > + core, s_ctrl, ctrl); > > > > +} > > > > + > > > > /* > > > > * Videobuf operations > > > > */ > > > > @@ -1939,6 +1979,9 @@ static const struct v4l2_ioctl_ops > > > vpfe_ioctl_ops = { > > > > .vidioc_querystd = vpfe_querystd, > > > > .vidioc_s_std = vpfe_s_std, > > > > .vidioc_g_std = vpfe_g_std, > > > > + .vidioc_queryctrl = vpfe_queryctrl, > > > > + .vidioc_g_ctrl = vpfe_g_ctrl, > > > > + .vidioc_s_ctrl = vpfe_s_ctrl, > > > > .vidioc_reqbufs = vpfe_reqbufs, > > > > .vidioc_querybuf = vpfe_querybuf, > > > > .vidioc_qbuf = vpfe_qbuf, > > > > -- > > > > 1.6.2.4 > > > > > > > > -- > > > > 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 > > > > > > > > > > > > > > > > -- > > > Hans Verkuil - video4linux developer - sponsored by TANDBERG > Telecom > > > -- > > > 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 > > > > > > > > > > -- > Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom -- 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/video/davinci/vpfe_capture.c b/drivers/media/video/davinci/vpfe_capture.c index abe21e4..8275d02 100644 --- a/drivers/media/video/davinci/vpfe_capture.c +++ b/drivers/media/video/davinci/vpfe_capture.c @@ -1368,6 +1368,46 @@ static int vpfe_g_std(struct file *file, void *priv, v4l2_std_id *std_id) return 0; } +static int vpfe_queryctrl(struct file *file, void *priv, + struct v4l2_queryctrl *qctrl) +{ + struct vpfe_device *vpfe_dev = video_drvdata(file); + struct vpfe_subdev_info *sdinfo; + int ret = 0; + + sdinfo = vpfe_dev->current_subdev; + + ret = v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo->grp_id, + core, queryctrl, qctrl); + + if (ret) + qctrl->flags |= V4L2_CTRL_FLAG_DISABLED; + + return ret; +} + +static int vpfe_g_ctrl(struct file *file, void *priv, struct v4l2_control *ctrl) +{ + struct vpfe_device *vpfe_dev = video_drvdata(file); + struct vpfe_subdev_info *sdinfo; + + sdinfo = vpfe_dev->current_subdev; + + return v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo->grp_id, + core, g_ctrl, ctrl); +} + +static int vpfe_s_ctrl(struct file *file, void *priv, struct v4l2_control *ctrl) +{ + struct vpfe_device *vpfe_dev = video_drvdata(file); + struct vpfe_subdev_info *sdinfo; + + sdinfo = vpfe_dev->current_subdev; + + return v4l2_device_call_until_err(&vpfe_dev->v4l2_dev, sdinfo->grp_id, + core, s_ctrl, ctrl); +} + /* * Videobuf operations */ @@ -1939,6 +1979,9 @@ static const struct v4l2_ioctl_ops vpfe_ioctl_ops = { .vidioc_querystd = vpfe_querystd, .vidioc_s_std = vpfe_s_std, .vidioc_g_std = vpfe_g_std, + .vidioc_queryctrl = vpfe_queryctrl, + .vidioc_g_ctrl = vpfe_g_ctrl, + .vidioc_s_ctrl = vpfe_s_ctrl, .vidioc_reqbufs = vpfe_reqbufs, .vidioc_querybuf = vpfe_querybuf, .vidioc_qbuf = vpfe_qbuf,