From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-media@vger.kernel.org,
Mauro Carvalho Chehab <mchehab@redhat.com>,
Sakari Ailus <sakari.ailus@iki.fi>,
Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
"Marek Szyprowski/Poland R&D Center-Linux (MSS)/./????"
<m.szyprowski@samsung.com>
Subject: Re: [RFC] The clock dependencies between sensor subdevs and the host interface drivers
Date: Tue, 09 Aug 2011 10:10:40 +0200 [thread overview]
Message-ID: <4E40EB80.7080302@samsung.com> (raw)
In-Reply-To: <201108081744.37953.laurent.pinchart@ideasonboard.com>
Hi Laurent,
On 08/08/2011 05:44 PM, Laurent Pinchart wrote:
> Hi Sylwester,
>
> On Monday 08 August 2011 17:36:32 Sylwester Nawrocki wrote:
>> Hi everyone,
>>
>> Nowadays many of the V4L2 camera device drivers heavily depend on the board
>> code to set up voltage supplies, clocks, and some control signals, like
>> 'reset' and 'standby' signals for the sensors. Those things are often
>> being done by means of the driver specific platform data callbacks.
>>
>> There has been recently quite a lot effort on ARM towards migration to the
>> device tree. Unfortunately the custom platform data callbacks effectively
>> prevent the boards to be booted and configured through the device tree
>> bindings.
>>
>> The following is usually handled in the board files:
>>
>> 1) sensor/frontend power supply
>> 2) sensor's master clock (provided by the host device)
>> 3) reset and standby signals (GPIO)
>> 4) other signals applied by the host processor to the sensor device, e.g.
>> I2C level shifter enable, etc.
>>
>> For 1), the regulator API should possibly be used. It should be applicable
>> for most, if not all cases.
>> 3) and 4) are a bit hard as there might be huge differences across boards
>> as how many GPIOs are used, what are the required delays between changes
>> of their states, etc. Still we could try to find a common description of
>> the behaviour and pass such information to the drivers.
>>
>> For 2) I'd like to propose adding a callback to struct v4l2_device, for
>> instance as in the below patch. The host driver would implement such an
>> operation and the sensor subdev driver would use it in its s_power op.
>
> What about using a struct clk object ? There has been lots of work in the ARM
> tree to make struct clk generic. I'm not sure if all patches have been pushed
> to mainline yet, but I think that's the direction we should follow.
But is the 'struct clk' tried to be unified across all archs, not only ARM ?
I'm afraid it's not the case.
By "using a struct clk object" do you also mean implementing some/all ops
of this object by the driver which exports it ?
I suppose we can't rely only on the clock controller functionality exposed
through the clock API.
Some devices may need to be brought to an active state before the clock can
be used outside. Some may have internal frequency dividers which need to be
handled in addition to the clock path in the clock controller.
For instance, on Exynos4 the FIMC devices belong to a power domain that needs
to be enabled so the clock is not blocked, and this is done through the
runtime PM calls.
Normally the host device driver runtime resumes the device when /dev/video*
is opened. But we might want to use the clock before it happens, when only a
/dev/v4l-subdev* is opened, to play with the sensor device only. In this
situation the host device needs to be runtime resumed first.
Thus the driver would need to (re)implement the clock ops to also handle
the details which are not covered by the clock controller driver.
I also wonder how could we support the boards which choose to use some extra
external oscillator to provide clock to the sensors, rather than the one
derived from the host.
Thanks,
--
Sylwester Nawrocki
Samsung Poland R&D Center
next prev parent reply other threads:[~2011-08-09 8:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-08 15:36 [RFC] The clock dependencies between sensor subdevs and the host interface drivers Sylwester Nawrocki
2011-08-08 15:44 ` Laurent Pinchart
2011-08-08 17:29 ` Guennadi Liakhovetski
2011-08-08 21:53 ` Laurent Pinchart
2011-08-09 8:10 ` Sylwester Nawrocki [this message]
2011-08-09 11:49 ` Laurent Pinchart
2011-08-09 12:58 ` Sylwester Nawrocki
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=4E40EB80.7080302@samsung.com \
--to=s.nawrocki@samsung.com \
--cc=g.liakhovetski@gmx.de \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=mchehab@redhat.com \
--cc=sakari.ailus@iki.fi \
/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