Lines Matching refs:afe

55 static int adv748x_afe_status(struct adv748x_afe *afe, u32 *signal,
58 struct adv748x_state *state = adv748x_afe_to_state(afe);
112 static void adv748x_afe_fill_format(struct adv748x_afe *afe,
122 fmt->height = afe->curr_norm & V4L2_STD_525_60 ? 480 : 576;
157 static int adv748x_afe_s_input(struct adv748x_afe *afe, unsigned int input)
159 struct adv748x_state *state = adv748x_afe_to_state(afe);
167 struct adv748x_afe *afe = adv748x_sd_to_afe(sd);
169 if (afe->curr_norm & V4L2_STD_525_60) {
186 struct adv748x_afe *afe = adv748x_sd_to_afe(sd);
188 *norm = afe->curr_norm;
195 struct adv748x_afe *afe = adv748x_sd_to_afe(sd);
196 struct adv748x_state *state = adv748x_afe_to_state(afe);
205 afe->curr_norm = std;
214 struct adv748x_afe *afe = adv748x_sd_to_afe(sd);
215 struct adv748x_state *state = adv748x_afe_to_state(afe);
221 if (afe->streaming) {
233 ret = adv748x_afe_status(afe, NULL, std);
235 afe_std = adv748x_afe_std(afe->curr_norm);
257 struct adv748x_afe *afe = adv748x_sd_to_afe(sd);
258 struct adv748x_state *state = adv748x_afe_to_state(afe);
263 ret = adv748x_afe_status(afe, status, NULL);
272 struct adv748x_afe *afe = adv748x_sd_to_afe(sd);
273 struct adv748x_state *state = adv748x_afe_to_state(afe);
280 ret = adv748x_afe_s_input(afe, afe->input);
285 ret = adv748x_tx_power(afe->tx, enable);
289 afe->streaming = enable;
291 adv748x_afe_status(afe, &signal, NULL);
317 static int adv748x_afe_propagate_pixelrate(struct adv748x_afe *afe)
321 tx = adv748x_get_remote_sd(&afe->pads[ADV748X_AFE_SOURCE]);
349 struct adv748x_afe *afe = adv748x_sd_to_afe(sd);
360 adv748x_afe_fill_format(afe, &sdformat->format);
361 adv748x_afe_propagate_pixelrate(afe);
417 struct adv748x_afe *afe = adv748x_ctrl_to_afe(ctrl);
418 struct adv748x_state *state = adv748x_afe_to_state(afe);
465 static int adv748x_afe_init_controls(struct adv748x_afe *afe)
467 struct adv748x_state *state = adv748x_afe_to_state(afe);
469 v4l2_ctrl_handler_init(&afe->ctrl_hdl, 5);
472 afe->ctrl_hdl.lock = &state->mutex;
474 v4l2_ctrl_new_std(&afe->ctrl_hdl, &adv748x_afe_ctrl_ops,
477 v4l2_ctrl_new_std(&afe->ctrl_hdl, &adv748x_afe_ctrl_ops,
480 v4l2_ctrl_new_std(&afe->ctrl_hdl, &adv748x_afe_ctrl_ops,
483 v4l2_ctrl_new_std(&afe->ctrl_hdl, &adv748x_afe_ctrl_ops,
487 v4l2_ctrl_new_std_menu_items(&afe->ctrl_hdl, &adv748x_afe_ctrl_ops,
492 afe->sd.ctrl_handler = &afe->ctrl_hdl;
493 if (afe->ctrl_hdl.error) {
494 v4l2_ctrl_handler_free(&afe->ctrl_hdl);
495 return afe->ctrl_hdl.error;
498 return v4l2_ctrl_handler_setup(&afe->ctrl_hdl);
501 int adv748x_afe_init(struct adv748x_afe *afe)
503 struct adv748x_state *state = adv748x_afe_to_state(afe);
507 afe->input = 0;
508 afe->streaming = false;
509 afe->curr_norm = V4L2_STD_NTSC_M;
511 adv748x_subdev_init(&afe->sd, state, &adv748x_afe_ops,
512 MEDIA_ENT_F_ATV_DECODER, "afe");
518 afe->input = i;
523 adv748x_afe_s_input(afe, afe->input);
525 adv_dbg(state, "AFE Default input set to %d\n", afe->input);
529 afe->pads[i].flags = MEDIA_PAD_FL_SINK;
531 afe->pads[ADV748X_AFE_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
533 ret = media_entity_pads_init(&afe->sd.entity, ADV748X_AFE_NR_PADS,
534 afe->pads);
538 ret = adv748x_afe_init_controls(afe);
545 media_entity_cleanup(&afe->sd.entity);
550 void adv748x_afe_cleanup(struct adv748x_afe *afe)
552 v4l2_device_unregister_subdev(&afe->sd);
553 media_entity_cleanup(&afe->sd.entity);
554 v4l2_ctrl_handler_free(&afe->ctrl_hdl);