Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 336fea92 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

[media] cx231xx: Improve the log message



Unfortunately, on devices that have multiple interfaces, udev->dev
points to the parent device (usb) instead of the cx231xx specific one.

Due to that the logs don't look too nice, as they'll print messages
as if they were produced by USB core:
  usb-1-2: New device Conexant Corporation Polaris AV Capturb @ 480 Mbps (1554:5010) with 7 interfaces

Instead of using the name of the parent device, let's use the name
of the first cx231xx interface for all cx231xx sub-modules.

With this path, the logs will be nicer:

  cx231xx 1-2:1.1: New device Conexant Corporation Polaris AV Capturb @ 480 Mbps (1554:5010) with 7 interfaces

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent ac550faa
Loading
Loading
Loading
Loading
+14 −14
Original line number Original line Diff line number Diff line
@@ -987,25 +987,25 @@ static int cx231xx_load_firmware(struct cx231xx *dev)
		IVTV_REG_APU, 0);
		IVTV_REG_APU, 0);


	if (retval != 0) {
	if (retval != 0) {
		dev_err(&dev->udev->dev,
		dev_err(dev->dev,
			"%s: Error with mc417_register_write\n", __func__);
			"%s: Error with mc417_register_write\n", __func__);
		return -1;
		return -1;
	}
	}


	retval = request_firmware(&firmware, CX231xx_FIRM_IMAGE_NAME,
	retval = request_firmware(&firmware, CX231xx_FIRM_IMAGE_NAME,
				  &dev->udev->dev);
				  dev->dev);


	if (retval != 0) {
	if (retval != 0) {
		dev_err(&dev->udev->dev,
		dev_err(dev->dev,
			"ERROR: Hotplug firmware request failed (%s).\n",
			"ERROR: Hotplug firmware request failed (%s).\n",
			CX231xx_FIRM_IMAGE_NAME);
			CX231xx_FIRM_IMAGE_NAME);
		dev_err(&dev->udev->dev,
		dev_err(dev->dev,
			"Please fix your hotplug setup, the board will not work without firmware loaded!\n");
			"Please fix your hotplug setup, the board will not work without firmware loaded!\n");
		return -1;
		return -1;
	}
	}


	if (firmware->size != CX231xx_FIRM_IMAGE_SIZE) {
	if (firmware->size != CX231xx_FIRM_IMAGE_SIZE) {
		dev_err(&dev->udev->dev,
		dev_err(dev->dev,
			"ERROR: Firmware size mismatch (have %zd, expected %d)\n",
			"ERROR: Firmware size mismatch (have %zd, expected %d)\n",
			firmware->size, CX231xx_FIRM_IMAGE_SIZE);
			firmware->size, CX231xx_FIRM_IMAGE_SIZE);
		release_firmware(firmware);
		release_firmware(firmware);
@@ -1013,7 +1013,7 @@ static int cx231xx_load_firmware(struct cx231xx *dev)
	}
	}


	if (0 != memcmp(firmware->data, magic, 8)) {
	if (0 != memcmp(firmware->data, magic, 8)) {
		dev_err(&dev->udev->dev,
		dev_err(dev->dev,
			"ERROR: Firmware magic mismatch, wrong file?\n");
			"ERROR: Firmware magic mismatch, wrong file?\n");
		release_firmware(firmware);
		release_firmware(firmware);
		return -1;
		return -1;
@@ -1061,7 +1061,7 @@ static int cx231xx_load_firmware(struct cx231xx *dev)
	retval |= mc417_register_write(dev, IVTV_REG_HW_BLOCKS,
	retval |= mc417_register_write(dev, IVTV_REG_HW_BLOCKS,
		IVTV_CMD_HW_BLOCKS_RST);
		IVTV_CMD_HW_BLOCKS_RST);
	if (retval < 0) {
	if (retval < 0) {
		dev_err(&dev->udev->dev,
		dev_err(dev->dev,
			"%s: Error with mc417_register_write\n",
			"%s: Error with mc417_register_write\n",
			__func__);
			__func__);
		return retval;
		return retval;
@@ -1074,7 +1074,7 @@ static int cx231xx_load_firmware(struct cx231xx *dev)
	retval |= mc417_register_write(dev, IVTV_REG_VPU, value & 0xFFFFFFE8);
	retval |= mc417_register_write(dev, IVTV_REG_VPU, value & 0xFFFFFFE8);


	if (retval < 0) {
	if (retval < 0) {
		dev_err(&dev->udev->dev,
		dev_err(dev->dev,
			"%s: Error with mc417_register_write\n",
			"%s: Error with mc417_register_write\n",
			__func__);
			__func__);
		return retval;
		return retval;
@@ -1123,27 +1123,27 @@ static int cx231xx_initialize_codec(struct cx231xx *dev)
		dprintk(2, "%s: PING OK\n", __func__);
		dprintk(2, "%s: PING OK\n", __func__);
		retval = cx231xx_load_firmware(dev);
		retval = cx231xx_load_firmware(dev);
		if (retval < 0) {
		if (retval < 0) {
			dev_err(&dev->udev->dev,
			dev_err(dev->dev,
				"%s: f/w load failed\n", __func__);
				"%s: f/w load failed\n", __func__);
			return retval;
			return retval;
		}
		}
		retval = cx231xx_find_mailbox(dev);
		retval = cx231xx_find_mailbox(dev);
		if (retval < 0) {
		if (retval < 0) {
			dev_err(&dev->udev->dev, "%s: mailbox < 0, error\n",
			dev_err(dev->dev, "%s: mailbox < 0, error\n",
				__func__);
				__func__);
			return -1;
			return -1;
		}
		}
		dev->cx23417_mailbox = retval;
		dev->cx23417_mailbox = retval;
		retval = cx231xx_api_cmd(dev, CX2341X_ENC_PING_FW, 0, 0);
		retval = cx231xx_api_cmd(dev, CX2341X_ENC_PING_FW, 0, 0);
		if (retval < 0) {
		if (retval < 0) {
			dev_err(&dev->udev->dev,
			dev_err(dev->dev,
				"ERROR: cx23417 firmware ping failed!\n");
				"ERROR: cx23417 firmware ping failed!\n");
			return -1;
			return -1;
		}
		}
		retval = cx231xx_api_cmd(dev, CX2341X_ENC_GET_VERSION, 0, 1,
		retval = cx231xx_api_cmd(dev, CX2341X_ENC_GET_VERSION, 0, 1,
			&version);
			&version);
		if (retval < 0) {
		if (retval < 0) {
			dev_err(&dev->udev->dev,
			dev_err(dev->dev,
				"ERROR: cx23417 firmware get encoder: version failed!\n");
				"ERROR: cx23417 firmware get encoder: version failed!\n");
			return -1;
			return -1;
		}
		}
@@ -1425,7 +1425,7 @@ static int bb_buf_prepare(struct videobuf_queue *q,
		if (!dev->video_mode.bulk_ctl.num_bufs)
		if (!dev->video_mode.bulk_ctl.num_bufs)
			urb_init = 1;
			urb_init = 1;
	}
	}
	dev_dbg(&dev->udev->dev,
	dev_dbg(dev->dev,
		"urb_init=%d dev->video_mode.max_pkt_size=%d\n",
		"urb_init=%d dev->video_mode.max_pkt_size=%d\n",
		urb_init, dev->video_mode.max_pkt_size);
		urb_init, dev->video_mode.max_pkt_size);
	dev->mode_tv = 1;
	dev->mode_tv = 1;
@@ -1698,7 +1698,7 @@ static int mpeg_open(struct file *file)
			    sizeof(struct cx231xx_buffer), fh, &dev->lock);
			    sizeof(struct cx231xx_buffer), fh, &dev->lock);
/*
/*
	videobuf_queue_sg_init(&fh->vidq, &cx231xx_qops,
	videobuf_queue_sg_init(&fh->vidq, &cx231xx_qops,
			    &dev->udev->dev, &dev->ts1.slock,
			    dev->dev, &dev->ts1.slock,
			    V4L2_BUF_TYPE_VIDEO_CAPTURE,
			    V4L2_BUF_TYPE_VIDEO_CAPTURE,
			    V4L2_FIELD_INTERLACED,
			    V4L2_FIELD_INTERLACED,
			    sizeof(struct cx231xx_buffer),
			    sizeof(struct cx231xx_buffer),
+28 −28
Original line number Original line Diff line number Diff line
@@ -48,7 +48,7 @@ static int cx231xx_isoc_audio_deinit(struct cx231xx *dev)
{
{
	int i;
	int i;


	dev_dbg(&dev->udev->dev, "Stopping isoc\n");
	dev_dbg(dev->dev, "Stopping isoc\n");


	for (i = 0; i < CX231XX_AUDIO_BUFS; i++) {
	for (i = 0; i < CX231XX_AUDIO_BUFS; i++) {
		if (dev->adev.urb[i]) {
		if (dev->adev.urb[i]) {
@@ -72,7 +72,7 @@ static int cx231xx_bulk_audio_deinit(struct cx231xx *dev)
{
{
	int i;
	int i;


	dev_dbg(&dev->udev->dev, "Stopping bulk\n");
	dev_dbg(dev->dev, "Stopping bulk\n");


	for (i = 0; i < CX231XX_AUDIO_BUFS; i++) {
	for (i = 0; i < CX231XX_AUDIO_BUFS; i++) {
		if (dev->adev.urb[i]) {
		if (dev->adev.urb[i]) {
@@ -116,7 +116,7 @@ static void cx231xx_audio_isocirq(struct urb *urb)
	case -ESHUTDOWN:
	case -ESHUTDOWN:
		return;
		return;
	default:		/* error */
	default:		/* error */
		dev_dbg(&dev->udev->dev, "urb completition error %d.\n",
		dev_dbg(dev->dev, "urb completition error %d.\n",
			urb->status);
			urb->status);
		break;
		break;
	}
	}
@@ -176,7 +176,7 @@ static void cx231xx_audio_isocirq(struct urb *urb)


	status = usb_submit_urb(urb, GFP_ATOMIC);
	status = usb_submit_urb(urb, GFP_ATOMIC);
	if (status < 0) {
	if (status < 0) {
		dev_err(&dev->udev->dev,
		dev_err(dev->dev,
			"resubmit of audio urb failed (error=%i)\n",
			"resubmit of audio urb failed (error=%i)\n",
			status);
			status);
	}
	}
@@ -206,7 +206,7 @@ static void cx231xx_audio_bulkirq(struct urb *urb)
	case -ESHUTDOWN:
	case -ESHUTDOWN:
		return;
		return;
	default:		/* error */
	default:		/* error */
		dev_dbg(&dev->udev->dev, "urb completition error %d.\n",
		dev_dbg(dev->dev, "urb completition error %d.\n",
			urb->status);
			urb->status);
		break;
		break;
	}
	}
