cset: provide a "BUSY" flag, set by hardware

There are some hardware operations that cannot be stopped, like
ongoing DMA, and we must prevent abort from freeing stuff while
in use.  This commit only adds the flag.

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Acked-by: Federico Vaga <federico.vaga@gmail.com>
zio_trigger_abort_disable(): wait for hardware operations

The hardware may be in uninterruptible operations, like writing in DMA
to the buffers. So we can't release stuff until the hardware is done.
We are in atomic context for sure, and the hardare is mandated to be
fast, so busy-wait for it.

The CSET_BUSY flag is set and cleared by the hardware driver,
with the cset lock taken.

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

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>
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>