Lines Matching full:edid
63 /* Number of EDID read retries left */
86 struct ad9389b_state_edid edid; member
343 struct ad9389b_state_edid *edid = &state->edid; in ad9389b_log_status() local
347 "reading EDID", in ad9389b_log_status()
371 v4l2_info(sd, "%s hotplug, %s Rx Sense, %s EDID (%d block(s))\n", in ad9389b_log_status()
376 edid->segments ? "found" : "no", edid->blocks); in ad9389b_log_status()
491 /* Set number of attempts to read the EDID */ in ad9389b_s_power()
503 /* The datasheet says that the EDID ready interrupt should be in ad9389b_set_isr()
664 static int ad9389b_get_edid(struct v4l2_subdev *sd, struct v4l2_edid *edid) in ad9389b_get_edid() argument
668 if (edid->pad != 0) in ad9389b_get_edid()
670 if (edid->blocks == 0 || edid->blocks > 256) in ad9389b_get_edid()
672 if (!state->edid.segments) { in ad9389b_get_edid()
673 v4l2_dbg(1, debug, sd, "EDID segment 0 not found\n"); in ad9389b_get_edid()
676 if (edid->start_block >= state->edid.segments * 2) in ad9389b_get_edid()
678 if (edid->blocks + edid->start_block >= state->edid.segments * 2) in ad9389b_get_edid()
679 edid->blocks = state->edid.segments * 2 - edid->start_block; in ad9389b_get_edid()
680 memcpy(edid->edid, &state->edid.data[edid->start_block * 128], in ad9389b_get_edid()
681 128 * edid->blocks); in ad9389b_get_edid()
793 v4l2_dbg(lvl, debug, sd, "edid segment %d\n", segment); in ad9389b_dbg_dump_edid()
820 /* Return if we received the EDID. */ in ad9389b_edid_handler()
825 /* We must retry reading the EDID several times, it is possible in ad9389b_edid_handler()
826 * that initially the EDID couldn't be read due to i2c errors in ad9389b_edid_handler()
828 if (state->edid.read_retries) { in ad9389b_edid_handler()
829 state->edid.read_retries--; in ad9389b_edid_handler()
830 v4l2_dbg(1, debug, sd, "%s: edid read failed\n", __func__); in ad9389b_edid_handler()
838 /* We failed to read the EDID, so send an event for this. */ in ad9389b_edid_handler()
842 v4l2_dbg(1, debug, sd, "%s: no edid found\n", __func__); in ad9389b_edid_handler()
921 state->edid.read_retries = EDID_MAX_RETRIES; in ad9389b_update_monitor_present_status()
928 memset(&state->edid, 0, sizeof(struct ad9389b_state_edid)); in ad9389b_update_monitor_present_status()
934 v4l2_ctrl_s_ctrl(state->have_edid0_ctrl, state->edid.segments ? 0x1 : 0x0); in ad9389b_update_monitor_present_status()
960 memset(&state->edid, 0, sizeof(struct ad9389b_state_edid)); in ad9389b_check_monitor_present_status()
979 u32 blocks = state->edid.blocks; in edid_verify_crc()
980 u8 *data = state->edid.data; in edid_verify_crc()
996 u8 *data = state->edid.data; in edid_verify_header()
1016 v4l2_dbg(1, debug, sd, "%s: edid ready (retries: %d)\n", in ad9389b_check_edid_status()
1017 __func__, EDID_MAX_RETRIES - state->edid.read_retries); in ad9389b_check_edid_status()
1024 v4l2_err(sd, "edid segment number too big\n"); in ad9389b_check_edid_status()
1028 ad9389b_edid_rd(sd, 256, &state->edid.data[segment * 256]); in ad9389b_check_edid_status()
1030 &state->edid.data[segment * 256]); in ad9389b_check_edid_status()
1032 state->edid.blocks = state->edid.data[0x7e] + 1; in ad9389b_check_edid_status()
1034 __func__, state->edid.blocks); in ad9389b_check_edid_status()
1038 /* edid crc error, force reread of edid segment */ in ad9389b_check_edid_status()
1039 v4l2_err(sd, "%s: edid crc or header error\n", __func__); in ad9389b_check_edid_status()
1045 state->edid.segments = segment + 1; in ad9389b_check_edid_status()
1046 if (((state->edid.data[0x7e] >> 1) + 1) > state->edid.segments) { in ad9389b_check_edid_status()
1047 /* Request next EDID segment */ in ad9389b_check_edid_status()
1049 __func__, state->edid.segments); in ad9389b_check_edid_status()
1051 ad9389b_wr(sd, 0xc4, state->edid.segments); in ad9389b_check_edid_status()
1052 state->edid.read_retries = EDID_MAX_RETRIES; in ad9389b_check_edid_status()
1062 v4l2_ctrl_s_ctrl(state->have_edid0_ctrl, state->edid.segments ? 0x1 : 0x0); in ad9389b_check_edid_status()
1071 struct ad9389b_state_edid *edid = &state->edid; in ad9389b_init_setup() local
1078 memset(edid, 0, sizeof(struct ad9389b_state_edid)); in ad9389b_init_setup()
1153 v4l2_err(sd, "failed to register edid i2c client\n"); in ad9389b_probe()