helpers.c: add buffer's helpers and use them

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Alessandro Rubini <rubini@gnudd.com>
sysfs.c: add buffer flush sysfs command

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Alessandro Rubini <rubini@gnudd.com>
sysfs.c: improve comment about buffer instance disable

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Alessandro Rubini <rubini@gnudd.com>
core: add support to interleaving

If a cset->flags has ZIO_CSET_INTERLEAVE_ONLY or
ZIO_CSET_CHAN_INTERLEAVE,
then ZIO creates an additional channel to the cset, an interleaved
channel.
As for normal channels, interleaved channel has 2 char device:

/dev/zio/devname-0-i-ctrl
/dev/zio/devname-0-i-data

If the cset is ZIO_CSET_INTERLEAVE_ONLY, ZIO creates only interleaved
channel char devices. From the sysfs you can enable/disable only the
interleaved channel; all the other channels are always disabled.

If the cset is ZIO_CSET_CHAN_INTERLEAVE, ZIO creates all char devices
for
normal channels and for the interleaved channel. By default the
interleaved
channel is disabled. You can enable the interleaved channel from the
sysfs.
Remember that if you enable the interleaved channel, you automatically
disable
all the other channels.

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Alessandro Rubini <rubini@gnudd.com>

Conflicts:
	include/linux/zio-user.h
zio-sysfs.h: introduce ZIO_ATTR_DEV_DRIVEN flags for attributes

This flags can be used by the ZIO framework to decide if read a value
directly from the hardware, or trust the value in the framework.

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
core: add write support to current_control

By writing the current-control binary attribute, the user can
configure the device.

To allow the configuration of the entire device from a control
provided by the user, this patch introduce a new structure
"zio_attr_config", it modifies the prototype of the function
t_op->config() and add a new zio device function zio_device->config()
for the device configuration.

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
tools/zio-control: a new GUI interface to read/write current_control

This interface allow you to inspect the current control of a channel.
You can change its attribute and the trigger's attributes.

At the moment, it is not possible to change the trigger type from this
interface.

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
config.c: add control flags to ignore device or trigger configuration

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
tools/zio-dump.c: print TLV information

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Alessandro Rubini <rubini@gnudd.com>
TEMP core: introduce TLV support for control

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
zio.h: stop_io return integer (0 if no error)

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Alessandro Rubini <rubini@gnudd.com>
helpers.c: on zio_trigger_data_done, call stop_io to invorm device

When the acquisition is over, the driver invokes zio_trigger_data_done()
to store blocks and make some clean up on trigger. But it can be useful
for the driver to clean up itself, or it must force the hardware to
interrupt the I/O.

So, with this patch, ZIO use the stop_io() operation both: when the trigger
aborts and when an acquisition is over. This should be not a problem for
the driver because in both cases the data transfer must be stopped.

More over, simmetry with the function  zio_arm_trigger(), which invoks
cset->raw_io(), the function zio_trigger_data_done() must invoke
cset->stop_io().

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Alessandro Rubini <rubini@gnudd.com>
helpers.c: on abort always invoke stop_io if it exists

If a device implement the stop_io function it mean that it must do
something when an acquisition abort. So if the trigger abort the
acquisition, ZIO must invoke stop_io if it exists.

We can abort the trigger only if the device successfully stopped the
acquisition

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Alessandro Rubini <rubini@gnudd.com>
TEMP introduce smb380 driver

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
drivers/zio-at91-adc: add support for the AT91 ADC

The driver support software fire and external trigger. At the moment it
does not support trigger from internal counter.

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
zio.h: introduce zio_all_block_ready() helper

It returns 1 if all active_block within a cset are ready, otherwise, it
returns 0

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Alessandro Rubini <rubini@gnudd.com>
zio-trig-timer.c: nshots support for timer

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>