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

Commit 589dadf2 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

[media] cx231xx: get rid of driver-defined printk macros



It currently does just like what pr_foo() macros do. So,
replace them.

A deeper cleanup is needed, as there are lots of debug macros
printed with pr_info.

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent f2dd851f
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include "cx231xx.h"

#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
@@ -39,8 +41,6 @@
#include <media/tuner.h>
#include <linux/usb.h>

#include "cx231xx.h"

#define CX231xx_FIRM_IMAGE_SIZE 376836
#define CX231xx_FIRM_IMAGE_NAME "v4l-cx23885-enc.fw"

@@ -1416,7 +1416,7 @@ static int bb_buf_prepare(struct videobuf_queue *q,
		if (!dev->video_mode.bulk_ctl.num_bufs)
			urb_init = 1;
	}
	/*cx231xx_info("urb_init=%d dev->video_mode.max_pkt_size=%d\n",
	/*pr_info("urb_init=%d dev->video_mode.max_pkt_size=%d\n",
		urb_init, dev->video_mode.max_pkt_size);*/
	dev->mode_tv = 1;

+15 −15
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include "cx231xx.h"
#include <linux/kernel.h>
#include <linux/usb.h>
#include <linux/init.h>
@@ -37,7 +38,6 @@
#include <sound/initval.h>
#include <sound/control.h>
#include <media/v4l2-common.h>
#include "cx231xx.h"

static int debug;
module_param(debug, int, 0644);
@@ -182,7 +182,7 @@ static void cx231xx_audio_isocirq(struct urb *urb)

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

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

	cx231xx_info("%s: Starting ISO AUDIO transfers\n", __func__);
	pr_info("%s: Starting ISO AUDIO transfers\n", __func__);

	if (dev->state & DEV_DISCONNECTED)
		return -ENODEV;
