Lines Matching refs:dev
308 static int set_itvc_reg(struct cx231xx *dev, u32 gpio_direction, u32 value) in set_itvc_reg() argument
315 status = cx231xx_send_gpio_cmd(dev, _gpio_direction, in set_itvc_reg()
320 static int get_itvc_reg(struct cx231xx *dev, u32 gpio_direction, u32 *val_ptr) in get_itvc_reg() argument
328 status = cx231xx_send_gpio_cmd(dev, _gpio_direction, in get_itvc_reg()
333 static int wait_for_mci_complete(struct cx231xx *dev) in wait_for_mci_complete() argument
338 get_itvc_reg(dev, gpio_direction, &gpio); in wait_for_mci_complete()
343 get_itvc_reg(dev, gpio_direction, &gpio); in wait_for_mci_complete()
353 static int mc417_register_write(struct cx231xx *dev, u16 address, u32 value) in mc417_register_write() argument
360 status = set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_register_write()
364 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_register_write()
369 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_register_write()
371 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_register_write()
376 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_register_write()
378 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_register_write()
383 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_register_write()
385 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_register_write()
390 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_register_write()
392 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_register_write()
397 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_register_write()
399 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_register_write()
404 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_register_write()
406 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_register_write()
408 return wait_for_mci_complete(dev); in mc417_register_write()
411 static int mc417_register_read(struct cx231xx *dev, u16 address, u32 *value) in mc417_register_read() argument
420 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_register_read()
422 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_register_read()
427 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_register_read()
429 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_register_read()
434 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_register_read()
436 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_register_read()
440 ret = wait_for_mci_complete(dev); in mc417_register_read()
446 set_itvc_reg(dev, ITVC_READ_DIR, temp); in mc417_register_read()
448 set_itvc_reg(dev, ITVC_READ_DIR, temp); in mc417_register_read()
449 get_itvc_reg(dev, ITVC_READ_DIR, &temp); in mc417_register_read()
451 set_itvc_reg(dev, ITVC_READ_DIR, (0x87 << 10)); in mc417_register_read()
455 set_itvc_reg(dev, ITVC_READ_DIR, temp); in mc417_register_read()
457 set_itvc_reg(dev, ITVC_READ_DIR, temp); in mc417_register_read()
458 get_itvc_reg(dev, ITVC_READ_DIR, &temp); in mc417_register_read()
461 set_itvc_reg(dev, ITVC_READ_DIR, (0x87 << 10)); in mc417_register_read()
465 set_itvc_reg(dev, ITVC_READ_DIR, temp); in mc417_register_read()
467 set_itvc_reg(dev, ITVC_READ_DIR, temp); in mc417_register_read()
468 get_itvc_reg(dev, ITVC_READ_DIR, &temp); in mc417_register_read()
470 set_itvc_reg(dev, ITVC_READ_DIR, (0x87 << 10)); in mc417_register_read()
474 set_itvc_reg(dev, ITVC_READ_DIR, temp); in mc417_register_read()
476 set_itvc_reg(dev, ITVC_READ_DIR, temp); in mc417_register_read()
477 get_itvc_reg(dev, ITVC_READ_DIR, &temp); in mc417_register_read()
479 set_itvc_reg(dev, ITVC_READ_DIR, (0x87 << 10)); in mc417_register_read()
485 static int mc417_memory_write(struct cx231xx *dev, u32 address, u32 value) in mc417_memory_write() argument
494 ret = set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_memory_write()
498 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_memory_write()
503 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_memory_write()
505 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_memory_write()
510 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_memory_write()
512 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_memory_write()
517 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_memory_write()
519 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_memory_write()
525 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_memory_write()
527 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_memory_write()
532 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_memory_write()
534 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_memory_write()
539 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_memory_write()
541 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_memory_write()
544 wait_for_mci_complete(dev); in mc417_memory_write()
549 static int mc417_memory_read(struct cx231xx *dev, u32 address, u32 *value) in mc417_memory_read() argument
559 ret = set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_memory_read()
563 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_memory_read()
568 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_memory_read()
570 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_memory_read()
575 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_memory_read()
577 set_itvc_reg(dev, ITVC_WRITE_DIR, temp); in mc417_memory_read()
580 ret = wait_for_mci_complete(dev); in mc417_memory_read()
585 set_itvc_reg(dev, ITVC_READ_DIR, temp); in mc417_memory_read()
587 set_itvc_reg(dev, ITVC_READ_DIR, temp); in mc417_memory_read()
588 get_itvc_reg(dev, ITVC_READ_DIR, &temp); in mc417_memory_read()
590 set_itvc_reg(dev, ITVC_READ_DIR, (0x87 << 10)); in mc417_memory_read()
594 set_itvc_reg(dev, ITVC_READ_DIR, temp); in mc417_memory_read()
596 set_itvc_reg(dev, ITVC_READ_DIR, temp); in mc417_memory_read()
597 get_itvc_reg(dev, ITVC_READ_DIR, &temp); in mc417_memory_read()
599 set_itvc_reg(dev, ITVC_READ_DIR, (0x87 << 10)); in mc417_memory_read()
603 set_itvc_reg(dev, ITVC_READ_DIR, temp); in mc417_memory_read()
605 set_itvc_reg(dev, ITVC_READ_DIR, temp); in mc417_memory_read()
606 get_itvc_reg(dev, ITVC_READ_DIR, &temp); in mc417_memory_read()
608 set_itvc_reg(dev, ITVC_READ_DIR, (0x87 << 10)); in mc417_memory_read()
612 set_itvc_reg(dev, ITVC_READ_DIR, temp); in mc417_memory_read()
614 set_itvc_reg(dev, ITVC_READ_DIR, temp); in mc417_memory_read()
615 get_itvc_reg(dev, ITVC_READ_DIR, &temp); in mc417_memory_read()
617 set_itvc_reg(dev, ITVC_READ_DIR, (0x87 << 10)); in mc417_memory_read()
717 struct cx231xx *dev = priv; in cx231xx_mbox_func() local
727 mc417_memory_read(dev, dev->cx23417_mailbox - 4, &value); in cx231xx_mbox_func()
737 mc417_memory_read(dev, dev->cx23417_mailbox, &flag); in cx231xx_mbox_func()
745 mc417_memory_write(dev, dev->cx23417_mailbox, flag); in cx231xx_mbox_func()
749 mc417_memory_write(dev, dev->cx23417_mailbox + 1, command); in cx231xx_mbox_func()
750 mc417_memory_write(dev, dev->cx23417_mailbox + 3, in cx231xx_mbox_func()
753 mc417_memory_write(dev, dev->cx23417_mailbox + 4 + i, data[i]); in cx231xx_mbox_func()
757 mc417_memory_write(dev, dev->cx23417_mailbox + 4 + i, 0); in cx231xx_mbox_func()
760 mc417_memory_write(dev, dev->cx23417_mailbox, flag); in cx231xx_mbox_func()
765 mc417_memory_read(dev, dev->cx23417_mailbox, &flag); in cx231xx_mbox_func()
777 mc417_memory_read(dev, dev->cx23417_mailbox + 4 + i, data + i); in cx231xx_mbox_func()
781 mc417_memory_read(dev, dev->cx23417_mailbox + 2, &retval); in cx231xx_mbox_func()
785 mc417_memory_write(dev, dev->cx23417_mailbox, flag); in cx231xx_mbox_func()
793 static int cx231xx_api_cmd(struct cx231xx *dev, u32 command, in cx231xx_api_cmd() argument
806 err = cx231xx_mbox_func(dev, command, inputcnt, outputcnt, data); in cx231xx_api_cmd()
817 static int cx231xx_find_mailbox(struct cx231xx *dev) in cx231xx_find_mailbox() argument
830 ret = mc417_memory_read(dev, i, &value); in cx231xx_find_mailbox()
846 static void mci_write_memory_to_gpio(struct cx231xx *dev, u32 address, u32 value, in mci_write_memory_to_gpio() argument
922 static int cx231xx_load_firmware(struct cx231xx *dev) in cx231xx_load_firmware() argument
960 retval |= mc417_memory_read(dev, 0x9020, &gpio_output); in cx231xx_load_firmware()
961 retval |= mc417_memory_read(dev, 0x900C, &value); in cx231xx_load_firmware()
963 retval = mc417_register_write(dev, in cx231xx_load_firmware()
965 retval |= mc417_register_write(dev, in cx231xx_load_firmware()
967 retval |= mc417_register_write(dev, in cx231xx_load_firmware()
969 retval |= mc417_register_write(dev, in cx231xx_load_firmware()
971 retval |= mc417_register_write(dev, in cx231xx_load_firmware()
975 dev_err(dev->dev, in cx231xx_load_firmware()
983 dev->dev); in cx231xx_load_firmware()
986 dev_err(dev->dev, in cx231xx_load_firmware()
989 dev_err(dev->dev, in cx231xx_load_firmware()
997 dev_err(dev->dev, in cx231xx_load_firmware()
1007 dev_err(dev->dev, in cx231xx_load_firmware()
1015 initGPIO(dev); in cx231xx_load_firmware()
1025 mci_write_memory_to_gpio(dev, address, fw_data, p_current_fw); in cx231xx_load_firmware()
1044 cx231xx_ep5_bulkout(dev, p_buffer, _buffer_size); in cx231xx_load_firmware()
1051 uninitGPIO(dev); in cx231xx_load_firmware()
1055 retval |= mc417_register_write(dev, IVTV_REG_HW_BLOCKS, in cx231xx_load_firmware()
1058 dev_err(dev->dev, in cx231xx_load_firmware()
1064 retval |= mc417_register_write(dev, 0x9020, gpio_output); in cx231xx_load_firmware()
1065 retval |= mc417_register_write(dev, 0x900C, value); in cx231xx_load_firmware()
1067 retval |= mc417_register_read(dev, IVTV_REG_VPU, &value); in cx231xx_load_firmware()
1068 retval |= mc417_register_write(dev, IVTV_REG_VPU, value & 0xFFFFFFE8); in cx231xx_load_firmware()
1071 dev_err(dev->dev, in cx231xx_load_firmware()
1079 static void cx231xx_codec_settings(struct cx231xx *dev) in cx231xx_codec_settings() argument
1084 cx231xx_api_cmd(dev, CX2341X_ENC_SET_FRAME_SIZE, 2, 0, in cx231xx_codec_settings()
1085 dev->ts1.height, dev->ts1.width); in cx231xx_codec_settings()
1087 dev->mpeg_ctrl_handler.width = dev->ts1.width; in cx231xx_codec_settings()
1088 dev->mpeg_ctrl_handler.height = dev->ts1.height; in cx231xx_codec_settings()
1090 cx2341x_handler_setup(&dev->mpeg_ctrl_handler); in cx231xx_codec_settings()
1092 cx231xx_api_cmd(dev, CX2341X_ENC_MISC, 2, 0, 3, 1); in cx231xx_codec_settings()
1093 cx231xx_api_cmd(dev, CX2341X_ENC_MISC, 2, 0, 4, 1); in cx231xx_codec_settings()
1096 static int cx231xx_initialize_codec(struct cx231xx *dev) in cx231xx_initialize_codec() argument
1104 cx231xx_disable656(dev); in cx231xx_initialize_codec()
1105 retval = cx231xx_api_cmd(dev, CX2341X_ENC_PING_FW, 0, 0); /* ping */ in cx231xx_initialize_codec()
1108 retval = cx231xx_load_firmware(dev); in cx231xx_initialize_codec()
1110 dev_err(dev->dev, in cx231xx_initialize_codec()
1114 retval = cx231xx_find_mailbox(dev); in cx231xx_initialize_codec()
1116 dev_err(dev->dev, "%s: mailbox < 0, error\n", in cx231xx_initialize_codec()
1120 dev->cx23417_mailbox = retval; in cx231xx_initialize_codec()
1121 retval = cx231xx_api_cmd(dev, CX2341X_ENC_PING_FW, 0, 0); in cx231xx_initialize_codec()
1123 dev_err(dev->dev, in cx231xx_initialize_codec()
1127 retval = cx231xx_api_cmd(dev, CX2341X_ENC_GET_VERSION, 0, 1, in cx231xx_initialize_codec()
1130 dev_err(dev->dev, in cx231xx_initialize_codec()
1139 retval = mc417_register_read(dev, 0x20f8, &val); in cx231xx_initialize_codec()
1146 cx231xx_enable656(dev); in cx231xx_initialize_codec()
1149 cx231xx_api_cmd(dev, CX2341X_ENC_STOP_CAPTURE, 3, 0, 1, 3, 4); in cx231xx_initialize_codec()
1151 cx231xx_codec_settings(dev); in cx231xx_initialize_codec()
1174 cx231xx_api_cmd(dev, CX2341X_ENC_SET_VBI_CONFIG, 7, 0, data[0], data[1], in cx231xx_initialize_codec()
1181 cx231xx_api_cmd(dev, CX2341X_ENC_SET_VBI_LINE, 5, 0, i, in cx231xx_initialize_codec()
1183 cx231xx_api_cmd(dev, CX2341X_ENC_SET_VBI_LINE, 5, 0, in cx231xx_initialize_codec()
1191 retval = cx231xx_api_cmd(dev, CX2341X_ENC_INITIALIZE_INPUT, 0, 0); in cx231xx_initialize_codec()
1197 mc417_memory_write(dev, 2120, 0x00000080); in cx231xx_initialize_codec()
1200 retval = cx231xx_api_cmd(dev, CX2341X_ENC_START_CAPTURE, 2, 0, in cx231xx_initialize_codec()
1207 mc417_register_read(dev, 0x20f8, &val); in cx231xx_initialize_codec()
1220 struct cx231xx *dev = vb2_get_drv_priv(vq); in queue_setup() local
1223 dev->ts1.ts_packet_size = mpeglinesize; in queue_setup()
1224 dev->ts1.ts_packet_count = mpeglines; in queue_setup()
1237 static void buffer_copy(struct cx231xx *dev, char *data, int len, struct urb *urb, in buffer_copy() argument
1251 dev->video_mode.isoc_ctl.buf = buf; in buffer_copy()
1255 buf = dev->video_mode.isoc_ctl.buf; in buffer_copy()
1315 static int cx231xx_isoc_copy(struct cx231xx *dev, struct urb *urb) in cx231xx_isoc_copy() argument
1324 buffer_copy(dev, dma_q->p_left_data, in cx231xx_isoc_copy()
1335 buffer_copy(dev, p_buffer, buffer_size, urb, dma_q); in cx231xx_isoc_copy()
1341 static int cx231xx_bulk_copy(struct cx231xx *dev, struct urb *urb) in cx231xx_bulk_copy() argument
1369 struct cx231xx *dev = vb2_get_drv_priv(vb->vb2_queue); in buffer_queue() local
1370 struct cx231xx_dmaqueue *vidq = &dev->video_mode.vidq; in buffer_queue()
1373 spin_lock_irqsave(&dev->video_mode.slock, flags); in buffer_queue()
1375 spin_unlock_irqrestore(&dev->video_mode.slock, flags); in buffer_queue()
1378 static void return_all_buffers(struct cx231xx *dev, in return_all_buffers() argument
1381 struct cx231xx_dmaqueue *vidq = &dev->video_mode.vidq; in return_all_buffers()
1385 spin_lock_irqsave(&dev->video_mode.slock, flags); in return_all_buffers()
1390 spin_unlock_irqrestore(&dev->video_mode.slock, flags); in return_all_buffers()
1395 struct cx231xx *dev = vb2_get_drv_priv(vq); in start_streaming() local
1396 struct cx231xx_dmaqueue *vidq = &dev->video_mode.vidq; in start_streaming()
1400 dev->mode_tv = 1; in start_streaming()
1402 cx231xx_set_alt_setting(dev, INDEX_VANC, 1); in start_streaming()
1403 cx231xx_set_gpio_value(dev, 2, 0); in start_streaming()
1405 cx231xx_initialize_codec(dev); in start_streaming()
1407 cx231xx_start_TS1(dev); in start_streaming()
1409 cx231xx_set_alt_setting(dev, INDEX_TS1, 0); in start_streaming()
1410 cx231xx_set_mode(dev, CX231XX_DIGITAL_MODE); in start_streaming()
1411 if (dev->USE_ISO) in start_streaming()
1412 ret = cx231xx_init_isoc(dev, CX231XX_NUM_PACKETS, in start_streaming()
1414 dev->ts1_mode.max_pkt_size, in start_streaming()
1417 ret = cx231xx_init_bulk(dev, 320, 5, in start_streaming()
1418 dev->ts1_mode.max_pkt_size, in start_streaming()
1421 return_all_buffers(dev, VB2_BUF_STATE_QUEUED); in start_streaming()
1423 call_all(dev, video, s_stream, 1); in start_streaming()
1429 struct cx231xx *dev = vb2_get_drv_priv(vq); in stop_streaming() local
1432 call_all(dev, video, s_stream, 0); in stop_streaming()
1434 cx231xx_stop_TS1(dev); in stop_streaming()
1437 if (dev->USE_ISO) in stop_streaming()
1438 cx231xx_uninit_isoc(dev); in stop_streaming()
1440 cx231xx_uninit_bulk(dev); in stop_streaming()
1441 cx231xx_set_mode(dev, CX231XX_SUSPEND); in stop_streaming()
1443 cx231xx_api_cmd(dev, CX2341X_ENC_STOP_CAPTURE, 3, 0, in stop_streaming()
1447 spin_lock_irqsave(&dev->video_mode.slock, flags); in stop_streaming()
1448 if (dev->USE_ISO) in stop_streaming()
1449 dev->video_mode.isoc_ctl.buf = NULL; in stop_streaming()
1451 dev->video_mode.bulk_ctl.buf = NULL; in stop_streaming()
1452 spin_unlock_irqrestore(&dev->video_mode.slock, flags); in stop_streaming()
1453 return_all_buffers(dev, VB2_BUF_STATE_ERROR); in stop_streaming()
1470 struct cx231xx *dev = video_drvdata(file); in vidioc_g_pixelaspect() local
1471 bool is_50hz = dev->encodernorm.id & V4L2_STD_625_50; in vidioc_g_pixelaspect()
1485 struct cx231xx *dev = video_drvdata(file); in vidioc_g_selection() local
1495 s->r.width = dev->ts1.width; in vidioc_g_selection()
1496 s->r.height = dev->ts1.height; in vidioc_g_selection()
1506 struct cx231xx *dev = video_drvdata(file); in vidioc_g_std() local
1508 *norm = dev->encodernorm.id; in vidioc_g_std()
1514 struct cx231xx *dev = video_drvdata(file); in vidioc_s_std() local
1522 dev->encodernorm = cx231xx_tvnorms[i]; in vidioc_s_std()
1524 if (dev->encodernorm.id & 0xb000) { in vidioc_s_std()
1526 dev->norm = V4L2_STD_NTSC; in vidioc_s_std()
1527 dev->ts1.height = 480; in vidioc_s_std()
1528 cx2341x_handler_set_50hz(&dev->mpeg_ctrl_handler, false); in vidioc_s_std()
1531 dev->norm = V4L2_STD_PAL_B; in vidioc_s_std()
1532 dev->ts1.height = 576; in vidioc_s_std()
1533 cx2341x_handler_set_50hz(&dev->mpeg_ctrl_handler, true); in vidioc_s_std()
1535 call_all(dev, video, s_std, dev->norm); in vidioc_s_std()
1537 cx231xx_do_mode_ctrl_overrides(dev); in vidioc_s_std()
1546 struct cx231xx *dev = video_drvdata(file); in vidioc_s_ctrl() local
1551 v4l2_device_for_each_subdev(sd, &dev->v4l2_dev) in vidioc_s_ctrl()
1571 struct cx231xx *dev = video_drvdata(file); in vidioc_g_fmt_vid_cap() local
1578 f->fmt.pix.width = dev->ts1.width; in vidioc_g_fmt_vid_cap()
1579 f->fmt.pix.height = dev->ts1.height; in vidioc_g_fmt_vid_cap()
1582 dev->ts1.width, dev->ts1.height); in vidioc_g_fmt_vid_cap()
1590 struct cx231xx *dev = video_drvdata(file); in vidioc_try_fmt_vid_cap() local
1599 dev->ts1.width, dev->ts1.height); in vidioc_try_fmt_vid_cap()
1606 struct cx231xx *dev = video_drvdata(file); in vidioc_log_status() local
1608 call_all(dev, core, log_status); in vidioc_log_status()
1663 void cx231xx_417_unregister(struct cx231xx *dev) in cx231xx_417_unregister() argument
1668 if (video_is_registered(&dev->v4l_device)) { in cx231xx_417_unregister()
1669 video_unregister_device(&dev->v4l_device); in cx231xx_417_unregister()
1670 v4l2_ctrl_handler_free(&dev->mpeg_ctrl_handler.hdl); in cx231xx_417_unregister()
1676 struct cx231xx *dev = container_of(cxhdl, struct cx231xx, mpeg_ctrl_handler); in cx231xx_s_video_encoding() local
1686 v4l2_subdev_call(dev->sd_cx25840, pad, set_fmt, NULL, &format); in cx231xx_s_video_encoding()
1693 struct cx231xx *dev = container_of(cxhdl, struct cx231xx, mpeg_ctrl_handler); in cx231xx_s_audio_sampling_freq() local
1698 call_all(dev, audio, s_clock_freq, freqs[idx]); in cx231xx_s_audio_sampling_freq()
1710 struct cx231xx *dev, in cx231xx_video_dev_init() argument
1718 snprintf(vfd->name, sizeof(vfd->name), "%s %s (%s)", dev->name, in cx231xx_video_dev_init()
1719 type, cx231xx_boards[dev->model].name); in cx231xx_video_dev_init()
1721 vfd->v4l2_dev = &dev->v4l2_dev; in cx231xx_video_dev_init()
1722 vfd->lock = &dev->lock; in cx231xx_video_dev_init()
1724 vfd->ctrl_handler = &dev->mpeg_ctrl_handler.hdl; in cx231xx_video_dev_init()
1725 video_set_drvdata(vfd, dev); in cx231xx_video_dev_init()
1726 if (dev->tuner_type == TUNER_ABSENT) { in cx231xx_video_dev_init()
1734 int cx231xx_417_register(struct cx231xx *dev) in cx231xx_417_register() argument
1738 struct cx231xx_tsport *tsport = &dev->ts1; in cx231xx_417_register()
1744 dev->encodernorm = cx231xx_tvnorms[0]; in cx231xx_417_register()
1746 if (dev->encodernorm.id & V4L2_STD_525_60) in cx231xx_417_register()
1752 err = cx2341x_handler_init(&dev->mpeg_ctrl_handler, 50); in cx231xx_417_register()
1754 dprintk(3, "%s: can't init cx2341x controls\n", dev->name); in cx231xx_417_register()
1757 dev->mpeg_ctrl_handler.func = cx231xx_mbox_func; in cx231xx_417_register()
1758 dev->mpeg_ctrl_handler.priv = dev; in cx231xx_417_register()
1759 dev->mpeg_ctrl_handler.ops = &cx231xx_ops; in cx231xx_417_register()
1760 if (dev->sd_cx25840) in cx231xx_417_register()
1761 v4l2_ctrl_add_handler(&dev->mpeg_ctrl_handler.hdl, in cx231xx_417_register()
1762 dev->sd_cx25840->ctrl_handler, NULL, false); in cx231xx_417_register()
1763 if (dev->mpeg_ctrl_handler.hdl.error) { in cx231xx_417_register()
1764 err = dev->mpeg_ctrl_handler.hdl.error; in cx231xx_417_register()
1765 dprintk(3, "%s: can't add cx25840 controls\n", dev->name); in cx231xx_417_register()
1766 v4l2_ctrl_handler_free(&dev->mpeg_ctrl_handler.hdl); in cx231xx_417_register()
1769 dev->norm = V4L2_STD_NTSC; in cx231xx_417_register()
1771 dev->mpeg_ctrl_handler.port = CX2341X_PORT_SERIAL; in cx231xx_417_register()
1772 cx2341x_handler_set_50hz(&dev->mpeg_ctrl_handler, false); in cx231xx_417_register()
1775 cx231xx_video_dev_init(dev, dev->udev, in cx231xx_417_register()
1776 &dev->v4l_device, &cx231xx_mpeg_template, "mpeg"); in cx231xx_417_register()
1777 q = &dev->mpegq; in cx231xx_417_register()
1780 q->drv_priv = dev; in cx231xx_417_register()
1786 q->lock = &dev->lock; in cx231xx_417_register()
1790 dev->v4l_device.queue = q; in cx231xx_417_register()
1792 err = video_register_device(&dev->v4l_device, in cx231xx_417_register()
1795 dprintk(3, "%s: can't register mpeg device\n", dev->name); in cx231xx_417_register()
1796 v4l2_ctrl_handler_free(&dev->mpeg_ctrl_handler.hdl); in cx231xx_417_register()
1801 dev->name, dev->v4l_device.num); in cx231xx_417_register()