Пример #1
0
static int zoran_show(struct seq_file *p, void *v)
{
	struct zoran *zr = p->private;
	int i;

	seq_printf(p, "ZR36067 registers:\n");
	for (i = 0; i < 0x130; i += 16)
		seq_printf(p, "%03X %08X  %08X  %08X  %08X \n", i,
			   btread(i), btread(i+4), btread(i+8), btread(i+12));
	return 0;
}
Пример #2
0
static void
setparam (struct zoran *zr,
	  char         *name,
	  char         *sval)
{
	int i = 0, reg0, reg, val;

	while (zr67[i].name != NULL) {
		if (!strncmp(name, zr67[i].name, strlen(zr67[i].name))) {
			reg = reg0 = btread(zr67[i].reg);
			reg &= ~(zr67[i].mask << zr67[i].bit);
			if (!isdigit(sval[0]))
				break;
			val = simple_strtoul(sval, NULL, 0);
			if ((val & ~zr67[i].mask))
				break;
			reg |= (val & zr67[i].mask) << zr67[i].bit;
			dprintk(4,
				KERN_INFO
				"%s: setparam: setting ZR36067 register 0x%03x: 0x%08x=>0x%08x %s=%d\n",
				ZR_DEVNAME(zr), zr67[i].reg, reg0, reg,
				zr67[i].name, val);
			btwrite(reg, zr67[i].reg);
			break;
		}
		i++;
	}
}
Пример #3
0
static int zoran_read_proc(char *buffer, char **start, off_t offset, int size, int *eof, void *data)
{
#ifdef CONFIG_PROC_FS
	int len = 0;
	off_t begin = 0;

	int i;
	struct zoran *zr;

	zr = (struct zoran *) data;
	DEBUG2(printk(KERN_INFO "%s: read_proc: buffer=%x, offset=%d, size=%d, data=%x\n", zr->name, (int) buffer, (int) offset, size, (int) data));
	*eof = 1;
	PRINT_PROC("ZR36067 registers:");
	for (i = 0; i < 0x130; i += 4) {
		if (!(i % 16)) {
			PRINT_PROC("\n%03X", i);
		}
		PRINT_PROC(" %08X ", btread(i));
	}
	PRINT_PROC("\n");
	if (offset >= len + begin) {
		return 0;
	}
	*start = buffer + begin - offset;
	return ((size < begin + len - offset) ? size : begin + len - offset);
#endif
	return 0;
}
Пример #4
0
static int bttv_bit_getsda(void *data)
{
	struct bttv *btv = (struct bttv*)data;
	int state;

	state = btread(BT848_I2C) & 0x01;
	return state;
}
Пример #5
0
void bttv_bit_setsda(void *data, int state)
{
	struct bttv *btv = (struct bttv*)data;

	if (state)
		btv->i2c_state |= 0x01;
	else
		btv->i2c_state &= ~0x01;
	btwrite(btv->i2c_state, BT848_I2C);
	btread(BT848_I2C);
}
Пример #6
0
void bttv_vbi_setlines(struct bttv_fh *fh, struct bttv *btv, int lines)
{
	int vdelay;

	if (lines < 1)
		lines = 1;
	if (lines > VBI_MAXLINES)
		lines = VBI_MAXLINES;
	fh->lines = lines;

	vdelay = btread(BT848_E_VDELAY_LO);
	if (vdelay < lines*2) {
		vdelay = lines*2;
		btwrite(vdelay,BT848_E_VDELAY_LO);
		btwrite(vdelay,BT848_O_VDELAY_LO);
	}
}
Пример #7
0
static void
zoran_procfs_output (struct procfs_io *io,
		     void             *data)
{
	int i;
	struct zoran *zr;
	zr = (struct zoran *) data;

	print_procfs(io, "ZR36067 registers:");
	for (i = 0; i < 0x130; i += 4) {
		if (!(i % 16)) {
			print_procfs(io, "\n%03X", i);
		};
		print_procfs(io, " %08X ", btread(i));
	};
	print_procfs(io, "\n");
}
Пример #8
0
int bttv_read_gpio(unsigned int card, unsigned long *data)
{
	struct bttv *btv;
	
	if (card >= bttv_num) {
		return -EINVAL;
	}

	btv = &bttvs[card];

	if(btv->shutdown) {
		return -ENODEV;
	}

/* prior setting BT848_GPIO_REG_INP is (probably) not needed 
   because we set direct input on init */
	*data = btread(BT848_GPIO_DATA);
	return 0;
}
Пример #9
0
int insert (short rrn, BTREG registro, short *promo_r_child, BTREG *promo_reg)
{
    BTPAGE page,
    newpage;
    int found, promoted;
    short pos, p_b_rrn;
    BTREG p_b_reg;

    if (rrn == NIL)
    {
      *promo_reg = registro;
      *promo_r_child = NIL;
      return(YES);
    }
    btread(rrn, &page);
    found = search_node ( registro.key, &page, &pos);
    
    if (found == YES)
      return ERROR;  //Chave duplicada no nó

    
    promoted = insert(page.child[pos], registro, &p_b_rrn, &p_b_reg);

    if (promoted == NO)
      return(NO);
    else if (promoted == ERROR)
      return ERROR;  //Chave duplicada no nó filho

    if(page.keycount < MAXKEYS)
    {
      ins_in_page(p_b_reg, p_b_rrn, &page);
      btwrite(rrn, &page);
      return(NO);
    }
    else
    {
      split(p_b_reg, p_b_rrn, &page, promo_reg, promo_r_child, &newpage);
      btwrite(rrn, &page);
      btwrite(*promo_r_child, &newpage);
      return(YES);
    }
}