Lines Matching refs:state

155 	struct ad9389b_state *state = get_ad9389b_state(sd);  in ad9389b_edid_rd()  local
161 buf[i] = i2c_smbus_read_byte_data(state->edid_i2c_client, i); in ad9389b_edid_rd()
240 struct ad9389b_state *state = get_ad9389b_state(sd); in ad9389b_set_IT_content_AVI_InfoFrame() local
242 if (state->dv_timings.bt.flags & V4L2_DV_FL_IS_CE_VIDEO) { in ad9389b_set_IT_content_AVI_InfoFrame()
253 struct ad9389b_state *state = get_ad9389b_state(sd); in ad9389b_set_rgb_quantization_mode() local
258 if (state->dv_timings.bt.flags & V4L2_DV_FL_IS_CE_VIDEO) { in ad9389b_set_rgb_quantization_mode()
316 struct ad9389b_state *state = get_ad9389b_state(sd); in ad9389b_s_ctrl() local
321 if (state->hdmi_mode_ctrl == ctrl) { in ad9389b_s_ctrl()
327 if (state->rgb_quantization_range_ctrl == ctrl) in ad9389b_s_ctrl()
355 struct ad9389b_state *state = get_ad9389b_state(sd); in ad9389b_log_status() local
356 struct ad9389b_state_edid *edid = &state->edid; in ad9389b_log_status()
382 v4l2_info(sd, "chip revision %d\n", state->chip_revision); in ad9389b_log_status()
383 v4l2_info(sd, "power %s\n", state->power_on ? "on" : "off"); in ad9389b_log_status()
400 state->edid_detect_counter, in ad9389b_log_status()
437 if (state->dv_timings.type == V4L2_DV_BT_656_1120) in ad9389b_log_status()
439 &state->dv_timings, false); in ad9389b_log_status()
448 struct ad9389b_state *state = get_ad9389b_state(sd); in ad9389b_s_power() local
449 struct ad9389b_platform_data *pdata = &state->pdata; in ad9389b_s_power()
455 state->power_on = on; in ad9389b_s_power()
604 struct ad9389b_state *state = get_ad9389b_state(sd); in ad9389b_s_dv_timings() local
619 state->dv_timings = *timings; in ad9389b_s_dv_timings()
622 ad9389b_set_rgb_quantization_mode(sd, state->rgb_quantization_range_ctrl); in ad9389b_s_dv_timings()
625 if (state->pdata.tmds_pll_gear == AD9389B_TMDS_PLL_GEAR_SEMI_AUTOMATIC) in ad9389b_s_dv_timings()
637 struct ad9389b_state *state = get_ad9389b_state(sd); in ad9389b_g_dv_timings() local
644 *timings = state->dv_timings; in ad9389b_g_dv_timings()
679 struct ad9389b_state *state = get_ad9389b_state(sd); in ad9389b_get_edid() local
685 if (!state->edid.segments) { in ad9389b_get_edid()
689 if (edid->start_block >= state->edid.segments * 2) in ad9389b_get_edid()
691 if (edid->blocks + edid->start_block >= state->edid.segments * 2) in ad9389b_get_edid()
692 edid->blocks = state->edid.segments * 2 - edid->start_block; in ad9389b_get_edid()
693 memcpy(edid->edid, &state->edid.data[edid->start_block * 128], in ad9389b_get_edid()
825 struct ad9389b_state *state = in ad9389b_edid_handler() local
827 struct v4l2_subdev *sd = &state->sd; in ad9389b_edid_handler()
841 if (state->edid.read_retries) { in ad9389b_edid_handler()
842 state->edid.read_retries--; in ad9389b_edid_handler()
846 queue_delayed_work(state->work_queue, in ad9389b_edid_handler()
847 &state->edid_handler, EDID_DELAY); in ad9389b_edid_handler()
873 struct ad9389b_state *state = get_ad9389b_state(sd); in ad9389b_setup() local
899 v4l2_ctrl_handler_setup(&state->hdl); in ad9389b_setup()
907 struct ad9389b_state *state = get_ad9389b_state(sd); in ad9389b_notify_monitor_detect() local
909 mdt.present = state->have_monitor; in ad9389b_notify_monitor_detect()
915 struct ad9389b_state *state = get_ad9389b_state(sd); in ad9389b_update_monitor_present_status() local
927 state->have_monitor = true; in ad9389b_update_monitor_present_status()
935 state->edid.read_retries = EDID_MAX_RETRIES; in ad9389b_update_monitor_present_status()
936 queue_delayed_work(state->work_queue, in ad9389b_update_monitor_present_status()
937 &state->edid_handler, EDID_DELAY); in ad9389b_update_monitor_present_status()
940 state->have_monitor = false; in ad9389b_update_monitor_present_status()
943 memset(&state->edid, 0, sizeof(struct ad9389b_state_edid)); in ad9389b_update_monitor_present_status()
947 v4l2_ctrl_s_ctrl(state->hotplug_ctrl, ad9389b_have_hotplug(sd) ? 0x1 : 0x0); in ad9389b_update_monitor_present_status()
948 v4l2_ctrl_s_ctrl(state->rx_sense_ctrl, ad9389b_have_rx_sense(sd) ? 0x1 : 0x0); in ad9389b_update_monitor_present_status()
949 v4l2_ctrl_s_ctrl(state->have_edid0_ctrl, state->edid.segments ? 0x1 : 0x0); in ad9389b_update_monitor_present_status()
952 ad9389b_s_ctrl(state->rgb_quantization_range_ctrl); in ad9389b_update_monitor_present_status()
953 ad9389b_s_ctrl(state->hdmi_mode_ctrl); in ad9389b_update_monitor_present_status()
958 struct ad9389b_state *state = get_ad9389b_state(sd); in ad9389b_check_monitor_present_status() local
967 while (state->power_on && (ad9389b_rd(sd, 0x41) & 0x40)) { in ad9389b_check_monitor_present_status()
974 cancel_delayed_work_sync(&state->edid_handler); in ad9389b_check_monitor_present_status()
975 memset(&state->edid, 0, sizeof(struct ad9389b_state_edid)); in ad9389b_check_monitor_present_status()
993 struct ad9389b_state *state = get_ad9389b_state(sd); in edid_verify_crc() local
994 u32 blocks = state->edid.blocks; in edid_verify_crc()
995 u8 *data = state->edid.data; in edid_verify_crc()
1010 struct ad9389b_state *state = get_ad9389b_state(sd); in edid_verify_header() local
1011 u8 *data = state->edid.data; in edid_verify_header()
1026 struct ad9389b_state *state = get_ad9389b_state(sd); in ad9389b_check_edid_status() local
1032 __func__, EDID_MAX_RETRIES - state->edid.read_retries); in ad9389b_check_edid_status()
1043 ad9389b_edid_rd(sd, 256, &state->edid.data[segment * 256]); in ad9389b_check_edid_status()
1045 &state->edid.data[segment * 256]); in ad9389b_check_edid_status()
1047 state->edid.blocks = state->edid.data[0x7e] + 1; in ad9389b_check_edid_status()
1049 __func__, state->edid.blocks); in ad9389b_check_edid_status()
1060 state->edid.segments = segment + 1; in ad9389b_check_edid_status()
1061 if (((state->edid.data[0x7e] >> 1) + 1) > state->edid.segments) { in ad9389b_check_edid_status()
1064 __func__, state->edid.segments); in ad9389b_check_edid_status()
1066 ad9389b_wr(sd, 0xc4, state->edid.segments); in ad9389b_check_edid_status()
1067 state->edid.read_retries = EDID_MAX_RETRIES; in ad9389b_check_edid_status()
1068 queue_delayed_work(state->work_queue, in ad9389b_check_edid_status()
1069 &state->edid_handler, EDID_DELAY); in ad9389b_check_edid_status()
1077 state->edid_detect_counter++; in ad9389b_check_edid_status()
1078 v4l2_ctrl_s_ctrl(state->have_edid0_ctrl, state->edid.segments ? 0x1 : 0x0); in ad9389b_check_edid_status()
1086 struct ad9389b_state *state = get_ad9389b_state(sd); in ad9389b_init_setup() local
1087 struct ad9389b_state_edid *edid = &state->edid; in ad9389b_init_setup()
1095 state->have_monitor = false; in ad9389b_init_setup()
1102 struct ad9389b_state *state; in ad9389b_probe() local
1115 state = devm_kzalloc(&client->dev, sizeof(*state), GFP_KERNEL); in ad9389b_probe()
1116 if (!state) in ad9389b_probe()
1124 memcpy(&state->pdata, pdata, sizeof(state->pdata)); in ad9389b_probe()
1126 sd = &state->sd; in ad9389b_probe()
1130 hdl = &state->hdl; in ad9389b_probe()
1135 state->hdmi_mode_ctrl = v4l2_ctrl_new_std_menu(hdl, &ad9389b_ctrl_ops, in ad9389b_probe()
1138 state->hotplug_ctrl = v4l2_ctrl_new_std(hdl, NULL, in ad9389b_probe()
1140 state->rx_sense_ctrl = v4l2_ctrl_new_std(hdl, NULL, in ad9389b_probe()
1142 state->have_edid0_ctrl = v4l2_ctrl_new_std(hdl, NULL, in ad9389b_probe()
1144 state->rgb_quantization_range_ctrl = in ad9389b_probe()
1154 state->hdmi_mode_ctrl->is_private = true; in ad9389b_probe()
1155 state->hotplug_ctrl->is_private = true; in ad9389b_probe()
1156 state->rx_sense_ctrl->is_private = true; in ad9389b_probe()
1157 state->have_edid0_ctrl->is_private = true; in ad9389b_probe()
1158 state->rgb_quantization_range_ctrl->is_private = true; in ad9389b_probe()
1160 state->pad.flags = MEDIA_PAD_FL_SINK; in ad9389b_probe()
1161 err = media_entity_init(&sd->entity, 1, &state->pad, 0); in ad9389b_probe()
1165 state->chip_revision = ad9389b_rd(sd, 0x0); in ad9389b_probe()
1166 if (state->chip_revision != 2) { in ad9389b_probe()
1167 v4l2_err(sd, "chip_revision %d != 2\n", state->chip_revision); in ad9389b_probe()
1172 ad9389b_rd(sd, 0x41), state->chip_revision); in ad9389b_probe()
1174 state->edid_i2c_client = i2c_new_dummy(client->adapter, (0x7e>>1)); in ad9389b_probe()
1175 if (state->edid_i2c_client == NULL) { in ad9389b_probe()
1181 state->work_queue = create_singlethread_workqueue(sd->name); in ad9389b_probe()
1182 if (state->work_queue == NULL) { in ad9389b_probe()
1188 INIT_DELAYED_WORK(&state->edid_handler, ad9389b_edid_handler); in ad9389b_probe()
1189 state->dv_timings = dv1080p60; in ad9389b_probe()
1199 i2c_unregister_device(state->edid_i2c_client); in ad9389b_probe()
1203 v4l2_ctrl_handler_free(&state->hdl); in ad9389b_probe()
1212 struct ad9389b_state *state = get_ad9389b_state(sd); in ad9389b_remove() local
1214 state->chip_revision = -1; in ad9389b_remove()
1222 cancel_delayed_work(&state->edid_handler); in ad9389b_remove()
1223 i2c_unregister_device(state->edid_i2c_client); in ad9389b_remove()
1224 destroy_workqueue(state->work_queue); in ad9389b_remove()