media: v4l: cci: Add macros to obtain register width and address
authorSakari Ailus <sakari.ailus@linux.intel.com>
Tue, 7 Nov 2023 15:42:40 +0000 (17:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Feb 2024 00:19:09 +0000 (16:19 -0800)
commit8d2cd1724e809526d788c8ece71662441eae90e6
tree9b55c9e58d376808a1631f5f79924e33e790ab5f
parent36bf2a8fb0aeaf62c85062c4dd31e85c2040c8a4
media: v4l: cci: Add macros to obtain register width and address

[ Upstream commit cd93cc245dfe334c38da98c14b34f9597e1b4ea6 ]

Add CCI_REG_WIDTH() macro to obtain register width in bits and similarly,
CCI_REG_WIDTH_BYTES() to obtain it in bytes.

Also add CCI_REG_ADDR() macro to obtain the address of a register.

Use both macros in v4l2-cci.c, too.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Stable-dep-of: d92e7a013ff3 ("media: v4l2-cci: Add support for little-endian encoded registers")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/v4l2-core/v4l2-cci.c
include/media/v4l2-cci.h