Lines Matching refs:tx
17 static int adv748x_csi2_set_virtual_channel(struct adv748x_csi2 *tx,
20 return tx_write(tx, ADV748X_CSI_VC_REF, vc << ADV748X_CSI_VC_REF_SHIFT);
26 * @tx: CSI2 private entity
29 * @src_pad: Pad number of source to link to this @tx
35 static int adv748x_csi2_register_link(struct adv748x_csi2 *tx,
50 &tx->sd.entity, ADV748X_CSI2_SINK,
56 tx->src = src;
71 struct adv748x_csi2 *tx = adv748x_sd_to_csi2(sd);
72 struct adv748x_state *state = tx->state;
75 adv_dbg(state, "Registered %s (%s)", is_txa(tx) ? "TXA":"TXB",
85 ret = adv748x_csi2_register_link(tx, sd->v4l2_dev,
88 is_txb(tx));
93 if (is_txb(tx))
94 state->afe.tx = tx;
98 if (is_txb(tx) || !is_hdmi_enabled(state))
101 ret = adv748x_csi2_register_link(tx, sd->v4l2_dev, &state->hdmi.sd,
107 state->hdmi.tx = tx;
122 struct adv748x_csi2 *tx = adv748x_sd_to_csi2(sd);
125 src = adv748x_get_remote_sd(&tx->pads[ADV748X_CSI2_SINK]);
148 struct adv748x_csi2 *tx = adv748x_sd_to_csi2(sd);
153 return &tx->format;
160 struct adv748x_csi2 *tx = adv748x_sd_to_csi2(sd);
161 struct adv748x_state *state = tx->state;
182 struct adv748x_csi2 *tx = adv748x_sd_to_csi2(sd);
183 struct adv748x_state *state = tx->state;
220 struct adv748x_csi2 *tx = adv748x_sd_to_csi2(sd);
226 switch (tx->active_lanes) {
268 struct adv748x_csi2 *tx = adv748x_sd_to_csi2(sd);
270 if (!tx->pixel_rate)
273 return v4l2_ctrl_s_ctrl_int64(tx->pixel_rate, rate);
290 static int adv748x_csi2_init_controls(struct adv748x_csi2 *tx)
293 v4l2_ctrl_handler_init(&tx->ctrl_hdl, 1);
295 tx->pixel_rate = v4l2_ctrl_new_std(&tx->ctrl_hdl,
300 tx->sd.ctrl_handler = &tx->ctrl_hdl;
301 if (tx->ctrl_hdl.error) {
302 v4l2_ctrl_handler_free(&tx->ctrl_hdl);
303 return tx->ctrl_hdl.error;
306 return v4l2_ctrl_handler_setup(&tx->ctrl_hdl);
309 int adv748x_csi2_init(struct adv748x_state *state, struct adv748x_csi2 *tx)
313 if (!is_tx_enabled(tx))
317 adv748x_csi2_set_virtual_channel(tx, 0);
319 adv748x_subdev_init(&tx->sd, state, &adv748x_csi2_ops,
321 is_txa(tx) ? "txa" : "txb");
324 tx->sd.fwnode = of_fwnode_handle(state->endpoints[tx->port]);
327 tx->sd.internal_ops = &adv748x_csi2_internal_ops;
329 tx->pads[ADV748X_CSI2_SINK].flags = MEDIA_PAD_FL_SINK;
330 tx->pads[ADV748X_CSI2_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
332 ret = media_entity_pads_init(&tx->sd.entity, ADV748X_CSI2_NR_PADS,
333 tx->pads);
337 ret = adv748x_csi2_init_controls(tx);
341 ret = v4l2_async_register_subdev(&tx->sd);
348 v4l2_ctrl_handler_free(&tx->ctrl_hdl);
350 media_entity_cleanup(&tx->sd.entity);
355 void adv748x_csi2_cleanup(struct adv748x_csi2 *tx)
357 if (!is_tx_enabled(tx))
360 v4l2_async_unregister_subdev(&tx->sd);
361 media_entity_cleanup(&tx->sd.entity);
362 v4l2_ctrl_handler_free(&tx->ctrl_hdl);