Lines Matching refs:t

162 	struct saa5249_device *t;  in saa5249_attach()  local
171 t = kmalloc(sizeof(*t), GFP_KERNEL); in saa5249_attach()
172 if(t==NULL) in saa5249_attach()
177 memset(t, 0, sizeof(*t)); in saa5249_attach()
179 init_MUTEX(&t->lock); in saa5249_attach()
188 kfree(t); in saa5249_attach()
196 memset(t->vdau[pgbuf].pgbuf, ' ', sizeof(t->vdau[0].pgbuf)); in saa5249_attach()
197 memset(t->vdau[pgbuf].sregs, 0, sizeof(t->vdau[0].sregs)); in saa5249_attach()
198 memset(t->vdau[pgbuf].laststat, 0, sizeof(t->vdau[0].laststat)); in saa5249_attach()
199 t->vdau[pgbuf].expire = 0; in saa5249_attach()
200 t->vdau[pgbuf].clrfound = TRUE; in saa5249_attach()
201 t->vdau[pgbuf].stopped = TRUE; in saa5249_attach()
202 t->is_searching[pgbuf] = FALSE; in saa5249_attach()
204 vd->priv=t; in saa5249_attach()
213 kfree(t); in saa5249_attach()
218 t->client = client; in saa5249_attach()
305 static int i2c_sendbuf(struct saa5249_device *t, int reg, int count, u8 *data) in i2c_sendbuf() argument
312 if(i2c_master_send(t->client, buf, count+1)==count+1) in i2c_sendbuf()
317 static int i2c_senddata(struct saa5249_device *t, ...) in i2c_senddata() argument
323 va_start(argp,t); in i2c_senddata()
327 return i2c_sendbuf(t, buf[0], ct-1, buf+1); in i2c_senddata()
336 static int i2c_getdata(struct saa5249_device *t, int count, u8 *buf) in i2c_getdata() argument
338 if(i2c_master_recv(t->client, buf, count)!=count) in i2c_getdata()
348 static int do_saa5249_ioctl(struct saa5249_device *t, unsigned int cmd, void *arg) in do_saa5249_ioctl() argument
374 memset(t->vdau[req.pgbuf].pgbuf, ' ', sizeof(t->vdau[0].pgbuf)); in do_saa5249_ioctl()
375 t->vdau[req.pgbuf].clrfound = TRUE; in do_saa5249_ioctl()
387 t->vdau[req.pgbuf].clrfound = TRUE; in do_saa5249_ioctl()
408 t->vdau[req.pgbuf].sregs[0] = (req.pagemask & PG_HUND ? 0x10 : 0) | (req.page / 0x100); in do_saa5249_ioctl()
409 t->vdau[req.pgbuf].sregs[1] = (req.pagemask & PG_TEN ? 0x10 : 0) | ((req.page / 0x10) & 0xf); in do_saa5249_ioctl()
410 t->vdau[req.pgbuf].sregs[2] = (req.pagemask & PG_UNIT ? 0x10 : 0) | (req.page & 0xf); in do_saa5249_ioctl()
411 t->vdau[req.pgbuf].sregs[3] = (req.pagemask & HR_TEN ? 0x10 : 0) | (req.hour / 0x10); in do_saa5249_ioctl()
412 t->vdau[req.pgbuf].sregs[4] = (req.pagemask & HR_UNIT ? 0x10 : 0) | (req.hour & 0xf); in do_saa5249_ioctl()
413 t->vdau[req.pgbuf].sregs[5] = (req.pagemask & MIN_TEN ? 0x10 : 0) | (req.minute / 0x10); in do_saa5249_ioctl()
414 t->vdau[req.pgbuf].sregs[6] = (req.pagemask & MIN_UNIT ? 0x10 : 0) | (req.minute & 0xf); in do_saa5249_ioctl()
415 t->vdau[req.pgbuf].stopped = FALSE; in do_saa5249_ioctl()
416 t->vdau[req.pgbuf].clrfound = TRUE; in do_saa5249_ioctl()
417 t->is_searching[req.pgbuf] = TRUE; in do_saa5249_ioctl()
432 if (!t->vdau[req.pgbuf].stopped) in do_saa5249_ioctl()
434 if (i2c_senddata(t, 2, 0, -1) || in do_saa5249_ioctl()
435 i2c_sendbuf(t, 3, sizeof(t->vdau[0].sregs), t->vdau[req.pgbuf].sregs) || in do_saa5249_ioctl()
436 i2c_senddata(t, 8, 0, 25, 0, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', -1) || in do_saa5249_ioctl()
437 i2c_senddata(t, 2, 0, t->vdau[req.pgbuf].sregs[0] | 8, -1) || in do_saa5249_ioctl()
438 i2c_senddata(t, 8, 0, 25, 0, -1)) in do_saa5249_ioctl()
441 if (i2c_getdata(t, 10, infobits)) in do_saa5249_ioctl()
445 (memcmp(infobits, t->vdau[req.pgbuf].laststat, sizeof(infobits)) || in do_saa5249_ioctl()
446 time_after_eq(jiffies, t->vdau[req.pgbuf].expire))) in do_saa5249_ioctl()
448 if (i2c_senddata(t, 8, 0, 0, 0, -1) || in do_saa5249_ioctl()
449 i2c_getdata(t, VTX_PAGESIZE, t->vdau[req.pgbuf].pgbuf)) in do_saa5249_ioctl()
451 t->vdau[req.pgbuf].expire = jiffies + PGBUF_EXPIRE; in do_saa5249_ioctl()
452 memset(t->vdau[req.pgbuf].pgbuf + VTX_PAGESIZE, ' ', VTX_VIRTUALSIZE - VTX_PAGESIZE); in do_saa5249_ioctl()
453 if (t->virtual_mode) in do_saa5249_ioctl()
456 if (i2c_senddata(t, 8, 0, 0x20, 0, -1) || in do_saa5249_ioctl()
457 i2c_getdata(t, 40, t->vdau[req.pgbuf].pgbuf + VTX_PAGESIZE + 20 * 40)) in do_saa5249_ioctl()
460 if (i2c_senddata(t, 8, 0, 0x21, 0, -1) || in do_saa5249_ioctl()
461 i2c_getdata(t, 40, t->vdau[req.pgbuf].pgbuf + VTX_PAGESIZE + 16 * 40)) in do_saa5249_ioctl()
467 if (i2c_senddata(t, 8, 0, 0x22, 0, -1) || in do_saa5249_ioctl()
468 i2c_getdata(t, 40, t->vdau[req.pgbuf].pgbuf + VTX_PAGESIZE + 23 * 40)) in do_saa5249_ioctl()
471 t->vdau[req.pgbuf].clrfound = FALSE; in do_saa5249_ioctl()
472 memcpy(t->vdau[req.pgbuf].laststat, infobits, sizeof(infobits)); in do_saa5249_ioctl()
476 memcpy(infobits, t->vdau[req.pgbuf].laststat, sizeof(infobits)); in do_saa5249_ioctl()
481 memcpy(infobits, t->vdau[req.pgbuf].laststat, sizeof(infobits)); in do_saa5249_ioctl()
509 if (t->vdau[req.pgbuf].clrfound) in do_saa5249_ioctl()
515 t->is_searching[req.pgbuf] = FALSE; in do_saa5249_ioctl()
530 if(copy_to_user(req.buffer, &t->vdau[req.pgbuf].pgbuf[req.start], req.end - req.start + 1)) in do_saa5249_ioctl()
544 if (i2c_senddata(t, 8, 0, 0, start, -1) || in do_saa5249_ioctl()
545 i2c_getdata(t, len, buf)) in do_saa5249_ioctl()
551 if (req.start <= 31 && req.end >= 7 && t->is_searching[req.pgbuf]) in do_saa5249_ioctl()
558 if (i2c_senddata(t, 8, 0, 0, start, -1) || in do_saa5249_ioctl()
559 i2c_getdata(t, len, buf)) in do_saa5249_ioctl()
575 t->vdau[req.pgbuf].stopped = TRUE; in do_saa5249_ioctl()
576 t->is_searching[req.pgbuf] = FALSE; in do_saa5249_ioctl()
587 if (i2c_senddata(t, 0, NUM_DAUS, 0, 8, -1) || i2c_senddata(t, 11, in do_saa5249_ioctl()
591 if (i2c_senddata(t, 3, 0x20, -1)) in do_saa5249_ioctl()
600 t->virtual_mode = (int)arg; in do_saa5249_ioctl()
613 struct saa5249_device *t=vd->priv; in saa5249_ioctl() local
616 down(&t->lock); in saa5249_ioctl()
617 err = do_saa5249_ioctl(t, cmd, arg); in saa5249_ioctl()
618 up(&t->lock); in saa5249_ioctl()
625 struct saa5249_device *t=vd->priv; in saa5249_open() local
628 if (t->client==NULL) in saa5249_open()
631 if (i2c_senddata(t, 0, 0, -1) || /* Select R11 */ in saa5249_open()
633 i2c_senddata(t, 1, disp_modes[t->disp_mode][0], 0, -1) || in saa5249_open()
635 …i2c_senddata(t, 4, NUM_DAUS, disp_modes[t->disp_mode][1], disp_modes[t->disp_mode][2], 7, -1)) /* … in saa5249_open()
643 memset(t->vdau[pgbuf].pgbuf, ' ', sizeof(t->vdau[0].pgbuf)); in saa5249_open()
644 memset(t->vdau[pgbuf].sregs, 0, sizeof(t->vdau[0].sregs)); in saa5249_open()
645 memset(t->vdau[pgbuf].laststat, 0, sizeof(t->vdau[0].laststat)); in saa5249_open()
646 t->vdau[pgbuf].expire = 0; in saa5249_open()
647 t->vdau[pgbuf].clrfound = TRUE; in saa5249_open()
648 t->vdau[pgbuf].stopped = TRUE; in saa5249_open()
649 t->is_searching[pgbuf] = FALSE; in saa5249_open()
651 t->virtual_mode=FALSE; in saa5249_open()
659 struct saa5249_device *t=vd->priv; in saa5249_release() local
660 i2c_senddata(t, 1, 0x20, -1); /* Turn off CCT */ in saa5249_release()
661 i2c_senddata(t, 5, 3, 3, -1); /* Turn off TV-display */ in saa5249_release()