21 Jan, 2015

1 commit

  • …/jic23/iio into staging-testing

    Jonathan writes:

    First round of IIO new drivers, cleanups and functionality for the 3.20 cycle take 2

    Updated pull request with Daniel's fix on top for the power management
    Kconfig changes that had snuck in since last update of the IIO tree
    worked it's way through from mainline.

    Original pull message

    New device support
    * jsa1212 proxmity / ambient light sensor
    * SM08500 supported added to the kxcjk-1013 accelerometer driver
    * KMX61 Accelerometer/Magnetometer. This took a somewhat rocky path
    being first merged, then reverted for a rewrite after a discussion of
    how to support additional functionality and finally being merged prior
    to some last reviews coming in, with resultant follow up patches.
    * Freescale mma9551l driver (minor follow up warning supression patch).
    * Semtech SX9500 proximity device driver.
    * ak8975 gains support for ak09911 and ak09912 and drop the standalone driver
    for the ak09911.

    New functionality
    * Dummy driver gains some virtual registers making it more flexible.
    * IIO_ACTIVITY channel types, with modifiers running, walking etc. This is
    to support on chip motion clasifiers. As such it is in the form of a
    confidence percentage. The only devices so far only do binary decisions
    but this gives us room when other devices give more nuanced clasification.
    * IIO_EV_DIR_NONE type for events where there is no obvious direction.
    First case is step detection.
    * IIO_STEPS channel type for pedometers.
    * ENABLE mask element used to control turning on counting types such as
    the pedometer that need a 'start point'.
    * INSTANCE event type to support things that happen once.
    * info element for height calibration (used in various motion estimation
    algorithms). Note heigh tof use
    * dummy driver demonstration of the use of all the new bits above.
    * event monitor support for the new events.
    * inv_mpu6050 gains an i2c mux to allow bypassing the device to access
    additional devices connected on the other side of it. Note that in
    Windows these are handled by firmware on the device and not exposed
    directly.
    * inv_mpu6050 gains ACPI enumeration.
    * inkern interface gains iio_write_channel_raw to allow in kernel users
    of DAC functionality via a simple wrapper.
    * Document input current readings in the ABI docs.
    * Add an error message when we get an out of range error in device tree
    processing for the in kernel interfaces. Basically a device tree debugging
    aid.
    * Add a sanity check that a scan index for a channel is unique during
    registration. There to help catch bugs as this should never happen
    in a bug free driver.

    Cleanups and fixlets

    A rework of buffer registration from Lars - a precursor to some other
    upcoming new stuff (a few patches from others rolled in here as well).
    * Ensure all drivers register the same channels for the device and buffer.
    * Move buffer registration into the core rather than using the old
    two step approach. Now we have simple ways of using a unified set channels
    for both without requiring channels be exposed by both interface, this
    removes a fair bit of boilerplate.
    * Stop sca3000 and ad5933 (both in staging) enabling buffer channels by
    default. It has long be convention in IIO to startup with no channels
    enabled and leave it up to userspace to say what goes in the buffer.
    Getting rid of these allows us to drop export of iio_scan_mask_set.
    * Drop get_bytes_per_datum from iio_buffer_access_funcs as not been used
    for a while.
    * Allocate standard buffer attributes in the core rather than in every
    driver with a buffer.
    * Make the length attribute read only when a driver is not able to set
    the length.
    * Drop the get_length callback for buffers as it is already available in
    struct iio_buffer.
    * Drop an unused arguement form iio_kfifo_allocate and add devm allocator
    for it.
    * some kconfig entries gain anotation with the resulting module name.
    * Fix a resulting compile issue in dummy driver due to a stub taking
    wrong parameters as a result of the above rework.
    * Fix an off by 2 error in copying the core assigned buffer attributes.

    Other cleanups,
    * Trivial space before comma fixups.
    * ak8975 fixlets - none critical. Rework to allow more device support.
    * Drop unnecessary sizeof(u8) calls.
    * bmp280 - refactor the compensation code to reduce copy operations and
    code length. A second patch futher optimized this and performed some
    other minor cleanups.
    * kxcjk-1013 - various power control cleanups to avoid unnecessary enable
    / disable of device. Make sure it is only controlled at all if CONFIG_PM
    is enabled. Also som cleanups of error paths.
    * Small cleanups in adf4530 driver - pointless message and unnecessary braces.
    * Clarifiy the proximity ABI docs to make it clear it should get bigger
    as we move futher away.
    * Drop a misleading comment form industrialio-core.c
    * Trivial white space cleanups.
    * sca3000 looses an unused debug function.
    * Fix char unsigned ordering in ad8366
    * Increase the sleep time in ad9523 to make it predictable (value didn't
    really matter so make it more than 20 msecs)
    * mxs-lradc touchscreen property cleanups in device tree are fixed to ensure
    the meet all the 'interesting' documentation.
    * A couple of cleanups for the staging ad5933 driver to avoid unnecessary
    conversion to a processed temperature vlaue in kernel and remove
    platform data form the state structure as not needed after probe.
    * Fix a wrong scale factor in the docs.

    Misc
    * Add IIO include files to the maintainers entry.

    Greg Kroah-Hartman
     

