Ejemplo n.º 1
0
/* Precondition: the cx18 structure has been memset to 0. Only
   the dev and instance fields have been filled in.
   No assumptions on the card type may be made here (see cx18_init_struct2
   for that).
 */
static int __devinit cx18_init_struct1(struct cx18 *cx)
{
	int ret;

	cx->base_addr = pci_resource_start(cx->pci_dev, 0);

	mutex_init(&cx->serialize_lock);
	mutex_init(&cx->gpio_lock);
	mutex_init(&cx->epu2apu_mb_lock);
	mutex_init(&cx->epu2cpu_mb_lock);

	ret = cx18_create_out_workq(cx);
	if (ret)
		return ret;

	ret = cx18_create_in_workq(cx);
	if (ret) {
		destroy_workqueue(cx->out_work_queue);
		return ret;
	}

	cx18_init_in_work_orders(cx);

	/* start counting open_id at 1 */
	cx->open_id = 1;

	/* Initial settings */
	cx2341x_fill_defaults(&cx->params);
	cx->temporal_strength = cx->params.video_temporal_filter;
	cx->spatial_strength = cx->params.video_spatial_filter;
	cx->filter_mode = cx->params.video_spatial_filter_mode |
		(cx->params.video_temporal_filter_mode << 1) |
		(cx->params.video_median_filter_type << 2);
	cx->params.port = CX2341X_PORT_MEMORY;
	cx->params.capabilities =
				CX2341X_CAP_HAS_TS | CX2341X_CAP_HAS_SLICED_VBI;
	init_waitqueue_head(&cx->cap_w);
	init_waitqueue_head(&cx->mb_apu_waitq);
	init_waitqueue_head(&cx->mb_cpu_waitq);
	init_waitqueue_head(&cx->dma_waitq);

	/* VBI */
	cx->vbi.in.type = V4L2_BUF_TYPE_VBI_CAPTURE;
	cx->vbi.sliced_in = &cx->vbi.in.fmt.sliced;

	/* IVTV style VBI insertion into MPEG streams */
	INIT_LIST_HEAD(&cx->vbi.sliced_mpeg_buf.list);
	INIT_LIST_HEAD(&cx->vbi.sliced_mpeg_mdl.list);
	INIT_LIST_HEAD(&cx->vbi.sliced_mpeg_mdl.buf_list);
	list_add(&cx->vbi.sliced_mpeg_buf.list,
		 &cx->vbi.sliced_mpeg_mdl.buf_list);
	return 0;
}
Ejemplo n.º 2
0
static int __devinit cx18_init_struct1(struct cx18 *cx)
{
	int ret;

	cx->base_addr = pci_resource_start(cx->pci_dev, 0);

	mutex_init(&cx->serialize_lock);
	mutex_init(&cx->gpio_lock);
	mutex_init(&cx->epu2apu_mb_lock);
	mutex_init(&cx->epu2cpu_mb_lock);

	ret = cx18_create_out_workq(cx);
	if (ret)
		return ret;

	ret = cx18_create_in_workq(cx);
	if (ret) {
		destroy_workqueue(cx->out_work_queue);
		return ret;
	}

	cx18_init_in_work_orders(cx);

	
	cx->open_id = 1;

	
	cx2341x_fill_defaults(&cx->params);
	cx->temporal_strength = cx->params.video_temporal_filter;
	cx->spatial_strength = cx->params.video_spatial_filter;
	cx->filter_mode = cx->params.video_spatial_filter_mode |
		(cx->params.video_temporal_filter_mode << 1) |
		(cx->params.video_median_filter_type << 2);
	cx->params.port = CX2341X_PORT_MEMORY;
	cx->params.capabilities =
				CX2341X_CAP_HAS_TS | CX2341X_CAP_HAS_SLICED_VBI;
	init_waitqueue_head(&cx->cap_w);
	init_waitqueue_head(&cx->mb_apu_waitq);
	init_waitqueue_head(&cx->mb_cpu_waitq);
	init_waitqueue_head(&cx->dma_waitq);

	
	cx->vbi.in.type = V4L2_BUF_TYPE_VBI_CAPTURE;
	cx->vbi.sliced_in = &cx->vbi.in.fmt.sliced;

	return 0;
}
/* Precondition: the cx18 structure has been memset to 0. Only
   the dev and num fields have been filled in.
   No assumptions on the card type may be made here (see cx18_init_struct2
   for that).
 */
static int __devinit cx18_init_struct1(struct cx18 *cx)
{
	cx->base_addr = pci_resource_start(cx->dev, 0);

	mutex_init(&cx->serialize_lock);
	mutex_init(&cx->i2c_bus_lock[0]);
	mutex_init(&cx->i2c_bus_lock[1]);
	mutex_init(&cx->gpio_lock);

	spin_lock_init(&cx->lock);
	spin_lock_init(&cx->dma_reg_lock);

	/* start counting open_id at 1 */
	cx->open_id = 1;

	/* Initial settings */
	cx2341x_fill_defaults(&cx->params);
	cx->temporal_strength = cx->params.video_temporal_filter;
	cx->spatial_strength = cx->params.video_spatial_filter;
	cx->filter_mode = cx->params.video_spatial_filter_mode |
		(cx->params.video_temporal_filter_mode << 1) |
		(cx->params.video_median_filter_type << 2);
	cx->params.port = CX2341X_PORT_MEMORY;
	cx->params.capabilities = CX2341X_CAP_HAS_TS;
	init_waitqueue_head(&cx->cap_w);
	init_waitqueue_head(&cx->mb_apu_waitq);
	init_waitqueue_head(&cx->mb_cpu_waitq);
	init_waitqueue_head(&cx->mb_epu_waitq);
	init_waitqueue_head(&cx->mb_hpu_waitq);
	init_waitqueue_head(&cx->dma_waitq);

	/* VBI */
	cx->vbi.in.type = V4L2_BUF_TYPE_SLICED_VBI_CAPTURE;
	cx->vbi.sliced_in = &cx->vbi.in.fmt.sliced;
	cx->vbi.raw_size = 1456;
	cx->vbi.raw_decoder_line_size = 1456;
	cx->vbi.raw_decoder_sav_odd_field = 0x20;
	cx->vbi.raw_decoder_sav_even_field = 0x60;
	cx->vbi.sliced_decoder_line_size = 272;
	cx->vbi.sliced_decoder_sav_odd_field = 0xB0;
	cx->vbi.sliced_decoder_sav_even_field = 0xF0;
	return 0;
}