0="ATV RF" 1="ATV RF13" 2="CVBS" 3="S-Video" 4="PAL" 5=CVBS13" 6="SVideo13"
*/
struct au8522_register_config filter_coef[] = {
- {AU8522_FILTER_COEF_R410, {0x25, 0x00, 0x25, 0x25, 0x00, 0x00, 0x00}},
- {AU8522_FILTER_COEF_R411, {0x20, 0x00, 0x20, 0x20, 0x00, 0x00, 0x00}},
- {AU8522_FILTER_COEF_R412, {0x03, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00}},
- {AU8522_FILTER_COEF_R413, {0xe6, 0x00, 0xe6, 0xe6, 0x00, 0x00, 0x00}},
- {AU8522_FILTER_COEF_R414, {0x40, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00}},
- {AU8522_FILTER_COEF_R415, {0x1b, 0x00, 0x1b, 0x1b, 0x00, 0x00, 0x00}},
- {AU8522_FILTER_COEF_R416, {0xc0, 0x00, 0xc0, 0x04, 0x00, 0x00, 0x00}},
- {AU8522_FILTER_COEF_R417, {0x04, 0x00, 0x04, 0x04, 0x00, 0x00, 0x00}},
- {AU8522_FILTER_COEF_R418, {0x8c, 0x00, 0x8c, 0x8c, 0x00, 0x00, 0x00}},
- {AU8522_FILTER_COEF_R419, {0xa0, 0x40, 0xa0, 0xa0, 0x40, 0x40, 0x40}},
- {AU8522_FILTER_COEF_R41A, {0x21, 0x09, 0x21, 0x21, 0x09, 0x09, 0x09}},
- {AU8522_FILTER_COEF_R41B, {0x6c, 0x38, 0x6c, 0x6c, 0x38, 0x38, 0x38}},
- {AU8522_FILTER_COEF_R41C, {0x03, 0xff, 0x03, 0x03, 0xff, 0xff, 0xff}},
- {AU8522_FILTER_COEF_R41D, {0xbf, 0xc7, 0xbf, 0xbf, 0xc7, 0xc7, 0xc7}},
- {AU8522_FILTER_COEF_R41E, {0xa0, 0xdf, 0xa0, 0xa0, 0xdf, 0xdf, 0xdf}},
- {AU8522_FILTER_COEF_R41F, {0x10, 0x06, 0x10, 0x10, 0x06, 0x06, 0x06}},
- {AU8522_FILTER_COEF_R420, {0xae, 0x30, 0xae, 0xae, 0x30, 0x30, 0x30}},
- {AU8522_FILTER_COEF_R421, {0xc4, 0x01, 0xc4, 0xc4, 0x01, 0x01, 0x01}},
- {AU8522_FILTER_COEF_R422, {0x54, 0xdd, 0x54, 0x54, 0xdd, 0xdd, 0xdd}},
- {AU8522_FILTER_COEF_R423, {0xd0, 0xaf, 0xd0, 0xd0, 0xaf, 0xaf, 0xaf}},
- {AU8522_FILTER_COEF_R424, {0x1c, 0xf7, 0x1c, 0x1c, 0xf7, 0xf7, 0xf7}},
- {AU8522_FILTER_COEF_R425, {0x76, 0xdb, 0x76, 0x76, 0xdb, 0xdb, 0xdb}},
- {AU8522_FILTER_COEF_R426, {0x61, 0xc0, 0x61, 0x61, 0xc0, 0xc0, 0xc0}},
- {AU8522_FILTER_COEF_R427, {0xd1, 0x2f, 0xd1, 0xd1, 0x2f, 0x2f, 0x2f}},
- {AU8522_FILTER_COEF_R428, {0x84, 0xd8, 0x84, 0x84, 0xd8, 0xd8, 0xd8}},
- {AU8522_FILTER_COEF_R429, {0x06, 0xfb, 0x06, 0x06, 0xfb, 0xfb, 0xfb}},
- {AU8522_FILTER_COEF_R42A, {0x21, 0xd5, 0x21, 0x21, 0xd5, 0xd5, 0xd5}},
- {AU8522_FILTER_COEF_R42B, {0x0a, 0x3e, 0x0a, 0x0a, 0x3e, 0x3e, 0x3e}},
- {AU8522_FILTER_COEF_R42C, {0xe6, 0x15, 0xe6, 0xe6, 0x15, 0x15, 0x15}},
- {AU8522_FILTER_COEF_R42D, {0x01, 0x34, 0x01, 0x01, 0x34, 0x34, 0x34}},
+ {AU8522_FILTER_COEF_R410, {0x25, 0x00, 0x25, 0x25, 0x00, 0x00, 0x00} },
+ {AU8522_FILTER_COEF_R411, {0x20, 0x00, 0x20, 0x20, 0x00, 0x00, 0x00} },
+ {AU8522_FILTER_COEF_R412, {0x03, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00} },
+ {AU8522_FILTER_COEF_R413, {0xe6, 0x00, 0xe6, 0xe6, 0x00, 0x00, 0x00} },
+ {AU8522_FILTER_COEF_R414, {0x40, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00} },
+ {AU8522_FILTER_COEF_R415, {0x1b, 0x00, 0x1b, 0x1b, 0x00, 0x00, 0x00} },
+ {AU8522_FILTER_COEF_R416, {0xc0, 0x00, 0xc0, 0x04, 0x00, 0x00, 0x00} },
+ {AU8522_FILTER_COEF_R417, {0x04, 0x00, 0x04, 0x04, 0x00, 0x00, 0x00} },
+ {AU8522_FILTER_COEF_R418, {0x8c, 0x00, 0x8c, 0x8c, 0x00, 0x00, 0x00} },
+ {AU8522_FILTER_COEF_R419, {0xa0, 0x40, 0xa0, 0xa0, 0x40, 0x40, 0x40} },
+ {AU8522_FILTER_COEF_R41A, {0x21, 0x09, 0x21, 0x21, 0x09, 0x09, 0x09} },
+ {AU8522_FILTER_COEF_R41B, {0x6c, 0x38, 0x6c, 0x6c, 0x38, 0x38, 0x38} },
+ {AU8522_FILTER_COEF_R41C, {0x03, 0xff, 0x03, 0x03, 0xff, 0xff, 0xff} },
+ {AU8522_FILTER_COEF_R41D, {0xbf, 0xc7, 0xbf, 0xbf, 0xc7, 0xc7, 0xc7} },
+ {AU8522_FILTER_COEF_R41E, {0xa0, 0xdf, 0xa0, 0xa0, 0xdf, 0xdf, 0xdf} },
+ {AU8522_FILTER_COEF_R41F, {0x10, 0x06, 0x10, 0x10, 0x06, 0x06, 0x06} },
+ {AU8522_FILTER_COEF_R420, {0xae, 0x30, 0xae, 0xae, 0x30, 0x30, 0x30} },
+ {AU8522_FILTER_COEF_R421, {0xc4, 0x01, 0xc4, 0xc4, 0x01, 0x01, 0x01} },
+ {AU8522_FILTER_COEF_R422, {0x54, 0xdd, 0x54, 0x54, 0xdd, 0xdd, 0xdd} },
+ {AU8522_FILTER_COEF_R423, {0xd0, 0xaf, 0xd0, 0xd0, 0xaf, 0xaf, 0xaf} },
+ {AU8522_FILTER_COEF_R424, {0x1c, 0xf7, 0x1c, 0x1c, 0xf7, 0xf7, 0xf7} },
+ {AU8522_FILTER_COEF_R425, {0x76, 0xdb, 0x76, 0x76, 0xdb, 0xdb, 0xdb} },
+ {AU8522_FILTER_COEF_R426, {0x61, 0xc0, 0x61, 0x61, 0xc0, 0xc0, 0xc0} },
+ {AU8522_FILTER_COEF_R427, {0xd1, 0x2f, 0xd1, 0xd1, 0x2f, 0x2f, 0x2f} },
+ {AU8522_FILTER_COEF_R428, {0x84, 0xd8, 0x84, 0x84, 0xd8, 0xd8, 0xd8} },
+ {AU8522_FILTER_COEF_R429, {0x06, 0xfb, 0x06, 0x06, 0xfb, 0xfb, 0xfb} },
+ {AU8522_FILTER_COEF_R42A, {0x21, 0xd5, 0x21, 0x21, 0xd5, 0xd5, 0xd5} },
+ {AU8522_FILTER_COEF_R42B, {0x0a, 0x3e, 0x0a, 0x0a, 0x3e, 0x3e, 0x3e} },
+ {AU8522_FILTER_COEF_R42C, {0xe6, 0x15, 0xe6, 0xe6, 0x15, 0x15, 0x15} },
+ {AU8522_FILTER_COEF_R42D, {0x01, 0x34, 0x01, 0x01, 0x34, 0x34, 0x34} },
};
-#define NUM_FILTER_COEF (sizeof (filter_coef) / sizeof(struct au8522_register_config))
+#define NUM_FILTER_COEF (sizeof(filter_coef)\
+ / sizeof(struct au8522_register_config))
/* Registers 0x060b through 0x0652 are the LP Filter coefficients
Note: the "ATVRF/ATVRF13" mode has never been tested
*/
struct au8522_register_config lpfilter_coef[] = {
- {0x060b, {0x21, 0x0b}},
- {0x060c, {0xad, 0xad}},
- {0x060d, {0x70, 0xf0}},
- {0x060e, {0xea, 0xe9}},
- {0x060f, {0xdd, 0xdd}},
- {0x0610, {0x08, 0x64}},
- {0x0611, {0x60, 0x60}},
- {0x0612, {0xf8, 0xb2}},
- {0x0613, {0x01, 0x02}},
- {0x0614, {0xe4, 0xb4}},
- {0x0615, {0x19, 0x02}},
- {0x0616, {0xae, 0x2e}},
- {0x0617, {0xee, 0xc5}},
- {0x0618, {0x56, 0x56}},
- {0x0619, {0x30, 0x58}},
- {0x061a, {0xf9, 0xf8}},
- {0x061b, {0x24, 0x64}},
- {0x061c, {0x07, 0x07}},
- {0x061d, {0x30, 0x30}},
- {0x061e, {0xa9, 0xed}},
- {0x061f, {0x09, 0x0b}},
- {0x0620, {0x42, 0xc2}},
- {0x0621, {0x1d, 0x2a}},
- {0x0622, {0xd6, 0x56}},
- {0x0623, {0x95, 0x8b}},
- {0x0624, {0x2b, 0x2b}},
- {0x0625, {0x30, 0x24}},
- {0x0626, {0x3e, 0x3e}},
- {0x0627, {0x62, 0xe2}},
- {0x0628, {0xe9, 0xf5}},
- {0x0629, {0x99, 0x19}},
- {0x062a, {0xd4, 0x11}},
- {0x062b, {0x03, 0x04}},
- {0x062c, {0xb5, 0x85}},
- {0x062d, {0x1e, 0x20}},
- {0x062e, {0x2a, 0xea}},
- {0x062f, {0xd7, 0xd2}},
- {0x0630, {0x15, 0x15}},
- {0x0631, {0xa3, 0xa9}},
- {0x0632, {0x1f, 0x1f}},
- {0x0633, {0xf9, 0xd1}},
- {0x0634, {0xc0, 0xc3}},
- {0x0635, {0x4d, 0x8d}},
- {0x0636, {0x21, 0x31}},
- {0x0637, {0x83, 0x83}},
- {0x0638, {0x08, 0x8c}},
- {0x0639, {0x19, 0x19}},
- {0x063a, {0x45, 0xa5}},
- {0x063b, {0xef, 0xec}},
- {0x063c, {0x8a, 0x8a}},
- {0x063d, {0xf4, 0xf6}},
- {0x063e, {0x8f, 0x8f}},
- {0x063f, {0x44, 0x0c}},
- {0x0640, {0xef, 0xf0}},
- {0x0641, {0x66, 0x66}},
- {0x0642, {0xcc, 0xd2}},
- {0x0643, {0x41, 0x41}},
- {0x0644, {0x63, 0x93}},
- {0x0645, {0x8e, 0x8e}},
- {0x0646, {0xa2, 0x42}},
- {0x0647, {0x7b, 0x7b}},
- {0x0648, {0x04, 0x04}},
- {0x0649, {0x00, 0x00}},
- {0x064a, {0x40, 0x40}},
- {0x064b, {0x8c, 0x98}},
- {0x064c, {0x00, 0x00}},
- {0x064d, {0x63, 0xc3}},
- {0x064e, {0x04, 0x04}},
- {0x064f, {0x20, 0x20}},
- {0x0650, {0x00, 0x00}},
- {0x0651, {0x40 ,0x40}},
- {0x0652, {0x01, 0x01}},
+ {0x060b, {0x21, 0x0b} },
+ {0x060c, {0xad, 0xad} },
+ {0x060d, {0x70, 0xf0} },
+ {0x060e, {0xea, 0xe9} },
+ {0x060f, {0xdd, 0xdd} },
+ {0x0610, {0x08, 0x64} },
+ {0x0611, {0x60, 0x60} },
+ {0x0612, {0xf8, 0xb2} },
+ {0x0613, {0x01, 0x02} },
+ {0x0614, {0xe4, 0xb4} },
+ {0x0615, {0x19, 0x02} },
+ {0x0616, {0xae, 0x2e} },
+ {0x0617, {0xee, 0xc5} },
+ {0x0618, {0x56, 0x56} },
+ {0x0619, {0x30, 0x58} },
+ {0x061a, {0xf9, 0xf8} },
+ {0x061b, {0x24, 0x64} },
+ {0x061c, {0x07, 0x07} },
+ {0x061d, {0x30, 0x30} },
+ {0x061e, {0xa9, 0xed} },
+ {0x061f, {0x09, 0x0b} },
+ {0x0620, {0x42, 0xc2} },
+ {0x0621, {0x1d, 0x2a} },
+ {0x0622, {0xd6, 0x56} },
+ {0x0623, {0x95, 0x8b} },
+ {0x0624, {0x2b, 0x2b} },
+ {0x0625, {0x30, 0x24} },
+ {0x0626, {0x3e, 0x3e} },
+ {0x0627, {0x62, 0xe2} },
+ {0x0628, {0xe9, 0xf5} },
+ {0x0629, {0x99, 0x19} },
+ {0x062a, {0xd4, 0x11} },
+ {0x062b, {0x03, 0x04} },
+ {0x062c, {0xb5, 0x85} },
+ {0x062d, {0x1e, 0x20} },
+ {0x062e, {0x2a, 0xea} },
+ {0x062f, {0xd7, 0xd2} },
+ {0x0630, {0x15, 0x15} },
+ {0x0631, {0xa3, 0xa9} },
+ {0x0632, {0x1f, 0x1f} },
+ {0x0633, {0xf9, 0xd1} },
+ {0x0634, {0xc0, 0xc3} },
+ {0x0635, {0x4d, 0x8d} },
+ {0x0636, {0x21, 0x31} },
+ {0x0637, {0x83, 0x83} },
+ {0x0638, {0x08, 0x8c} },
+ {0x0639, {0x19, 0x19} },
+ {0x063a, {0x45, 0xa5} },
+ {0x063b, {0xef, 0xec} },
+ {0x063c, {0x8a, 0x8a} },
+ {0x063d, {0xf4, 0xf6} },
+ {0x063e, {0x8f, 0x8f} },
+ {0x063f, {0x44, 0x0c} },
+ {0x0640, {0xef, 0xf0} },
+ {0x0641, {0x66, 0x66} },
+ {0x0642, {0xcc, 0xd2} },
+ {0x0643, {0x41, 0x41} },
+ {0x0644, {0x63, 0x93} },
+ {0x0645, {0x8e, 0x8e} },
+ {0x0646, {0xa2, 0x42} },
+ {0x0647, {0x7b, 0x7b} },
+ {0x0648, {0x04, 0x04} },
+ {0x0649, {0x00, 0x00} },
+ {0x064a, {0x40, 0x40} },
+ {0x064b, {0x8c, 0x98} },
+ {0x064c, {0x00, 0x00} },
+ {0x064d, {0x63, 0xc3} },
+ {0x064e, {0x04, 0x04} },
+ {0x064f, {0x20, 0x20} },
+ {0x0650, {0x00, 0x00} },
+ {0x0651, {0x40, 0x40} },
+ {0x0652, {0x01, 0x01} },
};
-#define NUM_LPFILTER_COEF (sizeof (lpfilter_coef) / sizeof(struct au8522_register_config))
+#define NUM_LPFILTER_COEF (sizeof(lpfilter_coef)\
+ / sizeof(struct au8522_register_config))
static inline struct au8522_state *to_state(struct v4l2_subdev *sd)
{
au8522_writereg(state, AU8522_TVDEC_VBI_USER_FRAME_PAT2_REG01EH, 0x00);
au8522_writereg(state, AU8522_TVDEC_VBI_USER_FRAME_PAT1_REG01FH, 0x00);
au8522_writereg(state, AU8522_TVDEC_VBI_USER_FRAME_PAT0_REG020H, 0x00);
- au8522_writereg(state, AU8522_TVDEC_VBI_USER_FRAME_MASK2_REG021H,0x00);
- au8522_writereg(state, AU8522_TVDEC_VBI_USER_FRAME_MASK1_REG022H,0x00);
- au8522_writereg(state, AU8522_TVDEC_VBI_USER_FRAME_MASK0_REG023H,0x00);
+ au8522_writereg(state, AU8522_TVDEC_VBI_USER_FRAME_MASK2_REG021H,
+ 0x00);
+ au8522_writereg(state, AU8522_TVDEC_VBI_USER_FRAME_MASK1_REG022H,
+ 0x00);
+ au8522_writereg(state, AU8522_TVDEC_VBI_USER_FRAME_MASK0_REG023H,
+ 0x00);
/* Setup the VBI registers */
- for (i = 0x30; i < 0x60; i++) {
+ for (i = 0x30; i < 0x60; i++)
au8522_writereg(state, i, 0x40);
- }
+
/* For some reason, every register is 0x40 except register 0x44
(confirmed via the HVR-950q USB capture) */
au8522_writereg(state, 0x44, 0x60);
if (aud_input != AU8522_AUDIO_SIF) {
/* The caller asked for a mode we don't currently support */
- printk("Unsupported audio mode requested! mode=%d\n",
+ printk(KERN_ERR "Unsupported audio mode requested! mode=%d\n",
aud_input);
return;
}
} else if (route->input == AU8522_COMPOSITE_CH4_SIF) {
au8522_setup_cvbs_tuner_mode(state);
} else {
- printk("au8522 mode not currently supported\n");
+ printk(KERN_ERR "au8522 mode not currently supported\n");
return -EINVAL;
}
return 0;
instance = au8522_get_state(&state, client->adapter, client->addr);
switch (instance) {
case 0:
- printk("au8522_decoder allocation failed\n");
+ printk(KERN_ERR "au8522_decoder allocation failed\n");
return -EIO;
case 1:
/* new demod instance */
- printk("au8522_decoder creating new instance...\n");
+ printk(KERN_INFO "au8522_decoder creating new instance...\n");
break;
default:
/* existing demod instance */
- printk("au8522_decoder attaching to existing instance...\n");
+ printk(KERN_INFO "au8522_decoder attach existing instance.\n");
break;
}
#include <linux/device.h>
#include <linux/suspend.h>
#include <linux/version.h>
-#include <linux/videodev.h>
#include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-chip-ident.h>
#define AU0828_VERSION_CODE KERNEL_VERSION(0, 0, 1)
-/* Forward declarations */
-void au0828_analog_stream_reset(struct au0828_dev *dev);
-
/* ------------------------------------------------------------------
Videobuf operations
------------------------------------------------------------------*/
static int check_dev(struct au0828_dev *dev)
{
if (dev->dev_state & DEV_DISCONNECTED) {
- printk("v4l2 ioctl: device not present\n");
+ printk(KERN_INFO "v4l2 ioctl: device not present\n");
return -ENODEV;
}
if (dev->dev_state & DEV_MISCONFIGURED) {
- printk("v4l2 ioctl: device is misconfigured; "
+ printk(KERN_INFO "v4l2 ioctl: device is misconfigured; "
"close and open it again\n");
return -EIO;
}
if ((char *)startwrite + lencopy > (char *)outp +
buf->vb.size) {
- au0828_isocdbg("Overflow of %zi bytes past buffer end (2)\n",
+ au0828_isocdbg("Overflow %zi bytes past buf end (2)\n",
((char *)startwrite + lencopy) -
((char *)outp + buf->vb.size));
lencopy = remain = (char *)outp + buf->vb.size -
if (offset > 1440) {
/* We have enough data to check for greenscreen */
- if (outp[0] < 0x60 && outp[1440] < 0x60) {
+ if (outp[0] < 0x60 && outp[1440] < 0x60)
dev->greenscreen_detected = 1;
- }
}
dma_q->pos += len;
continue;
}
- if (urb->iso_frame_desc[i].actual_length <= 0) {
+ if (urb->iso_frame_desc[i].actual_length <= 0)
continue;
- }
+
if (urb->iso_frame_desc[i].actual_length >
dev->max_pkt_size) {
au0828_isocdbg("packet bigger than packet size");
if (buf != NULL)
buffer_filled(dev, dma_q, buf);
get_next_buf(dma_q, &buf);
- if (buf == NULL) {
+ if (buf == NULL)
outp = NULL;
- } else
+ else
outp = videobuf_to_vmalloc(&buf->vb);
}
if (buf != NULL) {
- if (fbyte & 0x40) {
+ if (fbyte & 0x40)
buf->top_field = 1;
- } else {
+ else
buf->top_field = 0;
- }
}
dma_q->pos = 0;
}
- if (buf != NULL) {
+ if (buf != NULL)
au0828_copy_video(dev, dma_q, buf, p, outp, len);
- }
}
return rc;
}
if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
rc = videobuf_iolock(vq, &buf->vb, NULL);
if (rc < 0) {
- printk("videobuf_iolock failed\n");
+ printk(KERN_INFO "videobuf_iolock failed\n");
goto fail;
}
}
AU0828_MAX_ISO_BUFS, dev->max_pkt_size,
au0828_isoc_copy);
if (rc < 0) {
- printk("au0828_init_isoc failed\n");
+ printk(KERN_INFO "au0828_init_isoc failed\n");
goto fail;
}
}
int ret = 0;
dev->stream_state = STREAM_INTERRUPT;
- if(dev->dev_state == DEV_DISCONNECTED)
+ if (dev->dev_state == DEV_DISCONNECTED)
return -ENODEV;
- else if(ret) {
+ else if (ret) {
dev->dev_state = DEV_MISCONFIGURED;
- dprintk(1, "%s device is misconfigured!\n", __FUNCTION__);
+ dprintk(1, "%s device is misconfigured!\n", __func__);
return ret;
}
return 0;
list_for_each(list, &au0828_devlist) {
h = list_entry(list, struct au0828_dev, au0828list);
- if(h->vdev->minor == minor) {
+ if (h->vdev->minor == minor) {
dev = h;
type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
}
#ifdef VBI_NOT_YET_WORKING
- if(h->vbi_dev->minor == minor) {
+ if (h->vbi_dev->minor == minor) {
dev = h;
type = V4L2_BUF_TYPE_VBI_CAPTURE;
}
#endif
}
- if(NULL == dev)
+ if (NULL == dev)
return -ENODEV;
fh = kzalloc(sizeof(struct au0828_fh), GFP_KERNEL);
- if(NULL == fh) {
+ if (NULL == fh) {
dprintk(1, "Failed allocate au0828_fh struct!\n");
return -ENOMEM;
}
fh->dev = dev;
filp->private_data = fh;
- if(fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE && dev->users == 0) {
+ if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE && dev->users == 0) {
/* set au0828 interface0 to AS5 here again */
ret = usb_set_interface(dev->usbdev, 0, 5);
- if(ret < 0) {
- printk("Au0828 can't set alt setting to 5!\n");
+ if (ret < 0) {
+ printk(KERN_INFO "Au0828 can't set alternate to 5!\n");
return -EBUSY;
}
dev->width = NTSC_STD_W;
if (res_check(fh))
res_free(fh);
- if(dev->users == 1) {
+ if (dev->users == 1) {
videobuf_stop(&fh->vb_vidq);
videobuf_mmap_free(&fh->vb_vidq);
- if(dev->dev_state & DEV_DISCONNECTED) {
+ if (dev->dev_state & DEV_DISCONNECTED) {
au0828_analog_unregister(dev);
mutex_unlock(&dev->lock);
kfree(dev);
/* When close the device, set the usb intf0 into alt0 to free
USB bandwidth */
ret = usb_set_interface(dev->usbdev, 0, 0);
- if(ret < 0)
- printk("Au0828 can't set alt setting to 0!\n");
+ if (ret < 0)
+ printk(KERN_INFO "Au0828 can't set alternate to 0!\n");
}
kfree(fh);
if (rc < 0)
return rc;
- if(fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
+ if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
mutex_lock(&dev->lock);
rc = res_get(fh);
mutex_unlock(&dev->lock);
maxheight = 480;
#ifdef VBI_NOT_YET_WORKING
- if(format->type == V4L2_BUF_TYPE_SLICED_VBI_CAPTURE) {
+ if (format->type == V4L2_BUF_TYPE_SLICED_VBI_CAPTURE) {
dprintk(1, "VBI format set: to be supported!\n");
return 0;
}
- if(format->type == V4L2_BUF_TYPE_VBI_CAPTURE) {
+ if (format->type == V4L2_BUF_TYPE_VBI_CAPTURE)
return 0;
- }
#endif
- if(format->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) {
+ if (format->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
- }
/* If they are demanding a format other than the one we support,
bail out (tvtime asks for UYVY and then retries with YUYV) */
- if (format->fmt.pix.pixelformat != V4L2_PIX_FMT_UYVY) {
+ if (format->fmt.pix.pixelformat != V4L2_PIX_FMT_UYVY)
return -EINVAL;
- }
/* format->fmt.pix.width only support 720 and height 480 */
- if(width != 720)
+ if (width != 720)
width = 720;
- if(height != 480)
+ if (height != 480)
height = 480;
format->fmt.pix.width = width;
format->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M;
format->fmt.pix.field = V4L2_FIELD_INTERLACED;
- if(cmd == VIDIOC_TRY_FMT)
+ if (cmd == VIDIOC_TRY_FMT)
return 0;
/* maybe set new image format, driver current only support 720*480 */
dev->field_size = width * height;
dev->bytesperline = width * 2;
- if(dev->stream_state == STREAM_ON) {
+ if (dev->stream_state == STREAM_ON) {
dprintk(1, "VIDIOC_SET_FMT: interrupting stream!\n");
- if((ret = au0828_stream_interrupt(dev))) {
+ ret = au0828_stream_interrupt(dev);
+ if (ret != 0) {
dprintk(1, "error interrupting video stream!\n");
return ret;
}
/* set au0828 interface0 to AS5 here again */
ret = usb_set_interface(dev->usbdev, 0, 5);
- if(ret < 0) {
- printk("Au0828 can't set alt setting to 5!\n");
+ if (ret < 0) {
+ printk(KERN_INFO "Au0828 can't set alt setting to 5!\n");
return -EBUSY;
}
static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{
- if(f->index)
+ if (f->index)
return -EINVAL;
f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
int rc;
if (videobuf_queue_is_busy(&fh->vb_vidq)) {
- printk("%s queue busy\n", __func__);
+ printk(KERN_INFO "%s queue busy\n", __func__);
rc = -EBUSY;
goto out;
}
if (dev->stream_on && !fh->stream_on) {
- printk("%s device in use by another fh\n", __func__);
+ printk(KERN_INFO "%s device in use by another fh\n", __func__);
rc = -EBUSY;
goto out;
}
tmp = input->index;
- if(tmp > AU0828_MAX_INPUT)
+ if (tmp > AU0828_MAX_INPUT)
return -EINVAL;
- if(AUVI_INPUT(tmp).type == 0)
+ if (AUVI_INPUT(tmp).type == 0)
return -EINVAL;
input->index = tmp;
strcpy(input->name, inames[AUVI_INPUT(tmp).type]);
- if((AUVI_INPUT(tmp).type == AU0828_VMUX_TELEVISION) ||
- (AUVI_INPUT(tmp).type == AU0828_VMUX_CABLE))
+ if ((AUVI_INPUT(tmp).type == AU0828_VMUX_TELEVISION) ||
+ (AUVI_INPUT(tmp).type == AU0828_VMUX_CABLE))
input->type |= V4L2_INPUT_TYPE_TUNER;
else
input->type |= V4L2_INPUT_TYPE_CAMERA;
int i;
struct v4l2_routing route;
- dprintk(1, "VIDIOC_S_INPUT in function %s, input=%d\n", __FUNCTION__,
+ dprintk(1, "VIDIOC_S_INPUT in function %s, input=%d\n", __func__,
index);
- if(index >= AU0828_MAX_INPUT)
+ if (index >= AU0828_MAX_INPUT)
return -EINVAL;
- if(AUVI_INPUT(index).type == 0)
+ if (AUVI_INPUT(index).type == 0)
return -EINVAL;
dev->ctrl_input = index;
- switch(AUVI_INPUT(index).type) {
+ switch (AUVI_INPUT(index).type) {
case AU0828_VMUX_SVIDEO:
dev->input_type = AU0828_VMUX_SVIDEO;
break;
for (i = 0; i < AU0828_MAX_INPUT; i++) {
int enable = 0;
- if (AUVI_INPUT(i).audio_setup == NULL) {
+ if (AUVI_INPUT(i).audio_setup == NULL)
continue;
- }
if (i == index)
enable = 1;
struct au0828_dev *dev = fh->dev;
unsigned int index = a->index;
- if(a->index > 1)
+ if (a->index > 1)
return -EINVAL;
index = dev->ctrl_ainput;
- if(index == 0)
+ if (index == 0)
strcpy(a->name, "Television");
else
strcpy(a->name, "Line in");
{
struct au0828_fh *fh = priv;
struct au0828_dev *dev = fh->dev;
- if(a->index != dev->ctrl_ainput)
+ if (a->index != dev->ctrl_ainput)
return -EINVAL;
return 0;
}
struct au0828_fh *fh = priv;
struct au0828_dev *dev = fh->dev;
- if(t->index != 0)
+ if (t->index != 0)
return -EINVAL;
strcpy(t->name, "Auvitek tuner");
struct au0828_fh *fh = priv;
struct au0828_dev *dev = fh->dev;
- if(t->index != 0)
+ if (t->index != 0)
return -EINVAL;
t->type = V4L2_TUNER_ANALOG_TV;
struct au0828_fh *fh = priv;
struct au0828_dev *dev = fh->dev;
- if(freq->tuner != 0)
+ if (freq->tuner != 0)
return -EINVAL;
- if(freq->type != V4L2_TUNER_ANALOG_TV)
+ if (freq->type != V4L2_TUNER_ANALOG_TV)
return -EINVAL;
dev->ctrl_freq = freq->frequency;
struct au0828_fh *fh = priv;
struct au0828_dev *dev = fh->dev;
- if(cc->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
+ if (cc->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
cc->bounds.left = 0;
if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
au0828_call_i2c_clients(dev, VIDIOC_STREAMOFF, &b);
- if((ret = au0828_stream_interrupt(dev)) != 0)
+ ret = au0828_stream_interrupt(dev);
+ if (ret != 0)
return ret;
}
for (i = 0; i < AU0828_MAX_INPUT; i++) {
- if (AUVI_INPUT(i).audio_setup == NULL) {
+ if (AUVI_INPUT(i).audio_setup == NULL)
continue;
- }
(AUVI_INPUT(i).audio_setup)(dev, 0);
}
/* set au0828 usb interface0 to as5 */
retval = usb_set_interface(dev->usbdev,
- interface->cur_altsetting->desc.bInterfaceNumber, 5);
+ interface->cur_altsetting->desc.bInterfaceNumber, 5);
if (retval != 0) {
- printk("Failure setting usb interface0 to as5\n");
+ printk(KERN_INFO "Failure setting usb interface0 to as5\n");
return retval;
}
/* Figure out which endpoint has the isoc interface */
iface_desc = interface->cur_altsetting;
- for(i = 0; i < iface_desc->desc.bNumEndpoints; i++){
+ for (i = 0; i < iface_desc->desc.bNumEndpoints; i++) {
endpoint = &iface_desc->endpoint[i].desc;
- if(((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) &&
- ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_ISOC)){
+ if (((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK)
+ == USB_DIR_IN) &&
+ ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
+ == USB_ENDPOINT_XFER_ISOC)) {
/* we find our isoc in endpoint */
u16 tmp = le16_to_cpu(endpoint->wMaxPacketSize);
- dev->max_pkt_size = (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
+ dev->max_pkt_size = (tmp & 0x07ff) *
+ (((tmp & 0x1800) >> 11) + 1);
dev->isoc_in_endpointaddr = endpoint->bEndpointAddress;
}
}
- if(!(dev->isoc_in_endpointaddr)) {
- printk("Could not locate isoc endpoint\n");
+ if (!(dev->isoc_in_endpointaddr)) {
+ printk(KERN_INFO "Could not locate isoc endpoint\n");
kfree(dev);
return -ENODEV;
}
/* allocate and fill v4l2 video struct */
dev->vdev = video_device_alloc();
- if(NULL == dev->vdev) {
+ if (NULL == dev->vdev) {
dprintk(1, "Can't allocate video_device.\n");
return -ENOMEM;
}
#ifdef VBI_NOT_YET_WORKING
dev->vbi_dev = video_device_alloc();
- if(NULL == dev->vbi_dev) {
+ if (NULL == dev->vbi_dev) {
dprintk(1, "Can't allocate vbi_device.\n");
kfree(dev->vdev);
return -ENOMEM;
/* Fill the video capture device struct */
*dev->vdev = au0828_video_template;
- dev->vdev->vfl_type = VID_TYPE_CAPTURE | VID_TYPE_TUNER;
dev->vdev->parent = &dev->usbdev->dev;
strcpy(dev->vdev->name, "au0828a video");
#ifdef VBI_NOT_YET_WORKING
/* Setup the VBI device */
*dev->vbi_dev = au0828_video_template;
- dev->vbi_dev->vfl_type = VFL_TYPE_VBI;
dev->vbi_dev->parent = &dev->usbdev->dev;
strcpy(dev->vbi_dev->name, "au0828a vbi");
#endif
list_add_tail(&dev->au0828list, &au0828_devlist);
/* Register the v4l2 device */
- if((retval = video_register_device(dev->vdev, VFL_TYPE_GRABBER, -1)) != 0) {
- dprintk(1, "unable to register video device (error = %d).\n", retval);
+ retval = video_register_device(dev->vdev, VFL_TYPE_GRABBER, -1);
+ if (retval != 0) {
+ dprintk(1, "unable to register video device (error = %d).\n",
+ retval);
list_del(&dev->au0828list);
video_device_release(dev->vdev);
return -ENODEV;
#ifdef VBI_NOT_YET_WORKING
/* Register the vbi device */
- if((retval = video_register_device(dev->vbi_dev, VFL_TYPE_VBI, -1)) != 0) {
- dprintk(1, "unable to register vbi device (error = %d).\n", retval);
+ retval = video_register_device(dev->vbi_dev, VFL_TYPE_VBI, -1);
+ if (retval != 0) {
+ dprintk(1, "unable to register vbi device (error = %d).\n",
+ retval);
list_del(&dev->au0828list);
video_device_release(dev->vbi_dev);
video_device_release(dev->vdev);
}
#endif
- dprintk(1, "%s completed!\n", __FUNCTION__);
+ dprintk(1, "%s completed!\n", __func__);
return 0;
}