summaryrefslogtreecommitdiff
path: root/drivers/media/platform/microchip/microchip-isc.h
diff options
context:
space:
mode:
authorEugen Hristev <eugen.hristev@microchip.com>2022-11-07 14:18:15 +0000
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-11-25 07:46:50 +0000
commit920b2665f39253c484973baeebd0da8093cc3d7b (patch)
treec265bff5a2e8300d11466d8708d2b079143ad999 /drivers/media/platform/microchip/microchip-isc.h
parent91b4e487b0c6b83064ad57b7a3a8d38c3245f020 (diff)
downloadlinux-920b2665f39253c484973baeebd0da8093cc3d7b.tar.gz
linux-920b2665f39253c484973baeebd0da8093cc3d7b.tar.bz2
linux-920b2665f39253c484973baeebd0da8093cc3d7b.zip
media: microchip: microchip-isc: prepare for media controller support
Prepare the support for media-controller. This means that the capabilities of the driver have changed and now it's capable of media controller operations. The driver will register its media device, and add the video entity to this media device. The subdevices are registered to the same media device. The ISC will have a base entity which is auto-detected as microchip_isc_base. It will also register a subdevice that allows cropping of the incoming frame to the maximum frame size supported by the ISC. The ISC will create a link between the subdevice that is asynchronously registered and the microchip_isc_scaler entity. Then, the microchip_isc_scaler and microchip_isc_base are connected through another link. This patch does not change the previous capability of the driver, the fact that the format is still being propagated from the top video node down to the sensor. Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/platform/microchip/microchip-isc.h')
-rw-r--r--drivers/media/platform/microchip/microchip-isc.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/media/platform/microchip/microchip-isc.h b/drivers/media/platform/microchip/microchip-isc.h
index 32969a3f79c5..1ba951df4f15 100644
--- a/drivers/media/platform/microchip/microchip-isc.h
+++ b/drivers/media/platform/microchip/microchip-isc.h
@@ -183,6 +183,17 @@ struct isc_reg_offsets {
u32 his_entry;
};
+enum isc_mc_pads {
+ ISC_PAD_SINK = 0,
+ ISC_PADS_NUM = 1,
+};
+
+enum isc_scaler_pads {
+ ISC_SCALER_PAD_SINK = 0,
+ ISC_SCALER_PAD_SOURCE = 1,
+ ISC_SCALER_PADS_NUM = 2,
+};
+
/*
* struct isc_device - ISC device driver data/config struct
* @regmap: Register map
@@ -259,6 +270,12 @@ struct isc_reg_offsets {
* be used as an input to the controller
* @controller_formats_size: size of controller_formats array
* @formats_list_size: size of formats_list array
+ * @pads: media controller pads for isc video entity
+ * @mdev: media device that is registered by the isc
+ * @remote_pad: remote pad on the connected subdevice
+ * @scaler_sd: subdevice for the scaler that isc registers
+ * @scaler_pads: media controller pads for the scaler subdevice
+ * @scaler_format: current format for the scaler subdevice
*/
struct isc_device {
struct regmap *regmap;
@@ -348,6 +365,19 @@ struct isc_device {
struct isc_format *formats_list;
u32 controller_formats_size;
u32 formats_list_size;
+
+ struct {
+ struct media_pad pads[ISC_PADS_NUM];
+ struct media_device mdev;
+
+ u32 remote_pad;
+ };
+
+ struct {
+ struct v4l2_subdev scaler_sd;
+ struct media_pad scaler_pads[ISC_SCALER_PADS_NUM];
+ struct v4l2_mbus_framefmt scaler_format[ISC_SCALER_PADS_NUM];
+ };
};
extern const struct regmap_config microchip_isc_regmap_config;
@@ -359,4 +389,11 @@ int microchip_isc_clk_init(struct isc_device *isc);
void microchip_isc_subdev_cleanup(struct isc_device *isc);
void microchip_isc_clk_cleanup(struct isc_device *isc);
+int isc_scaler_link(struct isc_device *isc);
+int isc_scaler_init(struct isc_device *isc);
+int isc_mc_init(struct isc_device *isc, u32 ver);
+void isc_mc_cleanup(struct isc_device *isc);
+
+struct isc_format *isc_find_format_by_code(struct isc_device *isc,
+ unsigned int code, int *index);
#endif