Esempio n. 1
0
static int
zr36050_basic_test (struct zr36050 *ptr)
{
	zr36050_write(ptr, ZR050_SOF_IDX, 0x00);
	zr36050_write(ptr, ZR050_SOF_IDX + 1, 0x00);
	if ((zr36050_read(ptr, ZR050_SOF_IDX) |
	     zr36050_read(ptr, ZR050_SOF_IDX + 1)) != 0x0000) {
		dprintk(1,
			KERN_ERR
			"%s: attach failed, can't connect to jpeg processor!\n",
			ptr->name);
		return -ENXIO;
	}
	zr36050_write(ptr, ZR050_SOF_IDX, 0xff);
	zr36050_write(ptr, ZR050_SOF_IDX + 1, 0xc0);
	if (((zr36050_read(ptr, ZR050_SOF_IDX) << 8) |
	     zr36050_read(ptr, ZR050_SOF_IDX + 1)) != 0xffc0) {
		dprintk(1,
			KERN_ERR
			"%s: attach failed, can't connect to jpeg processor!\n",
			ptr->name);
		return -ENXIO;
	}

	zr36050_wait_end(ptr);
	if ((ptr->status1 & 0x4) == 0) {
		dprintk(1,
			KERN_ERR
			"%s: attach failed, jpeg processor failed (end flag)!\n",
			ptr->name);
		return -EBUSY;
	}

	return 0;		/* looks good! */
}
Esempio n. 2
0
/* status is kept in datastructure */
static u8
zr36050_read_status1 (struct zr36050 *ptr)
{
	ptr->status1 = zr36050_read(ptr, ZR050_STATUS_1);

	zr36050_read(ptr, 0);
	return ptr->status1;
}
Esempio n. 3
0
/* scale factor is kept in datastructure */
static u16
zr36050_read_scalefactor (struct zr36050 *ptr)
{
	ptr->scalefact = (zr36050_read(ptr, ZR050_SF_HI) << 8) |
			 (zr36050_read(ptr, ZR050_SF_LO) & 0xFF);

	/* leave 0 selected for an eventually GO from master */
	zr36050_read(ptr, 0);
	return ptr->scalefact;
}
Esempio n. 4
0
static u16
zr36050_read_scalefactor (struct zr36050 *ptr)
{
	ptr->scalefact = (zr36050_read(ptr, ZR050_SF_HI) << 8) |
			 (zr36050_read(ptr, ZR050_SF_LO) & 0xFF);

	/*                                                   */
	zr36050_read(ptr, 0);
	return ptr->scalefact;
}