From: Sakari Ailus <sakari.ailus-X3B1VOXEql0@public.gmane.org>
To: Todor Tomov <todor.tomov-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
pawel.moll-5wv7dgnIgG8@public.gmane.org,
mark.rutland-5wv7dgnIgG8@public.gmane.org,
ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org,
hverkuil-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org,
geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org,
matrandg-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org,
linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org
Subject: Re: [PATCH v5 2/2] media: Add a driver for the ov5645 camera sensor.
Date: Wed, 21 Sep 2016 23:54:43 +0300 [thread overview]
Message-ID: <57E2F393.6000706@iki.fi> (raw)
In-Reply-To: <57E292AB.9060808-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Hi Todor,
Todor Tomov wrote:
> Hi Sakari,
>
> One more question below:
>
> On 08/25/2016 10:18 AM, Sakari Ailus wrote:
>>>>> +
>>>>> +static struct v4l2_subdev_core_ops ov5645_core_ops = {
>>>>> + .s_power = ov5645_s_power,
>>>>> +};
>>>>> +
>>>>> +static struct v4l2_subdev_video_ops ov5645_video_ops = {
>>>>> + .s_stream = ov5645_s_stream,
>>>>> +};
>>>>> +
>>>>> +static struct v4l2_subdev_pad_ops ov5645_subdev_pad_ops = {
>>>>> + .enum_mbus_code = ov5645_enum_mbus_code,
>>>>> + .enum_frame_size = ov5645_enum_frame_size,
>>>>> + .get_fmt = ov5645_get_format,
>>>>> + .set_fmt = ov5645_set_format,
>>>>> + .get_selection = ov5645_get_selection,
>>>>
>>>> Could you add init_cfg() pad op to initialise the try format and selections?
>>>
>>> Yes, I'll do that.
>
> If I follow the code correctly this init_cfg() is called whenever the device is opened, right?
> This means that the format will be reset to default values every time the userspace opens the device.
> So I wonder if this is what we really want, or do we want to keep the last set format instead. For
> example if we use media-ctl only to get the current format, this is already enough - it opens the
> subdev node and resets the format to default.
What's getting set in init_cfg() called through open system call is the
try format, not the active format.
Whether to choose the default or current format for the try format for a
file handle was discussed some years ago and we indeed settled to use
the default one, since that's independent of whatever configuration
happened to be set --- quite possibly by a different application. AFAIR.
--
Kind regards,
Sakari Ailus
sakari.ailus-X3B1VOXEql0@public.gmane.org
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Sakari Ailus <sakari.ailus@iki.fi>
To: Todor Tomov <todor.tomov@linaro.org>
Cc: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
devicetree@vger.kernel.org, mchehab@osg.samsung.com,
hverkuil@xs4all.nl, geert@linux-m68k.org, matrandg@cisco.com,
linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com
Subject: Re: [PATCH v5 2/2] media: Add a driver for the ov5645 camera sensor.
Date: Wed, 21 Sep 2016 23:54:43 +0300 [thread overview]
Message-ID: <57E2F393.6000706@iki.fi> (raw)
In-Reply-To: <57E292AB.9060808@linaro.org>
Hi Todor,
Todor Tomov wrote:
> Hi Sakari,
>
> One more question below:
>
> On 08/25/2016 10:18 AM, Sakari Ailus wrote:
>>>>> +
>>>>> +static struct v4l2_subdev_core_ops ov5645_core_ops = {
>>>>> + .s_power = ov5645_s_power,
>>>>> +};
>>>>> +
>>>>> +static struct v4l2_subdev_video_ops ov5645_video_ops = {
>>>>> + .s_stream = ov5645_s_stream,
>>>>> +};
>>>>> +
>>>>> +static struct v4l2_subdev_pad_ops ov5645_subdev_pad_ops = {
>>>>> + .enum_mbus_code = ov5645_enum_mbus_code,
>>>>> + .enum_frame_size = ov5645_enum_frame_size,
>>>>> + .get_fmt = ov5645_get_format,
>>>>> + .set_fmt = ov5645_set_format,
>>>>> + .get_selection = ov5645_get_selection,
>>>>
>>>> Could you add init_cfg() pad op to initialise the try format and selections?
>>>
>>> Yes, I'll do that.
>
> If I follow the code correctly this init_cfg() is called whenever the device is opened, right?
> This means that the format will be reset to default values every time the userspace opens the device.
> So I wonder if this is what we really want, or do we want to keep the last set format instead. For
> example if we use media-ctl only to get the current format, this is already enough - it opens the
> subdev node and resets the format to default.
What's getting set in init_cfg() called through open system call is the
try format, not the active format.
Whether to choose the default or current format for the try format for a
file handle was discussed some years ago and we indeed settled to use
the default one, since that's independent of whatever configuration
happened to be set --- quite possibly by a different application. AFAIR.
--
Kind regards,
Sakari Ailus
sakari.ailus@iki.fi
next prev parent reply other threads:[~2016-09-21 20:54 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-08 14:54 [PATCH v5 0/2] OV5645 camera sensor driver Todor Tomov
[not found] ` <1467989679-29774-1-git-send-email-todor.tomov-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-07-08 14:54 ` [PATCH v5 1/2] media: i2c/ov5645: add the device tree binding document Todor Tomov
2016-07-08 14:54 ` Todor Tomov
2016-07-08 14:54 ` [PATCH v5 2/2] media: Add a driver for the ov5645 camera sensor Todor Tomov
2016-08-24 10:17 ` Sakari Ailus
2016-08-24 15:24 ` Todor Tomov
[not found] ` <57BDBC2F.7020902-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-08-25 7:18 ` Sakari Ailus
2016-08-25 7:18 ` Sakari Ailus
[not found] ` <20160825071800.GK12130-S+BSfZ9RZZmRSg0ZkenSGLdO1Tsj/99ntUK59QYPAWc@public.gmane.org>
2016-08-25 13:30 ` Todor Tomov
2016-08-25 13:30 ` Todor Tomov
[not found] ` <57BEF2F9.4000809-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-08-25 13:58 ` Sakari Ailus
2016-08-25 13:58 ` Sakari Ailus
2016-09-21 14:01 ` Todor Tomov
2016-09-21 14:01 ` Todor Tomov
[not found] ` <57E292AB.9060808-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-09-21 20:54 ` Sakari Ailus [this message]
2016-09-21 20:54 ` Sakari Ailus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57E2F393.6000706@iki.fi \
--to=sakari.ailus-x3b1voxeql0@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org \
--cc=hverkuil-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org \
--cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
--cc=laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org \
--cc=linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=matrandg-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
--cc=mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org \
--cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=todor.tomov-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.