linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* v4l controls API
@ 2018-12-03  8:02 Sebastian Süsens
  2018-12-03  8:29 ` Hans Verkuil
  0 siblings, 1 reply; 5+ messages in thread
From: Sebastian Süsens @ 2018-12-03  8:02 UTC (permalink / raw)
  To: linux-media

Hello,

I don't know how to get access to the v4l controls on a I2C camera sensor.

My driver structure looks following:

bridge driver                            -> csi-driver                                  -> sensor driver (includes controls)
register-async-notifer for csi driver        register-async-notifer for sensor driver
register video device

The v4l2 API say:
When a sub-device is registered with a V4L2 driver by calling v4l2_device_register_subdev() and the ctrl_handler fields of both v4l2_subdev and v4l2_device are set, then the controls of the subdev will become automatically available in the V4L2 driver as well. If the subdev driver contains controls that already exist in the V4L2 driver, then those will be skipped (so a V4L2 driver can always override a subdev control).

But how can I get access to the controls by asynchronous registration, because the controls are not added to the video device automatically?

Normally I can use:

v4l2-ctl -l -d /dev/video0

I don't know if this forum is the right place for this question, so please answer with a private e-mail su@mycable.de

------------------------------------------------------------------------
   Sebastian Süsens               Tel.   +49 4321 559 56-27
   mycable GmbH                   Fax    +49 4321 559 56-10
   Gartenstrasse 10
   24534 Neumuenster, Germany     Email  su@mycable.de
------------------------------------------------------------------------
   mycable GmbH, Managing Director: Michael Carstens-Behrens
   USt-IdNr: DE 214 231 199, Amtsgericht Kiel, HRB 1797 NM
------------------------------------------------------------------------
   This e-mail and any files transmitted with it are confidential and
   intended solely for the use of the individual or entity to whom
   they are addressed. If you have received this e-mail in error,
   please notify the sender and delete all copies from your system.
------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: v4l controls API
  2018-12-03  8:02 v4l controls API Sebastian Süsens
@ 2018-12-03  8:29 ` Hans Verkuil
  2018-12-03 10:03   ` Sebastian Süsens
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Verkuil @ 2018-12-03  8:29 UTC (permalink / raw)
  To: Sebastian Süsens, linux-media

On 12/03/2018 09:02 AM, Sebastian Süsens wrote:
> Hello,
> 
> I don't know how to get access to the v4l controls on a I2C camera sensor.
> 
> My driver structure looks following:
> 
> bridge driver                            -> csi-driver                                  -> sensor driver (includes controls)
> register-async-notifer for csi driver        register-async-notifer for sensor driver
> register video device
> 
> The v4l2 API say:
> When a sub-device is registered with a V4L2 driver by calling v4l2_device_register_subdev() and the ctrl_handler fields of both v4l2_subdev and v4l2_device are set, then the controls of the subdev will become automatically available in the V4L2 driver as well. If the subdev driver contains controls that already exist in the V4L2 driver, then those will be skipped (so a V4L2 driver can always override a subdev control).
> 
> But how can I get access to the controls by asynchronous registration, because the controls are not added to the video device automatically?

Yes, they are via v4l2_device_register_subdev(), which is called by the async code
when the subdev driver arrives.

Note that this assumes that the bridge driver has a control handler that struct
v4l2_device points to (the ctrl_handler field).

Also note that certain types of drivers (media controller-based) such as the imx
driver do not 'inherit' controls since each subdev has its own v4l-subdevX device node
through which its controls can be set. You do not mention which bridge driver you are
using, so I can't tell whether or not it falls in this category.

Regards,

	Hans

> 
> Normally I can use:
> 
> v4l2-ctl -l -d /dev/video0
> 
> I don't know if this forum is the right place for this question, so please answer with a private e-mail su@mycable.de
> 
> ------------------------------------------------------------------------
>    Sebastian Süsens               Tel.   +49 4321 559 56-27
>    mycable GmbH                   Fax    +49 4321 559 56-10
>    Gartenstrasse 10
>    24534 Neumuenster, Germany     Email  su@mycable.de
> ------------------------------------------------------------------------
>    mycable GmbH, Managing Director: Michael Carstens-Behrens
>    USt-IdNr: DE 214 231 199, Amtsgericht Kiel, HRB 1797 NM
> ------------------------------------------------------------------------
>    This e-mail and any files transmitted with it are confidential and
>    intended solely for the use of the individual or entity to whom
>    they are addressed. If you have received this e-mail in error,
>    please notify the sender and delete all copies from your system.
> ------------------------------------------------------------------------
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: v4l controls API
  2018-12-03  8:29 ` Hans Verkuil
