• Home
  • Raw
  • Download

Lines Matching refs:ch

83 static void vpif_calculate_offsets(struct channel_obj *ch);
84 static void vpif_config_addr(struct channel_obj *ch, int muxmode);
99 struct channel_obj *ch = fh->channel; in vpif_buffer_prepare() local
105 common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_buffer_prepare()
148 struct channel_obj *ch = fh->channel; in vpif_buffer_queue_setup() local
152 common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_buffer_queue_setup()
159 size = config_params.channel_bufsize[ch->channel_id]; in vpif_buffer_queue_setup()
165 if (ch->vpifparams.std_info.ycmux_mode == 0) { in vpif_buffer_queue_setup()
166 if (config_params.video_limit[ch->channel_id]) in vpif_buffer_queue_setup()
172 if (config_params.video_limit[ch->channel_id]) in vpif_buffer_queue_setup()
174 config_params.video_limit[ch->channel_id]) in vpif_buffer_queue_setup()
200 struct channel_obj *ch = fh->channel; in vpif_buffer_queue() local
206 common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_buffer_queue()
229 struct channel_obj *ch = fh->channel; in vpif_buf_cleanup() local
233 common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_buf_cleanup()
245 struct channel_obj *ch = fh->channel; in vpif_wait_prepare() local
248 common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_wait_prepare()
255 struct channel_obj *ch = fh->channel; in vpif_wait_finish() local
258 common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_wait_finish()
280 struct channel_obj *ch = fh->channel; in vpif_start_streaming() local
281 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_start_streaming()
282 struct vpif_params *vpif = &ch->vpifparams; in vpif_start_streaming()
304 ch->field_id = 0; in vpif_start_streaming()
309 vpif_calculate_offsets(ch); in vpif_start_streaming()
331 ret = vpif_set_video_params(vpif, ch->channel_id); in vpif_start_streaming()
339 vpif_config_addr(ch, ret); in vpif_start_streaming()
350 channel_first_int[VPIF_VIDEO_INDEX][ch->channel_id] = 1; in vpif_start_streaming()
351 if ((VPIF_CHANNEL0_VIDEO == ch->channel_id)) { in vpif_start_streaming()
356 if ((VPIF_CHANNEL1_VIDEO == ch->channel_id) || in vpif_start_streaming()
370 struct channel_obj *ch = fh->channel; in vpif_stop_streaming() local
377 common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_stop_streaming()
461 struct channel_obj *ch; in vpif_channel_isr() local
470 ch = dev->dev[channel_id]; in vpif_channel_isr()
472 field = ch->common[VPIF_VIDEO_INDEX].fmt.fmt.pix.field; in vpif_channel_isr()
475 common = &ch->common[i]; in vpif_channel_isr()
481 if (1 == ch->vpifparams.std_info.frm_fmt) { in vpif_channel_isr()
509 ch->field_id ^= 1; in vpif_channel_isr()
511 fid = vpif_channel_getfid(ch->channel_id); in vpif_channel_isr()
512 if (fid != ch->field_id) { in vpif_channel_isr()
518 ch->field_id = fid; in vpif_channel_isr()
554 static int vpif_update_std_info(struct channel_obj *ch) in vpif_update_std_info() argument
556 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_update_std_info()
557 struct vpif_params *vpifparams = &ch->vpifparams; in vpif_update_std_info()
560 struct video_obj *vid_ch = &ch->video; in vpif_update_std_info()
605 static void vpif_calculate_offsets(struct channel_obj *ch) in vpif_calculate_offsets() argument
608 struct video_obj *vid_ch = &(ch->video); in vpif_calculate_offsets()
609 struct vpif_params *vpifparams = &ch->vpifparams; in vpif_calculate_offsets()
610 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_calculate_offsets()
667 ch->vpifparams.video_params.stdid = vpifparams->std_info.stdid; in vpif_calculate_offsets()
674 static void vpif_config_format(struct channel_obj *ch) in vpif_config_format() argument
676 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_config_format()
681 if (config_params.numbuffers[ch->channel_id] == 0) in vpif_config_format()
687 = config_params.channel_bufsize[ch->channel_id]; in vpif_config_format()
689 if (ch->vpifparams.iface.if_type == VPIF_IF_RAW_BAYER) in vpif_config_format()
717 static int vpif_check_format(struct channel_obj *ch, in vpif_check_format() argument
721 struct common_obj *common = &(ch->common[VPIF_VIDEO_INDEX]); in vpif_check_format()
722 struct vpif_params *vpif_params = &ch->vpifparams; in vpif_check_format()
818 static void vpif_config_addr(struct channel_obj *ch, int muxmode) in vpif_config_addr() argument
824 common = &(ch->common[VPIF_VIDEO_INDEX]); in vpif_config_addr()
826 if (VPIF_CHANNEL1_VIDEO == ch->channel_id) in vpif_config_addr()
843 struct channel_obj *ch = fh->channel; in vpif_mmap() local
844 struct common_obj *common = &(ch->common[VPIF_VIDEO_INDEX]); in vpif_mmap()
890 struct channel_obj *ch; in vpif_open() local
895 ch = video_get_drvdata(vdev); in vpif_open()
897 vid_ch = &ch->video; in vpif_open()
898 common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_open()
913 fh->channel = ch; in vpif_open()
916 if (!ch->initialized) { in vpif_open()
918 ch->initialized = 1; in vpif_open()
919 memset(&(ch->vpifparams), 0, sizeof(struct vpif_params)); in vpif_open()
922 ch->usrs++; in vpif_open()
927 v4l2_prio_open(&ch->prio, &fh->prio); in vpif_open()
942 struct channel_obj *ch = fh->channel; in vpif_release() local
947 common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_release()
955 if (VPIF_CHANNEL0_VIDEO == ch->channel_id) { in vpif_release()
959 if ((VPIF_CHANNEL1_VIDEO == ch->channel_id) || in vpif_release()
971 ch->usrs--; in vpif_release()
974 v4l2_prio_close(&ch->prio, fh->prio); in vpif_release()
977 ch->initialized = 0; in vpif_release()
995 struct channel_obj *ch = fh->channel; in vpif_reqbufs() local
1007 if ((VPIF_CHANNEL0_VIDEO == ch->channel_id) in vpif_reqbufs()
1008 || (VPIF_CHANNEL1_VIDEO == ch->channel_id)) { in vpif_reqbufs()
1020 common = &ch->common[index]; in vpif_reqbufs()
1068 struct channel_obj *ch = fh->channel; in vpif_querybuf() local
1069 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_querybuf()
1094 struct channel_obj *ch = fh->channel; in vpif_qbuf() local
1095 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_qbuf()
1122 struct channel_obj *ch = fh->channel; in vpif_dqbuf() local
1123 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_dqbuf()
1142 struct channel_obj *ch = fh->channel; in vpif_streamon() local
1143 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_streamon()
1144 struct channel_obj *oth_ch = vpif_obj.dev[!ch->channel_id]; in vpif_streamon()
1150 vpif = &ch->vpifparams; in vpif_streamon()
1169 if ((ch->channel_id == VPIF_CHANNEL0_VIDEO && in vpif_streamon()
1172 ((ch->channel_id == VPIF_CHANNEL1_VIDEO) && in vpif_streamon()
1178 ret = vpif_check_format(ch, &common->fmt.fmt.pix, 0); in vpif_streamon()
1183 ret = v4l2_subdev_call(ch->sd, video, s_stream, 1); in vpif_streamon()
1211 struct channel_obj *ch = fh->channel; in vpif_streamoff() local
1212 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_streamoff()
1235 if (VPIF_CHANNEL0_VIDEO == ch->channel_id) { in vpif_streamoff()
1245 ret = v4l2_subdev_call(ch->sd, video, s_stream, 0); in vpif_streamoff()
1297 struct channel_obj *ch, in vpif_set_input() argument
1301 &vpif_cfg->chan_config[ch->channel_id]; in vpif_set_input()
1316 ret = vpif_cfg->setup_input_path(ch->channel_id, in vpif_set_input()
1336 ch->input_idx = index; in vpif_set_input()
1337 ch->sd = sd; in vpif_set_input()
1339 ch->vpifparams.iface = chan_cfg->vpif_if; in vpif_set_input()
1342 ch->video_dev->tvnorms = chan_cfg->inputs[index].input.std; in vpif_set_input()
1357 struct channel_obj *ch = fh->channel; in vpif_querystd() local
1363 ret = v4l2_subdev_call(ch->sd, video, querystd, std_id); in vpif_querystd()
1384 struct channel_obj *ch = fh->channel; in vpif_g_std() local
1388 *std = ch->video.stdid; in vpif_g_std()
1401 struct channel_obj *ch = fh->channel; in vpif_s_std() local
1402 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_s_std()
1412 if ((VPIF_CHANNEL0_VIDEO == ch->channel_id) || in vpif_s_std()
1413 (VPIF_CHANNEL1_VIDEO == ch->channel_id)) { in vpif_s_std()
1420 ret = v4l2_prio_check(&ch->prio, fh->prio); in vpif_s_std()
1427 ch->video.stdid = std_id; in vpif_s_std()
1428 memset(&ch->video.dv_timings, 0, sizeof(ch->video.dv_timings)); in vpif_s_std()
1431 if (vpif_update_std_info(ch)) { in vpif_s_std()
1437 vpif_config_format(ch); in vpif_s_std()
1440 ret = v4l2_subdev_call(ch->sd, core, s_std, std_id); in vpif_s_std()
1461 struct channel_obj *ch = fh->channel; in vpif_enum_input() local
1463 chan_cfg = &config->chan_config[ch->channel_id]; in vpif_enum_input()
1484 struct channel_obj *ch = fh->channel; in vpif_g_input() local
1486 *index = ch->input_idx; in vpif_g_input()
1501 struct channel_obj *ch = fh->channel; in vpif_s_input() local
1502 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_s_input()
1505 chan_cfg = &config->chan_config[ch->channel_id]; in vpif_s_input()
1515 if ((VPIF_CHANNEL0_VIDEO == ch->channel_id) || in vpif_s_input()
1516 (VPIF_CHANNEL1_VIDEO == ch->channel_id)) { in vpif_s_input()
1523 ret = v4l2_prio_check(&ch->prio, fh->prio); in vpif_s_input()
1528 return vpif_set_input(config, ch, index); in vpif_s_input()
1541 struct channel_obj *ch = fh->channel; in vpif_enum_fmt_vid_cap() local
1549 if (ch->vpifparams.iface.if_type == VPIF_IF_RAW_BAYER) { in vpif_enum_fmt_vid_cap()
1571 struct channel_obj *ch = fh->channel; in vpif_try_fmt_vid_cap() local
1574 return vpif_check_format(ch, pixfmt, 1); in vpif_try_fmt_vid_cap()
1588 struct channel_obj *ch = fh->channel; in vpif_g_fmt_vid_cap() local
1589 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_g_fmt_vid_cap()
1610 struct channel_obj *ch = fh->channel; in vpif_s_fmt_vid_cap() local
1611 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_s_fmt_vid_cap()
1623 if ((VPIF_CHANNEL0_VIDEO == ch->channel_id) || in vpif_s_fmt_vid_cap()
1624 (VPIF_CHANNEL1_VIDEO == ch->channel_id)) { in vpif_s_fmt_vid_cap()
1631 ret = v4l2_prio_check(&ch->prio, fh->prio); in vpif_s_fmt_vid_cap()
1639 ret = vpif_check_format(ch, pixfmt, 0); in vpif_s_fmt_vid_cap()
1679 struct channel_obj *ch = fh->channel; in vpif_g_priority() local
1681 *prio = v4l2_prio_max(&ch->prio); in vpif_g_priority()
1695 struct channel_obj *ch = fh->channel; in vpif_s_priority() local
1697 return v4l2_prio_change(&ch->prio, &fh->prio, p); in vpif_s_priority()
1710 struct channel_obj *ch = fh->channel; in vpif_cropcap() local
1711 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_cropcap()
1735 struct channel_obj *ch = fh->channel; in vpif_enum_dv_timings() local
1738 ret = v4l2_subdev_call(ch->sd, video, enum_dv_timings, timings); in vpif_enum_dv_timings()
1755 struct channel_obj *ch = fh->channel; in vpif_query_dv_timings() local
1758 ret = v4l2_subdev_call(ch->sd, video, query_dv_timings, timings); in vpif_query_dv_timings()
1774 struct channel_obj *ch = fh->channel; in vpif_s_dv_timings() local
1775 struct vpif_params *vpifparams = &ch->vpifparams; in vpif_s_dv_timings()
1777 struct video_obj *vid_ch = &ch->video; in vpif_s_dv_timings()
1787 ret = v4l2_subdev_call(ch->sd, video, s_dv_timings, timings); in vpif_s_dv_timings()
1868 struct channel_obj *ch = fh->channel; in vpif_g_dv_timings() local
1869 struct video_obj *vid_ch = &ch->video; in vpif_g_dv_timings()
1912 struct channel_obj *ch = fh->channel; in vpif_dbg_g_register() local
1914 return v4l2_subdev_call(ch->sd, core, g_register, reg); in vpif_dbg_g_register()
1930 struct channel_obj *ch = fh->channel; in vpif_dbg_s_register() local
1932 return v4l2_subdev_call(ch->sd, core, s_register, reg); in vpif_dbg_s_register()
2073 struct channel_obj *ch; in vpif_probe() local
2111 ch = vpif_obj.dev[i]; in vpif_probe()
2116 ch = vpif_obj.dev[j]; in vpif_probe()
2117 video_device_release(ch->video_dev); in vpif_probe()
2131 ch->video_dev = vfd; in vpif_probe()
2141 ch = vpif_obj.dev[j]; in vpif_probe()
2142 ch->channel_id = j; in vpif_probe()
2144 config_params.video_limit[ch->channel_id] = 0; in vpif_probe()
2146 config_params.video_limit[ch->channel_id] = in vpif_probe()
2180 ch = vpif_obj.dev[j]; in vpif_probe()
2181 ch->channel_id = j; in vpif_probe()
2182 common = &(ch->common[VPIF_VIDEO_INDEX]); in vpif_probe()
2185 ch->video_dev->lock = &common->lock; in vpif_probe()
2187 v4l2_prio_init(&ch->prio); in vpif_probe()
2188 video_set_drvdata(ch->video_dev, ch); in vpif_probe()
2191 err = vpif_set_input(config, ch, 0); in vpif_probe()
2195 err = video_register_device(ch->video_dev, in vpif_probe()
2206 ch = vpif_obj.dev[k]; in vpif_probe()
2208 video_unregister_device(ch->video_dev); in vpif_probe()
2216 ch = vpif_obj.dev[i]; in vpif_probe()
2218 video_device_release(ch->video_dev); in vpif_probe()
2239 struct channel_obj *ch; in vpif_remove() local
2246 ch = vpif_obj.dev[i]; in vpif_remove()
2248 video_unregister_device(ch->video_dev); in vpif_remove()
2261 struct channel_obj *ch; in vpif_suspend() local
2266 ch = vpif_obj.dev[i]; in vpif_suspend()
2267 common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_suspend()
2269 if (ch->usrs && common->io_usrs) { in vpif_suspend()
2271 if (ch->channel_id == VPIF_CHANNEL0_VIDEO) { in vpif_suspend()
2275 if (ch->channel_id == VPIF_CHANNEL1_VIDEO || in vpif_suspend()
2293 struct channel_obj *ch; in vpif_resume() local
2298 ch = vpif_obj.dev[i]; in vpif_resume()
2299 common = &ch->common[VPIF_VIDEO_INDEX]; in vpif_resume()
2301 if (ch->usrs && common->io_usrs) { in vpif_resume()
2303 if (ch->channel_id == VPIF_CHANNEL0_VIDEO) { in vpif_resume()
2307 if (ch->channel_id == VPIF_CHANNEL1_VIDEO || in vpif_resume()