linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] media: Introduce post_register() subdev operation
@ 2021-07-07 15:19 Jacopo Mondi
  2021-07-07 15:20 ` [PATCH v2 1/4] media: v4l2-subdev: Introduce post_register() core op Jacopo Mondi
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jacopo Mondi @ 2021-07-07 15:19 UTC (permalink / raw)
  To: Hans Verkuil, Mauro Carvalho Chehab
  Cc: Jacopo Mondi, Kieran Bingham, Laurent Pinchart,
	Niklas Söderlund, linux-media, linux-renesas-soc

Hello, this series adds a new core operation to the v4l2 subdev ops to allow
deferring part of the initialization sequence to a later point in time.

I'll copy the commit message of the now superseded patch that was using the
deprecated init() subdev operation to achieve the same result

------------------------------------------------------------------------------
The current probe() procedure of the RDACM20 and RDACM21 GMSL cameras is
performed with the embedded MAX9271 serializer's noise immunity
threshold disabled. Once the camera has been initialized by probing the
embedded chips, the threshold is enabled and then compensated on the
deserializer's side by increasing the reverse channel signal amplitude
once all cameras have bound.

The probe routine is thus run without noise immunity activated which
in noisy environment conditions makes the probe sequence less reliable as
the chips configuration requires a relatively high amount of i2c
transactions.

Break chip initialization in two:

- At probe time only configure the serializer's reverse channel with
  noise immunity activated, to reduce the number of transactions
  performed without noise immunity protection enabled
- Move the chips initialization to the .post_register() core subdev operation
  called by the deserializer after all camera have probed and
  have increased their noise immunity threshold

The initialization routine looks like the following:

            MAX9286                  RDACM20/21

            probe()
               |
               ---------------------> |
                                      probe() {
                                         enable_threshold()
                                      }
               |<--------------------|
           v4l2 async bound {
                compensate_amplitude()
                call post_register()
               |-------------------->|
                                     init() {
                                         access camera registers()
                                    }
               |<-------------------
            }
-------------------------------------------------------------------------------

The usage of post_register() is opt-in. The receiver should explicitly require
to be in control of calling post_register() by setting the newly introduced
V4L2_ASYNC_NOTIFIER_DEFER_POST_REGISTER flag.

If the receiver does not specify such flag, post_registered() is called by the
core just after the subdevice has been registered.

Thanks
   j

Jacopo Mondi (4):
  media: v4l2-subdev: Introduce post_register() core op
  media: v4l2-async: Add notifier flags
  media: v4l2-async: Call post_register() subdev op
  media: i2c: gmsl: Defer camera initialization

 drivers/media/i2c/max9286.c          | 21 ++++++--
 drivers/media/i2c/rdacm20.c          | 81 ++++++++++++++++------------
 drivers/media/i2c/rdacm21.c          | 73 ++++++++++++++-----------
 drivers/media/v4l2-core/v4l2-async.c | 11 ++++
 include/media/v4l2-async.h           | 10 ++++
 include/media/v4l2-subdev.h          |  3 ++
 6 files changed, 130 insertions(+), 69 deletions(-)

--
2.32.0


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

end of thread, other threads:[~2021-07-07 15:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-07 15:19 [PATCH v2 0/4] media: Introduce post_register() subdev operation Jacopo Mondi
2021-07-07 15:20 ` [PATCH v2 1/4] media: v4l2-subdev: Introduce post_register() core op Jacopo Mondi
2021-07-07 15:20 ` [PATCH v2 2/4] media: v4l2-async: Add notifier flags Jacopo Mondi
2021-07-07 15:20 ` [PATCH v2 3/4] media: v4l2-async: Call post_register() subdev op Jacopo Mondi
2021-07-07 15:20 ` [PATCH v2 4/4] media: i2c: gmsl: Defer camera initialization Jacopo Mondi

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