@ 2018-12-03 10:03   ` Sebastian Süsens
  2018-12-03 10:06     ` Hans Verkuil
  0 siblings, 1 reply; 5+ messages in thread
From: Sebastian Süsens @ 2018-12-03 10:03 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media

Hey,

I use the driver mx6s_capture kernel 4.9.88 
On the device tree it is registered with following name "fsl,imx6s-csi".

Hint:
I have no sub-devices on my systems only /dev/video0

------------------------------------------------------------------------
   Sebastian Süsens               Tel.   +49 4321 559 56-27
   mycable GmbH                   Fax    +49 4321 559 56-10
   Gartenstrasse 10
   24534 Neumuenster, Germany     Email  su@mycable.de
------------------------------------------------------------------------
   mycable GmbH, Managing Director: Michael Carstens-Behrens
   USt-IdNr: DE 214 231 199, Amtsgericht Kiel, HRB 1797 NM
------------------------------------------------------------------------
   This e-mail and any files transmitted with it are confidential and
   intended solely for the use of the individual or entity to whom
   they are addressed. If you have received this e-mail in error,
   please notify the sender and delete all copies from your system.
------------------------------------------------------------------------

----- Ursprüngliche Mail -----
Von: "Hans Verkuil" <hverkuil@xs4all.nl>
An: "Sebastian Süsens" <su@mycable.de>, "linux-media" <linux-media@vger.kernel.org>
Gesendet: Montag, 3. Dezember 2018 09:29:14
Betreff: Re: v4l controls API

On 12/03/2018 09:02 AM, Sebastian Süsens wrote:
> Hello,
> 
> I don't know how to get access to the v4l controls on a I2C camera sensor.
> 
> My driver structure looks following:
> 
> bridge driver                            -> csi-driver                                  -> sensor driver (includes controls)
> register-async-notifer for csi driver        register-async-notifer for sensor driver
> register video device
> 
> The v4l2 API say:
> When a sub-device is registered with a V4L2 driver by calling v4l2_device_register_subdev() and the ctrl_handler fields of both v4l2_subdev and v4l2_device are set, then the controls of the subdev will become automatically available in the V4L2 driver as well. If the subdev driver contains controls that already exist in the V4L2 driver, then those will be skipped (so a V4L2 driver can always override a subdev control).
> 
> But how can I get access to the controls by asynchronous registration, because the controls are not added to the video device automatically?

Yes, they are via v4l2_device_register_subdev(), which is called by the async code
when the subdev driver arrives.

Note that this assumes that the bridge driver has a control handler that struct
v4l2_device points to (the ctrl_handler field).

Also note that certain types of drivers (media controller-based) such as the imx
driver do not 'inherit' controls since each subdev has its own v4l-subdevX device node
through which its controls can be set. You do not mention which bridge driver you are
using, so I can't tell whether or not it falls in this category.

Regards,

	Hans

