linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
To: Arun Kumar K <arunkk.samsung@gmail.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	Arun Kumar K <arun.kk@samsung.com>,
	LMML <linux-media@vger.kernel.org>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	kilyeon.im@samsung.com, shaik.ameer@samsung.com
Subject: Re: [RFC v2 05/10] exynos5-fimc-is: Adds the sensor subdev
Date: Wed, 17 Jul 2013 00:03:39 +0200	[thread overview]
Message-ID: <51E5C33B.20804@gmail.com> (raw)
In-Reply-To: <CALt3h79RD2cejJBDStMqcuhi9BUo5EAn+5trNzJHHo_s_zYr7g@mail.gmail.com>

Hi Arun,

On 07/09/2013 02:04 PM, Arun Kumar K wrote:
> On Wed, Jun 26, 2013 at 12:57 PM, Hans Verkuil<hverkuil@xs4all.nl>  wrote:
>> On Fri May 31 2013 15:03:23 Arun Kumar K wrote:
>>> FIMC-IS uses certain sensors which are exclusively controlled
>>> from the IS firmware. This patch adds the sensor subdev for the
>>> fimc-is sensors.
>>>
>>> Signed-off-by: Arun Kumar K<arun.kk@samsung.com>
>>> Signed-off-by: Kilyeon Im<kilyeon.im@samsung.com>
>>
>> Not surprisingly I really hate the idea of sensor drivers that are tied to
>> a specific SoC, since it completely destroys the reusability of such drivers.
>>
>
> Yes agree to it.
>
>> I understand that you have little choice to do something special here, but
>> I was wondering whether there is a way of keeping things as generic as
>> possible.
>>
>> I'm just brainstorming here, but as far as I can see this driver is basically
>> a partial sensor driver: it handles the clock, the format negotiation and
>> power management. Any sensor driver needs that.
>>
>> What would be nice is if the fmic specific parts are replaced by callbacks
>> into the bridge driver using v4l2_subdev_notify().
>>
>> The platform data (or DT) can also state if this sensor is firmware controlled
>> or not. If not, then the missing bits can be implemented in the future by
>> someone who needs that.
>>
>> That way the driver itself remains independent from fimc.
>>
>> And existing sensor drivers can be adapted to be usable with fimc as well by
>> adding support for the notify callback.
>>
>> Would a scheme along those lines work?
>>
>
> Yes this should make the implementation very generic.
> Will check the feasibility of this approach.

Is I suggested earlier, you likely could do without this call back to the
FIMC-IS from within the sensor subdev. Look at your call chain right now:

  /dev/video?     media-dev-driver    sensor-subdev         FIMC-IS
     |                 |                   |                  |
     | VIDIOC_STREAMON |                   |                  |
     |---------------->#     s_stream()    |                  |
     |                 #------------------># pipeline_open()  |
     |                 |                   # ---------------->|
     |                 |                   # pipeline_start() |
     |                 |                   # ---------------->|
     |                 |                   |                  |

Couldn't you move pipeline_open(), pipeline_start() to s_stream handler
of the ISP subdev ? It is currently empty. The media device driver could
call s_stream on the ISP subdev each time it sees s_stream request on
the sensor subdev. And you wouldn't need any hacks to get the pipeline
pointer in the sensor subdev. Then it would be something like:

  /dev/video?     media-dev-driver    sensor-subdev  FIMC-IS-ISP-subdev
     |                 |                   |             |
     | VIDIOC_STREAMON |                   |             |
     |---------------->#     s_stream()    |             |
     |                 #------------------>|             |
     |                 #     s_stream()    |             |
     |                 #-------------------+------------># pipeline_open()
     |                 |                   |             # pipeline_start()
     |                 |                   |             #

I suppose pipeline_open() is better candidate for the s_power callback.
It just needs to be ensured at the media device level the subdev
operations sequences are correct.

