15 Sep, 2012

1 commit

  • Currently IIO uses a decimal fixed point representations for real type numbers.
    This patch introduces a new representation for rational type numbers. The number
    will be expressed by specifying a numerator and denominator. For converting a
    raw value to a processed value multiply it by the numerator and divide it by the
    denominator.

    The reasoning for introducing this new type is that for a lot of devices the
    scale can be represented easily by a fractional number, but it is not possible
    to represent it as fixed point number without rounding. E.g. for a simple DAC
    the scale is often the reference voltage divided by the number of possible
    values (Usually 2**n_bits - 1). Each driver currently implements the conversion
    of this fraction to a fixed point number on its own.

    Also when it comes to the in-kernel interface this allows to directly use the
    fractional factors to convert a raw value to a processed value. This should on
    one hand require less instructions and on the other hand increase the
    precision.

    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Jonathan Cameron

    Lars-Peter Clausen
     

07 Sep, 2012

1 commit


04 Sep, 2012

3 commits


11 Jul, 2012

1 commit

  • Add iio channel type and modifiers for Correlated Color Temperature (CCT)
    and RGBC (red/green/blue/clear) data.
    Add CCT and RGBC descriptions to documentation.

    Changes:
    Revised/condensed RGBC descriptions.

    Merge and trivial fix done by Jonathan Cameron.

    Signed-off-by: Jon Brenner
    Signed-off-by: Jonathan Cameron

    Jon Brenner
     

30 Jun, 2012

2 commits


14 Jun, 2012

1 commit


07 Jun, 2012

1 commit

  • Use scnprint instead of snprintf, because snprintf returns the number of bytes
    that would have been written to the buffer if there was enough space, and as a
    result writing to buf[len-1] might cause a access beyond the buffers limits.

    Reported-by: Dan Carpenter
    Signed-off-by: Lars-Peter Clausen
    Acked-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Lars-Peter Clausen
     

05 Jun, 2012

2 commits

  • We often have the case were we do have a enum style channel attribute. These
    attributes have in common that they are a list of string values which usually
    map in a 1-to-1 fashion to integer values.

    This patch implements some common helper code for implementing enum style
    channel attributes using extended channel attributes. The helper functions take
    care of converting between the string and integer values, as well providing a
    function for "_available" attributes which list all available enum items.

    Signed-off-by: Lars-Peter Clausen
    Acked-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Lars-Peter Clausen
     
  • There is no guarantee that the last reference to the iio device has already been
    dropped when iio_device_free is called. This means that we can up calling
    iio_dev_release after iio_device_free which will lead to a use after free. As
    the general rule the struct containing the device should always be freed in the
    release callback.

    This is what this patch does, it moves freeing the iio device struct as well as
    releasing the idr reference to the release callback. To ensure that the device
    is not freed before calling iio_device_free the device_unregister call in
    iio_device_unregister is broken apart. iio_device_unregister will now only call
    device_del to remove the device from the system and iio_device_free will call
    put_device to drop the reference we obtained in iio_devce_alloc.

    We also have to take care that calling iio_device_free without having called
    iio_device_register still works (i.e. this can happen if something failed during
    device initialization). For this to work properly two minor changes were
    necessary: channel_attr_list needs to be initialized in iio_device_alloc and we
    have to check whether the chrdev has been registered before releasing it in
    iio_device_release.

    This change also brings iio_device_unregister and iio_device_free more in sync
    with iio_device_register and iio_device_alloc which call device_add and
    device_initialize respectively.

    Signed-off-by: Lars-Peter Clausen
    Acked-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Lars-Peter Clausen
     

15 May, 2012

3 commits


09 May, 2012

2 commits


30 Apr, 2012

3 commits

  • There is currently no user, but we might need it in future.
    So better add it now, before we have to convert drivers afterwards.

    Signed-off-by: Michael Hennerich
    Acked-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Michael Hennerich
     
  • Signed-off-by: Michael Hennerich
    Acked-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Michael Hennerich
     
  • Currently we use two different naming schemes in the IIO API, iio_verb_object
    and iio_object_verb. E.g iio_device_register and iio_allocate_device. This
    patches renames instances of the later to the former. The patch also renames allocate to
    alloc as this seems to be the preferred form throughout the kernel.

    In particular the following renames are performed by the patch:
    iio_put_device -> iio_device_put
    iio_allocate_device -> iio_device_alloc
    iio_free_device -> iio_device_free
    iio_get_trigger -> iio_trigger_get
    iio_put_trigger -> iio_trigger_put
    iio_allocate_trigger -> iio_trigger_alloc
    iio_free_trigger -> iio_trigger_free

    The conversion was done with the following coccinelle patch with manual fixes to
    comments and documentation.

    @@
    @@
    -iio_put_device
    +iio_device_put
    @@
    @@
    -iio_allocate_device
    +iio_device_alloc
    @@
    @@
    -iio_free_device
    +iio_device_free
    @@
    @@
    -iio_get_trigger
    +iio_trigger_get
    @@
    @@
    -iio_put_trigger
    +iio_trigger_put
    @@
    @@
    -iio_allocate_trigger
    +iio_trigger_alloc
    @@
    @@
    -iio_free_trigger
    +iio_trigger_free

    Signed-off-by: Lars-Peter Clausen
    Acked-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Lars-Peter Clausen
     

26 Apr, 2012

1 commit

  • Take the core support + the kfifo buffer implentation out of
    staging. Whilst we are far from done in improving this subsystem
    it is now at a stage where the userspae interfaces (provided by
    the core) can be considered stable.

    Drivers will follow over a longer time scale.

    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Jonathan Cameron