Lines Matching full:afe
3 * Driver for Analog Devices ADV748X 8 channel analog front end (AFE) receiver
55 static int adv748x_afe_status(struct adv748x_afe *afe, u32 *signal, in adv748x_afe_status() argument
58 struct adv748x_state *state = adv748x_afe_to_state(afe); in adv748x_afe_status()
112 static void adv748x_afe_fill_format(struct adv748x_afe *afe, in adv748x_afe_fill_format() argument
122 fmt->height = afe->curr_norm & V4L2_STD_525_60 ? 480 : 576; in adv748x_afe_fill_format()
157 int adv748x_afe_s_input(struct adv748x_afe *afe, unsigned int input) in adv748x_afe_s_input() argument
159 struct adv748x_state *state = adv748x_afe_to_state(afe); in adv748x_afe_s_input()
167 struct adv748x_afe *afe = adv748x_sd_to_afe(sd); in adv748x_afe_g_pixelaspect() local
169 if (afe->curr_norm & V4L2_STD_525_60) { in adv748x_afe_g_pixelaspect()
186 struct adv748x_afe *afe = adv748x_sd_to_afe(sd); in adv748x_afe_g_std() local
188 *norm = afe->curr_norm; in adv748x_afe_g_std()
195 struct adv748x_afe *afe = adv748x_sd_to_afe(sd); in adv748x_afe_s_std() local
196 struct adv748x_state *state = adv748x_afe_to_state(afe); in adv748x_afe_s_std()
205 afe->curr_norm = std; in adv748x_afe_s_std()
214 struct adv748x_afe *afe = adv748x_sd_to_afe(sd); in adv748x_afe_querystd() local
215 struct adv748x_state *state = adv748x_afe_to_state(afe); in adv748x_afe_querystd()
221 if (afe->streaming) { in adv748x_afe_querystd()
233 ret = adv748x_afe_status(afe, NULL, std); in adv748x_afe_querystd()
235 afe_std = adv748x_afe_std(afe->curr_norm); in adv748x_afe_querystd()
257 struct adv748x_afe *afe = adv748x_sd_to_afe(sd); in adv748x_afe_g_input_status() local
258 struct adv748x_state *state = adv748x_afe_to_state(afe); in adv748x_afe_g_input_status()
263 ret = adv748x_afe_status(afe, status, NULL); in adv748x_afe_g_input_status()
272 struct adv748x_afe *afe = adv748x_sd_to_afe(sd); in adv748x_afe_s_stream() local
273 struct adv748x_state *state = adv748x_afe_to_state(afe); in adv748x_afe_s_stream()
280 ret = adv748x_afe_s_input(afe, afe->input); in adv748x_afe_s_stream()
285 ret = adv748x_tx_power(afe->tx, enable); in adv748x_afe_s_stream()
289 afe->streaming = enable; in adv748x_afe_s_stream()
291 adv748x_afe_status(afe, &signal, NULL); in adv748x_afe_s_stream()
317 static int adv748x_afe_propagate_pixelrate(struct adv748x_afe *afe) in adv748x_afe_propagate_pixelrate() argument
321 tx = adv748x_get_remote_sd(&afe->pads[ADV748X_AFE_SOURCE]); in adv748x_afe_propagate_pixelrate()
349 struct adv748x_afe *afe = adv748x_sd_to_afe(sd); in adv748x_afe_get_format() local
361 adv748x_afe_fill_format(afe, &sdformat->format); in adv748x_afe_get_format()
362 adv748x_afe_propagate_pixelrate(afe); in adv748x_afe_get_format()
418 struct adv748x_afe *afe = adv748x_ctrl_to_afe(ctrl); in adv748x_afe_s_ctrl() local
419 struct adv748x_state *state = adv748x_afe_to_state(afe); in adv748x_afe_s_ctrl()
466 static int adv748x_afe_init_controls(struct adv748x_afe *afe) in adv748x_afe_init_controls() argument
468 struct adv748x_state *state = adv748x_afe_to_state(afe); in adv748x_afe_init_controls()
470 v4l2_ctrl_handler_init(&afe->ctrl_hdl, 5); in adv748x_afe_init_controls()
473 afe->ctrl_hdl.lock = &state->mutex; in adv748x_afe_init_controls()
475 v4l2_ctrl_new_std(&afe->ctrl_hdl, &adv748x_afe_ctrl_ops, in adv748x_afe_init_controls()
478 v4l2_ctrl_new_std(&afe->ctrl_hdl, &adv748x_afe_ctrl_ops, in adv748x_afe_init_controls()
481 v4l2_ctrl_new_std(&afe->ctrl_hdl, &adv748x_afe_ctrl_ops, in adv748x_afe_init_controls()
484 v4l2_ctrl_new_std(&afe->ctrl_hdl, &adv748x_afe_ctrl_ops, in adv748x_afe_init_controls()
488 v4l2_ctrl_new_std_menu_items(&afe->ctrl_hdl, &adv748x_afe_ctrl_ops, in adv748x_afe_init_controls()
493 afe->sd.ctrl_handler = &afe->ctrl_hdl; in adv748x_afe_init_controls()
494 if (afe->ctrl_hdl.error) { in adv748x_afe_init_controls()
495 v4l2_ctrl_handler_free(&afe->ctrl_hdl); in adv748x_afe_init_controls()
496 return afe->ctrl_hdl.error; in adv748x_afe_init_controls()
499 return v4l2_ctrl_handler_setup(&afe->ctrl_hdl); in adv748x_afe_init_controls()
502 int adv748x_afe_init(struct adv748x_afe *afe) in adv748x_afe_init() argument
504 struct adv748x_state *state = adv748x_afe_to_state(afe); in adv748x_afe_init()
508 afe->input = 0; in adv748x_afe_init()
509 afe->streaming = false; in adv748x_afe_init()
510 afe->curr_norm = V4L2_STD_NTSC_M; in adv748x_afe_init()
512 adv748x_subdev_init(&afe->sd, state, &adv748x_afe_ops, in adv748x_afe_init()
513 MEDIA_ENT_F_ATV_DECODER, "afe"); in adv748x_afe_init()
519 afe->input = i; in adv748x_afe_init()
524 adv748x_afe_s_input(afe, afe->input); in adv748x_afe_init()
526 adv_dbg(state, "AFE Default input set to %d\n", afe->input); in adv748x_afe_init()
530 afe->pads[i].flags = MEDIA_PAD_FL_SINK; in adv748x_afe_init()
532 afe->pads[ADV748X_AFE_SOURCE].flags = MEDIA_PAD_FL_SOURCE; in adv748x_afe_init()
534 ret = media_entity_pads_init(&afe->sd.entity, ADV748X_AFE_NR_PADS, in adv748x_afe_init()
535 afe->pads); in adv748x_afe_init()
539 ret = adv748x_afe_init_controls(afe); in adv748x_afe_init()
546 media_entity_cleanup(&afe->sd.entity); in adv748x_afe_init()
551 void adv748x_afe_cleanup(struct adv748x_afe *afe) in adv748x_afe_cleanup() argument
553 v4l2_device_unregister_subdev(&afe->sd); in adv748x_afe_cleanup()
554 media_entity_cleanup(&afe->sd.entity); in adv748x_afe_cleanup()
555 v4l2_ctrl_handler_free(&afe->ctrl_hdl); in adv748x_afe_cleanup()