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

Commit b7085c08 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

[media] cx231xx: convert from pr_foo to dev_foo



Replace all pr_foo occurrences by dev_foo, as this is
the recommended way for drivers.

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 77e97ba2
Loading
Loading
Loading
Loading
+24 −14
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@
#include <media/v4l2-event.h>
#include <media/cx2341x.h>
#include <media/tuner.h>
#include <linux/usb.h>

#define CX231xx_FIRM_IMAGE_SIZE 376836
#define CX231xx_FIRM_IMAGE_NAME "v4l-cx23885-enc.fw"
@@ -988,7 +987,8 @@ static int cx231xx_load_firmware(struct cx231xx *dev)
		IVTV_REG_APU, 0);

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

@@ -996,21 +996,25 @@ static int cx231xx_load_firmware(struct cx231xx *dev)
				  &dev->udev->dev);

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

	if (firmware->size != CX231xx_FIRM_IMAGE_SIZE) {
		pr_err("ERROR: Firmware size mismatch (have %zd, expected %d)\n",
		dev_err(&dev->udev->dev,
			"ERROR: Firmware size mismatch (have %zd, expected %d)\n",
			firmware->size, CX231xx_FIRM_IMAGE_SIZE);
		release_firmware(firmware);
		return -1;
	}

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

	if (retval < 0) {
		pr_err("%s: Error with mc417_register_write\n",
		dev_err(&dev->udev->dev,
			"%s: Error with mc417_register_write\n",
			__func__);
		return retval;
	}
@@ -1117,25 +1123,28 @@ static int cx231xx_initialize_codec(struct cx231xx *dev)
		dprintk(2, "%s: PING OK\n", __func__);
		retval = cx231xx_load_firmware(dev);
		if (retval < 0) {
			pr_err("%s: f/w load failed\n", __func__);
			dev_err(&dev->udev->dev,
				"%s: f/w load failed\n", __func__);
			return retval;
		}
		retval = cx231xx_find_mailbox(dev);
		if (retval < 0) {
			pr_err("%s: mailbox < 0, error\n",
			dev_err(&dev->udev->dev, "%s: mailbox < 0, error\n",
				__func__);
			return -1;
		}
		dev->cx23417_mailbox = retval;
		retval = cx231xx_api_cmd(dev, CX2341X_ENC_PING_FW, 0, 0);
		if (retval < 0) {
			pr_err("ERROR: cx23417 firmware ping failed!\n");
			dev_err(&dev->udev->dev,
				"ERROR: cx23417 firmware ping failed!\n");
			return -1;
		}
		retval = cx231xx_api_cmd(dev, CX2341X_ENC_GET_VERSION, 0, 1,
			&version);
		if (retval < 0) {
			pr_err("ERROR: cx23417 firmware get encoder: version failed!\n");
			dev_err(&dev->udev->dev,
				"ERROR: cx23417 firmware get encoder: version failed!\n");
			return -1;
		}
		dprintk(1, "cx23417 firmware version is 0x%08x\n", version);
@@ -1416,8 +1425,9 @@ static int bb_buf_prepare(struct videobuf_queue *q,
		if (!dev->video_mode.bulk_ctl.num_bufs)
			urb_init = 1;
	}
	/*pr_info("urb_init=%d dev->video_mode.max_pkt_size=%d\n",
		urb_init, dev->video_mode.max_pkt_size);*/
	dev_dbg(&dev->udev->dev,
		"urb_init=%d dev->video_mode.max_pkt_size=%d\n",
		urb_init, dev->video_mode.max_pkt_size);
	dev->mode_tv = 1;

	if (urb_init) {
+27 −17
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@

#include "cx231xx.h"
#include <linux/kernel.h>
#include <linux/usb.h>
#include <linux/init.h>
#include <linux/sound.h>
#include <linux/spinlock.h>
@@ -182,7 +181,8 @@ static void cx231xx_audio_isocirq(struct urb *urb)

	status = usb_submit_urb(urb, GFP_ATOMIC);
	if (status < 0) {
		pr_err("resubmit of audio urb failed (error=%i)\n",
		dev_err(&dev->udev->dev,
			"resubmit of audio urb failed (error=%i)\n",
			status);
	}
	return;
@@ -266,7 +266,8 @@ static void cx231xx_audio_bulkirq(struct urb *urb)

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

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

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

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

	if (dev->state & DEV_DISCONNECTED)
		return -ENODEV;
@@ -356,7 +359,7 @@ static int cx231xx_init_audio_bulk(struct cx231xx *dev)
		memset(dev->adev.transfer_buffer[i], 0x80, sb_size);
		urb = usb_alloc_urb(CX231XX_NUM_AUDIO_PACKETS, GFP_ATOMIC);
		if (!urb) {
			pr_err("usb_alloc_urb failed!\n");
			dev_err(&dev->udev->dev, "usb_alloc_urb failed!\n");
			for (j = 0; j < i; j++) {
				usb_free_urb(dev->adev.urb[j]);
				kfree(dev->adev.transfer_buffer[j]);
@@ -439,12 +442,14 @@ static int snd_cx231xx_capture_open(struct snd_pcm_substream *substream)
	dprintk("opening device and trying to acquire exclusive lock\n");

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

	if (dev->state & DEV_DISCONNECTED) {
		pr_err("Can't open. the device was removed.\n");
		dev_err(&dev->udev->dev,
			"Can't open. the device was removed.\n");
		return -ENODEV;
	}

@@ -457,7 +462,8 @@ static int snd_cx231xx_capture_open(struct snd_pcm_substream *substream)
		ret = cx231xx_set_alt_setting(dev, INDEX_AUDIO, 0);
	mutex_unlock(&dev->lock);
	if (ret < 0) {
		pr_err("failed to set alternate setting !\n");
		dev_err(&dev->udev->dev,
			"failed to set alternate setting !\n");

		return ret;
	}
@@ -493,7 +499,8 @@ static int snd_cx231xx_pcm_close(struct snd_pcm_substream *substream)
	/* 1 - 48000 samples per sec */
	ret = cx231xx_set_alt_setting(dev, INDEX_AUDIO, 0);
	if (ret < 0) {
		pr_err("failed to set alternate setting !\n");
		dev_err(&dev->udev->dev,
			"failed to set alternate setting !\n");

		mutex_unlock(&dev->lock);
		return ret;
@@ -661,7 +668,8 @@ static int cx231xx_audio_init(struct cx231xx *dev)
		return 0;
	}

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

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

	adev->num_alt = uif->num_altsetting;
	pr_info("audio EndPoint Addr 0x%x, Alternate settings: %i\n",
	dev_info(&dev->udev->dev,
		"audio EndPoint Addr 0x%x, Alternate settings: %i\n",
		adev->end_point_addr, adev->num_alt);
	adev->alt_max_pkt_size = kmalloc(32 * adev->num_alt, GFP_KERNEL);

@@ -718,7 +727,8 @@ static int cx231xx_audio_init(struct cx231xx *dev)
				wMaxPacketSize);
		adev->alt_max_pkt_size[i] =
		    (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
		pr_debug("audio alternate setting %i, max size= %i\n", i,
		dev_dbg(&dev->udev->dev,
			"audio alternate setting %i, max size= %i\n", i,
			adev->alt_max_pkt_size[i]);
	}

+123 −90
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/bitmap.h>
#include <linux/usb.h>
#include <linux/i2c.h>
#include <linux/mm.h>
#include <linux/mutex.h>
@@ -83,10 +82,10 @@ void initGPIO(struct cx231xx *dev)
	cx231xx_send_gpio_cmd(dev, _gpio_direction, (u8 *)&value, 4, 0, 0);

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

	cx231xx_capture_start(dev, 1, Vbi);

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

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

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

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

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

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

	} else if (dev->norm & V4L2_STD_SECAM) {
		pr_debug("%s: SECAM\n", __func__);
		dev_dbg(&dev->udev->dev, "%s: SECAM\n", __func__);
		status =  cx231xx_read_modify_write_i2c_dword(dev,
							VID_BLK_I2C_ADDRESS,
							VERT_TIM_CTRL,
@@ -1025,7 +1033,7 @@ int cx231xx_do_mode_ctrl_overrides(struct cx231xx *dev)
							cx231xx_set_field
							(FLD_HBLANK_CNT, 0x85));
	} else {
		pr_debug("%s: PAL\n", __func__);
		dev_dbg(&dev->udev->dev, "%s: PAL\n", __func__);
		status = cx231xx_read_modify_write_i2c_dword(dev,
							VID_BLK_I2C_ADDRESS,
							VERT_TIM_CTRL,
@@ -1325,110 +1333,128 @@ void cx231xx_dump_HH_reg(struct cx231xx *dev)

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

			if (dev->board.has_417) {
				pr_debug("%s: MPEG\n", __func__);
				dev_dbg(&dev->udev->dev,
					"%s: MPEG\n", __func__);
				value &= 0xFFFFFFFC;
				value |= 0x3;

@@ -2554,7 +2585,7 @@ int cx231xx_initialize_stream_xfer(struct cx231xx *dev, u32 media_type)
							VRT_SET_REGISTER,
							TS1_LENGTH_REG, val, 4);
			} else {
				pr_debug("%s: BDA\n", __func__);
				dev_dbg(&dev->udev->dev, "%s: BDA\n", __func__);
				status = cx231xx_mode_register(dev,
							 TS_MODE_REG, 0x101);
				status = cx231xx_mode_register(dev,
@@ -2563,7 +2594,8 @@ int cx231xx_initialize_stream_xfer(struct cx231xx *dev, u32 media_type)
			break;

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

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

	/*
+72 −53

File changed.

Preview size limit exceeded, changes collapsed.

+47 −26

File changed.

Preview size limit exceeded, changes collapsed.

Loading