Lines Matching full:isc
3 * Microchip Image Sensor Controller (ISC) Scaler entity support
16 #include "microchip-isc-regs.h"
17 #include "microchip-isc.h"
32 struct isc_device *isc = container_of(sd, struct isc_device, scaler_sd); in isc_scaler_get_fmt() local
43 format->format = isc->scaler_format[format->pad]; in isc_scaler_get_fmt()
52 struct isc_device *isc = container_of(sd, struct isc_device, scaler_sd); in isc_scaler_set_fmt() local
59 req_fmt->format = isc->scaler_format[ISC_SCALER_PAD_SOURCE]; in isc_scaler_set_fmt()
69 fmt = isc_find_format_by_code(isc, req_fmt->format.code, &i); in isc_scaler_set_fmt()
72 fmt = &isc->formats_list[0]; in isc_scaler_set_fmt()
86 16, isc->max_width, 0, in isc_scaler_set_fmt()
88 16, isc->max_height, 0, 0); in isc_scaler_set_fmt()
93 isc->scaler_format[ISC_SCALER_PAD_SINK] = req_fmt->format; in isc_scaler_set_fmt()
96 isc->scaler_format[ISC_SCALER_PAD_SOURCE] = in isc_scaler_set_fmt()
97 isc->scaler_format[ISC_SCALER_PAD_SINK]; in isc_scaler_set_fmt()
99 (&isc->scaler_format[ISC_SCALER_PAD_SOURCE].width, 16, in isc_scaler_set_fmt()
100 isc->max_width, 0, in isc_scaler_set_fmt()
101 &isc->scaler_format[ISC_SCALER_PAD_SOURCE].height, 16, in isc_scaler_set_fmt()
102 isc->max_height, 0, 0); in isc_scaler_set_fmt()
111 struct isc_device *isc = container_of(sd, struct isc_device, scaler_sd); in isc_scaler_enum_mbus_code() local
114 * All formats supported by the ISC are supported by the scaler. in isc_scaler_enum_mbus_code()
115 * Advertise the formats which the ISC can take as input, as the scaler in isc_scaler_enum_mbus_code()
118 if (code->index < isc->formats_list_size) { in isc_scaler_enum_mbus_code()
119 code->code = isc->formats_list[code->index].mbus_code; in isc_scaler_enum_mbus_code()
130 struct isc_device *isc = container_of(sd, struct isc_device, scaler_sd); in isc_scaler_g_sel() local
139 sel->r.height = isc->scaler_format[ISC_SCALER_PAD_SOURCE].height; in isc_scaler_g_sel()
140 sel->r.width = isc->scaler_format[ISC_SCALER_PAD_SOURCE].width; in isc_scaler_g_sel()
154 struct isc_device *isc = container_of(sd, struct isc_device, scaler_sd); in isc_scaler_init_state() local
156 *v4l2_try_fmt = isc->scaler_format[ISC_SCALER_PAD_SOURCE]; in isc_scaler_init_state()
187 int isc_scaler_init(struct isc_device *isc) in isc_scaler_init() argument
191 v4l2_subdev_init(&isc->scaler_sd, &xisc_scaler_subdev_ops); in isc_scaler_init()
192 isc->scaler_sd.internal_ops = &isc_scaler_internal_ops; in isc_scaler_init()
194 isc->scaler_sd.owner = THIS_MODULE; in isc_scaler_init()
195 isc->scaler_sd.dev = isc->dev; in isc_scaler_init()
196 snprintf(isc->scaler_sd.name, sizeof(isc->scaler_sd.name), in isc_scaler_init()
199 isc->scaler_sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; in isc_scaler_init()
200 isc->scaler_sd.entity.function = MEDIA_ENT_F_PROC_VIDEO_SCALER; in isc_scaler_init()
201 isc->scaler_sd.entity.ops = &isc_scaler_entity_ops; in isc_scaler_init()
202 isc->scaler_pads[ISC_SCALER_PAD_SINK].flags = MEDIA_PAD_FL_SINK; in isc_scaler_init()
203 isc->scaler_pads[ISC_SCALER_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE; in isc_scaler_init()
205 isc_scaler_prepare_fmt(&isc->scaler_format[ISC_SCALER_PAD_SOURCE]); in isc_scaler_init()
206 isc->scaler_format[ISC_SCALER_PAD_SOURCE].height = isc->max_height; in isc_scaler_init()
207 isc->scaler_format[ISC_SCALER_PAD_SOURCE].width = isc->max_width; in isc_scaler_init()
208 isc->scaler_format[ISC_SCALER_PAD_SOURCE].code = in isc_scaler_init()
209 isc->formats_list[0].mbus_code; in isc_scaler_init()
211 isc->scaler_format[ISC_SCALER_PAD_SINK] = in isc_scaler_init()
212 isc->scaler_format[ISC_SCALER_PAD_SOURCE]; in isc_scaler_init()
214 ret = media_entity_pads_init(&isc->scaler_sd.entity, in isc_scaler_init()
216 isc->scaler_pads); in isc_scaler_init()
218 dev_err(isc->dev, "scaler sd media entity init failed\n"); in isc_scaler_init()
222 ret = v4l2_device_register_subdev(&isc->v4l2_dev, &isc->scaler_sd); in isc_scaler_init()
224 dev_err(isc->dev, "scaler sd failed to register subdev\n"); in isc_scaler_init()
232 int isc_scaler_link(struct isc_device *isc) in isc_scaler_link() argument
236 ret = media_create_pad_link(&isc->current_subdev->sd->entity, in isc_scaler_link()
237 isc->remote_pad, &isc->scaler_sd.entity, in isc_scaler_link()
243 dev_err(isc->dev, "Failed to create pad link: %s to %s\n", in isc_scaler_link()
244 isc->current_subdev->sd->entity.name, in isc_scaler_link()
245 isc->scaler_sd.entity.name); in isc_scaler_link()
249 dev_dbg(isc->dev, "link with %s pad: %d\n", in isc_scaler_link()
250 isc->current_subdev->sd->name, isc->remote_pad); in isc_scaler_link()
252 ret = media_create_pad_link(&isc->scaler_sd.entity, in isc_scaler_link()
254 &isc->video_dev.entity, ISC_PAD_SINK, in isc_scaler_link()
259 dev_err(isc->dev, "Failed to create pad link: %s to %s\n", in isc_scaler_link()
260 isc->scaler_sd.entity.name, in isc_scaler_link()
261 isc->video_dev.entity.name); in isc_scaler_link()
265 dev_dbg(isc->dev, "link with %s pad: %d\n", isc->scaler_sd.name, in isc_scaler_link()