Commit 90449f42 authored by Paul Kocialkowski's avatar Paul Kocialkowski Committed by Mauro Carvalho Chehab

media: sun6i-csi: Add bridge dimensions and format helpers

Introduce new helpers to ease getting information about the bridge.
Signed-off-by: default avatarPaul Kocialkowski <paul.kocialkowski@bootlin.com>
Acked-by: default avatarJernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent eee68463
......@@ -12,6 +12,26 @@
#include "sun6i_csi.h"
#include "sun6i_csi_bridge.h"
/* Helpers */
void sun6i_csi_bridge_dimensions(struct sun6i_csi_device *csi_dev,
unsigned int *width, unsigned int *height)
{
if (width)
*width = csi_dev->bridge.mbus_format.width;
if (height)
*height = csi_dev->bridge.mbus_format.height;
}
void sun6i_csi_bridge_format(struct sun6i_csi_device *csi_dev,
u32 *mbus_code, u32 *field)
{
if (mbus_code)
*mbus_code = csi_dev->bridge.mbus_format.code;
if (field)
*field = csi_dev->bridge.mbus_format.field;
}
/* Format */
static const u32 sun6i_csi_bridge_mbus_codes[] = {
......
......@@ -41,6 +41,13 @@ struct sun6i_csi_bridge {
struct sun6i_csi_bridge_source source_parallel;
};
/* Helpers */
void sun6i_csi_bridge_dimensions(struct sun6i_csi_device *csi_dev,
unsigned int *width, unsigned int *height);
void sun6i_csi_bridge_format(struct sun6i_csi_device *csi_dev,
u32 *mbus_code, u32 *field);
/* Bridge */
int sun6i_csi_bridge_setup(struct sun6i_csi_device *csi_dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment