/** * adv748x_csi2_register_link : Register and link internal entities * * @tx: CSI2 private entity * @v4l2_dev: Video registration device * @src: Source subdevice to establish link * @src_pad: Pad number of source to link to this @tx * @enable: Link enabled flag * * Ensure that the subdevice is registered against the v4l2_device, and link the * source pad to the sink pad of the CSI2 bus entity.
*/ staticint adv748x_csi2_register_link(struct adv748x_csi2 *tx, struct v4l2_device *v4l2_dev, struct v4l2_subdev *src, unsignedint src_pad, bool enable)
{ int ret;
if (!src->v4l2_dev) {
ret = v4l2_device_register_subdev(v4l2_dev, src); if (ret) return ret;
}
ret = media_create_pad_link(&src->entity, src_pad,
&tx->sd.entity, ADV748X_CSI2_SINK,
enable ? MEDIA_LNK_FL_ENABLED : 0); if (ret) return ret;
/* * We use the internal registered operation to be able to ensure that our * incremental subdevices (not connected in the forward path) can be registered * against the resulting video path and media device.
*/
/* * Link TXA to AFE and HDMI, and TXB to AFE only as TXB cannot output * HDMI. * * The HDMI->TXA link is enabled by default, as is the AFE->TXB one.
*/ if (is_afe_enabled(state)) {
ret = adv748x_csi2_register_link(tx, sd->v4l2_dev,
&state->afe.sd,
ADV748X_AFE_SOURCE,
is_txb(tx)); if (ret) return ret;
/* TXB can output AFE signals only. */ if (is_txb(tx))
state->afe.tx = tx;
}
/* Register link to HDMI for TXA only. */ if (is_txb(tx) || !is_hdmi_enabled(state)) return 0;
ret = adv748x_csi2_register_link(tx, sd->v4l2_dev, &state->hdmi.sd,
ADV748X_HDMI_SOURCE, true); if (ret) return ret;
/* The default HDMI output is TXA. */
state->hdmi.tx = tx;
/* ----------------------------------------------------------------------------- * v4l2_subdev_pad_ops * * The CSI2 bus pads are ignorant to the data sizes or formats. * But we must support setting the pad formats for format propagation.
*/
/* * The format available on the source pad is the one applied on the sink * pad.
*/ if (code->pad == ADV748X_CSI2_SOURCE) { struct v4l2_mbus_framefmt *fmt;
if (sdformat->pad == ADV748X_CSI2_SOURCE) return v4l2_subdev_get_fmt(sd, sd_state, sdformat);
/* * Make sure the format is supported, if not default it to * UYVY8 as it's supported by both TXes.
*/ if (!adv748x_csi2_is_fmt_supported(tx, sdformat->format.code))
sdformat->format.code = MEDIA_BUS_FMT_UYVY8_1X16;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.