From: "Hans Verkuil" <hverkuil@xs4all.nl>
To: "Martin Strubel" <hackfin@section5.ch>
Cc: linux-media@vger.kernel.org
Subject: Re: v4l2 device property framework in userspace
Date: Mon, 30 May 2011 12:52:21 +0200 [thread overview]
Message-ID: <322765c00a668d7915214de27d3debe7.squirrel@webmail.xs4all.nl> (raw)
In-Reply-To: <4DE365A8.9050508@section5.ch>
> Hi,
>
>>
>> Yes. As long as the sensors are implemented as sub-devices (see
>> Documentation/video4linux/v4l2-framework.txt) then you can add lots of
>> custom
>> controls to those subdevs that can be exposed to userspace. Writing
>> directly
>> to sensor registers from userspace is a no-go. If done correctly using
>> the
>> control framework (see Documentation/video4linux/v4l2-controls.txt) this
>> shouldn't
>> take a lot of code. The hardest part is probably documentation of those
>> controls.
>>
>
> Well, we could generate all the control handlers from XML by writing
> appropriate style sheets, but the point is that there are by now a few
> hundreds of registers covered up in the current driver. Putting this
> into the kernel would horribly bloat it, and this again is a no go on
> our embedded system.
> Documentation is also generated per property, BTW (as long as the user
> fills in the <info> node)
> Just to outline again what we're doing: The access to the registers (at
> least to the SPI control interface) is in fact in kernel space, just the
> handlers (and remember, there are a few 100s of them) are not. This
> keeps the kernel layer lean and mean.
Can you give examples of the sort of things that are in those registers?
Is that XML file available somewhere? Are there public datasheets?
BTW, you should need just a single control handler that just looks up all
the relevant information in a table.
> For machine vision people, most of the typical v4l2 controls are
> irrelevant, but for things like video format, we just pass ioctl calls
> to user space via kernel events, handle them, and pass the register
> read/write sequence back to the kernel.
> What problem do you see doing it this way? There seem to be various uio
> based drivers out for v4l2 devices.
If V4L2 drivers want to go into the kernel, then it is highly unlikely we
want to allow uio drivers. Such drivers cannot be reused. A typical sensor
can be used by many vendors and products. By ensuring that access to the
sensor is standardized you ensure that anyone can use that sensor and that
fixes/improvements to that sensor will benefit everyone.
You don't have that with uio, and that's the reason we don't want it
(other reasons are possible abuse of uio allowing closed source drivers
being build on top of it).
Regards,
Hans
next prev parent reply other threads:[~2011-05-30 10:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-29 13:07 v4l2 device property framework in userspace Martin Strubel
2011-05-30 7:32 ` Hans Verkuil
2011-05-30 9:38 ` Martin Strubel
2011-05-30 10:52 ` Hans Verkuil [this message]
2011-05-30 12:07 ` Martin Strubel
2011-05-30 12:53 ` Hans Verkuil
2011-05-30 13:30 ` Martin Strubel
2011-05-31 8:01 ` Hans Verkuil
2011-05-31 8:27 ` Martin Strubel
2011-05-31 10:55 ` Hans Verkuil
2011-05-31 11:33 ` Martin Strubel
2011-05-31 12:58 ` Mauro Carvalho Chehab
2011-06-06 11:00 ` Sakari Ailus
2011-05-31 6:38 ` Kim, HeungJun
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=322765c00a668d7915214de27d3debe7.squirrel@webmail.xs4all.nl \
--to=hverkuil@xs4all.nl \
--cc=hackfin@section5.ch \
--cc=linux-media@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox