Lines Matching full:tx
17 int adv748x_csi2_set_virtual_channel(struct adv748x_csi2 *tx, unsigned int vc) in adv748x_csi2_set_virtual_channel() argument
19 return tx_write(tx, ADV748X_CSI_VC_REF, vc << ADV748X_CSI_VC_REF_SHIFT); in adv748x_csi2_set_virtual_channel()
25 * @tx: CSI2 private entity
28 * @src_pad: Pad number of source to link to this @tx
34 static int adv748x_csi2_register_link(struct adv748x_csi2 *tx, in adv748x_csi2_register_link() argument
49 &tx->sd.entity, ADV748X_CSI2_SINK, in adv748x_csi2_register_link()
55 tx->src = src; in adv748x_csi2_register_link()
70 struct adv748x_csi2 *tx = adv748x_sd_to_csi2(sd); in adv748x_csi2_registered() local
71 struct adv748x_state *state = tx->state; in adv748x_csi2_registered()
74 adv_dbg(state, "Registered %s (%s)", is_txa(tx) ? "TXA":"TXB", in adv748x_csi2_registered()
84 ret = adv748x_csi2_register_link(tx, sd->v4l2_dev, in adv748x_csi2_registered()
87 is_txb(tx)); in adv748x_csi2_registered()
92 if (is_txb(tx)) in adv748x_csi2_registered()
93 state->afe.tx = tx; in adv748x_csi2_registered()
97 if (is_txb(tx) || !is_hdmi_enabled(state)) in adv748x_csi2_registered()
100 ret = adv748x_csi2_register_link(tx, sd->v4l2_dev, &state->hdmi.sd, in adv748x_csi2_registered()
106 state->hdmi.tx = tx; in adv748x_csi2_registered()
121 struct adv748x_csi2 *tx = adv748x_sd_to_csi2(sd); in adv748x_csi2_s_stream() local
124 src = adv748x_get_remote_sd(&tx->pads[ADV748X_CSI2_SINK]); in adv748x_csi2_s_stream()
147 struct adv748x_csi2 *tx = adv748x_sd_to_csi2(sd); in adv748x_csi2_get_pad_format() local
152 return &tx->format; in adv748x_csi2_get_pad_format()
159 struct adv748x_csi2 *tx = adv748x_sd_to_csi2(sd); in adv748x_csi2_get_format() local
160 struct adv748x_state *state = tx->state; in adv748x_csi2_get_format()
181 struct adv748x_csi2 *tx = adv748x_sd_to_csi2(sd); in adv748x_csi2_set_format() local
182 struct adv748x_state *state = tx->state; in adv748x_csi2_set_format()
219 struct adv748x_csi2 *tx = adv748x_sd_to_csi2(sd); in adv748x_csi2_get_mbus_config() local
225 config->bus.mipi_csi2.num_data_lanes = tx->active_lanes; in adv748x_csi2_get_mbus_config()
251 struct adv748x_csi2 *tx = adv748x_sd_to_csi2(sd); in adv748x_csi2_set_pixelrate() local
253 if (!tx->pixel_rate) in adv748x_csi2_set_pixelrate()
256 return v4l2_ctrl_s_ctrl_int64(tx->pixel_rate, rate); in adv748x_csi2_set_pixelrate()
273 static int adv748x_csi2_init_controls(struct adv748x_csi2 *tx) in adv748x_csi2_init_controls() argument
276 v4l2_ctrl_handler_init(&tx->ctrl_hdl, 1); in adv748x_csi2_init_controls()
278 tx->pixel_rate = v4l2_ctrl_new_std(&tx->ctrl_hdl, in adv748x_csi2_init_controls()
283 tx->sd.ctrl_handler = &tx->ctrl_hdl; in adv748x_csi2_init_controls()
284 if (tx->ctrl_hdl.error) { in adv748x_csi2_init_controls()
285 v4l2_ctrl_handler_free(&tx->ctrl_hdl); in adv748x_csi2_init_controls()
286 return tx->ctrl_hdl.error; in adv748x_csi2_init_controls()
289 return v4l2_ctrl_handler_setup(&tx->ctrl_hdl); in adv748x_csi2_init_controls()
292 int adv748x_csi2_init(struct adv748x_state *state, struct adv748x_csi2 *tx) in adv748x_csi2_init() argument
296 if (!is_tx_enabled(tx)) in adv748x_csi2_init()
299 adv748x_subdev_init(&tx->sd, state, &adv748x_csi2_ops, in adv748x_csi2_init()
301 is_txa(tx) ? "txa" : "txb"); in adv748x_csi2_init()
304 tx->sd.internal_ops = &adv748x_csi2_internal_ops; in adv748x_csi2_init()
306 tx->pads[ADV748X_CSI2_SINK].flags = MEDIA_PAD_FL_SINK; in adv748x_csi2_init()
307 tx->pads[ADV748X_CSI2_SOURCE].flags = MEDIA_PAD_FL_SOURCE; in adv748x_csi2_init()
309 ret = media_entity_pads_init(&tx->sd.entity, ADV748X_CSI2_NR_PADS, in adv748x_csi2_init()
310 tx->pads); in adv748x_csi2_init()
314 ret = v4l2_async_subdev_endpoint_add(&tx->sd, in adv748x_csi2_init()
315 of_fwnode_handle(state->endpoints[tx->port])); in adv748x_csi2_init()
319 ret = adv748x_csi2_init_controls(tx); in adv748x_csi2_init()
323 ret = v4l2_async_register_subdev(&tx->sd); in adv748x_csi2_init()
330 v4l2_ctrl_handler_free(&tx->ctrl_hdl); in adv748x_csi2_init()
332 v4l2_subdev_cleanup(&tx->sd); in adv748x_csi2_init()
334 media_entity_cleanup(&tx->sd.entity); in adv748x_csi2_init()
339 void adv748x_csi2_cleanup(struct adv748x_csi2 *tx) in adv748x_csi2_cleanup() argument
341 if (!is_tx_enabled(tx)) in adv748x_csi2_cleanup()
344 v4l2_async_unregister_subdev(&tx->sd); in adv748x_csi2_cleanup()
345 media_entity_cleanup(&tx->sd.entity); in adv748x_csi2_cleanup()
346 v4l2_ctrl_handler_free(&tx->ctrl_hdl); in adv748x_csi2_cleanup()
347 v4l2_subdev_cleanup(&tx->sd); in adv748x_csi2_cleanup()