--
Regards,
Sylwester

  reply	other threads:[~2013-07-16 22:03 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-31 13:03 [RFC v2 00/10] Exynos5 FIMC-IS driver Arun Kumar K
2013-05-31 13:03 ` [RFC v2 01/10] exynos5-fimc-is: Add Exynos5 FIMC-IS device tree bindings documentation Arun Kumar K
2013-06-20 22:45   ` Sylwester Nawrocki
2013-07-09 11:08     ` Arun Kumar K
2013-07-16 21:23       ` Sylwester Nawrocki
2013-07-17  4:42         ` Arun Kumar K
2013-05-31 13:03 ` [RFC v2 02/10] exynos5-fimc-is: Adds fimc-is driver core files Arun Kumar K
2013-06-06  5:20   ` Sachin Kamat
2013-06-07 10:26     ` Arun Kumar K
2013-06-20 22:46   ` Sylwester Nawrocki
2013-07-09 11:10     ` Arun Kumar K
2013-05-31 13:03 ` [RFC v2 03/10] exynos5-fimc-is: Adds common driver header files Arun Kumar K
2013-06-20 22:46   ` Sylwester Nawrocki
2013-06-21  7:14     ` Arun Kumar K
2013-07-09 11:20     ` Arun Kumar K
2013-05-31 13:03 ` [RFC v2 04/10] exynos5-fimc-is: Adds the register definition and context header Arun Kumar K
2013-06-06  6:24   ` Sachin Kamat
2013-06-07 10:27     ` Arun Kumar K
2013-05-31 13:03 ` [RFC v2 05/10] exynos5-fimc-is: Adds the sensor subdev Arun Kumar K
2013-06-06  6:39   ` Sachin Kamat
2013-06-07 10:30     ` Arun Kumar K
2013-06-20 23:04   ` Sylwester Nawrocki
2013-07-09 12:01     ` Arun Kumar K
2013-06-26  7:27   ` Hans Verkuil
2013-07-09 12:04     ` Arun Kumar K
2013-07-16 22:03       ` Sylwester Nawrocki [this message]
2013-07-17  4:55         ` Arun Kumar K
2013-07-17 14:14           ` Sylwester Nawrocki
2013-07-18  4:35             ` Arun Kumar K
2013-05-31 13:03 ` [RFC v2 06/10] exynos5-fimc-is: Adds isp subdev Arun Kumar K
2013-06-06  6:18   ` Sachin Kamat
2013-06-07 10:28     ` Arun Kumar K
2013-06-20 23:25   ` Sylwester Nawrocki
2013-07-09 11:42     ` Arun Kumar K
2013-07-16 22:11       ` Sylwester Nawrocki
2013-07-17  4:56         ` Arun Kumar K
2013-08-02  4:31     ` Arun Kumar K
2013-08-03 21:38       ` Sylwester Nawrocki
2013-06-26  7:15   ` Hans Verkuil
2013-07-09 11:42     ` Arun Kumar K
2013-05-31 13:03 ` [RFC v2 07/10] exynos5-fimc-is: Adds scaler subdev Arun Kumar K
2013-06-06  6:45   ` Sachin Kamat
2013-06-26  7:13   ` Hans Verkuil
2013-07-09 11:30     ` Arun Kumar K
2013-05-31 13:03 ` [RFC v2 08/10] exynos5-fimc-is: Adds the hardware pipeline control Arun Kumar K
2013-05-31 13:03 ` [RFC v2 09/10] exynos5-fimc-is: Adds the hardware interface module Arun Kumar K
2013-06-21 11:23   ` Andrzej Hajda
2013-07-09 11:26     ` Arun Kumar K
2013-05-31 13:03 ` [RFC v2 10/10] exynos5-fimc-is: Adds the Kconfig and Makefile Arun Kumar K

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=51E5C33B.20804@gmail.com \
    --to=sylvester.nawrocki@gmail.com \
    --cc=arun.kk@samsung.com \
    --cc=arunkk.samsung@gmail.com \
    --cc=hverkuil@xs4all.nl \
    --cc=kilyeon.im@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=s.nawrocki@samsung.com \
    --cc=shaik.ameer@samsung.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;
as well as URLs for NNTP newsgroup(s).