> 
> Normally I can use:
> 
> v4l2-ctl -l -d /dev/video0
> 
> I don't know if this forum is the right place for this question, so please answer with a private e-mail su@mycable.de
> 
> ------------------------------------------------------------------------
>    Sebastian Süsens               Tel.   +49 4321 559 56-27
>    mycable GmbH                   Fax    +49 4321 559 56-10
>    Gartenstrasse 10
>    24534 Neumuenster, Germany     Email  su@mycable.de
> ------------------------------------------------------------------------
>    mycable GmbH, Managing Director: Michael Carstens-Behrens
>    USt-IdNr: DE 214 231 199, Amtsgericht Kiel, HRB 1797 NM
> ------------------------------------------------------------------------
>    This e-mail and any files transmitted with it are confidential and
>    intended solely for the use of the individual or entity to whom
>    they are addressed. If you have received this e-mail in error,
>    please notify the sender and delete all copies from your system.
> ------------------------------------------------------------------------
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: v4l controls API
  2018-12-03 10:03   ` Sebastian Süsens
@ 2018-12-03 10:06     ` Hans Verkuil
  2018-12-03 11:26       ` Sebastian Süsens
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Verkuil @ 2018-12-03 10:06 UTC (permalink / raw)
  To: Sebastian Süsens; +Cc: linux-media

On 12/03/2018 11:03 AM, Sebastian Süsens wrote:
> Hey,
> 
> I use the driver mx6s_capture kernel 4.9.88 
> On the device tree it is registered with following name "fsl,imx6s-csi".

Ah, that's probably the freescale driver. We don't support that. It's known
to be quite buggy.

Sorry, you're on your own here.

Regards,

	Hans

> 
> Hint:
> I have no sub-devices on my systems only /dev/video0
> 
> ------------------------------------------------------------------------
>    Sebastian Süsens               Tel.   +49 4321 559 56-27
>    mycable GmbH                   Fax    +49 4321 559 56-10
>    Gartenstrasse 10
>    24534 Neumuenster, Germany     Email  su@mycable.de
> ------------------------------------------------------------------------
>    mycable GmbH, Managing Director: Michael Carstens-Behrens
>    USt-IdNr: DE 214 231 199, Amtsgericht Kiel, HRB 1797 NM
> ------------------------------------------------------------------------
>    This e-mail and any files transmitted with it are confidential and
>    intended solely for the use of the individual or entity to whom
>    they are addressed. If you have received this e-mail in error,
>    please notify the sender and delete all copies from your system.
> ------------------------------------------------------------------------
> 
> ----- Ursprüngliche Mail -----
> Von: "Hans Verkuil" <hverkuil@xs4all.nl>
> An: "Sebastian Süsens" <su@mycable.de>, "linux-media" <linux-media@vger.kernel.org>
> Gesendet: Montag, 3. Dezember 2018 09:29:14
> Betreff: Re: v4l controls API
> 
> On 12/03/2018 09:02 AM, Sebastian Süsens wrote:
>> Hello,
>>
>> I don't know how to get access to the v4l controls on a I2C camera sensor.
>>
>> My driver structure looks following:
>>
>> bridge driver                            -> csi-driver                                  -> sensor driver (includes controls)
>> register-async-notifer for csi driver        register-async-notifer for sensor driver
>> register video device
>>
>> The v4l2 API say:
>> When a sub-device is registered with a V4L2 driver by calling v4l2_device_register_subdev() and the ctrl_handler fields of both v4l2_subdev and v4l2_device are set, then the controls of the subdev will become automatically available in the V4L2 driver as well. If the subdev driver contains controls that already exist in the V4L2 driver, then those will be skipped (so a V4L2 driver can always override a subdev control).
>>
>> But how can I get access to the controls by asynchronous registration, because the controls are not added to the video device automatically?
> 
> Yes, they are via v4l2_device_register_subdev(), which is called by the async code
> when the subdev driver arrives.
> 
> Note that this assumes that the bridge driver has a control handler that struct
> v4l2_device points to (the ctrl_handler field).
> 
> Also note that certain types of drivers (media controller-based) such as the imx
> driver do not 'inherit' controls since each subdev has its own v4l-subdevX device node
> through which its controls can be set. You do not mention which bridge driver you are
> using, so I can't tell whether or not it falls in this category.
> 
> Regards,
> 
> 	Hans
> 
>>
>> Normally I can use:
>>
>> v4l2-ctl -l -d /dev/video0
>>
>> I don't know if this forum is the right place for this question, so please answer with a private e-mail su@mycable.de
>>
>> ------------------------------------------------------------------------
>>    Sebastian Süsens               Tel.   +49 4321 559 56-27
>>    mycable GmbH                   Fax    +49 4321 559 56-10
>>    Gartenstrasse 10
>>    24534 Neumuenster, Germany     Email  su@mycable.de
>> ------------------------------------------------------------------------
>>    mycable GmbH, Managing Director: Michael Carstens-Behrens
>>    USt-IdNr: DE 214 231 199, Amtsgericht Kiel, HRB 1797 NM
>> ------------------------------------------------------------------------
>>    This e-mail and any files transmitted with it are confidential and
>>    intended solely for the use of the individual or entity to whom
>>    they are addressed. If you have received this e-mail in error,
>>    please notify the sender and delete all copies from your system.
>> ------------------------------------------------------------------------
>>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: v4l controls API
  2018-12-03 10:06     ` Hans Verkuil
