int ret;
dprintk(DBGLVL_ENC, "%s() v_mux=%d a_mux=%d\n",
- __func__, port->mux_input, inputs[ port->mux_input - 1 ]);
+ __func__, port->mux_input, inputs[port->mux_input - 1]);
/* Audio Mute */
ret = saa7164_api_audio_mute(port, 1);
/* Audio Mux */
ret = saa7164_cmd_send(port->dev, port->audfeat.sourceid, SET_CUR,
- SU_INPUT_SELECT_CONTROL, sizeof(u8), &inputs[ port->mux_input - 1 ]);
+ SU_INPUT_SELECT_CONTROL, sizeof(u8), &inputs[port->mux_input - 1]);
if (ret != SAA_OK)
printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret);
printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret);
ret = saa7164_cmd_send(port->dev, port->audfeat.unitid, GET_CUR,
- ( 0x01 << 8) | VOLUME_CONTROL, sizeof(u16), &v);
+ (0x01 << 8) | VOLUME_CONTROL, sizeof(u16), &v);
if (ret != SAA_OK)
printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret);
/* Left */
ret = saa7164_cmd_send(port->dev, port->audfeat.unitid, SET_CUR,
- ( 0x01 << 8 ) | VOLUME_CONTROL, sizeof(s16), &v);
+ (0x01 << 8) | VOLUME_CONTROL, sizeof(s16), &v);
if (ret != SAA_OK)
printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret);
/* Right */
ret = saa7164_cmd_send(port->dev, port->audfeat.unitid, SET_CUR,
- ( 0x02 << 8 ) | VOLUME_CONTROL, sizeof(s16), &v);
+ (0x02 << 8) | VOLUME_CONTROL, sizeof(s16), &v);
if (ret != SAA_OK)
printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret);
ret = saa7164_cmd_send(port->dev, port->audfeat.unitid, GET_CUR,
- ( 0x01 << 8) | VOLUME_CONTROL, sizeof(u16), &v);
+ (0x01 << 8) | VOLUME_CONTROL, sizeof(u16), &v);
if (ret != SAA_OK)
printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret);
} else
if (port->type == SAA7164_MPEG_DVB) {
if (port->nr == SAA7164_PORT_TS1)
- p = &dev->ports[ SAA7164_PORT_ENC1 ];
+ p = &dev->ports[SAA7164_PORT_ENC1];
else
- p = &dev->ports[ SAA7164_PORT_ENC2 ];
+ p = &dev->ports[SAA7164_PORT_ENC2];
} else
if (port->type == SAA7164_MPEG_VBI) {
std = V4L2_STD_NTSC;
if (port->nr == SAA7164_PORT_VBI1)
- p = &dev->ports[ SAA7164_PORT_ENC1 ];
+ p = &dev->ports[SAA7164_PORT_ENC1];
else
- p = &dev->ports[ SAA7164_PORT_ENC2 ];
+ p = &dev->ports[SAA7164_PORT_ENC2];
} else
BUG();
"%s(?,?,%d) sizeof(struct tmComResDescrHeader) = %d bytes\n",
__func__, len, (u32)sizeof(struct tmComResDescrHeader));
- for (idx = 0; idx < (len - sizeof(struct tmComResDescrHeader)); ) {
+ for (idx = 0; idx < (len - sizeof(struct tmComResDescrHeader));) {
hdr = (struct tmComResDescrHeader *)(buf + idx);
tsfmt =
(struct tmComResTSFormatDescrHeader *)t;
if (currpath == 1)
- tsport = &dev->ports[ SAA7164_PORT_TS1 ];
+ tsport = &dev->ports[SAA7164_PORT_TS1];
else
- tsport = &dev->ports[ SAA7164_PORT_TS2 ];
+ tsport = &dev->ports[SAA7164_PORT_TS2];
memcpy(&tsport->hwcfg, vcoutputtermhdr,
sizeof(*vcoutputtermhdr));
saa7164_api_configure_port_mpeg2ts(dev,
psfmt =
(struct tmComResPSFormatDescrHeader *)t;
if (currpath == 1)
- encport = &dev->ports[ SAA7164_PORT_ENC1 ];
+ encport = &dev->ports[SAA7164_PORT_ENC1];
else
- encport = &dev->ports[ SAA7164_PORT_ENC2 ];
+ encport = &dev->ports[SAA7164_PORT_ENC2];
memcpy(&encport->hwcfg, vcoutputtermhdr,
sizeof(*vcoutputtermhdr));
saa7164_api_configure_port_mpeg2ps(dev,
vbifmt =
(struct tmComResVBIFormatDescrHeader *)t;
if (currpath == 1)
- vbiport = &dev->ports[ SAA7164_PORT_VBI1 ];
+ vbiport = &dev->ports[SAA7164_PORT_VBI1];
else
- vbiport = &dev->ports[ SAA7164_PORT_VBI2 ];
+ vbiport = &dev->ports[SAA7164_PORT_VBI2];
memcpy(&vbiport->hwcfg, vcoutputtermhdr,
sizeof(*vcoutputtermhdr));
memcpy(&vbiport->vbi_fmt_ntsc, vbifmt, sizeof(*vbifmt));
if (tunerunithdr->unitid == tunerunithdr->iunit) {
if (currpath == 1)
- encport = &dev->ports[ SAA7164_PORT_ENC1 ];
+ encport = &dev->ports[SAA7164_PORT_ENC1];
else
- encport = &dev->ports[ SAA7164_PORT_ENC2 ];
+ encport = &dev->ports[SAA7164_PORT_ENC2];
memcpy(&encport->tunerunit, tunerunithdr,
sizeof(struct tmComResTunerDescrHeader));
dprintk(DBGLVL_API, " (becomes dev->enc[%d] tuner)\n", encport->nr);
pdh->controlsize);
if (pdh->controlsize == 0x04) {
if (currpath == 1)
- encport = &dev->ports[ SAA7164_PORT_ENC1 ];
+ encport = &dev->ports[SAA7164_PORT_ENC1];
else
- encport = &dev->ports[ SAA7164_PORT_ENC2 ];
+ encport = &dev->ports[SAA7164_PORT_ENC2];
memcpy(&encport->vidproc, pdh,
sizeof(struct tmComResProcDescrHeader));
dprintk(DBGLVL_API, " (becomes dev->enc[%d])\n", encport->nr);
dprintk(DBGLVL_API, " controlsize = 0x%x\n",
afd->controlsize);
if (currpath == 1)
- encport = &dev->ports[ SAA7164_PORT_ENC1 ];
+ encport = &dev->ports[SAA7164_PORT_ENC1];
else
- encport = &dev->ports[ SAA7164_PORT_ENC2 ];
+ encport = &dev->ports[SAA7164_PORT_ENC2];
memcpy(&encport->audfeat, afd,
sizeof(struct tmComResAFeatureDescrHeader));
dprintk(DBGLVL_API, " (becomes dev->enc[%d])\n", encport->nr);
dprintk(DBGLVL_API, " iunit = 0x%x\n", edh->iunit);
if (edh->iunit == edh->unitid) {
if (currpath == 1)
- encport = &dev->ports[ SAA7164_PORT_ENC1 ];
+ encport = &dev->ports[SAA7164_PORT_ENC1];
else
- encport = &dev->ports[ SAA7164_PORT_ENC2 ];
+ encport = &dev->ports[SAA7164_PORT_ENC2];
memcpy(&encport->encunit, edh,
sizeof(struct tmComResEncoderDescrHeader));
dprintk(DBGLVL_API, " (becomes dev->enc[%d])\n", encport->nr);
exthdr->controlsize);
if (exthdr->devicetype & 0x80) {
if (currpath == 1)
- encport = &dev->ports[ SAA7164_PORT_ENC1 ];
+ encport = &dev->ports[SAA7164_PORT_ENC1];
else
- encport = &dev->ports[ SAA7164_PORT_ENC2 ];
+ encport = &dev->ports[SAA7164_PORT_ENC2];
memcpy(&encport->ifunit, exthdr,
sizeof(struct tmComResExtDevDescrHeader));
dprintk(DBGLVL_API, " (becomes dev->enc[%d])\n", encport->nr);
for (i = 0; i < buf->actual_size; i += 2048) {
- if ( (*(p + i + 0) != 0x00) || (*(p + i + 1) != 0x00) ||
- (*(p + i + 2) != 0x01) || (*(p + i + 3) != 0xBA) ) {
+ if ((*(p + i + 0) != 0x00) || (*(p + i + 1) != 0x00) ||
+ (*(p + i + 2) != 0x01) || (*(p + i + 3) != 0xBA)) {
printk(KERN_ERR "No pack at 0x%x\n", i);
// saa7164_dumphex16FF(buf->port->dev, (p + i), 32);
}
void saa7164_histogram_update(struct saa7164_histogram *hg, u32 val)
{
int i;
- for (i = 0; i < 64; i++ ) {
+ for (i = 0; i < 64; i++) {
if (val <= hg->counter1[i].val) {
hg->counter1[i].count++;
hg->counter1[i].update_time = jiffies;
int i;
printk(KERN_ERR "Histogram named %s (ms, count, last_update_jiffy)\n", hg->name);
- for (i = 0; i < 64; i++ ) {
+ for (i = 0; i < 64; i++) {
if (hg->counter1[i].count == 0)
continue;
if (guard_checking) {
p = (u8 *)buf->cpu;
- if ( (*(p + buf->actual_size + 0) != 0xff) ||
+ if ((*(p + buf->actual_size + 0) != 0xff) ||
(*(p + buf->actual_size + 1) != 0xff) ||
(*(p + buf->actual_size + 2) != 0xff) ||
(*(p + buf->actual_size + 3) != 0xff) ||
(*(p + buf->actual_size + 0x10) != 0xff) ||
(*(p + buf->actual_size + 0x11) != 0xff) ||
(*(p + buf->actual_size + 0x12) != 0xff) ||
- (*(p + buf->actual_size + 0x13) != 0xff) ) {
+ (*(p + buf->actual_size + 0x13) != 0xff)) {
printk(KERN_ERR "%s() buf %p guard buffer breach\n",
__func__, buf);
// saa7164_dumphex16FF(dev, (p + buf->actual_size) - 32 , 64);
static irqreturn_t saa7164_irq(int irq, void *dev_id)
{
struct saa7164_dev *dev = dev_id;
- struct saa7164_port *porta = &dev->ports[ SAA7164_PORT_TS1 ];
- struct saa7164_port *portb = &dev->ports[ SAA7164_PORT_TS2 ];
- struct saa7164_port *portc = &dev->ports[ SAA7164_PORT_ENC1 ];
- struct saa7164_port *portd = &dev->ports[ SAA7164_PORT_ENC2 ];
- struct saa7164_port *porte = &dev->ports[ SAA7164_PORT_VBI1 ];
- struct saa7164_port *portf = &dev->ports[ SAA7164_PORT_VBI2 ];
+ struct saa7164_port *porta = &dev->ports[SAA7164_PORT_TS1];
+ struct saa7164_port *portb = &dev->ports[SAA7164_PORT_TS2];
+ struct saa7164_port *portc = &dev->ports[SAA7164_PORT_ENC1];
+ struct saa7164_port *portd = &dev->ports[SAA7164_PORT_ENC2];
+ struct saa7164_port *porte = &dev->ports[SAA7164_PORT_VBI1];
+ struct saa7164_port *portf = &dev->ports[SAA7164_PORT_VBI2];
u32 intid, intstat[INT_SIZE/4];
int i, handled = 0, bit;
if ((portnr < 0) || (portnr >= SAA7164_MAX_PORTS))
BUG();
- port = &dev->ports[ portnr ];
+ port = &dev->ports[portnr];
port->dev = dev;
port->nr = portnr;
/* Begin to create the video sub-systems and register funcs */
if (saa7164_boards[dev->board].porta == SAA7164_MPEG_DVB) {
- if (saa7164_dvb_register(&dev->ports[ SAA7164_PORT_TS1 ]) < 0) {
+ if (saa7164_dvb_register(&dev->ports[SAA7164_PORT_TS1]) < 0) {
printk(KERN_ERR "%s() Failed to register "
"dvb adapters on porta\n",
__func__);
}
if (saa7164_boards[dev->board].portb == SAA7164_MPEG_DVB) {
- if (saa7164_dvb_register(&dev->ports[ SAA7164_PORT_TS2 ]) < 0) {
+ if (saa7164_dvb_register(&dev->ports[SAA7164_PORT_TS2]) < 0) {
printk(KERN_ERR"%s() Failed to register "
"dvb adapters on portb\n",
__func__);
}
if (saa7164_boards[dev->board].portc == SAA7164_MPEG_ENCODER) {
- if (saa7164_encoder_register(&dev->ports[ SAA7164_PORT_ENC1 ]) < 0) {
+ if (saa7164_encoder_register(&dev->ports[SAA7164_PORT_ENC1]) < 0) {
printk(KERN_ERR"%s() Failed to register "
"mpeg encoder\n", __func__);
}
}
if (saa7164_boards[dev->board].portd == SAA7164_MPEG_ENCODER) {
- if (saa7164_encoder_register(&dev->ports[ SAA7164_PORT_ENC2 ]) < 0) {
+ if (saa7164_encoder_register(&dev->ports[SAA7164_PORT_ENC2]) < 0) {
printk(KERN_ERR"%s() Failed to register "
"mpeg encoder\n", __func__);
}
}
if (saa7164_boards[dev->board].porte == SAA7164_MPEG_VBI) {
- if (saa7164_vbi_register(&dev->ports[ SAA7164_PORT_VBI1 ]) < 0) {
+ if (saa7164_vbi_register(&dev->ports[SAA7164_PORT_VBI1]) < 0) {
printk(KERN_ERR"%s() Failed to register "
"vbi device\n", __func__);
}
}
if (saa7164_boards[dev->board].portf == SAA7164_MPEG_VBI) {
- if (saa7164_vbi_register(&dev->ports[ SAA7164_PORT_VBI2 ]) < 0) {
+ if (saa7164_vbi_register(&dev->ports[SAA7164_PORT_VBI2]) < 0) {
printk(KERN_ERR"%s() Failed to register "
"vbi device\n", __func__);
}
saa7164_api_set_debug(dev, 0x00);
}
- saa7164_histogram_print(&dev->ports[ SAA7164_PORT_ENC1 ],
- &dev->ports[ SAA7164_PORT_ENC1 ].irq_interval);
- saa7164_histogram_print(&dev->ports[ SAA7164_PORT_ENC1 ],
- &dev->ports[ SAA7164_PORT_ENC1 ].svc_interval);
- saa7164_histogram_print(&dev->ports[ SAA7164_PORT_ENC1 ],
- &dev->ports[ SAA7164_PORT_ENC1 ].irq_svc_interval);
- saa7164_histogram_print(&dev->ports[ SAA7164_PORT_ENC1 ],
- &dev->ports[ SAA7164_PORT_ENC1 ].read_interval);
- saa7164_histogram_print(&dev->ports[ SAA7164_PORT_ENC1 ],
- &dev->ports[ SAA7164_PORT_ENC1 ].poll_interval);
- saa7164_histogram_print(&dev->ports[ SAA7164_PORT_VBI1 ],
- &dev->ports[ SAA7164_PORT_VBI1 ].read_interval);
- saa7164_histogram_print(&dev->ports[ SAA7164_PORT_VBI2 ],
- &dev->ports[ SAA7164_PORT_VBI2 ].poll_interval);
+ saa7164_histogram_print(&dev->ports[SAA7164_PORT_ENC1],
+ &dev->ports[SAA7164_PORT_ENC1].irq_interval);
+ saa7164_histogram_print(&dev->ports[SAA7164_PORT_ENC1],
+ &dev->ports[SAA7164_PORT_ENC1].svc_interval);
+ saa7164_histogram_print(&dev->ports[SAA7164_PORT_ENC1],
+ &dev->ports[SAA7164_PORT_ENC1].irq_svc_interval);
+ saa7164_histogram_print(&dev->ports[SAA7164_PORT_ENC1],
+ &dev->ports[SAA7164_PORT_ENC1].read_interval);
+ saa7164_histogram_print(&dev->ports[SAA7164_PORT_ENC1],
+ &dev->ports[SAA7164_PORT_ENC1].poll_interval);
+ saa7164_histogram_print(&dev->ports[SAA7164_PORT_VBI1],
+ &dev->ports[SAA7164_PORT_VBI1].read_interval);
+ saa7164_histogram_print(&dev->ports[SAA7164_PORT_VBI2],
+ &dev->ports[SAA7164_PORT_VBI2].poll_interval);
saa7164_shutdown(dev);
if (saa7164_boards[dev->board].porta == SAA7164_MPEG_DVB)
- saa7164_dvb_unregister(&dev->ports[ SAA7164_PORT_TS1 ]);
+ saa7164_dvb_unregister(&dev->ports[SAA7164_PORT_TS1]);
if (saa7164_boards[dev->board].portb == SAA7164_MPEG_DVB)
- saa7164_dvb_unregister(&dev->ports[ SAA7164_PORT_TS2 ]);
+ saa7164_dvb_unregister(&dev->ports[SAA7164_PORT_TS2]);
if (saa7164_boards[dev->board].portc == SAA7164_MPEG_ENCODER)
- saa7164_encoder_unregister(&dev->ports[ SAA7164_PORT_ENC1 ]);
+ saa7164_encoder_unregister(&dev->ports[SAA7164_PORT_ENC1]);
if (saa7164_boards[dev->board].portd == SAA7164_MPEG_ENCODER)
- saa7164_encoder_unregister(&dev->ports[ SAA7164_PORT_ENC2 ]);
+ saa7164_encoder_unregister(&dev->ports[SAA7164_PORT_ENC2]);
if (saa7164_boards[dev->board].porte == SAA7164_MPEG_VBI)
- saa7164_vbi_unregister(&dev->ports[ SAA7164_PORT_VBI1 ]);
+ saa7164_vbi_unregister(&dev->ports[SAA7164_PORT_VBI1]);
if (saa7164_boards[dev->board].portf == SAA7164_MPEG_VBI)
- saa7164_vbi_unregister(&dev->ports[ SAA7164_PORT_VBI2 ]);
+ saa7164_vbi_unregister(&dev->ports[SAA7164_PORT_VBI2]);
saa7164_i2c_unregister(&dev->i2c_bus[0]);
saa7164_i2c_unregister(&dev->i2c_bus[1]);
if (i->index >= 7)
return -EINVAL;
- strcpy(i->name, inputs[ i->index ]);
+ strcpy(i->name, inputs[i->index]);
if (i->index == 0)
i->type = V4L2_INPUT_TYPE_TUNER;
/* Update the hardware */
if (port->nr == SAA7164_PORT_ENC1)
- tsport = &dev->ports[ SAA7164_PORT_TS1 ];
+ tsport = &dev->ports[SAA7164_PORT_TS1];
else
if (port->nr == SAA7164_PORT_ENC2)
- tsport = &dev->ports[ SAA7164_PORT_TS2 ];
+ tsport = &dev->ports[SAA7164_PORT_TS2];
else
BUG();
list_for_each(list, &saa7164_devlist) {
h = list_entry(list, struct saa7164_dev, devlist);
- portc = &h->ports[ SAA7164_PORT_ENC1 ];
- portd = &h->ports[ SAA7164_PORT_ENC2 ];
+ portc = &h->ports[SAA7164_PORT_ENC1];
+ portd = &h->ports[SAA7164_PORT_ENC2];
if (portc->v4l_device &&
portc->v4l_device->minor == minor) {
/* 1. IPPPPPPPPPPPPPP */
/* 2. IBPBPBPBPBPBPBP */
/* 3. IBBPBBPBBPBBP */
-#define SAA7164_ENCODER_DEFAULT_GOP_DIST ( 1)
+#define SAA7164_ENCODER_DEFAULT_GOP_DIST (1)
#define SAA7164_ENCODER_DEFAULT_GOP_SIZE (15)
struct tmComResEncVideoGopStructure {
u8 ucGOPSize; /* GOP Size 12, 15 */
if (i->index >= 7)
return -EINVAL;
- strcpy(i->name, inputs[ i->index ]);
+ strcpy(i->name, inputs[i->index]);
if (i->index == 0)
i->type = V4L2_INPUT_TYPE_TUNER;
/* Update the hardware */
if (port->nr == SAA7164_PORT_VBI1)
- tsport = &dev->ports[ SAA7164_PORT_TS1 ];
+ tsport = &dev->ports[SAA7164_PORT_TS1];
else
if (port->nr == SAA7164_PORT_VBI2)
- tsport = &dev->ports[ SAA7164_PORT_TS2 ];
+ tsport = &dev->ports[SAA7164_PORT_TS2];
else
BUG();
list_for_each(list, &saa7164_devlist) {
h = list_entry(list, struct saa7164_dev, devlist);
- porte = &h->ports[ SAA7164_PORT_VBI1 ];
- portf = &h->ports[ SAA7164_PORT_VBI2 ];
+ porte = &h->ports[SAA7164_PORT_VBI1];
+ portf = &h->ports[SAA7164_PORT_VBI2];
if (porte->v4l_device &&
porte->v4l_device->minor == minor) {
#define DBGLVL_THR 4096
#define DBGLVL_CPU 8192
-#define SAA7164_NORMS ( V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_JP | V4L2_STD_NTSC_443 )
+#define SAA7164_NORMS (V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_JP | V4L2_STD_NTSC_443)
enum port_t {
SAA7164_MPEG_UNDEFINED = 0,
struct saa7164_i2c i2c_bus[3];
/* Transport related */
- struct saa7164_port ports[ SAA7164_MAX_PORTS ];
+ struct saa7164_port ports[SAA7164_MAX_PORTS];
/* Deferred command/api interrupts handling */
struct work_struct workcmd;