mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 00:53:34 +02:00
media: cadence: csi2rx: Add enum_mbus_code pad ops
Add enum_mbus_code ioctl so that user space can know what formats are supported to csi2rx. Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com> Reviewed-by: Julien Massot <julien.massot@collabora.com> Tested-by: Julien Massot <julien.massot@collabora.com> Reviewed-by: Jai Luthra <j-luthra@ti.com> Tested-by: Jai Luthra <j-luthra@ti.com> # [Test on sk-am62a] Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
parent
999eb5f810
commit
c271690491
|
|
@ -393,6 +393,18 @@ static int csi2rx_s_stream(struct v4l2_subdev *subdev, int enable)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int csi2rx_enum_mbus_code(struct v4l2_subdev *subdev,
|
||||
struct v4l2_subdev_state *state,
|
||||
struct v4l2_subdev_mbus_code_enum *code_enum)
|
||||
{
|
||||
if (code_enum->index >= ARRAY_SIZE(formats))
|
||||
return -EINVAL;
|
||||
|
||||
code_enum->code = formats[code_enum->index].code;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int csi2rx_set_fmt(struct v4l2_subdev *subdev,
|
||||
struct v4l2_subdev_state *state,
|
||||
struct v4l2_subdev_format *format)
|
||||
|
|
@ -443,6 +455,7 @@ static int csi2rx_init_state(struct v4l2_subdev *subdev,
|
|||
}
|
||||
|
||||
static const struct v4l2_subdev_pad_ops csi2rx_pad_ops = {
|
||||
.enum_mbus_code = csi2rx_enum_mbus_code,
|
||||
.get_fmt = v4l2_subdev_get_fmt,
|
||||
.set_fmt = csi2rx_set_fmt,
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user