09 Jan, 2015

1 commit

  • …/jic23/iio into staging-linus

    Jonathan writes:

    First round of IIO fixes for the 3.19 cycle.

    * ad799x fix ad7991/ad7995/ad7999 setup as they do not have a configuration
    register to write to. It is written during the convesion sequence. As
    such we don't want to write to it at other times.
    * Fix iio_channel_read utility function to return to ensure it is apparent
    if the relevant element is not there. This avoids using a wrong value
    if some channels have the element and others do not.

    Greg Kroah-Hartman
     

06 Jan, 2015

1 commit

  • If the DT contains an invalid channel specifier then the probe of
    iio_hwmon fails with the following message:

    iio_hwmon: probe of iio_hwmon failed with error -22

    So it's better to print out the relevant channel specifier in
    error case to locate the problem.

    Signed-off-by: Stefan Wahren
    Signed-off-by: Jonathan Cameron

    Stefan Wahren
     

01 Jan, 2015

1 commit


12 Dec, 2014

1 commit


06 Nov, 2014

1 commit

  • …/iio into staging-next

    Jonathan writes:

    First round of new drivers, features and cleanups for IIO in the 3.19 cycle.

    New drivers / supported parts
    * rockchip - rk3066-tsadc variant
    * si7020 humidity and temperature sensor
    * mcp320x - add mcp3001, mcp3002, mcp3004, mcp3008, mcp3201, mcp3202
    * bmp280 pressure and temperature sensor
    * Qualcomm SPMI PMIC current ADC driver
    * Exynos_adc - support exynos7

    New features
    * vf610-adc - add temperature sensor support
    * Documentation of current attributes, scaled pressure, offset and
    scaled humidity, RGBC intensity gain factor and scale applied to
    differential voltage channels.
    * Bring iio_event_monitor up to date with newer modifiers.
    * Add of_xlate function to allow for complex channel mappings from the
    device tree.
    * Add -g parameter to generic_buffer example to allow for devices with
    directly fed (no trigger) buffers.
    * Move exynos driver over to syscon for PMU register access.

    Cleanups, fixes for new drivers
    * lis3l02dq drop an unneeded else.
    * st sensors - renam st_sensors to st_sensor_settings (for clarity)
    * st sensors - drop an unused parameter from all the probe utility
    functions.
    * vf610 better error handling and tidy up.
    * si7020 - cleanups following merge
    * as3935 - drop some unnecessary semicolons.
    * bmp280 - fix the pressure calculation.

    Greg Kroah-Hartman
     

25 Oct, 2014

1 commit

  • When #iio-cells is greater than '0', the driver could provide
    a custom of_xlate function that reads the *args* and returns
    the appropriate index in registered IIO channels array.

    Add simple translation function, suitable for the most 1:1
    mapped channels in IIO chips, and use it when driver did not
    provide custom implementation.

    Signed-off-by: Ivan T. Ivanov
    Reviewed-by: Lars-Peter Clausen
    Signed-off-by: Jonathan Cameron

    Ivan T. Ivanov
     

25 Aug, 2014

1 commit


21 Jun, 2014

1 commit

  • Currently in the inkern.c code for IIO framework, the function
    of_iio_channel_get_by_name() will return a non-NULL pointer when
    it cannot find a channel using of_iio_channel_get() and when it
    tries to search for 'io-channel-ranges' property and fails. This
    is incorrect behaviour as the function which calls this expects
    a NULL pointer for failure. This patch rectifies the issue.

    Signed-off-by: Adam Thomson
    Signed-off-by: Jonathan Cameron
    Cc: Stable@vger.kernel.org

    Adam Thomson
     

30 Apr, 2014

1 commit

  • This callback is introduced to overcome some limitations of existing
    read_raw callback. The functionality of both existing read_raw and
    read_raw_multi is similar, both are used to request values from the
    device. The current read_raw callback allows only two return values.
    The new read_raw_multi allows returning multiple values. Instead of
    passing just address of val and val2, it passes length and pointer
    to values. Depending on the type and length of passed buffer, iio
    client drivers can return multiple values.

    Signed-off-by: Srinivas Pandruvada
    Signed-off-by: Jonathan Cameron

    Srinivas Pandruvada
     

