From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: linux-media@vger.kernel.org,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Hans Verkuil <hverkuil@xs4all.nl>,
Sylwester Nawrocki <sylvester.nawrocki@gmail.com>,
linux-sh@vger.kernel.org, Magnus Damm <magnus.damm@gmail.com>,
Sakari Ailus <sakari.ailus@iki.fi>,
Prabhakar Lad <prabhakar.lad@ti.com>
Subject: Re: [PATCH v7 2/7] media: V4L2: support asynchronous subdevice registration
Date: Mon, 08 Apr 2013 15:38:38 +0000 [thread overview]
Message-ID: <5162E47E.8010306@samsung.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1304081548360.29945@axis700.grange>
On 04/08/2013 03:55 PM, Guennadi Liakhovetski wrote:
> On Mon, 8 Apr 2013, Sylwester Nawrocki wrote:
>> On 04/08/2013 01:07 PM, Guennadi Liakhovetski wrote:
[...]
>>> +static struct v4l2_async_subdev *v4l2_async_belongs(struct v4l2_async_notifier *notifier,
>>> + struct v4l2_async_subdev_list *asdl)
>>> +{
>>> + struct v4l2_async_subdev *asd = NULL;
>>> + bool (*match)(struct device *,
>>> + struct v4l2_async_hw_device *);
>>> +
>>> + list_for_each_entry (asd, ¬ifier->waiting, list) {
>>> + struct v4l2_async_hw_device *hw = &asd->hw;
>>> + switch (hw->bus_type) {
>>> + case V4L2_ASYNC_BUS_SPECIAL:
>>> + match = hw->match.special.match;
>>> + if (!match)
>>> + /* Match always */
>>> + return asd;
>>> + break;
>>> + case V4L2_ASYNC_BUS_PLATFORM:
>>> + match = match_platform;
>>> + break;
>>> + case V4L2_ASYNC_BUS_I2C:
>>> + match = match_i2c;
>>> + break;
>>> + default:
>>> + /* Oops */
>>> + match = NULL;
>>> + dev_err(notifier->v4l2_dev ? notifier->v4l2_dev->dev : NULL,
>>> + "Invalid bus-type %u on %p\n", hw->bus_type, asd);
>>> + }
>>> +
>>> + if (match && match(asdl->dev, hw))
>>> + break;
>>
>> Since we maintain various lists of sub-devices, couldn't we match them e.g. by
>> name instead ? What would be preventing this ?
>
> Do you have a specific case where your proposal would work, whereas mine
> wouldn't? This can be changed at any time, we can leave it until there's a
> real use-case, for which this implementation wouldn't work.
No, don't have any specific case in mind. Just was wondering if we don't
happen to be over-engineering things a bit. And yes, this seems something
that could be changed later if required.
>> And additionally provide an API to override the matching method?
>
> Override - that's what the "SPECIAL" (CUSTOM) is for.
Yes, I wanted to emphasize the idea to have a possibility for custom subdev
matching was good.
Regards,
Sylwester
next prev parent reply other threads:[~2013-04-08 15:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-08 11:07 [PATCH v7 0/7] V4L2 clock and async patches and soc-camera example Guennadi Liakhovetski
2013-04-08 11:07 ` [PATCH v7 1/7] media: V4L2: add temporary clock helpers Guennadi Liakhovetski
2013-04-08 11:07 ` [PATCH v7 2/7] media: V4L2: support asynchronous subdevice registration Guennadi Liakhovetski
2013-04-08 13:42 ` Sylwester Nawrocki
2013-04-08 13:55 ` Guennadi Liakhovetski
2013-04-08 15:38 ` Sylwester Nawrocki [this message]
2013-04-08 11:07 ` [PATCH v7 3/7] media: soc-camera: switch I2C subdevice drivers to use v4l2-clk Guennadi Liakhovetski
2013-04-08 11:07 ` [PATCH v7 4/7] soc-camera: add V4L2-async support Guennadi Liakhovetski
2013-04-08 11:07 ` [PATCH v7 5/7] sh_mobile_ceu_camera: add asynchronous subdevice probing support Guennadi Liakhovetski
2013-04-08 11:07 ` [PATCH v7 6/7] imx074: support asynchronous probing Guennadi Liakhovetski
2013-04-08 11:07 ` [PATCH v7 7/7] ARM: shmobile: convert ap4evb to asynchronously register camera subdevices Guennadi Liakhovetski
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=5162E47E.8010306@samsung.com \
--to=s.nawrocki@samsung.com \
--cc=g.liakhovetski@gmx.de \
--cc=hverkuil@xs4all.nl \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=prabhakar.lad@ti.com \
--cc=sakari.ailus@iki.fi \
--cc=sylvester.nawrocki@gmail.com \
/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