コード例 #1
0
ファイル: vpx3220.c プロジェクト: AquaSoftGmbH/mjpeg
static int
vpx3220_fp_status (struct i2c_client *client)
{
	unsigned char status;
	unsigned int i;

	for (i = 0; i < VPX_TIMEOUT_COUNT; i++) {
		status = vpx3220_read(client, 0x29);

		if (!(status & 4))
			return 0;

		udelay(10);

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
		if (current->need_resched)
			schedule();
#else
		if (need_resched())
			cond_resched();
#endif
	}

	return -1;
}
コード例 #2
0
static void
vpx3220_dump_i2c (struct i2c_client *client)
{
	int len = sizeof(init_common);
	const unsigned char *data = init_common;

	while (len > 1) {
		dprintk(1,
			KERN_DEBUG "vpx3216b i2c reg 0x%02x data 0x%02x\n",
			*data, vpx3220_read(client, *data));
		data += 2;
		len -= 2;
	}
}
コード例 #3
0
static int
vpx3220_fp_status (struct i2c_client *client)
{
	unsigned char status;
	unsigned int i;

	for (i = 0; i < VPX_TIMEOUT_COUNT; i++) {
		status = vpx3220_read(client, 0x29);

		if (!(status & 4))
			return 0;

		udelay(10);

		if (need_resched())
			cond_resched();
	}

	return -1;
}