@@ -262,7 +262,7 @@ static void cx231xx_audio_bulkirq(struct urb *urb)


	status = usb_submit_urb(urb, GFP_ATOMIC);
	status = usb_submit_urb(urb, GFP_ATOMIC);
	if (status < 0) {
	if (status < 0) {
		dev_err(&dev->udev->dev,
		dev_err(dev->dev,
			"resubmit of audio urb failed (error=%i)\n",
			"resubmit of audio urb failed (error=%i)\n",
			status);
			status);
	}
	}
@@ -274,7 +274,7 @@ static int cx231xx_init_audio_isoc(struct cx231xx *dev)
	int i, errCode;
	int i, errCode;
	int sb_size;
	int sb_size;


	dev_dbg(&dev->udev->dev,
	dev_dbg(dev->dev,
		"%s: Starting ISO AUDIO transfers\n", __func__);
		"%s: Starting ISO AUDIO transfers\n", __func__);


	if (dev->state & DEV_DISCONNECTED)
	if (dev->state & DEV_DISCONNECTED)
@@ -293,7 +293,7 @@ static int cx231xx_init_audio_isoc(struct cx231xx *dev)
		memset(dev->adev.transfer_buffer[i], 0x80, sb_size);
		memset(dev->adev.transfer_buffer[i], 0x80, sb_size);
		urb = usb_alloc_urb(CX231XX_ISO_NUM_AUDIO_PACKETS, GFP_ATOMIC);
		urb = usb_alloc_urb(CX231XX_ISO_NUM_AUDIO_PACKETS, GFP_ATOMIC);
		if (!urb) {
		if (!urb) {
			dev_err(&dev->udev->dev, "usb_alloc_urb failed!\n");
			dev_err(dev->dev, "usb_alloc_urb failed!\n");
			for (j = 0; j < i; j++) {
			for (j = 0; j < i; j++) {
				usb_free_urb(dev->adev.urb[j]);
				usb_free_urb(dev->adev.urb[j]);
				kfree(dev->adev.transfer_buffer[j]);
				kfree(dev->adev.transfer_buffer[j]);
@@ -336,7 +336,7 @@ static int cx231xx_init_audio_bulk(struct cx231xx *dev)
	int i, errCode;
	int i, errCode;
	int sb_size;
	int sb_size;


	dev_dbg(&dev->udev->dev,
	dev_dbg(dev->dev,
		"%s: Starting BULK AUDIO transfers\n", __func__);
		"%s: Starting BULK AUDIO transfers\n", __func__);


	if (dev->state & DEV_DISCONNECTED)
	if (dev->state & DEV_DISCONNECTED)
@@ -355,7 +355,7 @@ static int cx231xx_init_audio_bulk(struct cx231xx *dev)
		memset(dev->adev.transfer_buffer[i], 0x80, sb_size);
		memset(dev->adev.transfer_buffer[i], 0x80, sb_size);
		urb = usb_alloc_urb(CX231XX_NUM_AUDIO_PACKETS, GFP_ATOMIC);
		urb = usb_alloc_urb(CX231XX_NUM_AUDIO_PACKETS, GFP_ATOMIC);
		if (!urb) {
		if (!urb) {
			dev_err(&dev->udev->dev, "usb_alloc_urb failed!\n");
			dev_err(dev->dev, "usb_alloc_urb failed!\n");
			for (j = 0; j < i; j++) {
			for (j = 0; j < i; j++) {
				usb_free_urb(dev->adev.urb[j]);
				usb_free_urb(dev->adev.urb[j]);
				kfree(dev->adev.transfer_buffer[j]);
				kfree(dev->adev.transfer_buffer[j]);
@@ -393,7 +393,7 @@ static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs,
	struct snd_pcm_runtime *runtime = subs->runtime;
	struct snd_pcm_runtime *runtime = subs->runtime;
	struct cx231xx *dev = snd_pcm_substream_chip(subs);
	struct cx231xx *dev = snd_pcm_substream_chip(subs);


	dev_dbg(&dev->udev->dev, "Allocating vbuffer\n");
	dev_dbg(dev->dev, "Allocating vbuffer\n");
	if (runtime->dma_area) {
	if (runtime->dma_area) {
		if (runtime->dma_bytes > size)
		if (runtime->dma_bytes > size)
			return 0;
			return 0;
@@ -436,17 +436,17 @@ static int snd_cx231xx_capture_open(struct snd_pcm_substream *substream)
	struct snd_pcm_runtime *runtime = substream->runtime;
	struct snd_pcm_runtime *runtime = substream->runtime;
	int ret = 0;
	int ret = 0;


	dev_dbg(&dev->udev->dev,
	dev_dbg(dev->dev,
		"opening device and trying to acquire exclusive lock\n");
		"opening device and trying to acquire exclusive lock\n");


	if (!dev) {
	if (!dev) {
		dev_err(&dev->udev->dev,
		dev_err(dev->dev,
			"BUG: cx231xx can't find device struct. Can't proceed with open\n");
			"BUG: cx231xx can't find device struct. Can't proceed with open\n");
		return -ENODEV;
		return -ENODEV;
	}
	}


	if (dev->state & DEV_DISCONNECTED) {
	if (dev->state & DEV_DISCONNECTED) {
		dev_err(&dev->udev->dev,
		dev_err(dev->dev,
			"Can't open. the device was removed.\n");
			"Can't open. the device was removed.\n");
		return -ENODEV;
		return -ENODEV;
	}
	}
@@ -460,7 +460,7 @@ static int snd_cx231xx_capture_open(struct snd_pcm_substream *substream)
		ret = cx231xx_set_alt_setting(dev, INDEX_AUDIO, 0);
		ret = cx231xx_set_alt_setting(dev, INDEX_AUDIO, 0);
	mutex_unlock(&dev->lock);
	mutex_unlock(&dev->lock);
	if (ret < 0) {
	if (ret < 0) {
		dev_err(&dev->udev->dev,
		dev_err(dev->dev,
			"failed to set alternate setting !\n");
			"failed to set alternate setting !\n");


		return ret;
		return ret;
@@ -487,7 +487,7 @@ static int snd_cx231xx_pcm_close(struct snd_pcm_substream *substream)
	int ret;
	int ret;
	struct cx231xx *dev = snd_pcm_substream_chip(substream);
	struct cx231xx *dev = snd_pcm_substream_chip(substream);


	dev_dbg(&dev->udev->dev, "closing device\n");
	dev_dbg(dev->dev, "closing device\n");


	/* inform hardware to stop streaming */
	/* inform hardware to stop streaming */
	mutex_lock(&dev->lock);
	mutex_lock(&dev->lock);
@@ -497,7 +497,7 @@ static int snd_cx231xx_pcm_close(struct snd_pcm_substream *substream)
	/* 1 - 48000 samples per sec */
	/* 1 - 48000 samples per sec */
	ret = cx231xx_set_alt_setting(dev, INDEX_AUDIO, 0);
	ret = cx231xx_set_alt_setting(dev, INDEX_AUDIO, 0);
	if (ret < 0) {
	if (ret < 0) {
		dev_err(&dev->udev->dev,
		dev_err(dev->dev,
			"failed to set alternate setting !\n");
			"failed to set alternate setting !\n");


		mutex_unlock(&dev->lock);
		mutex_unlock(&dev->lock);
@@ -508,10 +508,10 @@ static int snd_cx231xx_pcm_close(struct snd_pcm_substream *substream)
	mutex_unlock(&dev->lock);
	mutex_unlock(&dev->lock);


	if (dev->adev.users == 0 && dev->adev.shutdown == 1) {
	if (dev->adev.users == 0 && dev->adev.shutdown == 1) {
		dev_dbg(&dev->udev->dev, "audio users: %d\n", dev->adev.users);
		dev_dbg(dev->dev, "audio users: %d\n", dev->adev.users);
		dev_dbg(&dev->udev->dev, "disabling audio stream!\n");
		dev_dbg(dev->dev, "disabling audio stream!\n");
		dev->adev.shutdown = 0;
		dev->adev.shutdown = 0;
		dev_dbg(&dev->udev->dev, "released lock\n");
		dev_dbg(dev->dev, "released lock\n");
		if (atomic_read(&dev->stream_started) > 0) {
		if (atomic_read(&dev->stream_started) > 0) {
			atomic_set(&dev->stream_started, 0);
			atomic_set(&dev->stream_started, 0);
			schedule_work(&dev->wq_trigger);
			schedule_work(&dev->wq_trigger);
@@ -526,7 +526,7 @@ static int snd_cx231xx_hw_capture_params(struct snd_pcm_substream *substream,
	struct cx231xx *dev = snd_pcm_substream_chip(substream);
	struct cx231xx *dev = snd_pcm_substream_chip(substream);
	int ret;
	int ret;


	dev_dbg(&dev->udev->dev, "Setting capture parameters\n");
	dev_dbg(dev->dev, "Setting capture parameters\n");


	ret = snd_pcm_alloc_vmalloc_buffer(substream,
	ret = snd_pcm_alloc_vmalloc_buffer(substream,
					   params_buffer_bytes(hw_params));
					   params_buffer_bytes(hw_params));
@@ -548,7 +548,7 @@ static int snd_cx231xx_hw_capture_free(struct snd_pcm_substream *substream)
{
{
	struct cx231xx *dev = snd_pcm_substream_chip(substream);
	struct cx231xx *dev = snd_pcm_substream_chip(substream);


	dev_dbg(&dev->udev->dev, "Stop capture, if needed\n");
	dev_dbg(dev->dev, "Stop capture, if needed\n");


	if (atomic_read(&dev->stream_started) > 0) {
	if (atomic_read(&dev->stream_started) > 0) {
		atomic_set(&dev->stream_started, 0);
		atomic_set(&dev->stream_started, 0);
@@ -573,7 +573,7 @@ static void audio_trigger(struct work_struct *work)
	struct cx231xx *dev = container_of(work, struct cx231xx, wq_trigger);
	struct cx231xx *dev = container_of(work, struct cx231xx, wq_trigger);


	if (atomic_read(&dev->stream_started)) {
	if (atomic_read(&dev->stream_started)) {
		dev_dbg(&dev->udev->dev, "starting capture");
		dev_dbg(dev->dev, "starting capture");
		if (is_fw_load(dev) == 0)
		if (is_fw_load(dev) == 0)
			cx25840_call(dev, core, load_fw);
			cx25840_call(dev, core, load_fw);
		if (dev->USE_ISO)
		if (dev->USE_ISO)
@@ -581,7 +581,7 @@ static void audio_trigger(struct work_struct *work)
		else
		else
			cx231xx_init_audio_bulk(dev);
			cx231xx_init_audio_bulk(dev);
	} else {
	} else {
		dev_dbg(&dev->udev->dev, "stopping capture");
		dev_dbg(dev->dev, "stopping capture");
		cx231xx_isoc_audio_deinit(dev);
		cx231xx_isoc_audio_deinit(dev);
	}
	}
}
}
@@ -667,10 +667,10 @@ static int cx231xx_audio_init(struct cx231xx *dev)
		return 0;
		return 0;
	}
	}


	dev_dbg(&dev->udev->dev,
	dev_dbg(dev->dev,
		"probing for cx231xx non standard usbaudio\n");
		"probing for cx231xx non standard usbaudio\n");


	err = snd_card_new(&dev->udev->dev, index[devnr], "Cx231xx Audio",
	err = snd_card_new(dev->dev, index[devnr], "Cx231xx Audio",
			   THIS_MODULE, 0, &card);
			   THIS_MODULE, 0, &card);
	if (err < 0)
	if (err < 0)
		return err;
		return err;
@@ -712,7 +712,7 @@ static int cx231xx_audio_init(struct cx231xx *dev)
			bEndpointAddress;
			bEndpointAddress;


	adev->num_alt = uif->num_altsetting;
	adev->num_alt = uif->num_altsetting;
	dev_info(&dev->udev->dev,
	dev_info(dev->dev,
		"audio EndPoint Addr 0x%x, Alternate settings: %i\n",
		"audio EndPoint Addr 0x%x, Alternate settings: %i\n",
		adev->end_point_addr, adev->num_alt);
		adev->end_point_addr, adev->num_alt);
	adev->alt_max_pkt_size = kmalloc(32 * adev->num_alt, GFP_KERNEL);
	adev->alt_max_pkt_size = kmalloc(32 * adev->num_alt, GFP_KERNEL);
@@ -726,7 +726,7 @@ static int cx231xx_audio_init(struct cx231xx *dev)
				wMaxPacketSize);
				wMaxPacketSize);
		adev->alt_max_pkt_size[i] =
		adev->alt_max_pkt_size[i] =
		    (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
		    (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
		dev_dbg(&dev->udev->dev,
		dev_dbg(dev->dev,
			"audio alternate setting %i, max size= %i\n", i,
			"audio alternate setting %i, max size= %i\n", i,
			adev->alt_max_pkt_size[i]);
			adev->alt_max_pkt_size[i]);
	}
	}
+63 −63
Original line number Original line Diff line number Diff line
@@ -82,10 +82,10 @@ void initGPIO(struct cx231xx *dev)
	cx231xx_send_gpio_cmd(dev, _gpio_direction, (u8 *)&value, 4, 0, 0);
	cx231xx_send_gpio_cmd(dev, _gpio_direction, (u8 *)&value, 4, 0, 0);


	verve_read_byte(dev, 0x07, &val);
	verve_read_byte(dev, 0x07, &val);
	dev_dbg(&dev->udev->dev, "verve_read_byte address0x07=0x%x\n", val);
	dev_dbg(dev->dev, "verve_read_byte address0x07=0x%x\n", val);
	verve_write_byte(dev, 0x07, 0xF4);
	verve_write_byte(dev, 0x07, 0xF4);
	verve_read_byte(dev, 0x07, &val);
	verve_read_byte(dev, 0x07, &val);
	dev_dbg(&dev->udev->dev, "verve_read_byte address0x07=0x%x\n", val);
	dev_dbg(dev->dev, "verve_read_byte address0x07=0x%x\n", val);


	cx231xx_capture_start(dev, 1, Vbi);
	cx231xx_capture_start(dev, 1, Vbi);


@@ -155,7 +155,7 @@ int cx231xx_afe_init_super_block(struct cx231xx *dev, u32 ref_count)
	while (afe_power_status != 0x18) {
	while (afe_power_status != 0x18) {
		status = afe_write_byte(dev, SUP_BLK_PWRDN, 0x18);
		status = afe_write_byte(dev, SUP_BLK_PWRDN, 0x18);
		if (status < 0) {
		if (status < 0) {
			dev_dbg(&dev->udev->dev,
			dev_dbg(dev->dev,
				"%s: Init Super Block failed in send cmd\n",
				"%s: Init Super Block failed in send cmd\n",
				__func__);
				__func__);
			break;
			break;
@@ -164,14 +164,14 @@ int cx231xx_afe_init_super_block(struct cx231xx *dev, u32 ref_count)
		status = afe_read_byte(dev, SUP_BLK_PWRDN, &afe_power_status);
		status = afe_read_byte(dev, SUP_BLK_PWRDN, &afe_power_status);
		afe_power_status &= 0xff;
		afe_power_status &= 0xff;
		if (status < 0) {
		if (status < 0) {
			dev_dbg(&dev->udev->dev,
			dev_dbg(dev->dev,
				"%s: Init Super Block failed in receive cmd\n",
				"%s: Init Super Block failed in receive cmd\n",
				__func__);
				__func__);
			break;
			break;
		}
		}
		i++;
		i++;
		if (i == 10) {
		if (i == 10) {
			dev_dbg(&dev->udev->dev,
			dev_dbg(dev->dev,
				"%s: Init Super Block force break in loop !!!!\n",
				"%s: Init Super Block force break in loop !!!!\n",
				__func__);
				__func__);
			status = -1;
			status = -1;
@@ -412,7 +412,7 @@ int cx231xx_afe_update_power_control(struct cx231xx *dev,
			status |= afe_write_byte(dev, ADC_PWRDN_CLAMP_CH3,
			status |= afe_write_byte(dev, ADC_PWRDN_CLAMP_CH3,
						0x00);
						0x00);
		} else {
		} else {
			dev_dbg(&dev->udev->dev, "Invalid AV mode input\n");
			dev_dbg(dev->dev, "Invalid AV mode input\n");
			status = -1;
			status = -1;
		}
		}
		break;
		break;
@@ -469,7 +469,7 @@ int cx231xx_afe_update_power_control(struct cx231xx *dev,
			status |= afe_write_byte(dev, ADC_PWRDN_CLAMP_CH3,
			status |= afe_write_byte(dev, ADC_PWRDN_CLAMP_CH3,
							0x40);
							0x40);
		} else {
		} else {
			dev_dbg(&dev->udev->dev, "Invalid AV mode input\n");
			dev_dbg(dev->dev, "Invalid AV mode input\n");
			status = -1;
			status = -1;
		}
		}
	}			/* switch  */
	}			/* switch  */
@@ -575,7 +575,7 @@ int cx231xx_set_video_input_mux(struct cx231xx *dev, u8 input)
			status = cx231xx_set_power_mode(dev,
			status = cx231xx_set_power_mode(dev,
					POLARIS_AVMODE_ENXTERNAL_AV);
					POLARIS_AVMODE_ENXTERNAL_AV);
			if (status < 0) {
			if (status < 0) {
				dev_err(&dev->udev->dev,
				dev_err(dev->dev,
					"%s: Failed to set Power - errCode [%d]!\n",
					"%s: Failed to set Power - errCode [%d]!\n",
					__func__, status);
					__func__, status);
				return status;
				return status;
@@ -593,7 +593,7 @@ int cx231xx_set_video_input_mux(struct cx231xx *dev, u8 input)
			status = cx231xx_set_power_mode(dev,
			status = cx231xx_set_power_mode(dev,
						POLARIS_AVMODE_ANALOGT_TV);
						POLARIS_AVMODE_ANALOGT_TV);
			if (status < 0) {
			if (status < 0) {
				dev_err(&dev->udev->dev,
				dev_err(dev->dev,
					"%s: Failed to set Power - errCode [%d]!\n",
					"%s: Failed to set Power - errCode [%d]!\n",
					__func__, status);
					__func__, status);
				return status;
				return status;
@@ -610,7 +610,7 @@ int cx231xx_set_video_input_mux(struct cx231xx *dev, u8 input)


		break;
		break;
	default:
	default:
		dev_err(&dev->udev->dev, "%s: Unknown Input %d !\n",
		dev_err(dev->dev, "%s: Unknown Input %d !\n",
			__func__, INPUT(input)->type);
			__func__, INPUT(input)->type);
		break;
		break;
	}
	}
@@ -630,7 +630,7 @@ int cx231xx_set_decoder_video_input(struct cx231xx *dev,
	if (pin_type != dev->video_input) {
	if (pin_type != dev->video_input) {
		status = cx231xx_afe_adjust_ref_count(dev, pin_type);
		status = cx231xx_afe_adjust_ref_count(dev, pin_type);
		if (status < 0) {
		if (status < 0) {
			dev_err(&dev->udev->dev,
			dev_err(dev->dev,
				"%s: adjust_ref_count :Failed to set AFE input mux - errCode [%d]!\n",
				"%s: adjust_ref_count :Failed to set AFE input mux - errCode [%d]!\n",
				__func__, status);
				__func__, status);
			return status;
			return status;
@@ -640,7 +640,7 @@ int cx231xx_set_decoder_video_input(struct cx231xx *dev,
	/* call afe block to set video inputs */
	/* call afe block to set video inputs */
	status = cx231xx_afe_set_input_mux(dev, input);
	status = cx231xx_afe_set_input_mux(dev, input);
	if (status < 0) {
	if (status < 0) {
		dev_err(&dev->udev->dev,
		dev_err(dev->dev,
			"%s: set_input_mux :Failed to set AFE input mux - errCode [%d]!\n",
			"%s: set_input_mux :Failed to set AFE input mux - errCode [%d]!\n",
			__func__, status);
			__func__, status);
		return status;
		return status;
@@ -672,7 +672,7 @@ int cx231xx_set_decoder_video_input(struct cx231xx *dev,
		/* Tell DIF object to go to baseband mode  */
		/* Tell DIF object to go to baseband mode  */
		status = cx231xx_dif_set_standard(dev, DIF_USE_BASEBAND);
		status = cx231xx_dif_set_standard(dev, DIF_USE_BASEBAND);
		if (status < 0) {
		if (status < 0) {
			dev_err(&dev->udev->dev,
			dev_err(dev->dev,
				"%s: cx231xx_dif set to By pass mode- errCode [%d]!\n",
				"%s: cx231xx_dif set to By pass mode- errCode [%d]!\n",
				__func__, status);
				__func__, status);
			return status;
			return status;
@@ -717,7 +717,7 @@ int cx231xx_set_decoder_video_input(struct cx231xx *dev,
		/* Tell DIF object to go to baseband mode */
		/* Tell DIF object to go to baseband mode */
		status = cx231xx_dif_set_standard(dev, DIF_USE_BASEBAND);
		status = cx231xx_dif_set_standard(dev, DIF_USE_BASEBAND);
		if (status < 0) {
		if (status < 0) {
			dev_err(&dev->udev->dev,
			dev_err(dev->dev,
				"%s: cx231xx_dif set to By pass mode- errCode [%d]!\n",
				"%s: cx231xx_dif set to By pass mode- errCode [%d]!\n",
				__func__, status);
				__func__, status);
			return status;
			return status;
@@ -792,7 +792,7 @@ int cx231xx_set_decoder_video_input(struct cx231xx *dev,
			status = cx231xx_dif_set_standard(dev,
			status = cx231xx_dif_set_standard(dev,
							  DIF_USE_BASEBAND);
							  DIF_USE_BASEBAND);
			if (status < 0) {
			if (status < 0) {
				dev_err(&dev->udev->dev,
				dev_err(dev->dev,
					"%s: cx231xx_dif set to By pass mode- errCode [%d]!\n",
					"%s: cx231xx_dif set to By pass mode- errCode [%d]!\n",
				       __func__, status);
				       __func__, status);
				return status;
				return status;
@@ -828,7 +828,7 @@ int cx231xx_set_decoder_video_input(struct cx231xx *dev,
			/* Reinitialize the DIF */
			/* Reinitialize the DIF */
			status = cx231xx_dif_set_standard(dev, dev->norm);
			status = cx231xx_dif_set_standard(dev, dev->norm);
			if (status < 0) {
			if (status < 0) {
				dev_err(&dev->udev->dev,
				dev_err(dev->dev,
					"%s: cx231xx_dif set to By pass mode- errCode [%d]!\n",
					"%s: cx231xx_dif set to By pass mode- errCode [%d]!\n",
					__func__, status);
					__func__, status);
				return status;
				return status;
@@ -972,14 +972,14 @@ int cx231xx_do_mode_ctrl_overrides(struct cx231xx *dev)
{
{
	int status = 0;
	int status = 0;


	dev_dbg(&dev->udev->dev, "%s: 0x%x\n",
	dev_dbg(dev->dev, "%s: 0x%x\n",
		__func__, (unsigned int)dev->norm);
		__func__, (unsigned int)dev->norm);


	/* Change the DFE_CTRL3 bp_percent to fix flagging */
	/* Change the DFE_CTRL3 bp_percent to fix flagging */
	status = vid_blk_write_word(dev, DFE_CTRL3, 0xCD3F0280);
	status = vid_blk_write_word(dev, DFE_CTRL3, 0xCD3F0280);


	if (dev->norm & (V4L2_STD_NTSC | V4L2_STD_PAL_M)) {
	if (dev->norm & (V4L2_STD_NTSC | V4L2_STD_PAL_M)) {
		dev_dbg(&dev->udev->dev, "%s: NTSC\n", __func__);
		dev_dbg(dev->dev, "%s: NTSC\n", __func__);


		/* Move the close caption lines out of active video,
		/* Move the close caption lines out of active video,
		   adjust the active video start point */
		   adjust the active video start point */
@@ -1006,7 +1006,7 @@ int cx231xx_do_mode_ctrl_overrides(struct cx231xx *dev)
							(FLD_HBLANK_CNT, 0x79));
							(FLD_HBLANK_CNT, 0x79));


	} else if (dev->norm & V4L2_STD_SECAM) {
	} else if (dev->norm & V4L2_STD_SECAM) {
		dev_dbg(&dev->udev->dev, "%s: SECAM\n", __func__);
		dev_dbg(dev->dev, "%s: SECAM\n", __func__);
		status =  cx231xx_read_modify_write_i2c_dword(dev,
		status =  cx231xx_read_modify_write_i2c_dword(dev,
							VID_BLK_I2C_ADDRESS,
							VID_BLK_I2C_ADDRESS,
							VERT_TIM_CTRL,
							VERT_TIM_CTRL,
@@ -1033,7 +1033,7 @@ int cx231xx_do_mode_ctrl_overrides(struct cx231xx *dev)
							cx231xx_set_field
							cx231xx_set_field
							(FLD_HBLANK_CNT, 0x85));
							(FLD_HBLANK_CNT, 0x85));
	} else {
	} else {
		dev_dbg(&dev->udev->dev, "%s: PAL\n", __func__);
		dev_dbg(dev->dev, "%s: PAL\n", __func__);
		status = cx231xx_read_modify_write_i2c_dword(dev,
		status = cx231xx_read_modify_write_i2c_dword(dev,
							VID_BLK_I2C_ADDRESS,
							VID_BLK_I2C_ADDRESS,
							VERT_TIM_CTRL,
							VERT_TIM_CTRL,
@@ -1208,7 +1208,7 @@ int cx231xx_set_audio_decoder_input(struct cx231xx *dev,
			/* This is just a casual suggestion to people adding
			/* This is just a casual suggestion to people adding
			   new boards in case they use a tuner type we don't
			   new boards in case they use a tuner type we don't
			   currently know about */
			   currently know about */
			dev_info(&dev->udev->dev,
			dev_info(dev->dev,
				 "Unknown tuner type configuring SIF");
				 "Unknown tuner type configuring SIF");
			break;
			break;
		}
		}
@@ -1334,127 +1334,127 @@ void cx231xx_dump_HH_reg(struct cx231xx *dev)


	for (i = 0x100; i < 0x140; i++) {
	for (i = 0x100; i < 0x140; i++) {
		vid_blk_read_word(dev, i, &value);
		vid_blk_read_word(dev, i, &value);
		dev_dbg(&dev->udev->dev, "reg0x%x=0x%x\n", i, value);
		dev_dbg(dev->dev, "reg0x%x=0x%x\n", i, value);
		i = i+3;
		i = i+3;
	}
	}


	for (i = 0x300; i < 0x400; i++) {
	for (i = 0x300; i < 0x400; i++) {
		vid_blk_read_word(dev, i, &value);
		vid_blk_read_word(dev, i, &value);
		dev_dbg(&dev->udev->dev, "reg0x%x=0x%x\n", i, value);
		dev_dbg(dev->dev, "reg0x%x=0x%x\n", i, value);
		i = i+3;
		i = i+3;
	}
	}


	for (i = 0x400; i < 0x440; i++) {
	for (i = 0x400; i < 0x440; i++) {
		vid_blk_read_word(dev, i,  &value);
		vid_blk_read_word(dev, i,  &value);
		dev_dbg(&dev->udev->dev, "reg0x%x=0x%x\n", i, value);
		dev_dbg(dev->dev, "reg0x%x=0x%x\n", i, value);
		i = i+3;
		i = i+3;
	}
	}


	vid_blk_read_word(dev, AFE_CTRL_C2HH_SRC_CTRL, &value);
	vid_blk_read_word(dev, AFE_CTRL_C2HH_SRC_CTRL, &value);
	dev_dbg(&dev->udev->dev, "AFE_CTRL_C2HH_SRC_CTRL=0x%x\n", value);
	dev_dbg(dev->dev, "AFE_CTRL_C2HH_SRC_CTRL=0x%x\n", value);
	vid_blk_write_word(dev, AFE_CTRL_C2HH_SRC_CTRL, 0x4485D390);
	vid_blk_write_word(dev, AFE_CTRL_C2HH_SRC_CTRL, 0x4485D390);
	vid_blk_read_word(dev, AFE_CTRL_C2HH_SRC_CTRL, &value);
	vid_blk_read_word(dev, AFE_CTRL_C2HH_SRC_CTRL, &value);
	dev_dbg(&dev->udev->dev, "AFE_CTRL_C2HH_SRC_CTRL=0x%x\n", value);
	dev_dbg(dev->dev, "AFE_CTRL_C2HH_SRC_CTRL=0x%x\n", value);
}
}


#if 0
#if 0
static void cx231xx_dump_SC_reg(struct cx231xx *dev)
static void cx231xx_dump_SC_reg(struct cx231xx *dev)
{
{
	u8 value[4] = { 0, 0, 0, 0 };
	u8 value[4] = { 0, 0, 0, 0 };
	dev_dbg(&dev->udev->dev, "%s!\n", __func__);
	dev_dbg(dev->dev, "%s!\n", __func__);


	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, BOARD_CFG_STAT,
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, BOARD_CFG_STAT,
				 value, 4);
				 value, 4);
	dev_dbg(&dev->udev->dev,
	dev_dbg(dev->dev,
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", BOARD_CFG_STAT, value[0],
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", BOARD_CFG_STAT, value[0],
		value[1], value[2], value[3]);
		value[1], value[2], value[3]);
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, TS_MODE_REG,
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, TS_MODE_REG,
				 value, 4);
				 value, 4);
	dev_dbg(&dev->udev->dev,
	dev_dbg(dev->dev,
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", TS_MODE_REG, value[0],
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", TS_MODE_REG, value[0],
		 value[1], value[2], value[3]);
		 value[1], value[2], value[3]);
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, TS1_CFG_REG,
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, TS1_CFG_REG,
				 value, 4);
				 value, 4);
	dev_dbg(&dev->udev->dev,
	dev_dbg(dev->dev,
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", TS1_CFG_REG, value[0],
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", TS1_CFG_REG, value[0],
		 value[1], value[2], value[3]);
		 value[1], value[2], value[3]);
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, TS1_LENGTH_REG,
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, TS1_LENGTH_REG,
				 value, 4);
				 value, 4);
	dev_dbg(&dev->udev->dev,
	dev_dbg(dev->dev,
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", TS1_LENGTH_REG, value[0],
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", TS1_LENGTH_REG, value[0],
		value[1], value[2], value[3]);
		value[1], value[2], value[3]);


	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, TS2_CFG_REG,
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, TS2_CFG_REG,
				 value, 4);
				 value, 4);
	dev_dbg(&dev->udev->dev,
	dev_dbg(dev->dev,
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", TS2_CFG_REG, value[0],
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", TS2_CFG_REG, value[0],
		value[1], value[2], value[3]);
		value[1], value[2], value[3]);
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, TS2_LENGTH_REG,
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, TS2_LENGTH_REG,
				 value, 4);
				 value, 4);
	dev_dbg(&dev->udev->dev,
	dev_dbg(dev->dev,
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", TS2_LENGTH_REG, value[0],
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", TS2_LENGTH_REG, value[0],
		value[1], value[2], value[3]);
		value[1], value[2], value[3]);
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, EP_MODE_SET,
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, EP_MODE_SET,
				 value, 4);
				 value, 4);
	dev_dbg(&dev->udev->dev,
	dev_dbg(dev->dev,
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", EP_MODE_SET, value[0],
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", EP_MODE_SET, value[0],
		 value[1], value[2], value[3]);
		 value[1], value[2], value[3]);
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_PWR_PTN1,
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_PWR_PTN1,
				 value, 4);
				 value, 4);
	dev_dbg(&dev->udev->dev,
	dev_dbg(dev->dev,
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_PTN1, value[0],
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_PTN1, value[0],
		value[1], value[2], value[3]);
		value[1], value[2], value[3]);


	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_PWR_PTN2,
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_PWR_PTN2,
				 value, 4);
				 value, 4);
	dev_dbg(&dev->udev->dev,
	dev_dbg(dev->dev,
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_PTN2, value[0],
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_PTN2, value[0],
		value[1], value[2], value[3]);
		value[1], value[2], value[3]);
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_PWR_PTN3,
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_PWR_PTN3,
				 value, 4);
				 value, 4);
	dev_dbg(&dev->udev->dev,
	dev_dbg(dev->dev,
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_PTN3, value[0],
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_PTN3, value[0],
		value[1], value[2], value[3]);
		value[1], value[2], value[3]);
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_PWR_MASK0,
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_PWR_MASK0,
				 value, 4);
				 value, 4);
	dev_dbg(&dev->udev->dev,
	dev_dbg(dev->dev,
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_MASK0, value[0],
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_MASK0, value[0],
		value[1], value[2], value[3]);
		value[1], value[2], value[3]);
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_PWR_MASK1,
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_PWR_MASK1,
				 value, 4);
				 value, 4);
	dev_dbg(&dev->udev->dev,
	dev_dbg(dev->dev,
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_MASK1, value[0],
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_MASK1, value[0],
		value[1], value[2], value[3]);
		value[1], value[2], value[3]);


	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_PWR_MASK2,
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_PWR_MASK2,
				 value, 4);
				 value, 4);
	dev_dbg(&dev->udev->dev,
	dev_dbg(dev->dev,
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_MASK2, value[0],
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_MASK2, value[0],
		value[1], value[2], value[3]);
		value[1], value[2], value[3]);
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_GAIN,
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_GAIN,
				 value, 4);
				 value, 4);
	dev_dbg(&dev->udev->dev,
	dev_dbg(dev->dev,
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_GAIN, value[0],
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_GAIN, value[0],
		value[1], value[2], value[3]);
		value[1], value[2], value[3]);
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_CAR_REG,
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_CAR_REG,
				 value, 4);
				 value, 4);
	dev_dbg(&dev->udev->dev,
	dev_dbg(dev->dev,
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_CAR_REG, value[0],
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_CAR_REG, value[0],
		value[1], value[2], value[3]);
		value[1], value[2], value[3]);
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_OT_CFG1,
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_OT_CFG1,
				 value, 4);
				 value, 4);
	dev_dbg(&dev->udev->dev,
	dev_dbg(dev->dev,
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_OT_CFG1, value[0],
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_OT_CFG1, value[0],
		value[1], value[2], value[3]);
		value[1], value[2], value[3]);


	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_OT_CFG2,
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_OT_CFG2,
				 value, 4);
				 value, 4);
	dev_dbg(&dev->udev->dev,
	dev_dbg(dev->dev,
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_OT_CFG2, value[0],
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_OT_CFG2, value[0],
		value[1], value[2], value[3]);
		value[1], value[2], value[3]);
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, PWR_CTL_EN,
	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, PWR_CTL_EN,
				 value, 4);
				 value, 4);
	dev_dbg(&dev->udev->dev,
	dev_dbg(dev->dev,
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", PWR_CTL_EN, value[0],
		"reg0x%x=0x%x 0x%x 0x%x 0x%x\n", PWR_CTL_EN, value[0],
		value[1], value[2], value[3]);
		value[1], value[2], value[3]);
}
}
@@ -1524,7 +1524,7 @@ void cx231xx_set_Colibri_For_LowIF(struct cx231xx *dev, u32 if_freq,
	u32 standard = 0;
	u32 standard = 0;
	u8 value[4] = { 0, 0, 0, 0 };
	u8 value[4] = { 0, 0, 0, 0 };


	dev_dbg(&dev->udev->dev, "Enter cx231xx_set_Colibri_For_LowIF()\n");
	dev_dbg(dev->dev, "Enter cx231xx_set_Colibri_For_LowIF()\n");
	value[0] = (u8) 0x6F;
	value[0] = (u8) 0x6F;
	value[1] = (u8) 0x6F;
	value[1] = (u8) 0x6F;
	value[2] = (u8) 0x6F;
	value[2] = (u8) 0x6F;
@@ -1544,7 +1544,7 @@ void cx231xx_set_Colibri_For_LowIF(struct cx231xx *dev, u32 if_freq,
	colibri_carrier_offset = cx231xx_Get_Colibri_CarrierOffset(mode,
	colibri_carrier_offset = cx231xx_Get_Colibri_CarrierOffset(mode,
								   standard);
								   standard);


	dev_dbg(&dev->udev->dev, "colibri_carrier_offset=%d, standard=0x%x\n",
	dev_dbg(dev->dev, "colibri_carrier_offset=%d, standard=0x%x\n",
		     colibri_carrier_offset, standard);
		     colibri_carrier_offset, standard);


	/* Set the band Pass filter for DIF*/
	/* Set the band Pass filter for DIF*/
@@ -1578,7 +1578,7 @@ void cx231xx_set_DIF_bandpass(struct cx231xx *dev, u32 if_freq,
	u64 pll_freq_u64 = 0;
	u64 pll_freq_u64 = 0;
	u32 i = 0;
	u32 i = 0;


	dev_dbg(&dev->udev->dev, "if_freq=%d;spectral_invert=0x%x;mode=0x%x\n",
	dev_dbg(dev->dev, "if_freq=%d;spectral_invert=0x%x;mode=0x%x\n",
		if_freq, spectral_invert, mode);
		if_freq, spectral_invert, mode);




@@ -1622,7 +1622,7 @@ void cx231xx_set_DIF_bandpass(struct cx231xx *dev, u32 if_freq,
		if_freq = 16000000;
		if_freq = 16000000;
	}
	}


	dev_dbg(&dev->udev->dev, "Enter IF=%zu\n", ARRAY_SIZE(Dif_set_array));
	dev_dbg(dev->dev, "Enter IF=%zu\n", ARRAY_SIZE(Dif_set_array));
	for (i = 0; i < ARRAY_SIZE(Dif_set_array); i++) {
	for (i = 0; i < ARRAY_SIZE(Dif_set_array); i++) {
		if (Dif_set_array[i].if_freq == if_freq) {
		if (Dif_set_array[i].if_freq == if_freq) {
			vid_blk_write_word(dev,
			vid_blk_write_word(dev,
@@ -1734,7 +1734,7 @@ int cx231xx_dif_set_standard(struct cx231xx *dev, u32 standard)
	u32 dif_misc_ctrl_value = 0;
	u32 dif_misc_ctrl_value = 0;
	u32 func_mode = 0;
	u32 func_mode = 0;


	dev_dbg(&dev->udev->dev, "%s: setStandard to %x\n", __func__, standard);
	dev_dbg(dev->dev, "%s: setStandard to %x\n", __func__, standard);


	status = vid_blk_read_word(dev, DIF_MISC_CTRL, &dif_misc_ctrl_value);
	status = vid_blk_read_word(dev, DIF_MISC_CTRL, &dif_misc_ctrl_value);
	if (standard != DIF_USE_BASEBAND)
	if (standard != DIF_USE_BASEBAND)
@@ -2137,7 +2137,7 @@ int cx231xx_tuner_post_channel_change(struct cx231xx *dev)
{
{
	int status = 0;
	int status = 0;
	u32 dwval;
	u32 dwval;
	dev_dbg(&dev->udev->dev, "%s: dev->tuner_type =0%d\n",
	dev_dbg(dev->dev, "%s: dev->tuner_type =0%d\n",
		__func__, dev->tuner_type);
		__func__, dev->tuner_type);
	/* Set the RF and IF k_agc values to 4 for PAL/NTSC and 8 for
	/* Set the RF and IF k_agc values to 4 for PAL/NTSC and 8 for
	 * SECAM L/B/D standards */
	 * SECAM L/B/D standards */
@@ -2239,7 +2239,7 @@ int cx231xx_set_power_mode(struct cx231xx *dev, enum AV_MODE mode)
	if (dev->power_mode != mode)
	if (dev->power_mode != mode)
		dev->power_mode = mode;
		dev->power_mode = mode;
	else {
	else {
		dev_dbg(&dev->udev->dev, "%s: mode = %d, No Change req.\n",
		dev_dbg(dev->dev, "%s: mode = %d, No Change req.\n",
			 __func__, mode);
			 __func__, mode);
		return 0;
		return 0;
	}
	}
@@ -2479,7 +2479,7 @@ int cx231xx_start_stream(struct cx231xx *dev, u32 ep_mask)
	u32 tmp = 0;
	u32 tmp = 0;
	int status = 0;
	int status = 0;


	dev_dbg(&dev->udev->dev, "%s: ep_mask = %x\n", __func__, ep_mask);
	dev_dbg(dev->dev, "%s: ep_mask = %x\n", __func__, ep_mask);
	status = cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, EP_MODE_SET,
	status = cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, EP_MODE_SET,
				       value, 4);
				       value, 4);
	if (status < 0)
	if (status < 0)
@@ -2504,7 +2504,7 @@ int cx231xx_stop_stream(struct cx231xx *dev, u32 ep_mask)
	u32 tmp = 0;
	u32 tmp = 0;
	int status = 0;
	int status = 0;


	dev_dbg(&dev->udev->dev, "%s: ep_mask = %x\n", __func__, ep_mask);
	dev_dbg(dev->dev, "%s: ep_mask = %x\n", __func__, ep_mask);
	status =
	status =
	    cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, EP_MODE_SET, value, 4);
	    cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, EP_MODE_SET, value, 4);
	if (status < 0)
	if (status < 0)
@@ -2532,37 +2532,37 @@ int cx231xx_initialize_stream_xfer(struct cx231xx *dev, u32 media_type)
	if (dev->udev->speed == USB_SPEED_HIGH) {
	if (dev->udev->speed == USB_SPEED_HIGH) {
		switch (media_type) {
		switch (media_type) {
		case Audio:
		case Audio:
			dev_dbg(&dev->udev->dev,
			dev_dbg(dev->dev,
				"%s: Audio enter HANC\n", __func__);
				"%s: Audio enter HANC\n", __func__);
			status =
			status =
			    cx231xx_mode_register(dev, TS_MODE_REG, 0x9300);
			    cx231xx_mode_register(dev, TS_MODE_REG, 0x9300);
			break;
			break;


		case Vbi:
		case Vbi:
			dev_dbg(&dev->udev->dev,
			dev_dbg(dev->dev,
				"%s: set vanc registers\n", __func__);
				"%s: set vanc registers\n", __func__);
			status = cx231xx_mode_register(dev, TS_MODE_REG, 0x300);
			status = cx231xx_mode_register(dev, TS_MODE_REG, 0x300);
			break;
			break;


		case Sliced_cc:
		case Sliced_cc:
			dev_dbg(&dev->udev->dev,
			dev_dbg(dev->dev,
				"%s: set hanc registers\n", __func__);
				"%s: set hanc registers\n", __func__);
			status =
			status =
			    cx231xx_mode_register(dev, TS_MODE_REG, 0x1300);
			    cx231xx_mode_register(dev, TS_MODE_REG, 0x1300);
			break;
			break;


		case Raw_Video:
		case Raw_Video:
			dev_dbg(&dev->udev->dev,
			dev_dbg(dev->dev,
				"%s: set video registers\n", __func__);
				"%s: set video registers\n", __func__);
			status = cx231xx_mode_register(dev, TS_MODE_REG, 0x100);
			status = cx231xx_mode_register(dev, TS_MODE_REG, 0x100);
			break;
			break;


		case TS1_serial_mode:
		case TS1_serial_mode:
			dev_dbg(&dev->udev->dev,
			dev_dbg(dev->dev,
				"%s: set ts1 registers", __func__);
				"%s: set ts1 registers", __func__);


			if (dev->board.has_417) {
			if (dev->board.has_417) {
				dev_dbg(&dev->udev->dev,
				dev_dbg(dev->dev,
					"%s: MPEG\n", __func__);
					"%s: MPEG\n", __func__);
				value &= 0xFFFFFFFC;
				value &= 0xFFFFFFFC;
				value |= 0x3;
				value |= 0x3;
@@ -2586,7 +2586,7 @@ int cx231xx_initialize_stream_xfer(struct cx231xx *dev, u32 media_type)
							VRT_SET_REGISTER,
							VRT_SET_REGISTER,
							TS1_LENGTH_REG, val, 4);
							TS1_LENGTH_REG, val, 4);
			} else {
			} else {
				dev_dbg(&dev->udev->dev, "%s: BDA\n", __func__);
				dev_dbg(dev->dev, "%s: BDA\n", __func__);
				status = cx231xx_mode_register(dev,
				status = cx231xx_mode_register(dev,
							 TS_MODE_REG, 0x101);
							 TS_MODE_REG, 0x101);
				status = cx231xx_mode_register(dev,
				status = cx231xx_mode_register(dev,
@@ -2595,7 +2595,7 @@ int cx231xx_initialize_stream_xfer(struct cx231xx *dev, u32 media_type)
			break;
			break;


		case TS1_parallel_mode:
		case TS1_parallel_mode:
			dev_dbg(&dev->udev->dev,
			dev_dbg(dev->dev,
				"%s: set ts1 parallel mode registers\n",
				"%s: set ts1 parallel mode registers\n",
				__func__);
				__func__);
			status = cx231xx_mode_register(dev, TS_MODE_REG, 0x100);
			status = cx231xx_mode_register(dev, TS_MODE_REG, 0x100);
@@ -2950,7 +2950,7 @@ int cx231xx_gpio_i2c_read_ack(struct cx231xx *dev)
			 (nCnt > 0));
			 (nCnt > 0));


	if (nCnt == 0)
	if (nCnt == 0)
		dev_dbg(&dev->udev->dev,
		dev_dbg(dev->dev,
			"No ACK after %d msec -GPIO I2C failed!",
			"No ACK after %d msec -GPIO I2C failed!",
			nInit * 10);
			nInit * 10);


+36 −35

File changed.

Preview size limit exceeded, changes collapsed.

+26 −26

File changed.

Preview size limit exceeded, changes collapsed.

Loading