Fixes several CodingStyle issues on the driver.
Signed-off-by: Srinivasa Deevi <srinivasa.deevi@conexant.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
snd_pcm_stream_lock(substream);
dev->adev.hwptr_done_capture += length;
- if (dev->adev.hwptr_done_capture >= runtime->buffer_size)
- dev->adev.hwptr_done_capture -= runtime->buffer_size;
+ if (dev->adev.hwptr_done_capture >=
+ runtime->buffer_size)
+ dev->adev.hwptr_done_capture -=
+ runtime->buffer_size;
dev->adev.capture_transfer_done += length;
- if (dev->adev.capture_transfer_done >= runtime->period_size) {
- dev->adev.capture_transfer_done -= runtime->period_size;
+ if (dev->adev.capture_transfer_done >=
+ runtime->period_size) {
+ dev->adev.capture_transfer_done -=
+ runtime->period_size;
period_elapsed = 1;
}
snd_pcm_stream_unlock(substream);
urb->dev = dev->udev;
urb->context = dev;
- urb->pipe = usb_rcvisocpipe(dev->udev, dev->adev.end_point_addr);
+ urb->pipe = usb_rcvisocpipe(dev->udev,
+ dev->adev.end_point_addr);
urb->transfer_flags = URB_ISO_ASAP;
urb->transfer_buffer = dev->adev.transfer_buffer[i];
urb->interval = 1;
urb->number_of_packets = CX231XX_NUM_AUDIO_PACKETS;
urb->transfer_buffer_length = sb_size;
- for (j = k = 0; j < CX231XX_NUM_AUDIO_PACKETS; j++, k += dev->adev.max_pkt_size) {
+ for (j = k = 0; j < CX231XX_NUM_AUDIO_PACKETS;
+ j++, k += dev->adev.max_pkt_size) {
urb->iso_frame_desc[j].offset = k;
urb->iso_frame_desc[j].length = dev->adev.max_pkt_size;
}
dev->mute = 0;
/* set alternate setting for audio interface */
- ret = cx231xx_set_alt_setting(dev, INDEX_AUDIO, 1); /* 1 - 48000 samples per sec */
+ /* 1 - 48000 samples per sec */
+ ret = cx231xx_set_alt_setting(dev, INDEX_AUDIO, 1);
if (ret < 0) {
cx231xx_errdev("failed to set alternate setting !\n");
dprintk("closing device\n");
/* set alternate setting for audio interface */
- ret = cx231xx_set_alt_setting(dev, INDEX_AUDIO, 0); /* 1 - 48000 samples per sec */
+ /* 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");
&colibri_power_status, 1);
colibri_power_status &= 0xff;
if (status < 0) {
- cx231xx_info(": Init Super Block failed in sending/receiving cmds\n");
+ cx231xx_info(
+ ": Init Super Block failed in send/receive cmds\n");
break;
}
i++;
if (i == 10) {
- cx231xx_info(": Init Super Block force break in loop !!!!\n");
+ cx231xx_info(
+ ": Init Super Block force break in loop !!!!\n");
status = -1;
break;
}
break;
}
- if ((mode != dev->colibri_mode) && (dev->video_input == CX231XX_VMUX_TELEVISION))
+ if ((mode != dev->colibri_mode) &&
+ (dev->video_input == CX231XX_VMUX_TELEVISION))
status = cx231xx_colibri_adjust_ref_count(dev,
CX231XX_VMUX_TELEVISION);
status = cx231xx_set_power_mode(dev,
POLARIS_AVMODE_ENXTERNAL_AV);
if (status < 0) {
- cx231xx_errdev("%s: cx231xx_set_power_mode : Failed to set Power - errCode [%d]!\n",
- __func__, status);
+ cx231xx_errdev("%s: set_power_mode : Failed to"
+ " set Power - errCode [%d]!\n",
+ __func__, status);
return status;
}
}
status = cx231xx_set_power_mode(dev,
POLARIS_AVMODE_ANALOGT_TV);
if (status < 0) {
- cx231xx_errdev("%s: cx231xx_set_power_mode : Failed to set Power - errCode [%d]!\n",
- __func__, status);
+ cx231xx_errdev("%s: set_power_mode:Failed"
+ " to set Power - errCode [%d]!\n",
+ __func__, status);
return status;
}
}
INPUT(input)->vmux);
break;
default:
- cx231xx_errdev("%s: cx231xx_set_power_mode : Unknown Input %d !\n",
+ cx231xx_errdev("%s: set_power_mode : Unknown Input %d !\n",
__func__, INPUT(input)->type);
break;
}
return status;
}
-int cx231xx_set_decoder_video_input(struct cx231xx *dev, u8 pin_type, u8 input)
+int cx231xx_set_decoder_video_input(struct cx231xx *dev,
+ u8 pin_type, u8 input)
{
int status = 0;
u32 value = 0;
if (pin_type != dev->video_input) {
status = cx231xx_colibri_adjust_ref_count(dev, pin_type);
if (status < 0) {
- cx231xx_errdev("%s: cx231xx_colibri_adjust_ref_count :Failed to set Colibri input mux - errCode [%d]!\n",
- __func__, status);
+ cx231xx_errdev("%s: adjust_ref_count :Failed to set"
+ "Colibri input mux - errCode [%d]!\n",
+ __func__, status);
return status;
}
}
/* call colibri block to set video inputs */
status = cx231xx_colibri_set_input_mux(dev, input);
if (status < 0) {
- cx231xx_errdev("%s: cx231xx_colibri_set_input_mux :Failed to set Colibri input mux - errCode [%d]!\n",
- __func__, status);
+ cx231xx_errdev("%s: set_input_mux :Failed to set"
+ " Colibri input mux - errCode [%d]!\n",
+ __func__, status);
return status;
}
value |= (0 << 13) | (1 << 4);
value &= ~(1 << 5);
- value &= (~(0x1ff8000)); /* set [24:23] [22:15] to 0 */
- value |= 0x1000000; /* set FUNC_MODE[24:23] = 2 IF_MOD[22:15] = 0 */
+ /* set [24:23] [22:15] to 0 */
+ value &= (~(0x1ff8000));
+ /* set FUNC_MODE[24:23] = 2 IF_MOD[22:15] = 0 */
+ value |= 0x1000000;
status = cx231xx_write_i2c_data(dev, HAMMERHEAD_I2C_ADDRESS,
AFE_CTRL, 2, value, 4);
/* 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 mode - errCode [%d]!\n",
+ cx231xx_errdev("%s: cx231xx_dif set to By pass"
+ " mode- errCode [%d]!\n",
__func__, status);
return status;
}
status = cx231xx_read_i2c_data(dev, HAMMERHEAD_I2C_ADDRESS,
AFE_CTRL, 2, &value, 4);
- value &= (~(0x1ff8000)); /* set [24:23] [22:15] to 0 */
- value |= 0x1000010; /* set FUNC_MODE[24:23] = 2
- IF_MOD[22:15] = 0 DCR_BYP_CH2[4:4] = 1; */
+ /* set [24:23] [22:15] to 0 */
+ value &= (~(0x1ff8000));
+ /* set FUNC_MODE[24:23] = 2
+ IF_MOD[22:15] = 0 DCR_BYP_CH2[4:4] = 1; */
+ value |= 0x1000010;
status = cx231xx_write_i2c_data(dev,
HAMMERHEAD_I2C_ADDRESS,
AFE_CTRL, 2, value, 4);
/* 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 mode - errCode [%d]!\n",
+ cx231xx_errdev("%s: cx231xx_dif set to By pass"
+ " mode- errCode [%d]!\n",
__func__, status);
return status;
}
value |= (0 << 13) | (1 << 4);
value &= ~(1 << 5);
- value &= (~(0x1FF8000)); /* set [24:23] [22:15] to 0 */
- value |= 0x1000000; /* set FUNC_MODE[24:23] = 2 IF_MOD[22:15] = 0 */
+ /* set [24:23] [22:15] to 0 */
+ value &= (~(0x1FF8000));
+ /* set FUNC_MODE[24:23] = 2 IF_MOD[22:15] = 0 */
+ value |= 0x1000000;
status = cx231xx_write_i2c_data(dev,
HAMMERHEAD_I2C_ADDRESS,
AFE_CTRL, 2,
status = cx231xx_dif_set_standard(dev,
DIF_USE_BASEBAND);
if (status < 0) {
- cx231xx_errdev("%s: cx231xx_dif set to By pass mode - errCode [%d]!\n",
- __func__, status);
+ cx231xx_errdev("%s: cx231xx_dif set to By pass"
+ " mode- errCode [%d]!\n",
+ __func__, status);
return status;
}
status = cx231xx_read_modify_write_i2c_dword(dev,
HAMMERHEAD_I2C_ADDRESS,
MODE_CTRL, FLD_INPUT_MODE,
- cx231xx_set_field(FLD_INPUT_MODE, INPUT_MODE_CVBS_0));
+ cx231xx_set_field(FLD_INPUT_MODE,
+ INPUT_MODE_CVBS_0));
break;
default:
/* Enable the DIF for the tuner */
/* Reinitialize the DIF */
status = cx231xx_dif_set_standard(dev, dev->norm);
if (status < 0) {
- cx231xx_errdev("%s: cx231xx_dif set to By pass mode - errCode [%d]!\n",
- __func__, status);
+ cx231xx_errdev("%s: cx231xx_dif set to By pass"
+ " mode- errCode [%d]!\n",
+ __func__, status);
return status;
}
status = cx231xx_read_modify_write_i2c_dword(dev,
HAMMERHEAD_I2C_ADDRESS,
MODE_CTRL, FLD_INPUT_MODE,
- cx231xx_set_field(FLD_INPUT_MODE, INPUT_MODE_CVBS_0));
+ cx231xx_set_field(FLD_INPUT_MODE,
+ INPUT_MODE_CVBS_0));
- /* Set some bits in AFE_CTRL so that channel 2 or 3 is ready to receive audio */
+ /* Set some bits in AFE_CTRL so that channel 2 or 3
+ * is ready to receive audio */
/* Clear clamp for channels 2 and 3 (bit 16-17) */
/* Clear droop comp (bit 19-20) */
/* Set VGA_SEL (for audio control) (bit 7-8) */
}
/*
- * Handle any video-mode specific overrides that are different on a per video standards
- * basis after touching the MODE_CTRL register which resets many values for autodetect
+ * Handle any video-mode specific overrides that are different
+ * on a per video standards basis after touching the MODE_CTRL
+ * register which resets many values for autodetect
*/
int cx231xx_do_mode_ctrl_overrides(struct cx231xx *dev)
{
DFE_CTRL3, 2,
0xCD3F0280, 4);
- if (dev->norm & (V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_JP | V4L2_STD_PAL_M)) {
+ if (dev->norm & (V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_JP |
+ V4L2_STD_PAL_M)) {
cx231xx_info("do_mode_ctrl_overrides NTSC\n");
/* Move the close caption lines out of active video,
if (mode == V4L2_TUNER_RADIO) {
/* C2HH */
- status = cx231xx_reg_mask_write(dev, HAMMERHEAD_I2C_ADDRESS, 32,
- AFE_CTRL_C2HH_SRC_CTRL, 30, 31, 0x1); /* lo if big signal */
- status = cx231xx_reg_mask_write(dev, HAMMERHEAD_I2C_ADDRESS, 32,
- AFE_CTRL_C2HH_SRC_CTRL, 23, 24, function_mode); /* FUNC_MODE = DIF */
- status = cx231xx_reg_mask_write(dev, HAMMERHEAD_I2C_ADDRESS, 32,
- AFE_CTRL_C2HH_SRC_CTRL, 15, 22, 0xFF); /* IF_MODE */
- status = cx231xx_reg_mask_write(dev, HAMMERHEAD_I2C_ADDRESS, 32,
- AFE_CTRL_C2HH_SRC_CTRL, 9, 9, 0x1); /* no inv */
+ /* lo if big signal */
+ status = cx231xx_reg_mask_write(dev,
+ HAMMERHEAD_I2C_ADDRESS, 32,
+ AFE_CTRL_C2HH_SRC_CTRL, 30, 31, 0x1);
+ /* FUNC_MODE = DIF */
+ status = cx231xx_reg_mask_write(dev,
+ HAMMERHEAD_I2C_ADDRESS, 32,
+ AFE_CTRL_C2HH_SRC_CTRL, 23, 24, function_mode);
+ /* IF_MODE */
+ status = cx231xx_reg_mask_write(dev,
+ HAMMERHEAD_I2C_ADDRESS, 32,
+ AFE_CTRL_C2HH_SRC_CTRL, 15, 22, 0xFF);
+ /* no inv */
+ status = cx231xx_reg_mask_write(dev,
+ HAMMERHEAD_I2C_ADDRESS, 32,
+ AFE_CTRL_C2HH_SRC_CTRL, 9, 9, 0x1);
} else {
switch (standard) {
case V4L2_STD_NTSC_M: /* 75 IRE Setup */
- case V4L2_STD_NTSC_M_JP: /* Japan, 0 IRE Setup */
+ case V4L2_STD_NTSC_M_JP:/* Japan, 0 IRE Setup */
case V4L2_STD_PAL_M:
case V4L2_STD_PAL_N:
case V4L2_STD_PAL_Nc:
+ /* lo if big signal */
status = cx231xx_reg_mask_write(dev,
HAMMERHEAD_I2C_ADDRESS, 32,
- AFE_CTRL_C2HH_SRC_CTRL, 30, 31, 0x1); /* lo if big signal */
+ AFE_CTRL_C2HH_SRC_CTRL, 30, 31, 0x1);
+ /* FUNC_MODE = DIF */
status = cx231xx_reg_mask_write(dev,
HAMMERHEAD_I2C_ADDRESS, 32,
AFE_CTRL_C2HH_SRC_CTRL, 23, 24,
- function_mode); /* FUNC_MODE = DIF */
+ function_mode);
+ /* IF_MODE */
status = cx231xx_reg_mask_write(dev,
HAMMERHEAD_I2C_ADDRESS, 32,
- AFE_CTRL_C2HH_SRC_CTRL, 15, 22, 0xb); /* IF_MODE */
+ AFE_CTRL_C2HH_SRC_CTRL, 15, 22, 0xb);
+ /* no inv */
status = cx231xx_reg_mask_write(dev,
HAMMERHEAD_I2C_ADDRESS, 32,
- AFE_CTRL_C2HH_SRC_CTRL, 9, 9, 0x1); /* no inv */
+ AFE_CTRL_C2HH_SRC_CTRL, 9, 9, 0x1);
+ /* 0x124, AUD_CHAN1_SRC = 0x3 */
status = cx231xx_reg_mask_write(dev,
HAMMERHEAD_I2C_ADDRESS, 32,
- AUD_IO_CTRL, 0, 31, 0x00000003); /* 0x124, AUD_CHAN1_SRC = 0x3 */
+ AUD_IO_CTRL, 0, 31, 0x00000003);
break;
case V4L2_STD_PAL_B:
case V4L2_STD_PAL_G:
/* C2HH setup */
+ /* lo if big signal */
status = cx231xx_reg_mask_write(dev,
HAMMERHEAD_I2C_ADDRESS, 32,
- AFE_CTRL_C2HH_SRC_CTRL, 30, 31, 0x1); /* lo if big signal */
+ AFE_CTRL_C2HH_SRC_CTRL, 30, 31, 0x1);
+ /* FUNC_MODE = DIF */
status = cx231xx_reg_mask_write(dev,
HAMMERHEAD_I2C_ADDRESS, 32,
AFE_CTRL_C2HH_SRC_CTRL, 23, 24,
- function_mode); /* FUNC_MODE = DIF */
+ function_mode);
+ /* IF_MODE */
status = cx231xx_reg_mask_write(dev,
HAMMERHEAD_I2C_ADDRESS, 32,
- AFE_CTRL_C2HH_SRC_CTRL, 15, 22, 0xE); /* IF_MODE */
+ AFE_CTRL_C2HH_SRC_CTRL, 15, 22, 0xE);
+ /* no inv */
status = cx231xx_reg_mask_write(dev,
HAMMERHEAD_I2C_ADDRESS, 32,
- AFE_CTRL_C2HH_SRC_CTRL, 9, 9, 0x1); /* no inv */
+ AFE_CTRL_C2HH_SRC_CTRL, 9, 9, 0x1);
break;
case V4L2_STD_PAL_D:
case V4L2_STD_SECAM_K:
case V4L2_STD_SECAM_K1:
/* C2HH setup */
+ /* lo if big signal */
status = cx231xx_reg_mask_write(dev,
HAMMERHEAD_I2C_ADDRESS, 32,
- AFE_CTRL_C2HH_SRC_CTRL, 30, 31, 0x1); /* lo if big signal */
+ AFE_CTRL_C2HH_SRC_CTRL, 30, 31, 0x1);
+ /* FUNC_MODE = DIF */
status = cx231xx_reg_mask_write(dev,
HAMMERHEAD_I2C_ADDRESS, 32,
AFE_CTRL_C2HH_SRC_CTRL, 23, 24,
- function_mode); /* FUNC_MODE = DIF */
+ function_mode);
+ /* IF_MODE */
status = cx231xx_reg_mask_write(dev,
HAMMERHEAD_I2C_ADDRESS, 32,
- AFE_CTRL_C2HH_SRC_CTRL, 15, 22, 0xF); /* IF_MODE */
+ AFE_CTRL_C2HH_SRC_CTRL, 15, 22, 0xF);
+ /* no inv */
status = cx231xx_reg_mask_write(dev,
HAMMERHEAD_I2C_ADDRESS, 32,
- AFE_CTRL_C2HH_SRC_CTRL, 9, 9, 0x1); /* no inv */
+ AFE_CTRL_C2HH_SRC_CTRL, 9, 9, 0x1);
break;
case DIF_USE_BASEBAND:
status = cx231xx_write_ctrl_reg(dev, VRT_SET_REGISTER,
PWR_CTL_EN, value, 4);
- dev->xc_fw_load_done = 0; /* reset state of xceive tuner */
+ /* reset state of xceive tuner */
+ dev->xc_fw_load_done = 0;
break;
case POLARIS_AVMODE_ANALOGT_TV:
status = cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, PWR_CTL_EN, value,
4);
- cx231xx_info(" The data of PWR_CTL_EN register 0x74=0x%0x,0x%0x,0x%0x,0x%0x\n",
+ cx231xx_info(" The data of PWR_CTL_EN register 0x74"
+ "=0x%0x,0x%0x,0x%0x,0x%0x\n",
value[0], value[1], value[2], value[3]);
return status;
{
int rc;
u32 ep_mask = -1;
- PPCB_CONFIG pcb_config;
+ struct pcb_config *pcb_config;
/* get EP for media type */
- pcb_config = &dev->current_pcb_config;
+ pcb_config = (struct pcb_config *)&dev->current_pcb_config;
if (pcb_config->config_num == 1) {
switch (media_type) {
rc = cx231xx_stop_stream(dev, ep_mask);
}
+ if (dev->mode == CX231XX_ANALOG_MODE)
+ ;/* do any in Analog mode */
+ else
+ ;/* do any in digital mode */
return rc;
}
status = cx231xx_get_gpio_bit(dev, dev->gpio_dir,
(u8 *)&dev->gpio_val);
nCnt--;
- } while (((dev->gpio_val & (1 << dev->board.tuner_scl_gpio)) == 0) && (nCnt > 0));
+ } while (((dev->gpio_val &
+ (1 << dev->board.tuner_scl_gpio)) == 0) &&
+ (nCnt > 0));
if (nCnt == 0)
- cx231xx_info("No ACK after %d msec for clock stretch. GPIO I2C operation failed!",
+ cx231xx_info("No ACK after %d msec -GPIO I2C failed!",
nInit * 10);
/* readAck
/*
- cx231xx-cards.c - driver for Conexant Cx23100/101/102 USB video capture devices
+ cx231xx-cards.c - driver for Conexant Cx23100/101/102
+ USB video capture devices
Copyright (C) 2008 <srinivasa.deevi at conexant dot com>
- Based on em28xx driver
+ Based on em28xx driver
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
.amux =
CX231XX_AMUX_LINE_IN,
.gpio = 0,
- }},
+ } },
},
[CX231XX_BOARD_CNXT_RDE_250] = {
.amux =
CX231XX_AMUX_LINE_IN,
.gpio = 0,
- }},
+ } },
},
[CX231XX_BOARD_CNXT_RDU_250] = {
.amux =
CX231XX_AMUX_LINE_IN,
.gpio = 0,
- }},
+ } },
},
};
const unsigned int cx231xx_bcount = ARRAY_SIZE(cx231xx_boards);
if (dev->tuner_type == TUNER_XC5000) {
if (command == XC5000_TUNER_RESET) {
cx231xx_info
- ("Tuner Call back : RESET : command %d : tuner type %d \n",
- command, dev->tuner_type);
-
+ ("Tuner CB: RESET: cmd %d : tuner type %d \n",
+ command, dev->tuner_type);
cx231xx_set_gpio_value(dev, dev->board.tuner_gpio->bit,
1);
msleep(10);
}
return rc;
}
-
EXPORT_SYMBOL_GPL(cx231xx_tuner_callback);
-static void inline cx231xx_set_model(struct cx231xx *dev)
+static inline void cx231xx_set_model(struct cx231xx *dev)
{
memcpy(&dev->board, &cx231xx_boards[dev->model], sizeof(dev->board));
}
return 0;
- fail_reg_devices:
+fail_reg_devices:
mutex_unlock(&dev->lock);
return retval;
}
dev->has_alsa_audio = 1;
dev->power_mode = -1;
- dev->vbi_or_sliced_cc_mode = 0; /* 0 - vbi ; 1 -sliced cc mode */
+ /* 0 - vbi ; 1 -sliced cc mode */
+ dev->vbi_or_sliced_cc_mode = 0;
/* get maximum no.of IAD interfaces */
assoc_desc = udev->actconfig->intf_assoc[0];
dev->max_iad_interface_count = assoc_desc->bInterfaceCount;
- cx231xx_info(": Found IAD interface count %d\n",
+ cx231xx_info("Found IAD interface count %d\n",
dev->max_iad_interface_count);
/* init CIR module TBD */
assoc_desc = udev->actconfig->intf_assoc[0];
if (assoc_desc->bFirstInterface == ifnum) {
cx231xx_info
- (": Found IAD interface match: AV Descriptor Start!! \n");
+ ("Found IAD interface match: AV Desc Start!! \n");
} else {
- cx231xx_err(DRIVER_NAME
- " Not found matching interface\n");
+ cx231xx_err(" Not found matching interface\n");
return -ENODEV;
}
skip_interface = 1; /* set skipping */
else {
cx231xx_info
- (": Found IAD interface number match with AV Device number!! \n");
+ ("Found IAD interface no. match with AV Device no.!\n");
}
}
/*
- cx231xx-core.c - driver for Conexant Cx23100/101/102 USB video capture devices
+ cx231xx-core.c - driver for Conexant Cx23100/101/102
+ USB video capture devices
Copyright (C) 2008 <srinivasa.deevi at conexant dot com>
- Based on em28xx driver
+ Based on em28xx driver
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
printk(KERN_INFO "%s %s :"fmt, \
dev->name, __func__ , ##arg); } while (0)
-/************************************************************************************
-* Device control list functions *
-*************************************************************************************/
+/*****************************************************************
+* Device control list functions *
+******************************************************************/
static LIST_HEAD(cx231xx_devlist);
static DEFINE_MUTEX(cx231xx_devlist_mutex);
mutex_unlock(&cx231xx_devlist_mutex);
return 0;
}
-
EXPORT_SYMBOL(cx231xx_register_extension);
void cx231xx_unregister_extension(struct cx231xx_ops *ops)
mutex_unlock(&cx231xx_extension_devlist_lock);
mutex_unlock(&cx231xx_devlist_mutex);
}
-
EXPORT_SYMBOL(cx231xx_unregister_extension);
void cx231xx_init_extension(struct cx231xx *dev)
mutex_unlock(&cx231xx_extension_devlist_lock);
}
-/************************************************************************************
-* U S B related functions *
-*************************************************************************************/
+/****************************************************************
+* U S B related functions *
+*****************************************************************/
int cx231xx_send_usb_command(struct cx231xx_i2c *i2c_bus,
struct cx231xx_i2c_xfer_data *req_data)
{
int status = 0;
struct cx231xx *dev = i2c_bus->dev;
- VENDOR_REQUEST_IN ven_req;
+ struct VENDOR_REQUEST_IN ven_req;
u8 saddr_len = 0;
u8 _i2c_period = 0;
_i2c_nostop << 1 | I2C_SYNC | _i2c_reserve << 6;
/* set channel number */
- if (req_data->direction & I2C_M_RD)
- ven_req.bRequest = i2c_bus->nr + 4; /* channel number, for read,
- spec required channel_num +4 */
- else
+ if (req_data->direction & I2C_M_RD) {
+ /* channel number, for read,spec required channel_num +4 */
+ ven_req.bRequest = i2c_bus->nr + 4;
+ } else
ven_req.bRequest = i2c_bus->nr; /* channel number, */
/* set index value */
status = cx231xx_send_vendor_cmd(dev, &ven_req);
if (status < 0) {
cx231xx_info
- ("UsbInterface::sendCommand, output buffer failed with status -%d\n",
+ ("UsbInterface::sendCommand, failed with status -%d\n",
status);
}
return status;
}
-
EXPORT_SYMBOL_GPL(cx231xx_send_usb_command);
+
/*
* cx231xx_read_ctrl_reg()
* reads data from the usb device specifying bRequest and wValue
return ret;
}
-int cx231xx_send_vendor_cmd(struct cx231xx *dev, VENDOR_REQUEST_IN * ven_req)
+int cx231xx_send_vendor_cmd(struct cx231xx *dev,
+ struct VENDOR_REQUEST_IN *ven_req)
{
int ret;
int pipe = 0;
int byte;
cx231xx_isocdbg("(pipe 0x%08x): "
- "OUT: %02x %02x %02x %02x %02x %02x %02x %02x >>>",
- pipe,
- USB_DIR_OUT | USB_TYPE_VENDOR |
- USB_RECIP_DEVICE, req, 0, val, reg & 0xff,
- reg >> 8, len & 0xff, len >> 8);
+ "OUT: %02x %02x %02x %02x %02x %02x %02x %02x >>>",
+ pipe,
+ USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+ req, 0, val, reg & 0xff,
+ reg >> 8, len & 0xff, len >> 8);
for (byte = 0; byte < len; byte++)
cx231xx_isocdbg(" %02x", (unsigned char)buf[byte]);
return ret;
}
-/************************************************************************************
-* USB Alternate Setting functions *
-*************************************************************************************/
+/****************************************************************
+* USB Alternate Setting functions *
+*****************************************************************/
int cx231xx_set_video_alternate(struct cx231xx *dev)
{
dev->video_mode.alt,
dev->video_mode.max_pkt_size);
cx231xx_info
- (" setting alternate %d with wMaxPacketSize=%u , Interface = %d\n",
+ (" setting alt %d with wMaxPktSize=%u , Interface = %d\n",
dev->video_mode.alt, dev->video_mode.max_pkt_size,
usb_interface_index);
errCode =
dev->video_mode.alt);
if (errCode < 0) {
cx231xx_errdev
- ("cannot change alternate number to %d (error=%i)\n",
+ ("cannot change alt number to %d (error=%i)\n",
dev->video_mode.alt, errCode);
return errCode;
}
if (alt > 0 && max_pkt_size == 0) {
cx231xx_errdev
- ("cannot change interface %d alternate number to %d : Max. Pkt size is ZERO\n",
- usb_interface_index, alt);
+ ("can't change interface %d alt no. to %d: Max. Pkt size = 0\n",
+ usb_interface_index, alt);
return -1;
}
status = usb_set_interface(dev->udev, usb_interface_index, alt);
if (status < 0) {
cx231xx_errdev
- ("cannot change interface %d alternate number to %d (error=%i)\n",
- usb_interface_index, alt, status);
+ ("can't change interface %d alt no. to %d (err=%i)\n",
+ usb_interface_index, alt, status);
return status;
}
}
return status;
}
-
EXPORT_SYMBOL_GPL(cx231xx_set_alt_setting);
int cx231xx_gpio_set(struct cx231xx *dev, struct cx231xx_reg_seq *gpio)
dev->mode = set_mode;
- if (dev->mode == CX231XX_DIGITAL_MODE) {
- /* Set Digital power mode */
- } else {
- /* Set Analog Power mode */
- }
+ if (dev->mode == CX231XX_DIGITAL_MODE)
+ ;/* Set Digital power mode */
+ else
+ ;/* Set Analog Power mode */
+
return 0;
}
-
EXPORT_SYMBOL_GPL(cx231xx_set_mode);
-/************************************************************************************
-* URB Streaming functions *
-*************************************************************************************/
+/*****************************************************************
+* URB Streaming functions *
+******************************************************************/
/*
* IRQ callback, called by URB callback
cx231xx_capture_start(dev, 0, Raw_Video);
}
-
EXPORT_SYMBOL_GPL(cx231xx_uninit_isoc);
/*
*/
int cx231xx_init_isoc(struct cx231xx *dev, int max_packets,
int num_bufs, int max_pkt_size,
- int (*isoc_copy) (struct cx231xx * dev, struct urb * urb))
+ int (*isoc_copy) (struct cx231xx *dev, struct urb *urb))
{
struct cx231xx_dmaqueue *dma_q = &dev->video_mode.vidq;
int i;
cx231xx_err("unable to allocate %i bytes for transfer"
" buffer %i%s\n",
sb_size, i,
- in_interrupt()? " while in int" : "");
+ in_interrupt() ? " while in int" : "");
cx231xx_uninit_isoc(dev);
return -ENOMEM;
}
return 0;
}
-
EXPORT_SYMBOL_GPL(cx231xx_init_isoc);
-/************************************************************************************
-* Device Init/UnInit functions *
-*************************************************************************************/
+/*****************************************************************
+* Device Init/UnInit functions *
+******************************************************************/
int cx231xx_dev_init(struct cx231xx *dev)
{
int errCode = 0;
cx231xx_i2c_register(&dev->i2c_bus[2]);
/* init hardware */
- /* Note : with out calling set power mode function, colibri can not be set up correctly */
+ /* Note : with out calling set power mode function,
+ colibri can not be set up correctly */
errCode = cx231xx_set_power_mode(dev, POLARIS_AVMODE_ANALOGT_TV);
if (errCode < 0) {
cx231xx_errdev
- ("%s: cx231xx_set_power_mode : Failed to set Power - errCode [%d]!\n",
+ ("%s: Failed to set Power - errCode [%d]!\n",
__func__, errCode);
return errCode;
}
return errCode;
}
-
EXPORT_SYMBOL_GPL(cx231xx_dev_init);
void cx231xx_dev_uninit(struct cx231xx *dev)
cx231xx_i2c_unregister(&dev->i2c_bus[1]);
cx231xx_i2c_unregister(&dev->i2c_bus[0]);
}
-
EXPORT_SYMBOL_GPL(cx231xx_dev_uninit);
-/************************************************************************************
-* G P I O related functions *
-*************************************************************************************/
+/*****************************************************************
+* G P I O related functions *
+******************************************************************/
int cx231xx_send_gpio_cmd(struct cx231xx *dev, u32 gpio_bit, u8 * gpio_val,
u8 len, u8 request, u8 direction)
{
int status = 0;
- VENDOR_REQUEST_IN ven_req;
+ struct VENDOR_REQUEST_IN ven_req;
/* Set wValue */
ven_req.wValue = (u16) (gpio_bit >> 16 & 0xffff);
status = cx231xx_send_vendor_cmd(dev, &ven_req);
if (status < 0) {
cx231xx_info
- ("UsbInterface::sendCommand, output buffer failed with status -%d\n",
+ ("UsbInterface::sendCommand, failed with status -%d\n",
status);
}
return status;
}
-
EXPORT_SYMBOL_GPL(cx231xx_send_gpio_cmd);
-/*************************************************************************************
- * C O N T R O L - Register R E A D / W R I T E functions *
- *************************************************************************************/
+/*****************************************************************
+ * C O N T R O L - Register R E A D / W R I T E functions *
+ *****************************************************************/
int cx231xx_mode_register(struct cx231xx *dev, u16 address, u32 mode)
{
u8 value[4] = { 0x0, 0x0, 0x0, 0x0 };
return status;
}
-/*************************************************************************************
- * I 2 C Internal C O N T R O L functions *
- *************************************************************************************/
+/*****************************************************************
+ * I 2 C Internal C O N T R O L functions *
+ *****************************************************************/
int cx231xx_read_i2c_data(struct cx231xx *dev, u8 dev_addr, u16 saddr,
- u8 saddr_len, u32 * data, u8 data_len)
+ u8 saddr_len, u32 *data, u8 data_len)
{
int status = 0;
struct cx231xx_i2c_xfer_data req_data;
u32 mask = 0;
int i;
- if (bit_start > (size - 1) || bit_end > (size - 1)) {
+ if (bit_start > (size - 1) || bit_end > (size - 1))
return -1;
- }
if (size == 8) {
status =
&tmp, 4);
}
- if (status < 0) {
+ if (status < 0)
return status;
- }
mask = 1 << bit_end;
- for (i = bit_end; i > bit_start && i > 0; i--) {
+ for (i = bit_end; i > bit_start && i > 0; i--)
mask = mask + (1 << (i - 1));
- }
value <<= bit_start;
{
u32 temp;
- for (temp = field_mask; (temp & 1) == 0; temp >>= 1) {
+ for (temp = field_mask; (temp & 1) == 0; temp >>= 1)
data <<= 1;
- }
return data;
}
DVB device driver for cx231xx
Copyright (C) 2008 <srinivasa.deevi at conexant dot com>
- Based on em28xx driver
+ Based on em28xx driver
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
dvb_net_init(&dvb->adapter, &dvb->net, &dvb->demux.dmx);
return 0;
- fail_fe_conn:
+fail_fe_conn:
dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_mem);
- fail_fe_mem:
+fail_fe_mem:
dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_hw);
- fail_fe_hw:
+fail_fe_hw:
dvb_dmxdev_release(&dvb->dmxdev);
- fail_dmxdev:
+fail_dmxdev:
dvb_dmx_release(&dvb->demux);
- fail_dmx:
+fail_dmx:
dvb_unregister_frontend(dvb->frontend);
- fail_frontend:
+fail_frontend:
dvb_frontend_detach(dvb->frontend);
dvb_unregister_adapter(&dvb->adapter);
- fail_adapter:
+fail_adapter:
return result;
}
printk(KERN_INFO "Successfully loaded cx231xx-dvb\n");
return 0;
- out_free:
+out_free:
cx231xx_set_mode(dev, CX231XX_SUSPEND);
kfree(dvb);
dev->dvb = NULL;
cx231xx-i2c.c - driver for Conexant Cx23100/101/102 USB video capture devices
Copyright (C) 2008 <srinivasa.deevi at conexant dot com>
- Based on em28xx driver
- Based on Cx23885 driver
+ Based on em28xx driver
+ Based on Cx23885 driver
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#define dprintk1(lvl, fmt, args...) \
do { \
if (i2c_debug >= lvl) { \
- printk(fmt, ##args); \
- } \
+ printk(fmt, ##args); \
+ } \
} while (0)
#define dprintk2(lvl, fmt, args...) \
if (size == 2) { /* register write sub addr */
- /* Just writing sub address will cause problem to XC5000
- So ignore the request */
+ /* Just writing sub address will cause problem to XC5000
+ So ignore the request */
return 0;
} else if (size == 4) { /* register write with sub addr */
switch (saddr) {
case 0x0000: /* start tuner calibration mode */
need_gpio = 1;
- dev->xc_fw_load_done = 1; /* FW Loading is done */
+ /* FW Loading is done */
+ dev->xc_fw_load_done = 1;
break;
case 0x000D: /* Set signal source */
case 0x0001: /* Set TV standard - Video */
if (need_gpio) {
dprintk1(1,
- " GPIO W R I T E : addr 0x%x, len %d, saddr 0x%x\n",
- msg->addr, msg->len, saddr);
+ "GPIO WRITE: addr 0x%x, len %d, saddr 0x%x\n",
+ msg->addr, msg->len, saddr);
return dev->cx231xx_gpio_i2c_write(dev,
msg->addr,
switch (saddr) {
case 0x0009: /* BUSY check */
dprintk1(1,
- " GPIO R E A D : Special case BUSY check \n");
- /* Try to read BUSY register, just set it to zero */
+ "GPIO R E A D: Special case BUSY check \n");
+ /*Try read BUSY register, just set it to zero*/
msg->buf[0] = 0;
if (msg->len == 2)
msg->buf[1] = 0;
}
if (need_gpio) {
- /* this is a special case to handle Xceive tuner clock stretch issue
- with gpio based I2C interface */
+ /* this is a special case to handle Xceive tuner
+ clock stretch issue with gpio based I2C */
+
dprintk1(1,
- " GPIO R E A D : addr 0x%x, len %d, saddr 0x%x\n",
- msg->addr, msg->len,
- msg->buf[0] << 8 | msg->buf[1]);
+ "GPIO R E A D: addr 0x%x, len %d, saddr 0x%x\n",
+ msg->addr, msg->len,
+ msg->buf[0] << 8 | msg->buf[1]);
+
status =
dev->cx231xx_gpio_i2c_write(dev, msg->addr,
msg->buf,
if ((msg2->len < 16)) {
dprintk1(1,
- " i2c_read : addr 0x%x, len %d, subaddr 0x%x, leng %d\n",
- msg2->addr, msg2->len, saddr, msg1->len);
+ "i2c_read: addr 0x%x, len %d, saddr 0x%x, len %d\n",
+ msg2->addr, msg2->len, saddr, msg1->len);
switch (saddr) {
case 0x0008: /* read FW load status */
dprintk2(2, "%s %s addr=%x len=%d:",
(msgs[i].flags & I2C_M_RD) ? "read" : "write",
i == num - 1 ? "stop" : "nonstop", addr, msgs[i].len);
- if (!msgs[i].len) { /* no len: check only for device presence */
+ if (!msgs[i].len) {
+ /* no len: check only for device presence */
rc = cx231xx_i2c_check_for_device(i2c_adap, &msgs[i]);
if (rc < 0) {
dprintk2(2, " no device\n");
}
return num;
- err:
+err:
dprintk2(2, " ERROR: %i\n", rc);
return rc;
}
handle cx231xx IR remotes via linux kernel input layer.
Copyright (C) 2008 <srinivasa.deevi at conexant dot com>
- Based on em28xx driver
+ Based on em28xx driver
- < This is a place holder for IR now.>
+ < This is a place holder for IR now.>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
goto err_out_stop;
return 0;
- err_out_stop:
+err_out_stop:
cx231xx_ir_stop(ir);
dev->ir = NULL;
- err_out_free:
+err_out_free:
input_free_device(input_dev);
kfree(ir);
return err;
/*
- cx231xx-reg.h - driver for Conexant Cx23100/101/102 USB video capture devices
+ cx231xx-reg.h - driver for Conexant Cx23100/101/102
+ USB video capture devices
Copyright (C) 2008 <srinivasa.deevi at conexant dot com>
#define _CX231XX_REG_H
/*****************************************************************************
- * VBI codes *
+ * VBI codes *
*****************************************************************************/
#define SAV_ACTIVE_VIDEO_FIELD1 0x80
#define INPUT_MODE_YC2_2 2 /* INPUT_MODE_VALUE(2) */
#define INPUT_MODE_YUV_3 3 /* INPUT_MODE_VALUE(3) */
-#define LUMA_LPF_LOW_BANDPASS 0 /* 0.6Mhz lowpass filter bandwidth */
-#define LUMA_LPF_MEDIUM_BANDPASS 1 /* 1.0Mhz lowpass filter bandwidth */
-#define LUMA_LPF_HIGH_BANDPASS 2 /* 1.5Mhz lowpass filter bandwidth */
+#define LUMA_LPF_LOW_BANDPASS 0 /* 0.6Mhz LPF BW */
+#define LUMA_LPF_MEDIUM_BANDPASS 1 /* 1.0Mhz LPF BW */
+#define LUMA_LPF_HIGH_BANDPASS 2 /* 1.5Mhz LPF BW */
-#define UV_LPF_LOW_BANDPASS 0 /* 0.6Mhz lowpass filter bandwidth */
-#define UV_LPF_MEDIUM_BANDPASS 1 /* 1.0Mhz lowpass filter bandwidth */
-#define UV_LPF_HIGH_BANDPASS 2 /* 1.5Mhz lowpass filter bandwidth */
+#define UV_LPF_LOW_BANDPASS 0 /* 0.6Mhz LPF BW */
+#define UV_LPF_MEDIUM_BANDPASS 1 /* 1.0Mhz LPF BW */
+#define UV_LPF_HIGH_BANDPASS 2 /* 1.5Mhz LPF BW */
#define TWO_TAP_FILT 0
#define THREE_TAP_FILT 1
while (bytes_parsed < buffer_size) {
u32 bytes_used = 0;
- sav_eav = cx231xx_find_next_SAV_EAV(p_buffer + bytes_parsed, /* p_buffer */
- buffer_size - bytes_parsed, /* buffer size */
- &bytes_used); /* Receives bytes used to get SAV/EAV */
+ sav_eav = cx231xx_find_next_SAV_EAV(
+ p_buffer + bytes_parsed, /* p_buffer */
+ buffer_size - bytes_parsed, /* buffer size */
+ &bytes_used); /* bytes used to get SAV/EAV */
bytes_parsed += bytes_used;
sav_eav &= 0xF0;
if (sav_eav && (bytes_parsed < buffer_size)) {
bytes_parsed += cx231xx_get_vbi_line(dev,
- dma_q, sav_eav, /* SAV/EAV */
- p_buffer + bytes_parsed, /* p_buffer */
- buffer_size - bytes_parsed); /* buffer size */
+ dma_q, sav_eav, /* SAV/EAV */
+ p_buffer+bytes_parsed, /* p_buffer */
+ buffer_size-bytes_parsed);/*buf size*/
}
}
- /* Save the last four bytes of the buffer so we can check the buffer boundary
- condition next time */
+ /* Save the last four bytes of the buffer so we can
+ check the buffer boundary condition next time */
memcpy(dma_q->partial_buf, p_buffer + buffer_size - 4, 4);
bytes_parsed = 0;
}
cx231xx_vbi.h - driver for Conexant Cx23100/101/102 USB video capture devices
Copyright (C) 2008 <srinivasa.deevi at conexant dot com>
- Based on cx88 driver
+ Based on cx88 driver
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
extern struct videobuf_queue_ops cx231xx_vbi_qops;
-#define NTSC_VBI_START_LINE 10 /* line 10 - 21 */
-#define NTSC_VBI_END_LINE 21
-#define NTSC_VBI_LINES (NTSC_VBI_END_LINE - NTSC_VBI_START_LINE + 1)
+#define NTSC_VBI_START_LINE 10 /* line 10 - 21 */
+#define NTSC_VBI_END_LINE 21
+#define NTSC_VBI_LINES (NTSC_VBI_END_LINE-NTSC_VBI_START_LINE+1)
-#define PAL_VBI_START_LINE 6
-#define PAL_VBI_END_LINE 23
-#define PAL_VBI_LINES (PAL_VBI_END_LINE - PAL_VBI_START_LINE + 1)
+#define PAL_VBI_START_LINE 6
+#define PAL_VBI_END_LINE 23
+#define PAL_VBI_LINES (PAL_VBI_END_LINE-PAL_VBI_START_LINE+1)
-#define VBI_STRIDE 1440
-#define VBI_SAMPLES_PER_LINE 1440
+#define VBI_STRIDE 1440
+#define VBI_SAMPLES_PER_LINE 1440
#define CX231XX_NUM_VBI_PACKETS 4
#define CX231XX_NUM_VBI_BUFS 5
/* stream functions */
int cx231xx_init_vbi_isoc(struct cx231xx *dev, int max_packets,
int num_bufs, int max_pkt_size,
- int (*isoc_copy) (struct cx231xx * dev,
- struct urb * urb));
+ int (*isoc_copy) (struct cx231xx *dev,
+ struct urb *urb));
void cx231xx_uninit_vbi_isoc(struct cx231xx *dev);
/* vbi data copy functions */
u32 cx231xx_get_vbi_line(struct cx231xx *dev, struct cx231xx_dmaqueue *dma_q,
- u8 sav_eav, u8 * p_buffer, u32 buffer_size);
+ u8 sav_eav, u8 *p_buffer, u32 buffer_size);
+
u32 cx231xx_copy_vbi_line(struct cx231xx *dev, struct cx231xx_dmaqueue *dma_q,
- u8 * p_line, u32 length, int field_number);
+ u8 *p_line, u32 length, int field_number);
+
void cx231xx_reset_vbi_buffer(struct cx231xx *dev,
struct cx231xx_dmaqueue *dma_q);
int cx231xx_do_vbi_copy(struct cx231xx *dev, struct cx231xx_dmaqueue *dma_q,
- u8 * p_buffer, u32 bytes_to_copy);
+ u8 *p_buffer, u32 bytes_to_copy);
u8 cx231xx_is_vbi_buffer_done(struct cx231xx *dev,
struct cx231xx_dmaqueue *dma_q);
bytes_parsed = 0;
if (dma_q->is_partial_line) {
- /* Handle the case where we were working on a partial line */
+ /* Handle the case of a partial line */
sav_eav = dma_q->last_sav;
} else {
- /* Check for a SAV/EAV overlapping the buffer boundary */
+ /* Check for a SAV/EAV overlapping
+ the buffer boundary */
sav_eav =
cx231xx_find_boundary_SAV_EAV(p_buffer,
dma_q->partial_buf,
the last buffer or a partial line */
if (sav_eav) {
bytes_parsed += cx231xx_get_video_line(dev, dma_q,
- sav_eav, /* SAV/EAV */
- p_buffer + bytes_parsed, /* p_buffer */
- buffer_size - bytes_parsed); /* buffer size */
+ sav_eav, /* SAV/EAV */
+ p_buffer + bytes_parsed, /* p_buffer */
+ buffer_size - bytes_parsed);/* buf size */
}
/* Now parse data that is completely in this buffer */
while (bytes_parsed < buffer_size) {
u32 bytes_used = 0;
- sav_eav = cx231xx_find_next_SAV_EAV(p_buffer + bytes_parsed, /* p_buffer */
- buffer_size - bytes_parsed, /* buffer size */
- &bytes_used); /* Receives bytes used to get SAV/EAV */
+ sav_eav = cx231xx_find_next_SAV_EAV(
+ p_buffer + bytes_parsed, /* p_buffer */
+ buffer_size - bytes_parsed, /* buf size */
+ &bytes_used);/* bytes used to get SAV/EAV */
bytes_parsed += bytes_used;
sav_eav &= 0xF0;
if (sav_eav && (bytes_parsed < buffer_size)) {
bytes_parsed += cx231xx_get_video_line(dev,
- dma_q, sav_eav, /* SAV/EAV */
- p_buffer + bytes_parsed, /* p_buffer */
- buffer_size - bytes_parsed); /* buffer size */
+ dma_q, sav_eav, /* SAV/EAV */
+ p_buffer + bytes_parsed,/* p_buffer */
+ buffer_size - bytes_parsed);/*buf size*/
}
}
#ifdef CONFIG_VIDEO_ADV_DEBUG
/*
- -R, --list-registers=type=<host/i2cdrv/i2caddr>,chip=<chip>[,min=<addr>,max=<addr>]
+ -R, --list-registers=type=<host/i2cdrv/i2caddr>,
+ chip=<chip>[,min=<addr>,max=<addr>]
dump registers from <min> to <max> [VIDIOC_DBG_G_REGISTER]
- -r, --set-register=type=<host/i2cdrv/i2caddr>,chip=<chip>,reg=<addr>,val=<val>
+ -r, --set-register=type=<host/i2cdrv/i2caddr>,
+ chip=<chip>,reg=<addr>,val=<val>
set the register [VIDIOC_DBG_S_REGISTER]
if type == host, then <chip> is the hosts chip ID (default 0)
/******************************** usb interface ******************************/
-static struct video_device *cx231xx_vdev_init(struct cx231xx *dev, const struct video_device
- *template, const char *type_name)
+static struct video_device *cx231xx_vdev_init(struct cx231xx *dev,
+ const struct video_device
+ *template, const char *type_name)
{
struct video_device *vfd;
#include <linux/i2c-algo-bit.h>
#include <linux/mutex.h>
#include <media/ir-kbd-i2c.h>
-#if defined(CONFIG_VIDEO_CX231XX_DVB) || defined(CONFIG_VIDEO_CX231XX_DVB_MODULE)
+#if defined(CONFIG_VIDEO_CX231XX_DVB) || \
+ defined(CONFIG_VIDEO_CX231XX_DVB_MODULE)
#include <media/videobuf-dvb.h>
#endif
#define CX231XX_INTERLACED_DEFAULT 1
/* time to wait when stopping the isoc transfer */
-#define CX231XX_URB_TIMEOUT msecs_to_jiffies(CX231XX_NUM_BUFS * CX231XX_NUM_PACKETS)
+#define CX231XX_URB_TIMEOUT \
+ msecs_to_jiffies(CX231XX_NUM_BUFS * CX231XX_NUM_PACKETS)
enum cx231xx_mode {
CX231XX_SUSPEND,
CX231XX_AVDECODER
};
-typedef enum _I2C_MASTER_PORT {
+enum CX231XX_I2C_MASTER_PORT {
I2C_0 = 0,
I2C_1 = 1,
I2C_2 = 2,
I2C_3 = 3
-} CX231XX_I2C_MASTER_PORT;
+};
struct cx231xx_board {
char *name;
enum v4l2_buf_type type;
};
-/**********************************************************************************/
+/*****************************************************************/
/* set/get i2c */
-#define I2C_SPEED_1M 0x0 /* 00--1Mb/s, 01-400kb/s, 10--100kb/s, 11--5Mb/s */
-#define I2C_SPEED_400K 0x1 /* 00--1Mb/s, 01-400kb/s, 10--100kb/s, 11--5Mb/s */
-#define I2C_SPEED_100K 0x2 /* 00--1Mb/s, 01-400kb/s, 10--100kb/s, 11--5Mb/s */
-#define I2C_SPEED_5M 0x3 /* 00--1Mb/s, 01-400kb/s, 10--100kb/s, 11--5Mb/s */
-
-#define I2C_STOP 0x0 /* 0-- STOP transaction */
-#define I2C_NOSTOP 0x1 /* 1-- do not transmit STOP at end of transaction */
-#define I2C_SYNC 0x1 /* 1--alllow slave to insert clock wait states */
+/* 00--1Mb/s, 01-400kb/s, 10--100kb/s, 11--5Mb/s */
+#define I2C_SPEED_1M 0x0
+#define I2C_SPEED_400K 0x1
+#define I2C_SPEED_100K 0x2
+#define I2C_SPEED_5M 0x3
+
+/* 0-- STOP transaction */
+#define I2C_STOP 0x0
+/* 1-- do not transmit STOP at end of transaction */
+#define I2C_NOSTOP 0x1
+/* 1--alllow slave to insert clock wait states */
+#define I2C_SYNC 0x1
struct cx231xx_i2c {
struct cx231xx *dev;
u8 *p_buffer; /* pointer to the buffer */
};
-typedef struct _VENDOR_REQUEST_IN {
+struct VENDOR_REQUEST_IN{
u8 bRequest;
u16 wValue;
u16 wIndex;
u8 direction;
u8 bData;
u8 *pBuff;
-} VENDOR_REQUEST_IN, *PVENDOR_REQUEST_IN;
+};
struct cx231xx_ctrl {
struct v4l2_queryctrl v;
u32 shift;
};
-typedef enum {
+enum TRANSFER_TYPE{
Raw_Video = 0,
Audio,
Vbi, /* VANC */
TS1_serial_mode,
TS2,
TS1_parallel_mode
-} TRANSFER_TYPE;
+} ;
struct cx231xx_video_mode {
/* Isoc control struct */
int (*cx231xx_write_ctrl_reg) (struct cx231xx *dev, u8 req, u16 reg,
char *buf, int len);
int (*cx231xx_send_usb_command) (struct cx231xx_i2c *i2c_bus,
- struct cx231xx_i2c_xfer_data *req_data);
+ struct cx231xx_i2c_xfer_data *req_data);
int (*cx231xx_gpio_i2c_read) (struct cx231xx *dev, u8 dev_addr,
u8 *buf, u8 len);
int (*cx231xx_gpio_i2c_write) (struct cx231xx *dev, u8 dev_addr,
char *buf, int len);
int cx231xx_mode_register(struct cx231xx *dev, u16 address, u32 mode);
-int cx231xx_send_vendor_cmd(struct cx231xx *dev, VENDOR_REQUEST_IN *ven_req);
+int cx231xx_send_vendor_cmd(struct cx231xx *dev,
+ struct VENDOR_REQUEST_IN *ven_req);
int cx231xx_send_usb_command(struct cx231xx_i2c *i2c_bus,
- struct cx231xx_i2c_xfer_data *req_data);
+ struct cx231xx_i2c_xfer_data *req_data);
/* Gpio related functions */
int cx231xx_send_gpio_cmd(struct cx231xx *dev, u32 gpio_bit, u8 *gpio_val,