17 Mar, 2014

1 commit


04 Jul, 2013

1 commit

  • When reading IIO_CHAN_INFO_OFFSET, the return value of iio_channel_read() for
    success will be IIO_VAL*, checking for 0 is not correct.

    Without this fix the offset applied by iio drivers will be ignored when
    converting a raw value to one in appropriate base units (e.g mV) in
    a IIO client drivers that use iio_convert_raw_to_processed including
    iio-hwmon.

    Cc: # 3.10.x
    Signed-off-by: Alexandre Belloni
    Signed-off-by: Jonathan Cameron

    Alexandre Belloni
     

05 Jun, 2013

2 commits


16 Mar, 2013

1 commit


07 Feb, 2013

1 commit


02 Feb, 2013

2 commits


10 Nov, 2012

1 commit


20 Oct, 2012

1 commit

  • For ADCs or DACs the denominator for fractional types often is a power of two.
    In this case we can use a shift operation instead of the rather expensive 64 bit
    division. This patch adds a new fractional type which expects the denominator to
    be specified as the log2 of the actual denominator. E.g. for ADCs and DACs this
    will usually be the number of significant bits.

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

    Lars-Peter Clausen
     

19 Oct, 2012

1 commit


22 Sep, 2012

2 commits

  • When the IIO consumer tries to get specific IIO channel,
    few error cases can be happened.
    (a) Memory allocation failure
    (b) No matched ADC channel error
    (c) Invalid input arguments
    This patch enables cleaning up error handling in case of (a) and (b).

    In error handling code,
    (a): the reference count of the IIO device should be decreased.
    (b): the allocated memory should be freed with restoring the reference count.
    Therefore iio_deivce_put() is called in both cases.
    This can be handled in the last error statement.

    Additionally, integer variable is used for stating each error case explicitly.
    Then, the error returns as ERR_PTR() with this value.

    Signed-off-by: Milo(Woogyom) Kim
    Signed-off-by: Jonathan Cameron

    Kim, Milo
     
  • The reference count of the IIO device is increased if the IIO map has
    matched consumer name.
    After then, it tries to allocate the iio_channel which is used by the consumer.
    If it fails to allocate memory, the reference count should be decreased.

    This patch enables restoring the reference count of the IIO device.

    Signed-off-by: Milo(Woogyom) Kim
    Signed-off-by: Jonathan Cameron

    Kim, Milo
     

18 Sep, 2012

2 commits

  • Add a function to read a processed value from a channel. The function will first
    attempt to read the IIO_CHAN_INFO_PROCESSED attribute. If that fails it will
    read the IIO_CHAN_INFO_RAW attribute and convert the result from a raw value to
    a processed value.

    The patch also introduces a function to convert raw value to a processed value
    and exports it, in case a user needs or wants to do the conversion by itself.

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

    Lars-Peter Clausen
     
  • The datasheet name is defined in the IIO driver.
    On the other hand, the adc_channel_label is configured in
    the platform side.
    If the datasheet name is not matched with any adc_channel_label,
    the iio_channel_get() should be returned as error for preventing
    invalid channel data access.

    This can be handled either way.
    (a) checking null data when using it : in the xxx_read_raw()
    or
    (b) error returns when the channel is requested : this patch

    The IIO consumer can't use the channel with invalid channel spec.
    Therefore case (b) is more reasonable.

    Signed-off-by: Milo(Woogyom) Kim
    Signed-off-by: Jonathan Cameron

    Kim, Milo
     

15 Sep, 2012

1 commit

  • Use kzalloc() rather than kmalloc() for initializing the iio_channel structure.
    This patch enables the iio_dev and iio_chan_spec are set to NULL.
    This may prevent the page fault problem because the pointer of iio_chan_spec
    is initialized as NULL.

    The iio_chan_spec is updated only in case that the IIO map has
    specific channel label.
    When the map has no ADC channel label, then the value of iio_chan_spec
    remains as invalid pointer.
    To prevent this problem, the pointer should be initialized as NULL.

    Signed-off-by: Milo(Woogyom) Kim
    Signed-off-by: Jonathan Cameron

    Kim, Milo
     

28 Aug, 2012

1 commit


13 Jul, 2012

1 commit


09 Jul, 2012

1 commit


30 Jun, 2012

1 commit


05 Jun, 2012

1 commit


03 May, 2012

1 commit


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