@ 2018-12-03 11:26       ` Sebastian Süsens
  0 siblings, 0 replies; 5+ messages in thread
From: Sebastian Süsens @ 2018-12-03 11:26 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media

Ok, nevertheless thank your for your reply.


------------------------------------------------------------------------
   Sebastian Süsens               Tel.   +49 4321 559 56-27
   mycable GmbH                   Fax    +49 4321 559 56-10
   Gartenstrasse 10
   24534 Neumuenster, Germany     Email  su@mycable.de
------------------------------------------------------------------------
   mycable GmbH, Managing Director: Michael Carstens-Behrens
   USt-IdNr: DE 214 231 199, Amtsgericht Kiel, HRB 1797 NM
------------------------------------------------------------------------
   This e-mail and any files transmitted with it are confidential and
   intended solely for the use of the individual or entity to whom
   they are addressed. If you have received this e-mail in error,
   please notify the sender and delete all copies from your system.
------------------------------------------------------------------------

----- Ursprüngliche Mail -----
Von: "Hans Verkuil" <hverkuil@xs4all.nl>
An: "Sebastian Süsens" <su@mycable.de>
CC: "linux-media" <linux-media@vger.kernel.org>
Gesendet: Montag, 3. Dezember 2018 11:06:29
Betreff: Re: v4l controls API

On 12/03/2018 11:03 AM, Sebastian Süsens wrote:
> Hey,
> 
> I use the driver mx6s_capture kernel 4.9.88 
> On the device tree it is registered with following name "fsl,imx6s-csi".

Ah, that's probably the freescale driver. We don't support that. It's known
to be quite buggy.

Sorry, you're on your own here.

Regards,

	Hans

> 
> Hint:
> I have no sub-devices on my systems only /dev/video0
> 
> ------------------------------------------------------------------------
>    Sebastian Süsens               Tel.   +49 4321 559 56-27
>    mycable GmbH                   Fax    +49 4321 559 56-10
>    Gartenstrasse 10
>    24534 Neumuenster, Germany     Email  su@mycable.de
> ------------------------------------------------------------------------
>    mycable GmbH, Managing Director: Michael Carstens-Behrens
>    USt-IdNr: DE 214 231 199, Amtsgericht Kiel, HRB 1797 NM
> ------------------------------------------------------------------------
>    This e-mail and any files transmitted with it are confidential and
>    intended solely for the use of the individual or entity to whom
>    they are addressed. If you have received this e-mail in error,
>    please notify the sender and delete all copies from your system.
> ------------------------------------------------------------------------
> 
> ----- Ursprüngliche Mail -----
> Von: "Hans Verkuil" <hverkuil@xs4all.nl>
> An: "Sebastian Süsens" <su@mycable.de>, "linux-media" <linux-media@vger.kernel.org>
> Gesendet: Montag, 3. Dezember 2018 09:29:14
> Betreff: Re: v4l controls API
> 
> On 12/03/2018 09:02 AM, Sebastian Süsens wrote:
>> Hello,
>>
>> I don't know how to get access to the v4l controls on a I2C camera sensor.
>>
>> My driver structure looks following:
>>
>> bridge driver                            -> csi-driver                                  -> sensor driver (includes controls)
>> register-async-notifer for csi driver        register-async-notifer for sensor driver
>> register video device
>>
>> The v4l2 API say:
>> When a sub-device is registered with a V4L2 driver by calling v4l2_device_register_subdev() and the ctrl_handler fields of both v4l2_subdev and v4l2_device are set, then the controls of the subdev will become automatically available in the V4L2 driver as well. If the subdev driver contains controls that already exist in the V4L2 driver, then those will be skipped (so a V4L2 driver can always override a subdev control).
>>
>> But how can I get access to the controls by asynchronous registration, because the controls are not added to the video device automatically?
> 
> Yes, they are via v4l2_device_register_subdev(), which is called by the async code
> when the subdev driver arrives.
> 
> Note that this assumes that the bridge driver has a control handler that struct
> v4l2_device points to (the ctrl_handler field).
> 
> Also note that certain types of drivers (media controller-based) such as the imx
> driver do not 'inherit' controls since each subdev has its own v4l-subdevX device node
> through which its controls can be set. You do not mention which bridge driver you are
> using, so I can't tell whether or not it falls in this category.
> 
> Regards,
> 
> 	Hans
> 
>>
>> Normally I can use:
>>
>> v4l2-ctl -l -d /dev/video0
>>
>> I don't know if this forum is the right place for this question, so please answer with a private e-mail su@mycable.de
>>
>> ------------------------------------------------------------------------
>>    Sebastian Süsens               Tel.   +49 4321 559 56-27
>>    mycable GmbH                   Fax    +49 4321 559 56-10
>>    Gartenstrasse 10
>>    24534 Neumuenster, Germany     Email  su@mycable.de
>> ------------------------------------------------------------------------
>>    mycable GmbH, Managing Director: Michael Carstens-Behrens
>>    USt-IdNr: DE 214 231 199, Amtsgericht Kiel, HRB 1797 NM
>> ------------------------------------------------------------------------
>>    This e-mail and any files transmitted with it are confidential and
>>    intended solely for the use of the individual or entity to whom
>>    they are addressed. If you have received this e-mail in error,
>>    please notify the sender and delete all copies from your system.
>> ------------------------------------------------------------------------
>>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-12-03 11:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-03  8:02 v4l controls API Sebastian Süsens
2018-12-03  8:29 ` Hans Verkuil
2018-12-03 10:03   ` Sebastian Süsens
2018-12-03 10:06     ` Hans Verkuil
2018-12-03 11:26       ` Sebastian Süsens

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).