Exemplo n.º 1
0
static enum hrtimer_restart zdtc_fn(struct hrtimer *timer)
{
	struct timespec ts;

	getnstimeofday(&ts);
	dev_dbg(&zdtc.cset->head.dev, "%s: %9li.%09li\n", __func__,
		ts.tv_sec, ts.tv_nsec);
	zio_trigger_data_done(zdtc.cset);
	return HRTIMER_NORESTART;
}
Exemplo n.º 2
0
/* This acts as either a timer or an interrupt tasklet */
static void fd_tlet(unsigned long arg)
{
	struct fd_dev *fd = (void *)arg;
	struct zio_device *zdev = fd->zdev;
	struct zio_channel *chan = zdev->cset[0].chan;

	/* If we have no interrupt, read the hw fifo now */
	if (fd_timer_period_ms) {
		while (!fd_read_hw_fifo(fd))
			;
		mod_timer(&fd->fifo_timer, jiffies + fd_timer_period_jiffies);
	}

	/* FIXME: race condition */
	if (!test_bit(FD_FLAG_INPUT_READY, &fd->flags))
		return;

	/* there is an active block, try reading an accumulated sample */
	if (fd_read_sw_fifo(fd, chan) == 0) {
		clear_bit(FD_FLAG_INPUT_READY, &fd->flags);
		zio_trigger_data_done(chan->cset);
	}
}