@@ -295,7 +295,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) {
			cx231xx_errdev("usb_alloc_urb failed!\n");
			pr_err("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 +338,7 @@ static int cx231xx_init_audio_bulk(struct cx231xx *dev)
	int i, errCode;
	int sb_size;

	cx231xx_info("%s: Starting BULK AUDIO transfers\n", __func__);
	pr_info("%s: Starting BULK AUDIO transfers\n", __func__);

	if (dev->state & DEV_DISCONNECTED)
		return -ENODEV;
@@ -356,7 +356,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) {
			cx231xx_errdev("usb_alloc_urb failed!\n");
			pr_err("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,13 +439,13 @@ static int snd_cx231xx_capture_open(struct snd_pcm_substream *substream)
	dprintk("opening device and trying to acquire exclusive lock\n");

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

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

@@ -458,7 +458,7 @@ 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) {
		cx231xx_errdev("failed to set alternate setting !\n");
		pr_err("failed to set alternate setting !\n");

		return ret;
	}
@@ -494,7 +494,7 @@ 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) {
		cx231xx_errdev("failed to set alternate setting !\n");
		pr_err("failed to set alternate setting !\n");

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

	cx231xx_info("cx231xx-audio.c: probing for cx231xx "
	pr_info("cx231xx-audio.c: probing for cx231xx "
		     "non standard usbaudio\n");

	err = snd_card_new(&dev->udev->dev, index[devnr], "Cx231xx Audio",
@@ -707,12 +707,12 @@ static int cx231xx_audio_init(struct cx231xx *dev)
			bEndpointAddress;

	adev->num_alt = uif->num_altsetting;
	cx231xx_info("EndPoint Addr 0x%x, Alternate settings: %i\n",
	pr_info("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);

	if (adev->alt_max_pkt_size == NULL) {
		cx231xx_errdev("out of memory!\n");
		pr_err("out of memory!\n");
		return -ENOMEM;
	}

@@ -722,7 +722,7 @@ static int cx231xx_audio_init(struct cx231xx *dev)
				wMaxPacketSize);
		adev->alt_max_pkt_size[i] =
		    (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
		cx231xx_info("Alternate setting %i, max size= %i\n", i,
		pr_info("Alternate setting %i, max size= %i\n", i,
			     adev->alt_max_pkt_size[i]);
	}

+63 −63
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include "cx231xx.h"
#include <linux/init.h>
#include <linux/list.h>
#include <linux/module.h>
@@ -36,7 +37,6 @@
#include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h>

#include "cx231xx.h"
#include "cx231xx-dif.h"

#define TUNER_MODE_FM_RADIO 0
@@ -83,10 +83,10 @@ void initGPIO(struct cx231xx *dev)
	cx231xx_send_gpio_cmd(dev, _gpio_direction, (u8 *)&value, 4, 0, 0);

	verve_read_byte(dev, 0x07, &val);
	cx231xx_info(" verve_read_byte address0x07=0x%x\n", val);
	pr_info(" verve_read_byte address0x07=0x%x\n", val);
	verve_write_byte(dev, 0x07, 0xF4);
	verve_read_byte(dev, 0x07, &val);
	cx231xx_info(" verve_read_byte address0x07=0x%x\n", val);
	pr_info(" verve_read_byte address0x07=0x%x\n", val);

	cx231xx_capture_start(dev, 1, Vbi);

@@ -156,7 +156,7 @@ 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) {
			cx231xx_info(
			pr_info(
			": Init Super Block failed in send cmd\n");
			break;
		}
@@ -164,13 +164,13 @@ 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) {
			cx231xx_info(
			pr_info(
			": Init Super Block failed in receive cmd\n");
			break;
		}
		i++;
		if (i == 10) {
			cx231xx_info(
			pr_info(
			": Init Super Block force break in loop !!!!\n");
			status = -1;
			break;
@@ -410,7 +410,7 @@ int cx231xx_afe_update_power_control(struct cx231xx *dev,
			status |= afe_write_byte(dev, ADC_PWRDN_CLAMP_CH3,
						0x00);
		} else {
			cx231xx_info("Invalid AV mode input\n");
			pr_info("Invalid AV mode input\n");
			status = -1;
		}
		break;
@@ -467,7 +467,7 @@ int cx231xx_afe_update_power_control(struct cx231xx *dev,
			status |= afe_write_byte(dev, ADC_PWRDN_CLAMP_CH3,
							0x40);
		} else {
			cx231xx_info("Invalid AV mode input\n");
			pr_info("Invalid AV mode input\n");
			status = -1;
		}
	}			/* switch  */
@@ -573,7 +573,7 @@ int cx231xx_set_video_input_mux(struct cx231xx *dev, u8 input)
			status = cx231xx_set_power_mode(dev,
					POLARIS_AVMODE_ENXTERNAL_AV);
			if (status < 0) {
				cx231xx_errdev("%s: set_power_mode : Failed to"
				pr_err("%s: set_power_mode : Failed to"
						" set Power - errCode [%d]!\n",
						__func__, status);
				return status;
@@ -591,7 +591,7 @@ int cx231xx_set_video_input_mux(struct cx231xx *dev, u8 input)
			status = cx231xx_set_power_mode(dev,
						POLARIS_AVMODE_ANALOGT_TV);
			if (status < 0) {
				cx231xx_errdev("%s: set_power_mode:Failed"
				pr_err("%s: set_power_mode:Failed"
					" to set Power - errCode [%d]!\n",
					__func__, status);
				return status;
@@ -608,7 +608,7 @@ int cx231xx_set_video_input_mux(struct cx231xx *dev, u8 input)

		break;
	default:
		cx231xx_errdev("%s: set_power_mode : Unknown Input %d !\n",
		pr_err("%s: set_power_mode : Unknown Input %d !\n",
		     __func__, INPUT(input)->type);
		break;
	}
@@ -628,7 +628,7 @@ 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) {
			cx231xx_errdev("%s: adjust_ref_count :Failed to set"
			pr_err("%s: adjust_ref_count :Failed to set"
				"AFE input mux - errCode [%d]!\n",
				__func__, status);
			return status;
@@ -638,7 +638,7 @@ 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) {
		cx231xx_errdev("%s: set_input_mux :Failed to set"
		pr_err("%s: set_input_mux :Failed to set"
				" AFE input mux - errCode [%d]!\n",
				__func__, status);
		return status;
@@ -670,7 +670,7 @@ 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) {
			cx231xx_errdev("%s: cx231xx_dif set to By pass"
			pr_err("%s: cx231xx_dif set to By pass"
						   " mode- errCode [%d]!\n",
				__func__, status);
			return status;
@@ -715,7 +715,7 @@ 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) {
			cx231xx_errdev("%s: cx231xx_dif set to By pass"
			pr_err("%s: cx231xx_dif set to By pass"
						   " mode- errCode [%d]!\n",
				__func__, status);
			return status;
@@ -790,7 +790,7 @@ int cx231xx_set_decoder_video_input(struct cx231xx *dev,
			status = cx231xx_dif_set_standard(dev,
							  DIF_USE_BASEBAND);
			if (status < 0) {
				cx231xx_errdev("%s: cx231xx_dif set to By pass"
				pr_err("%s: cx231xx_dif set to By pass"
						" mode- errCode [%d]!\n",
						__func__, status);
				return status;
@@ -826,7 +826,7 @@ int cx231xx_set_decoder_video_input(struct cx231xx *dev,
			/* Reinitialize the DIF */
			status = cx231xx_dif_set_standard(dev, dev->norm);
			if (status < 0) {
				cx231xx_errdev("%s: cx231xx_dif set to By pass"
				pr_err("%s: cx231xx_dif set to By pass"
						" mode- errCode [%d]!\n",
						__func__, status);
				return status;
@@ -970,14 +970,14 @@ int cx231xx_do_mode_ctrl_overrides(struct cx231xx *dev)
{
	int status = 0;

	cx231xx_info("do_mode_ctrl_overrides : 0x%x\n",
	pr_info("do_mode_ctrl_overrides : 0x%x\n",
		     (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)) {
		cx231xx_info("do_mode_ctrl_overrides NTSC\n");
		pr_info("do_mode_ctrl_overrides NTSC\n");

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

	} else if (dev->norm & V4L2_STD_SECAM) {
		cx231xx_info("do_mode_ctrl_overrides SECAM\n");
		pr_info("do_mode_ctrl_overrides SECAM\n");
		status =  cx231xx_read_modify_write_i2c_dword(dev,
							VID_BLK_I2C_ADDRESS,
							VERT_TIM_CTRL,
@@ -1031,7 +1031,7 @@ int cx231xx_do_mode_ctrl_overrides(struct cx231xx *dev)
							cx231xx_set_field
							(FLD_HBLANK_CNT, 0x85));
	} else {
		cx231xx_info("do_mode_ctrl_overrides PAL\n");
		pr_info("do_mode_ctrl_overrides PAL\n");
		status = cx231xx_read_modify_write_i2c_dword(dev,
							VID_BLK_I2C_ADDRESS,
							VERT_TIM_CTRL,
@@ -1331,109 +1331,109 @@ void cx231xx_dump_HH_reg(struct cx231xx *dev)

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

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

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

	vid_blk_read_word(dev, AFE_CTRL_C2HH_SRC_CTRL, &value);
	cx231xx_info("AFE_CTRL_C2HH_SRC_CTRL=0x%x\n", value);
	pr_info("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);
	cx231xx_info("AFE_CTRL_C2HH_SRC_CTRL=0x%x\n", value);
	pr_info("AFE_CTRL_C2HH_SRC_CTRL=0x%x\n", value);
}

void cx231xx_dump_SC_reg(struct cx231xx *dev)
{
	u8 value[4] = { 0, 0, 0, 0 };
	cx231xx_info("cx231xx_dump_SC_reg!\n");
	pr_info("cx231xx_dump_SC_reg!\n");

	cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, BOARD_CFG_STAT,
				 value, 4);
	cx231xx_info("reg0x%x=0x%x 0x%x 0x%x 0x%x\n", BOARD_CFG_STAT, value[0],
	pr_info("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);
	cx231xx_info("reg0x%x=0x%x 0x%x 0x%x 0x%x\n", TS_MODE_REG, value[0],
	pr_info("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);
	cx231xx_info("reg0x%x=0x%x 0x%x 0x%x 0x%x\n", TS1_CFG_REG, value[0],
	pr_info("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);
	cx231xx_info("reg0x%x=0x%x 0x%x 0x%x 0x%x\n", TS1_LENGTH_REG, value[0],
	pr_info("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);
	cx231xx_info("reg0x%x=0x%x 0x%x 0x%x 0x%x\n", TS2_CFG_REG, value[0],
	pr_info("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);
	cx231xx_info("reg0x%x=0x%x 0x%x 0x%x 0x%x\n", TS2_LENGTH_REG, value[0],
	pr_info("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);
	cx231xx_info("reg0x%x=0x%x 0x%x 0x%x 0x%x\n", EP_MODE_SET, value[0],
	pr_info("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);
	cx231xx_info("reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_PTN1, value[0],
	pr_info("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);
	cx231xx_info("reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_PTN2, value[0],
	pr_info("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);
	cx231xx_info("reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_PTN3, value[0],
	pr_info("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);
	cx231xx_info("reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_MASK0, value[0],
	pr_info("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);
	cx231xx_info("reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_MASK1, value[0],
	pr_info("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);
	cx231xx_info("reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_MASK2, value[0],
	pr_info("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);
	cx231xx_info("reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_GAIN, value[0],
	pr_info("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);
	cx231xx_info("reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_CAR_REG, value[0],
	pr_info("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);
	cx231xx_info("reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_OT_CFG1, value[0],
	pr_info("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);
	cx231xx_info("reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_OT_CFG2, value[0],
	pr_info("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);
	cx231xx_info("reg0x%x=0x%x 0x%x 0x%x 0x%x\n", PWR_CTL_EN, value[0],
	pr_info("reg0x%x=0x%x 0x%x 0x%x 0x%x\n", PWR_CTL_EN, value[0],
				 value[1], value[2], value[3]);


@@ -1503,7 +1503,7 @@ void cx231xx_set_Colibri_For_LowIF(struct cx231xx *dev, u32 if_freq,
	u32 standard = 0;
	u8 value[4] = { 0, 0, 0, 0 };

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

	cx231xx_info("colibri_carrier_offset=%d, standard=0x%x\n",
	pr_info("colibri_carrier_offset=%d, standard=0x%x\n",
		     colibri_carrier_offset, standard);

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

	cx231xx_info("if_freq=%d;spectral_invert=0x%x;mode=0x%x\n",
	pr_info("if_freq=%d;spectral_invert=0x%x;mode=0x%x\n",
			 if_freq, spectral_invert, mode);


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

	cx231xx_info("Enter IF=%zu\n",
	pr_info("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) {
@@ -1714,7 +1714,7 @@ int cx231xx_dif_set_standard(struct cx231xx *dev, u32 standard)
	u32 dif_misc_ctrl_value = 0;
	u32 func_mode = 0;

	cx231xx_info("%s: setStandard to %x\n", __func__, standard);
	pr_info("%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)
@@ -2117,7 +2117,7 @@ int cx231xx_tuner_post_channel_change(struct cx231xx *dev)
{
	int status = 0;
	u32 dwval;
	cx231xx_info("cx231xx_tuner_post_channel_change  dev->tuner_type =0%d\n",
	pr_info("cx231xx_tuner_post_channel_change  dev->tuner_type =0%d\n",
		     dev->tuner_type);
	/* Set the RF and IF k_agc values to 4 for PAL/NTSC and 8 for
	 * SECAM L/B/D standards */
@@ -2219,7 +2219,7 @@ int cx231xx_set_power_mode(struct cx231xx *dev, enum AV_MODE mode)
	if (dev->power_mode != mode)
		dev->power_mode = mode;
	else {
		cx231xx_info(" setPowerMode::mode = %d, No Change req.\n",
		pr_info(" setPowerMode::mode = %d, No Change req.\n",
			     mode);
		return 0;
	}
@@ -2459,7 +2459,7 @@ int cx231xx_start_stream(struct cx231xx *dev, u32 ep_mask)
	u32 tmp = 0;
	int status = 0;

	cx231xx_info("cx231xx_start_stream():: ep_mask = %x\n", ep_mask);
	pr_info("cx231xx_start_stream():: ep_mask = %x\n", ep_mask);
	status = cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, EP_MODE_SET,
				       value, 4);
	if (status < 0)
@@ -2484,7 +2484,7 @@ int cx231xx_stop_stream(struct cx231xx *dev, u32 ep_mask)
	u32 tmp = 0;
	int status = 0;

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

		case Vbi:
			cx231xx_info("%s: set vanc registers\n", __func__);
			pr_info("%s: set vanc registers\n", __func__);
			status = cx231xx_mode_register(dev, TS_MODE_REG, 0x300);
			break;

		case Sliced_cc:
			cx231xx_info("%s: set hanc registers\n", __func__);
			pr_info("%s: set hanc registers\n", __func__);
			status =
			    cx231xx_mode_register(dev, TS_MODE_REG, 0x1300);
			break;

		case Raw_Video:
			cx231xx_info("%s: set video registers\n", __func__);
			pr_info("%s: set video registers\n", __func__);
			status = cx231xx_mode_register(dev, TS_MODE_REG, 0x100);
			break;

		case TS1_serial_mode:
			cx231xx_info("%s: set ts1 registers", __func__);
			pr_info("%s: set ts1 registers", __func__);

		if (dev->board.has_417) {
			cx231xx_info(" MPEG\n");
			pr_info(" MPEG\n");
			value &= 0xFFFFFFFC;
			value |= 0x3;

@@ -2558,14 +2558,14 @@ int cx231xx_initialize_stream_xfer(struct cx231xx *dev, u32 media_type)
				 TS1_LENGTH_REG, val, 4);

		} else {
			cx231xx_info(" BDA\n");
			pr_info(" BDA\n");
			status = cx231xx_mode_register(dev, TS_MODE_REG, 0x101);
			status = cx231xx_mode_register(dev, TS1_CFG_REG, 0x010);
		}
			break;

		case TS1_parallel_mode:
			cx231xx_info("%s: set ts1 parallel mode registers\n",
			pr_info("%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);
@@ -2919,7 +2919,7 @@ int cx231xx_gpio_i2c_read_ack(struct cx231xx *dev)
			 (nCnt > 0));

	if (nCnt == 0)
		cx231xx_info("No ACK after %d msec -GPIO I2C failed!",
		pr_info("No ACK after %d msec -GPIO I2C failed!",
			     nInit * 10);

	/*
+36 −36

File changed.

Preview size limit exceeded, changes collapsed.

+27 −27
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include "cx231xx.h"
#include <linux/init.h>
#include <linux/list.h>
#include <linux/module.h>
@@ -29,7 +30,6 @@
#include <media/v4l2-common.h>
#include <media/tuner.h>

#include "cx231xx.h"
#include "cx231xx-reg.h"

/* #define ENABLE_DEBUG_ISOC_FRAMES */
@@ -228,7 +228,7 @@ int cx231xx_send_usb_command(struct cx231xx_i2c *i2c_bus,
	/* call common vendor command request */
	status = cx231xx_send_vendor_cmd(dev, &ven_req);
	if (status < 0) {
		cx231xx_info
		pr_info
		    ("UsbInterface::sendCommand, failed with status -%d\n",
		     status);
	}
@@ -524,7 +524,7 @@ int cx231xx_set_video_alternate(struct cx231xx *dev)
		    usb_set_interface(dev->udev, usb_interface_index,
				      dev->video_mode.alt);
		if (errCode < 0) {
			cx231xx_errdev
			pr_err
			    ("cannot change alt number to %d (error=%i)\n",
			     dev->video_mode.alt, errCode);
			return errCode;
@@ -600,7 +600,7 @@ int cx231xx_set_alt_setting(struct cx231xx *dev, u8 index, u8 alt)
	}

	if (alt > 0 && max_pkt_size == 0) {
		cx231xx_errdev
		pr_err
		("can't change interface %d alt no. to %d: Max. Pkt size = 0\n",
		usb_interface_index, alt);
		/*To workaround error number=-71 on EP0 for videograbber,
@@ -616,7 +616,7 @@ int cx231xx_set_alt_setting(struct cx231xx *dev, u8 index, u8 alt)
	if (usb_interface_index > 0) {
		status = usb_set_interface(dev->udev, usb_interface_index, alt);
		if (status < 0) {
			cx231xx_errdev
			pr_err
			("can't change interface %d alt no. to %d (err=%i)\n",
			usb_interface_index, alt, status);
			return status;
@@ -768,7 +768,7 @@ int cx231xx_ep5_bulkout(struct cx231xx *dev, u8 *firmware, u16 size)

	buffer = kzalloc(4096, GFP_KERNEL);
	if (buffer == NULL) {
		cx231xx_info("out of mem\n");
		pr_info("out of mem\n");
		return -ENOMEM;
	}
	memcpy(&buffer[0], firmware, 4096);
@@ -777,7 +777,7 @@ int cx231xx_ep5_bulkout(struct cx231xx *dev, u8 *firmware, u16 size)
			buffer, 4096, &actlen, 2000);

	if (ret)
		cx231xx_info("bulk message failed: %d (%d/%d)", ret,
		pr_info("bulk message failed: %d (%d/%d)", ret,
				size, actlen);
	else {
		errCode = actlen != size ? -1 : 0;
@@ -988,7 +988,7 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets,

	dma_q->p_left_data = kzalloc(4096, GFP_KERNEL);
	if (dma_q->p_left_data == NULL) {
		cx231xx_info("out of mem\n");
		pr_info("out of mem\n");
		return -ENOMEM;
	}

@@ -1018,14 +1018,14 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets,
	dev->video_mode.isoc_ctl.urb =
	    kzalloc(sizeof(void *) * num_bufs, GFP_KERNEL);
	if (!dev->video_mode.isoc_ctl.urb) {
		cx231xx_errdev("cannot alloc memory for usb buffers\n");
		pr_err("cannot alloc memory for usb buffers\n");
		return -ENOMEM;
	}

	dev->video_mode.isoc_ctl.transfer_buffer =
	    kzalloc(sizeof(void *) * num_bufs, GFP_KERNEL);
	if (!dev->video_mode.isoc_ctl.transfer_buffer) {
		cx231xx_errdev("cannot allocate memory for usbtransfer\n");
		pr_err("cannot allocate memory for usbtransfer\n");
		kfree(dev->video_mode.isoc_ctl.urb);
		return -ENOMEM;
	}
@@ -1045,7 +1045,7 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets,
	for (i = 0; i < dev->video_mode.isoc_ctl.num_bufs; i++) {
		urb = usb_alloc_urb(max_packets, GFP_KERNEL);
		if (!urb) {
			cx231xx_err("cannot alloc isoc_ctl.urb %i\n", i);
			pr_err("cannot alloc isoc_ctl.urb %i\n", i);
			cx231xx_uninit_isoc(dev);
			return -ENOMEM;
		}
@@ -1055,7 +1055,7 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets,
		    usb_alloc_coherent(dev->udev, sb_size, GFP_KERNEL,
				       &urb->transfer_dma);
		if (!dev->video_mode.isoc_ctl.transfer_buffer[i]) {
			cx231xx_err("unable to allocate %i bytes for transfer"
			pr_err("unable to allocate %i bytes for transfer"
				    " buffer %i%s\n",
				    sb_size, i,
				    in_interrupt() ? " while in int" : "");
@@ -1090,7 +1090,7 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets,
		rc = usb_submit_urb(dev->video_mode.isoc_ctl.urb[i],
				    GFP_ATOMIC);
		if (rc) {
			cx231xx_err("submit of urb %i failed (error=%i)\n", i,
			pr_err("submit of urb %i failed (error=%i)\n", i,
				    rc);
			cx231xx_uninit_isoc(dev);
			return rc;
@@ -1151,14 +1151,14 @@ int cx231xx_init_bulk(struct cx231xx *dev, int max_packets,
	dev->video_mode.bulk_ctl.urb =
	    kzalloc(sizeof(void *) * num_bufs, GFP_KERNEL);
	if (!dev->video_mode.bulk_ctl.urb) {
		cx231xx_errdev("cannot alloc memory for usb buffers\n");
		pr_err("cannot alloc memory for usb buffers\n");
		return -ENOMEM;
	}

	dev->video_mode.bulk_ctl.transfer_buffer =
	    kzalloc(sizeof(void *) * num_bufs, GFP_KERNEL);
	if (!dev->video_mode.bulk_ctl.transfer_buffer) {
		cx231xx_errdev("cannot allocate memory for usbtransfer\n");
		pr_err("cannot allocate memory for usbtransfer\n");
		kfree(dev->video_mode.bulk_ctl.urb);
		return -ENOMEM;
	}
@@ -1178,7 +1178,7 @@ int cx231xx_init_bulk(struct cx231xx *dev, int max_packets,
	for (i = 0; i < dev->video_mode.bulk_ctl.num_bufs; i++) {
		urb = usb_alloc_urb(0, GFP_KERNEL);
		if (!urb) {
			cx231xx_err("cannot alloc bulk_ctl.urb %i\n", i);
			pr_err("cannot alloc bulk_ctl.urb %i\n", i);
			cx231xx_uninit_bulk(dev);
			return -ENOMEM;
		}
@@ -1189,7 +1189,7 @@ int cx231xx_init_bulk(struct cx231xx *dev, int max_packets,
		    usb_alloc_coherent(dev->udev, sb_size, GFP_KERNEL,
				     &urb->transfer_dma);
		if (!dev->video_mode.bulk_ctl.transfer_buffer[i]) {
			cx231xx_err("unable to allocate %i bytes for transfer"
			pr_err("unable to allocate %i bytes for transfer"
				    " buffer %i%s\n",
				    sb_size, i,
				    in_interrupt() ? " while in int" : "");
@@ -1212,7 +1212,7 @@ int cx231xx_init_bulk(struct cx231xx *dev, int max_packets,
		rc = usb_submit_urb(dev->video_mode.bulk_ctl.urb[i],
				    GFP_ATOMIC);
		if (rc) {
			cx231xx_err("submit of urb %i failed (error=%i)\n", i,
			pr_err("submit of urb %i failed (error=%i)\n", i,
				    rc);
			cx231xx_uninit_bulk(dev);
			return rc;
@@ -1316,7 +1316,7 @@ int cx231xx_dev_init(struct cx231xx *dev)
		errCode = cx231xx_set_power_mode(dev,
				 POLARIS_AVMODE_ENXTERNAL_AV);
		if (errCode < 0) {
			cx231xx_errdev
			pr_err
			("%s: Failed to set Power - errCode [%d]!\n",
			__func__, errCode);
			return errCode;
@@ -1325,7 +1325,7 @@ int cx231xx_dev_init(struct cx231xx *dev)
		errCode = cx231xx_set_power_mode(dev,
				 POLARIS_AVMODE_ANALOGT_TV);
		if (errCode < 0) {
			cx231xx_errdev
			pr_err
			("%s: Failed to set Power - errCode [%d]!\n",
			__func__, errCode);
			return errCode;
@@ -1340,14 +1340,14 @@ int cx231xx_dev_init(struct cx231xx *dev)
	/* initialize Colibri block */
	errCode = cx231xx_afe_init_super_block(dev, 0x23c);
	if (errCode < 0) {
		cx231xx_errdev
		pr_err
		    ("%s: cx231xx_afe init super block - errCode [%d]!\n",
		     __func__, errCode);
		return errCode;
	}
	errCode = cx231xx_afe_init_channels(dev);
	if (errCode < 0) {
		cx231xx_errdev
		pr_err
		    ("%s: cx231xx_afe init channels - errCode [%d]!\n",
		     __func__, errCode);
		return errCode;
@@ -1356,7 +1356,7 @@ int cx231xx_dev_init(struct cx231xx *dev)
	/* Set DIF in By pass mode */
	errCode = cx231xx_dif_set_standard(dev, DIF_USE_BASEBAND);
	if (errCode < 0) {
		cx231xx_errdev
		pr_err
		    ("%s: cx231xx_dif set to By pass mode - errCode [%d]!\n",
		     __func__, errCode);
		return errCode;
@@ -1365,7 +1365,7 @@ int cx231xx_dev_init(struct cx231xx *dev)
	/* I2S block related functions */
	errCode = cx231xx_i2s_blk_initialize(dev);
	if (errCode < 0) {
		cx231xx_errdev
		pr_err
		    ("%s: cx231xx_i2s block initialize - errCode [%d]!\n",
		     __func__, errCode);
		return errCode;
@@ -1374,7 +1374,7 @@ int cx231xx_dev_init(struct cx231xx *dev)
	/* init control pins */
	errCode = cx231xx_init_ctrl_pin_status(dev);
	if (errCode < 0) {
		cx231xx_errdev("%s: cx231xx_init ctrl pins - errCode [%d]!\n",
		pr_err("%s: cx231xx_init ctrl pins - errCode [%d]!\n",
			       __func__, errCode);
		return errCode;
	}
@@ -1400,7 +1400,7 @@ int cx231xx_dev_init(struct cx231xx *dev)
		break;
	}
	if (errCode < 0) {
		cx231xx_errdev
		pr_err
		    ("%s: cx231xx_AGC mode to Analog - errCode [%d]!\n",
		     __func__, errCode);
		return errCode;
@@ -1477,7 +1477,7 @@ int cx231xx_send_gpio_cmd(struct cx231xx *dev, u32 gpio_bit, u8 *gpio_val,
	/* call common vendor command request */
	status = cx231xx_send_vendor_cmd(dev, &ven_req);
	if (status < 0) {
		cx231xx_info
		pr_info
		    ("UsbInterface::sendCommand, failed with status -%d\n",
		     status);
	}
Loading