Hans de Goede 613cbb91e9 media: Add MIPI CCI register access helper functions
The CSI2 specification specifies a standard method to access camera sensor
registers called "Camera Control Interface (CCI)".

This uses either 8 or 16 bit (big-endian wire order) register addresses
and supports 8, 16, 24 or 32 bit (big-endian wire order) register widths.

Currently a lot of Linux camera sensor drivers all have their own custom
helpers for this, often copy and pasted from other drivers.

Add a set of generic helpers for this so that all sensor drivers can
switch to a single common implementation.

These helpers take an extra optional "int *err" function parameter,
this can be used to chain a bunch of register accesses together with
only a single error check at the end, rather than needing to error
check each individual register access. The first failing call will
set the contents of err to a non 0 value and all other calls will
then become no-ops.

Link: https://lore.kernel.org/linux-media/59aefa7f-7bf9-6736-6040-39551329cd0a@redhat.com/

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Tested-by: Tommaso Merciai <tomm.merciai@gmail.com>
Reviewed-by: Tommaso Merciai <tomm.merciai@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2023-08-10 07:58:38 +02:00

101 lines
2.0 KiB
Plaintext

# SPDX-License-Identifier: GPL-2.0-only
#
# Generic video config states
#
config VIDEO_V4L2_I2C
bool
depends on I2C && VIDEO_DEV
default y
config VIDEO_V4L2_SUBDEV_API
bool
depends on VIDEO_DEV && MEDIA_CONTROLLER
help
Enables the V4L2 sub-device pad-level userspace API used to configure
video format, size and frame rate between hardware blocks.
This API is mostly used by camera interfaces in embedded platforms.
config VIDEO_ADV_DEBUG
bool "Enable advanced debug functionality on V4L2 drivers"
help
Say Y here to enable advanced debugging functionality on some
V4L devices.
In doubt, say N.
config VIDEO_FIXED_MINOR_RANGES
bool "Enable old-style fixed minor ranges on drivers/video devices"
help
Say Y here to enable the old-style fixed-range minor assignments.
Only useful if you rely on the old behavior and use mknod instead of udev.
When in doubt, say N.
# Used by drivers that need tuner.ko
config VIDEO_TUNER
tristate
# Used by drivers that need v4l2-jpeg.ko
config V4L2_JPEG_HELPER
tristate
# Used by drivers that need v4l2-h264.ko
config V4L2_H264
tristate
# Used by drivers that need v4l2-vp9.ko
config V4L2_VP9
tristate
# Used by drivers that need v4l2-mem2mem.ko
config V4L2_MEM2MEM_DEV
tristate
depends on VIDEOBUF2_CORE
# Used by LED subsystem flash drivers
config V4L2_FLASH_LED_CLASS
tristate "V4L2 flash API for LED flash class devices"
depends on VIDEO_DEV
depends on LEDS_CLASS_FLASH
select MEDIA_CONTROLLER
select V4L2_ASYNC
select VIDEO_V4L2_SUBDEV_API
help
Say Y here to enable V4L2 flash API support for LED flash
class drivers.
When in doubt, say N.
config V4L2_FWNODE
tristate
select V4L2_ASYNC
config V4L2_ASYNC
tristate
config V4L2_CCI
tristate
config V4L2_CCI_I2C
tristate
depends on I2C
select REGMAP_I2C
select V4L2_CCI
# Used by drivers that need Videobuf modules
config VIDEOBUF_GEN
tristate
config VIDEOBUF_DMA_SG
tristate
select VIDEOBUF_GEN
config VIDEOBUF_VMALLOC
tristate
select VIDEOBUF_GEN
config VIDEOBUF_DMA_CONTIG
tristate
select VIDEOBUF_GEN