zio: add current len and kb sysfs buf attribute

This patch add two new attributes: "allocated-buffer-len" and
"allocated-buffer-kb". Buffers are expected to use one of them, or both.

The purpose of these attribute is to export to user space information about
the number of blocks stored in a buffer. This information can be used to
monitor buffer status, and see how the data flow behaves.

We report the allocated buffer size, which includes active blocks,
instead of the size currently stored, because it reflects actual use
of the available data space (the max-buffer-* attributes). Knowing how
many blocks, or kilobytes, are currently stored is much less
important.

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Alessandro Rubini <rubini@gnudd.com>
buffers: use alloc_len and alloc_kb sysfs attribute

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Alessandro Rubini <rubini@gnudd.com>
zio.h and doc: introduce ZIO_CSET_TYPE_RAW

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Acked-by: Federico Vaga <federico.vaga@gmail.com>
include/linux/zio-sysfs.h: introduce helper to retrieve std attributes

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Alessandro Rubini <rubini@gnudd.com>
core: add change_flags operation to zio_{device|cset|chan}

Add to zio_device, zio_cset and zio_channel a new operation: change_flags.
The core uses this function to signal to the driver that some flags are changed.

This patch also improve the comment on the __zobj_enable function

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Alessandro Rubini <rubini@gnudd.com>
zio-ad788x.c: re-organize code (and fix memory leakage)

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Alessandro Rubini <rubini@gnudd.com>
zio-ad788x.c: split tx building in a new function

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Alessandro Rubini <rubini@gnudd.com>
ad788x: add support to AD7476 1-chan ADC

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

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

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>
Acked-by: Alessandro Rubini <rubini@gnudd.com>
config.c: check if mask are empty before find attrs

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Alessandro Rubini <rubini@gnudd.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>
Acked-by: Alessandro Rubini <rubini@gnudd.com>
UNTESTED zio-trigger.h: on output configure device before trigger fire

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Alessandro Rubini <rubini@gnudd.com>
config.c: do not se seq_num if 0

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