24 #include <linux/list.h>
25 #include <linux/module.h>
26 #include <linux/kernel.h>
27 #include <linux/slab.h>
38 static unsigned int gbuffers = 8;
39 static unsigned int noninterlaced;
40 static unsigned int gbufsize = 720*576*4;
41 static unsigned int gbufsize_max = 720*576*4;
42 static char secam[] =
"--";
53 #define dprintk(fmt, arg...) if (video_debug&0x04) \
54 printk(KERN_DEBUG "%s/video: " fmt, dev->name , ## arg)
61 #define VP_T_CODE_P_NON_INVERTED 0x00
62 #define VP_T_CODE_P_INVERTED 0x01
69 #define VP_CLK_CTRL2_NOT_DELAYED 0x00
70 #define VP_CLK_CTRL2_DELAYED 0x04
74 #define VP_CLK_CTRL1_NON_INVERTED 0x00
75 #define VP_CLK_CTRL1_INVERTED 0x02
82 #define VP_VS_TYPE_MASK 0x07
84 #define VP_VS_TYPE_OFF 0x00
85 #define VP_VS_TYPE_V123 0x01
86 #define VP_VS_TYPE_V_ITU 0x02
87 #define VP_VS_TYPE_VGATE_L 0x03
88 #define VP_VS_TYPE_RESERVED1 0x04
89 #define VP_VS_TYPE_RESERVED2 0x05
90 #define VP_VS_TYPE_F_ITU 0x06
91 #define VP_VS_TYPE_SC_FID 0x07
96 static int video_out[][9] = {
97 [
CCIR656] = { 0x00, 0xb1, 0x00, 0xa1, 0x00, 0x04, 0x06, 0x00, 0x00 },
102 .name =
"8 bpp gray",
107 .name =
"15 bpp RGB, le",
112 .name =
"15 bpp RGB, be",
118 .name =
"16 bpp RGB, le",
123 .name =
"16 bpp RGB, be",
129 .name =
"24 bpp RGB, le",
134 .name =
"24 bpp RGB, be",
140 .name =
"32 bpp RGB, le",
145 .name =
"32 bpp RGB, be",
152 .name =
"4:2:2 packed, YUYV",
159 .name =
"4:2:2 packed, UYVY",
165 .name =
"4:2:2 planar, Y-Cb-Cr",
174 .name =
"4:2:0 planar, Y-Cb-Cr",
183 .name =
"4:2:0 planar, Y-Cb-Cr",
194 #define FORMATS ARRAY_SIZE(formats)
196 #define NORM_625_50 \
199 .video_v_start = 24, \
200 .video_v_stop = 311, \
201 .vbi_v_start_0 = 7, \
202 .vbi_v_stop_0 = 22, \
203 .vbi_v_start_1 = 319, \
206 #define NORM_525_60 \
209 .video_v_start = 23, \
210 .video_v_stop = 262, \
211 .vbi_v_start_0 = 10, \
212 .vbi_v_stop_0 = 21, \
213 .vbi_v_start_1 = 273, \
222 .sync_control = 0x18,
223 .luma_control = 0x40,
224 .chroma_ctrl1 = 0x81,
226 .chroma_ctrl2 = 0x06,
234 .sync_control = 0x18,
235 .luma_control = 0x40,
236 .chroma_ctrl1 = 0x81,
238 .chroma_ctrl2 = 0x06,
246 .sync_control = 0x18,
247 .luma_control = 0x40,
248 .chroma_ctrl1 = 0x81,
250 .chroma_ctrl2 = 0x06,
258 .sync_control = 0x18,
259 .luma_control = 0x40,
260 .chroma_ctrl1 = 0x81,
262 .chroma_ctrl2 = 0x06,
270 .sync_control = 0x59,
271 .luma_control = 0x40,
272 .chroma_ctrl1 = 0x89,
274 .chroma_ctrl2 = 0x0e,
282 .sync_control = 0x18,
283 .luma_control = 0x1b,
284 .chroma_ctrl1 = 0xd1,
286 .chroma_ctrl2 = 0x00,
294 .sync_control = 0x18,
295 .luma_control = 0x1b,
296 .chroma_ctrl1 = 0xd1,
298 .chroma_ctrl2 = 0x00,
306 .sync_control = 0x18,
307 .luma_control = 0x1b,
308 .chroma_ctrl1 = 0xd1,
310 .chroma_ctrl2 = 0x00,
318 .sync_control = 0x18,
319 .luma_control = 0x1b,
320 .chroma_ctrl1 = 0xd1,
322 .chroma_ctrl2 = 0x00,
330 .sync_control = 0x59,
331 .luma_control = 0x40,
332 .chroma_ctrl1 = 0xb9,
334 .chroma_ctrl2 = 0x0e,
342 .sync_control = 0x18,
343 .luma_control = 0x40,
344 .chroma_ctrl1 = 0xa1,
346 .chroma_ctrl2 = 0x06,
359 .vbi_v_start_1 = 273,
362 .sync_control = 0x18,
363 .luma_control = 0x40,
364 .chroma_ctrl1 = 0x81,
366 .chroma_ctrl2 = 0x06,
370 #define TVNORMS ARRAY_SIZE(tvnorms)
372 #define V4L2_CID_PRIVATE_INVERT (V4L2_CID_PRIVATE_BASE + 0)
373 #define V4L2_CID_PRIVATE_Y_ODD (V4L2_CID_PRIVATE_BASE + 1)
374 #define V4L2_CID_PRIVATE_Y_EVEN (V4L2_CID_PRIVATE_BASE + 2)
375 #define V4L2_CID_PRIVATE_AUTOMUTE (V4L2_CID_PRIVATE_BASE + 3)
376 #define V4L2_CID_PRIVATE_LASTP1 (V4L2_CID_PRIVATE_BASE + 4)
386 .name =
"Brightness",
390 .default_value = 128,
402 .name =
"Saturation",
448 .name =
"y offset odd field",
456 .name =
"y offset even field",
471 static const unsigned int CTRLS =
ARRAY_SIZE(video_ctrls);
477 for (i = 0; i < CTRLS; i++)
478 if (video_ctrls[i].
id ==
id)
479 return video_ctrls+
i;
488 if (formats[i].fourcc == fourcc)
517 static int res_check(
struct saa7134_fh *fh,
unsigned int bit)
522 static int res_locked(
struct saa7134_dev *dev,
unsigned int bit)
567 set_tvnorm(dev, dev->
tvnorm);
572 static void saa7134_set_decoder(
struct saa7134_dev *dev)
574 int luma_control, sync_control, mux;
583 luma_control |= 0x80;
585 sync_control |= 0x20;
625 saa7134_set_decoder(dev);
636 static const struct {
658 for (i = 0; i <
count; i++)
659 if (vals[i].xpsc == prescale)
667 (vals[i].xc2_1 << 3) | (vals[i].xdcg));
669 (vals[i].vpfy << 2) | vals[i].vpfy);
672 static void set_v_scale(
struct saa7134_dev *dev,
int task,
int yscale)
682 dprintk(
"yscale LPI yscale=%d\n",yscale);
688 val = 0x40 * 1024 / yscale;
689 dprintk(
"yscale ACM yscale=%d val=0x%x\n",yscale,val);
697 static void set_size(
struct saa7134_dev *dev,
int task,
700 int prescale,xscale,yscale,y_even,y_odd;
701 int h_start, h_stop, v_start, v_stop;
702 int div = interlace ? 2 : 1;
724 dprintk(
"prescale=%d xscale=%d yscale=%d\n",prescale,xscale,yscale);
725 set_h_prescale(dev,task,prescale);
728 set_v_scale(dev,task,yscale);
758 for (i = 0; i <
entries; i++) {
761 if (i < 15 && cl[i].position == cl[i+1].position)
766 dprintk(
"clip: %s winbits=%02x pos=%d\n",
767 name,winbits,cl[i].position);
770 for (; reg < 0x400; reg += 8) {
778 static int clip_range(
int val)
786 static int cliplist_cmp(
const void *
a,
const void *
b)
798 int nclips,
int interlace)
802 int div = interlace ? 2 : 1;
804 memset(col, 0,
sizeof(col));
805 memset(row, 0,
sizeof(row));
806 for (i = 0; i < nclips && i < 8; i++) {
807 col[
cols].position = clip_range(clips[i].
c.left);
808 col[
cols].enable = (1 <<
i);
810 col[
cols].position = clip_range(clips[i].
c.left+clips[i].
c.width);
811 col[
cols].disable = (1 <<
i);
813 row[
rows].position = clip_range(clips[i].
c.top / div);
814 row[
rows].enable = (1 <<
i);
816 row[
rows].position = clip_range((clips[i].
c.top + clips[i].
c.height)
818 row[
rows].disable = (1 <<
i);
821 sort(col, cols,
sizeof col[0], cliplist_cmp,
NULL);
823 set_cliplist(dev,0x380,col,cols,
"cols");
824 set_cliplist(dev,0x384,row,
rows,
"rows");
837 if (win->
w.width < 48 || win->
w.height < 32)
847 field = (win->
w.height > maxh/2)
863 if (win->
w.width > maxw)
865 if (win->
w.height > maxh)
866 win->
w.height = maxh;
875 err = verify_preview(dev,&fh->
win);
880 dprintk(
"start_preview %dx%d+%d+%d %s field=%s\n",
881 fh->
win.w.width,fh->
win.w.height,
882 fh->
win.w.left,fh->
win.w.top,
898 base += dev->
ovbuf.fmt.bytesperline * fh->
win.w.top;
899 base += dev->
ovfmt->depth/8 * fh->
win.w.left;
900 bpl = dev->
ovbuf.fmt.bytesperline;
904 if (dev->
ovfmt->wswap)
938 unsigned long base,
control,bpl;
941 dprintk(
"buffer_activate buf=%p\n",buf);
945 set_size(dev,
TASK_A,buf->
vb.width,buf->
vb.height,
955 if (buf->
fmt->planar)
958 bpl = (buf->
vb.width * buf->
fmt->depth) / 8;
961 (buf->
pt->dma >> 12);
979 if (buf->
fmt->planar) {
981 bpl_uv = bpl >> buf->
fmt->hshift;
982 lines_uv = buf->
vb.height >> buf->
fmt->vshift;
983 base2 = base + bpl * buf->
vb.height;
984 base3 = base2 + bpl_uv * lines_uv;
985 if (buf->
fmt->uvswap)
987 dprintk(
"uv: bpl=%ld lines=%ld base2/3=%ld/%ld\n",
988 bpl_uv,lines_uv,base2,base3);
1029 if (fh->
width < 48 ||
1037 if (0 != buf->
vb.baddr && buf->
vb.bsize < size)
1040 dprintk(
"buffer_prepare [%d,size=%dx%d,bytes=%d,fields=%s,%s]\n",
1043 if (buf->
vb.width != fh->
width ||
1045 buf->
vb.size != size ||
1046 buf->
vb.field != field ||
1082 buffer_setup(
struct videobuf_queue *q,
unsigned int *count,
unsigned int *size)
1109 .buf_setup = buffer_setup,
1110 .buf_prepare = buffer_prepare,
1111 .buf_queue = buffer_queue,
1112 .buf_release = buffer_release,
1121 ctrl = ctrl_by_id(c->
id);
1175 unsigned long flags;
1176 int restart_overlay = 0;
1191 ctrl = ctrl_by_id(c->
id);
1196 switch (ctrl->
type) {
1244 restart_overlay = 1;
1248 restart_overlay = 1;
1252 restart_overlay = 1;
1258 tda9887_cfg.
tuner = TUNER_TDA9887;
1277 stop_preview(dev,fh);
1278 start_preview(dev,fh);
1279 spin_unlock_irqrestore(&dev->
slock,flags);
1315 static int saa7134_resource(
struct saa7134_fh *fh)
1327 static int video_open(
struct file *
file)
1347 dprintk(
"open dev=%s radio=%d type=%s\n", video_device_node_name(vdev),
1391 video_read(
struct file *file,
char __user *
data,
size_t count, loff_t *ppos)
1406 data, count, ppos, 1,
1420 unsigned int rc = 0;
1427 if (!list_empty(&fh->
cap.stream))
1435 if (0 != fh->
cap.ops->buf_prepare(&fh->
cap,fh->
cap.read_buf,fh->
cap.field))
1437 fh->
cap.ops->buf_queue(&fh->
cap,fh->
cap.read_buf);
1438 fh->
cap.read_off = 0;
1440 buf = fh->
cap.read_buf;
1446 poll_wait(file, &buf->
done, wait);
1458 static int video_release(
struct file *file)
1463 unsigned long flags;
1470 stop_preview(dev,fh);
1471 spin_unlock_irqrestore(&dev->
slock,flags);
1480 if (fh->
cap.read_buf) {
1481 buffer_release(&fh->
cap,fh->
cap.read_buf);
1513 static int video_mmap(
struct file *file,
struct vm_area_struct * vma)
1520 static ssize_t radio_read(
struct file *file,
char __user *data,
1521 size_t count, loff_t *ppos)
1527 cmd.block_count = count/3;
1537 static unsigned int radio_poll(
struct file *file,
poll_table *wait)
1553 static int saa7134_try_get_set_fmt_vbi_cap(
struct file *file,
void *
priv,
1560 f->
fmt.
vbi.sampling_rate = 6750000 * 4;
1561 f->
fmt.
vbi.samples_per_line = 2048 ;
1563 f->
fmt.
vbi.offset = 64 * 4;
1573 static int saa7134_g_fmt_vid_cap(
struct file *file,
void *
priv,
1581 f->
fmt.
pix.pixelformat = fh->
fmt->fourcc;
1582 f->
fmt.
pix.bytesperline =
1583 (f->
fmt.
pix.width * fh->
fmt->depth) >> 3;
1589 static int saa7134_g_fmt_vid_overlay(
struct file *file,
void *
priv,
1603 static int saa7134_try_fmt_vid_cap(
struct file *file,
void *priv,
1610 unsigned int maxw, maxh;
1616 field = f->
fmt.
pix.field;
1621 field = (f->
fmt.
pix.height > maxh/2)
1637 if (f->
fmt.
pix.width < 48)
1639 if (f->
fmt.
pix.height < 32)
1641 if (f->
fmt.
pix.width > maxw)
1643 if (f->
fmt.
pix.height > maxh)
1644 f->
fmt.
pix.height = maxh;
1645 f->
fmt.
pix.width &= ~0x03;
1646 f->
fmt.
pix.bytesperline =
1654 static int saa7134_try_fmt_vid_overlay(
struct file *file,
void *priv,
1665 return verify_preview(dev, &f->
fmt.
win);
1668 static int saa7134_s_fmt_vid_cap(
struct file *file,
void *priv,
1674 err = saa7134_try_fmt_vid_cap(file, priv, f);
1685 static int saa7134_s_fmt_vid_overlay(
struct file *file,
void *priv,
1691 unsigned long flags;
1697 err = verify_preview(dev, &f->
fmt.
win);
1717 stop_preview(dev, fh);
1718 start_preview(dev, fh);
1719 spin_unlock_irqrestore(&dev->
slock, flags);
1735 ctrl = ctrl_by_id(c->
id);
1736 *c = (
NULL !=
ctrl) ? *ctrl : no_ctrl;
1741 static int saa7134_enum_input(
struct file *file,
void *priv,
1763 if (0 != (v1 & 0x40))
1765 if (0 != (v2 & 0x40))
1767 if (0 != (v2 & 0x0e))
1774 static int saa7134_g_input(
struct file *file,
void *priv,
unsigned int *i)
1783 static int saa7134_s_input(
struct file *file,
void *priv,
unsigned int i)
1803 static int saa7134_querycap(
struct file *file,
void *priv,
1826 if ((tuner_type == TUNER_ABSENT) || (tuner_type ==
UNSET))
1833 unsigned long flags;
1852 if (*
id == tvnorms[i].
id)
1857 if (*
id & tvnorms[i].
id)
1863 if (secam[0] ==
'L' || secam[0] ==
'l') {
1864 if (secam[1] ==
'C' || secam[1] ==
'c')
1869 if (secam[0] ==
'D' || secam[0] ==
'd')
1874 for (i = 0; i <
TVNORMS; i++) {
1875 if (fixup == tvnorms[i].
id)
1882 *
id = tvnorms[
i].
id;
1887 stop_preview(dev, fh);
1888 spin_unlock_irqrestore(&dev->
slock, flags);
1890 set_tvnorm(dev, &tvnorms[i]);
1893 start_preview(dev, fh);
1894 spin_unlock_irqrestore(&dev->
slock, flags);
1896 set_tvnorm(dev, &tvnorms[i]);
1904 static int saa7134_s_std(
struct file *file,
void *priv,
v4l2_std_id *
id)
1911 static int saa7134_g_std(
struct file *file,
void *priv,
v4l2_std_id *
id)
1920 static int saa7134_cropcap(
struct file *file,
void *priv,
1944 static int saa7134_g_crop(
struct file *file,
void *f,
struct v4l2_crop *crop)
1956 static int saa7134_s_crop(
struct file *file,
void *f,
const struct v4l2_crop *crop)
1966 if (crop->
c.height < 0)
1968 if (crop->
c.width < 0)
1993 static int saa7134_g_tuner(
struct file *file,
void *priv,
2002 memset(t, 0,
sizeof(*t));
2007 if (n == SAA7134_INPUT_MAX)
2025 static int saa7134_s_tuner(
struct file *file,
void *priv,
2037 if (
UNSET == mode) {
2047 static int saa7134_g_frequency(
struct file *file,
void *priv,
2059 static int saa7134_s_frequency(
struct file *file,
void *priv,
2086 static int saa7134_g_audio(
struct file *file,
void *priv,
struct v4l2_audio *a)
2092 static int saa7134_s_audio(
struct file *file,
void *priv,
const struct v4l2_audio *a)
2097 static int saa7134_g_priority(
struct file *file,
void *f,
enum v4l2_priority *
p)
2106 static int saa7134_s_priority(
struct file *file,
void *f,
2115 static int saa7134_enum_fmt_vid_cap(
struct file *file,
void *priv,
2118 if (f->
index >= FORMATS)
2129 static int saa7134_enum_fmt_vid_overlay(
struct file *file,
void *priv,
2148 static int saa7134_g_fbuf(
struct file *file,
void *f,
2160 static int saa7134_s_fbuf(
struct file *file,
void *f,
2179 if (0 == dev->
ovbuf.fmt.bytesperline)
2180 dev->
ovbuf.fmt.bytesperline =
2185 static int saa7134_overlay(
struct file *file,
void *f,
unsigned int on)
2189 unsigned long flags;
2200 start_preview(dev, fh);
2201 spin_unlock_irqrestore(&dev->
slock, flags);
2207 stop_preview(dev, fh);
2208 spin_unlock_irqrestore(&dev->
slock, flags);
2214 static int saa7134_reqbufs(
struct file *file,
void *priv,
2221 static int saa7134_querybuf(
struct file *file,
void *priv,
2228 static int saa7134_qbuf(
struct file *file,
void *priv,
struct v4l2_buffer *b)
2234 static int saa7134_dqbuf(
struct file *file,
void *priv,
struct v4l2_buffer *b)
2241 static int saa7134_streamon(
struct file *file,
void *priv,
2246 int res = saa7134_resource(fh);
2248 if (!res_get(dev, fh, res))
2254 static int saa7134_streamoff(
struct file *file,
void *priv,
2260 int res = saa7134_resource(fh);
2265 res_free(dev, fh, res);
2269 static int saa7134_g_parm(
struct file *file,
void *fh,
2275 #ifdef CONFIG_VIDEO_ADV_DEBUG
2276 static int vidioc_g_register (
struct file *file,
void *priv,
2289 static int vidioc_s_register (
struct file *file,
void *priv,
2302 static int radio_querycap(
struct file *file,
void *priv,
2315 static int radio_g_tuner(
struct file *file,
void *priv,
2324 memset(t, 0,
sizeof(*t));
2336 static int radio_s_tuner(
struct file *file,
void *priv,
2349 static int radio_enum_input(
struct file *file,
void *priv,
2361 static int radio_g_input(
struct file *filp,
void *priv,
unsigned int *i)
2367 static int radio_g_audio(
struct file *file,
void *priv,
2370 memset(a, 0,
sizeof(*a));
2375 static int radio_s_audio(
struct file *file,
void *priv,
2381 static int radio_s_input(
struct file *filp,
void *priv,
unsigned int i)
2386 static int radio_s_std(
struct file *file,
void *fh,
v4l2_std_id *norm)
2391 static int radio_queryctrl(
struct file *file,
void *priv,
2400 ctrl = ctrl_by_id(c->
id);
2411 .release = video_release,
2419 .vidioc_querycap = saa7134_querycap,
2420 .vidioc_enum_fmt_vid_cap = saa7134_enum_fmt_vid_cap,
2421 .vidioc_g_fmt_vid_cap = saa7134_g_fmt_vid_cap,
2422 .vidioc_try_fmt_vid_cap = saa7134_try_fmt_vid_cap,
2423 .vidioc_s_fmt_vid_cap = saa7134_s_fmt_vid_cap,
2424 .vidioc_enum_fmt_vid_overlay = saa7134_enum_fmt_vid_overlay,
2425 .vidioc_g_fmt_vid_overlay = saa7134_g_fmt_vid_overlay,
2426 .vidioc_try_fmt_vid_overlay = saa7134_try_fmt_vid_overlay,
2427 .vidioc_s_fmt_vid_overlay = saa7134_s_fmt_vid_overlay,
2428 .vidioc_g_fmt_vbi_cap = saa7134_try_get_set_fmt_vbi_cap,
2429 .vidioc_try_fmt_vbi_cap = saa7134_try_get_set_fmt_vbi_cap,
2430 .vidioc_s_fmt_vbi_cap = saa7134_try_get_set_fmt_vbi_cap,
2431 .vidioc_g_audio = saa7134_g_audio,
2432 .vidioc_s_audio = saa7134_s_audio,
2433 .vidioc_cropcap = saa7134_cropcap,
2434 .vidioc_reqbufs = saa7134_reqbufs,
2435 .vidioc_querybuf = saa7134_querybuf,
2436 .vidioc_qbuf = saa7134_qbuf,
2437 .vidioc_dqbuf = saa7134_dqbuf,
2438 .vidioc_s_std = saa7134_s_std,
2439 .vidioc_g_std = saa7134_g_std,
2440 .vidioc_enum_input = saa7134_enum_input,
2441 .vidioc_g_input = saa7134_g_input,
2442 .vidioc_s_input = saa7134_s_input,
2444 .vidioc_g_ctrl = saa7134_g_ctrl,
2445 .vidioc_s_ctrl = saa7134_s_ctrl,
2446 .vidioc_streamon = saa7134_streamon,
2447 .vidioc_streamoff = saa7134_streamoff,
2448 .vidioc_g_tuner = saa7134_g_tuner,
2449 .vidioc_s_tuner = saa7134_s_tuner,
2450 .vidioc_g_crop = saa7134_g_crop,
2451 .vidioc_s_crop = saa7134_s_crop,
2452 .vidioc_g_fbuf = saa7134_g_fbuf,
2453 .vidioc_s_fbuf = saa7134_s_fbuf,
2454 .vidioc_overlay = saa7134_overlay,
2455 .vidioc_g_priority = saa7134_g_priority,
2456 .vidioc_s_priority = saa7134_s_priority,
2457 .vidioc_g_parm = saa7134_g_parm,
2458 .vidioc_g_frequency = saa7134_g_frequency,
2459 .vidioc_s_frequency = saa7134_s_frequency,
2460 #ifdef CONFIG_VIDEO_ADV_DEBUG
2461 .vidioc_g_register = vidioc_g_register,
2462 .vidioc_s_register = vidioc_s_register,
2470 .release = video_release,
2476 .vidioc_querycap = radio_querycap,
2477 .vidioc_g_tuner = radio_g_tuner,
2478 .vidioc_enum_input = radio_enum_input,
2479 .vidioc_g_audio = radio_g_audio,
2480 .vidioc_s_tuner = radio_s_tuner,
2481 .vidioc_s_audio = radio_s_audio,
2482 .vidioc_s_input = radio_s_input,
2483 .vidioc_s_std = radio_s_std,
2484 .vidioc_queryctrl = radio_queryctrl,
2485 .vidioc_g_input = radio_g_input,
2486 .vidioc_g_ctrl = saa7134_g_ctrl,
2487 .vidioc_s_ctrl = saa7134_s_ctrl,
2488 .vidioc_g_frequency = saa7134_g_frequency,
2489 .vidioc_s_frequency = saa7134_s_frequency,
2496 .name =
"saa7134-video",
2497 .fops = &video_fops,
2498 .ioctl_ops = &video_ioctl_ops,
2504 .name =
"saa7134-radio",
2505 .fops = &radio_fops,
2506 .ioctl_ops = &radio_ioctl_ops,
2514 if (gbufsize < 0 || gbufsize > gbufsize_max)
2515 gbufsize = gbufsize_max;
2532 INIT_LIST_HEAD(&dev->
video_q.queue);
2553 video_reg = video_out[vo][1];
2559 video_reg = video_out[vo][5];
2565 video_reg = video_out[vo][6];
2583 set_tvnorm(dev,&tvnorms[0]);
2592 static const char *
st[] = {
2593 "(no signal)",
"NTSC",
"PAL",
"SECAM" };
2598 dprintk(
"DCSDT: pll: %s, sync: %s, norm: %s\n",
2599 (st1 & 0x40) ?
"not locked" :
"locked",
2600 (st2 & 0x40) ?
"no" :
"yes",
2602 dev->
nosignal = (st1 & 0x40) || (st2 & 0x40) || !(st2 & 0x1);
2614 if ((st2 & 0x80) && !noninterlaced && !dev->
nosignal)
2619 if (dev->
mops && dev->
mops->signal_change)
2620 dev->
mops->signal_change(dev);
2628 spin_lock(&dev->
slock);
2631 field = dev->
video_q.curr->vb.field;
2634 if ((status & 0x10) == 0x00) {
2635 dev->
video_q.curr->top_seen = 1;
2638 if (!dev->
video_q.curr->top_seen)
2641 if ((status & 0x10) != 0x10)
2644 if ((status & 0x10) != 0x00)
2653 spin_unlock(&dev->
slock);