26 Apr, 2016

6 commits


24 Apr, 2016

13 commits

  • Signed-off-by: Crestez Dan Leonard
    Signed-off-by: Jonathan Cameron

    Crestez Dan Leonard
     
  • This patch exposes ALSTIM as illuminance_integration_time and ALSPGA as
    illuminance_scale.

    Changing ALSTIM also changes the number of bits available in the data
    register. This is handled inside raw value reading because:
    * It's very easy to shift a few bits
    * It allows SCALE and INT_TIME to be completely independent controls
    * Buffer support requires constant scan_type.realbits per-channel

    Signed-off-by: Crestez Dan Leonard
    Signed-off-by: Jonathan Cameron

    Crestez Dan Leonard
     
  • This is exposed as an output channel with "led" as an extend_name.

    Other sensors also have support for controlling an external LED. It's
    not clear that simply exposing an undecorated output channel is the
    correct approach.

    Signed-off-by: Crestez Dan Leonard
    Signed-off-by: Jonathan Cameron

    Crestez Dan Leonard
     
  • The proximity sensor relies on sending pulses to an external IR led and
    it is disabled by default on powerup. The driver will enable it with a
    default power setting.

    Signed-off-by: Crestez Dan Leonard
    Signed-off-by: Jonathan Cameron

    Crestez Dan Leonard
     
  • This just adds support for reporting illuminance with default settings.

    Important default registers are written on probe because the device
    otherwise lacks a reset function.

    Signed-off-by: Crestez Dan Leonard
    Signed-off-by: Jonathan Cameron

    Crestez Dan Leonard
     
  • Signed-off-by: Tiberiu Breana
    Signed-off-by: Jonathan Cameron

    Tiberiu Breana
     
  • Add basic support for the Aosong AM2315 relative humidity
    and ambient temperature sensor.
    Includes support for raw readings and ACPI detection.

    Datasheet:
    http://www.aosong.com/asp_bin/Products/en/AM2315.pdf

    Signed-off-by: Tiberiu Breana
    Signed-off-by: Jonathan Cameron

    Tiberiu Breana
     
  • Add support for HopeRF pressure and temperature sensor.

    This device uses two fixed I2C addresses, one for storing
    calibration coefficients and another for accessing the ADC.

    Signed-off-by: Marek Vasut
    Cc: Matt Ranostay
    Cc: Jonathan Cameron
    Signed-off-by: Jonathan Cameron

    Marek Vasut
     
  • This device has an identical interface to other supported sensors and the patch
    only adds IDs.

    Signed-off-by: Crestez Dan Leonard
    Signed-off-by: Jonathan Cameron

    Crestez Dan Leonard
     
  • It causes a static checker warning if we use "buf" on the failure path
    so move that inside the if statement.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Jonathan Cameron

    Dan Carpenter
     
  • Add a new rotation matrix sysfs attribute compliant with IIO core
    mounting matrix API.
    Matrix is retrieved from "in_anglvel_mount_matrix" and
    "in_accel_mount_matrix" sysfs attributes. It is declared into mpu6050 DTS
    entry as a "mount-matrix" property.

    Old interface is kept for backward userspace compatibility and may be
    retrieved from legacy platform_data mechanism only.

    Signed-off-by: Gregor Boirie
    Acked-by: Rob Herring
    Signed-off-by: Jonathan Cameron

    Gregor Boirie
     
  • Expose a rotation matrix to indicate userspace the chip orientation with
    respect to the overall hardware system.
    Matrix is retrieved from "in_mount_matrix". It is declared into ak8975 DTS
    entry as a "mount-matrix" property.

    Signed-off-by: Gregor Boirie
    Acked-by: Rob Herring
    Signed-off-by: Jonathan Cameron

    Gregor Boirie
     
  • Expose a rotation matrix to indicate userspace the chip placement with
    respect to the overall hardware system. This is needed to adjust
    coordinates sampled from a sensor chip when its position deviates from the
    main hardware system.

    Final coordinates computation is delegated to userspace since:
    * computation may involve floating point arithmetics ;
    * it allows an application to combine adjustments with arbitrary
    transformations.

    This 3 dimentional space rotation matrix is expressed as 3x3 array of
    strings to support floating point numbers. It may be retrieved from a
    "[_][_]mount_matrix" sysfs attribute file. It is declared into a
    device / driver specific DTS property or platform data.

    Signed-off-by: Gregor Boirie
    Signed-off-by: Jonathan Cameron

    Gregor Boirie
     

20 Apr, 2016

12 commits

  • Driver includes struct regmap and struct device in its global data.
    Remove the struct device and use regmap API to retrieve device info.

    Patch created using Coccinelle plus manual edits.

    Signed-off-by: Alison Schofield
    Reviewed-by: Srinivas Pandruvada
    Signed-off-by: Jonathan Cameron

    Alison Schofield
     
  • Driver includes struct regmap and struct device in its global data.
    Remove the struct device and use regmap API to retrieve device info.

    Patch created using Coccinelle plus manual edits.

    Signed-off-by: Alison Schofield
    Reviewed-by: Irina Tirdea
    Reviewed-by: Srinivas Pandruvada
    Signed-off-by: Jonathan Cameron

    Alison Schofield
     
  • ultraviolet (UV) light sensor with I2C interface with a peak
    sensitivity at 355 nm

    strangely, chip uses two addresses 0x38 and 0x39 for LSB and
    MSB data, resp.

    datasheet: http://www.vishay.com/docs/84277/veml6070.pdf

    Signed-off-by: Peter Meerwald-Stadler
    Signed-off-by: Jonathan Cameron

    Peter Meerwald-Stadler
     
  • Add following APIs in the list of managed resources of IIO:
    devm_iio_channel_get()
    devm_iio_channel_get_all()
    devm_iio_channel_release()
    devm_iio_channel_release_all()

    Signed-off-by: Laxman Dewangan
    Signed-off-by: Jonathan Cameron

    Laxman Dewangan
     
  • Some of kernel driver uses the IIO framework to get the sensor
    value via ADC or IIO HW driver. The client driver get iio channel
    by iio_channel_get_all() and release it by calling
    iio_channel_release_all().

    Add resource managed version (devm_*) of these APIs so that if client
    calls the devm_iio_channel_get_all() then it need not to release it
    explicitly, it can be done by managed device framework when driver
    get un-binded.

    This reduces the code in error path and also need of .remove callback in
    some cases.

    Signed-off-by: Laxman Dewangan
    Signed-off-by: Jonathan Cameron

    Laxman Dewangan
     
  • Some of kernel driver uses the IIO framework to get the sensor
    value via ADC or IIO HW driver. The client driver get iio channel
    by iio_channel_get() and release it by calling iio_channel_release().

    Add resource managed version (devm_*) of these APIs so that if client
    calls the devm_iio_channel_get() then it need not to release it explicitly,
    it can be done by managed device framework when driver get un-binded.

    This reduces the code in error path and also need of .remove callback in
    some cases.

    Signed-off-by: Laxman Dewangan
    Signed-off-by: Jonathan Cameron

    Laxman Dewangan
     
  • If no channels are enabled when we run generic_buffer on a
    device, add a command-line option to just enable all of them,
    run the sampling and disable them all again afterwards.

    This is extremely useful when I'm low-level testing my
    sensors with interrupts and triggers, sample session:

    root@Ux500:/ lsiio
    Device 000: lsm303dlh_accel
    Device 001: lis331dl_accel
    Device 002: l3g4200d
    Device 003: lsm303dlh_magn
    Device 004: lps001wp
    Trigger 000: lsm303dlh_accel-trigger
    Trigger 001: lis331dl_accel-trigger
    Trigger 002: l3g4200d-trigger

    root@Ux500:/ generic_buffer -a -c 10 -n l3g4200d
    iio device number being used is 2
    iio trigger number being used is 2
    No channels are enabled, enabling all channels
    Enabling: in_anglvel_x_en
    Enabling: in_anglvel_y_en
    Enabling: in_anglvel_z_en
    Enabling: in_timestamp_en
    /sys/bus/iio/devices/iio:device2 l3g4200d-trigger
    -3.593664 -0.713133 4.870143 946684863662292480
    3.225546 0.867357 -4.945878 946684863671875000
    -0.676413 0.127296 0.106641 946684863681488037
    -0.661113 0.110160 0.128826 946684863690673828
    -0.664173 0.113067 0.123471 946684863700683593
    -0.664938 0.109395 0.124848 946684863710144042
    -0.664173 0.110619 0.130203 946684863719512939
    -0.666162 0.111231 0.132651 946684863729125976
    -0.668610 0.111690 0.130662 946684863738739013
    -0.660501 0.110466 0.131733 946684863748565673
    Disabling: in_anglvel_x_en
    Disabling: in_anglvel_y_en
    Disabling: in_anglvel_z_en
    Disabling: in_timestamp_en

    Pure awesomeness. If some channels have been enabled through
    scripts or manual interaction, nothing happens.

    Cc: Peter Meerwald-Stadler
    Acked-by: Daniel Baluta
    Signed-off-by: Linus Walleij
    Signed-off-by: Jonathan Cameron

    Linus Walleij
     
  • Some types of ST Sensors can be connected to the same IRQ line
    as other peripherals using open drain. Add a device tree binding
    and a sensor data property to flip the right bit in the interrupt
    control register to enable open drain mode on the INT line.

    If the line is set to be open drain, also tag on IRQF_SHARED
    to the IRQ flags when requesting the interrupt, as the whole
    point of using open drain interrupt lines is to share them with
    more than one peripheral (wire-or).

    Cc: devicetree@vger.kernel.org
    Cc: Giuseppe Barba
    Cc: Denis Ciocca
    Acked-by: Rob Herring
    Signed-off-by: Linus Walleij
    Signed-off-by: Jonathan Cameron

    Linus Walleij
     
  • This makes all ST sensor drivers check that they actually have
    new data available for the requested channel(s) before claiming
    an IRQ, by reading the status register (which is conveniently
    the same for all ST sensors) and check that the channel has new
    data before proceeding to read it and fill the buffer.

    This way sensors can share an interrupt line: it can be flaged
    as shared and then the sensor that did not fire will return
    NO_IRQ, and the sensor that fired will handle the IRQ and
    return IRQ_HANDLED.

    Cc: Giuseppe Barba
    Cc: Denis Ciocca
    Signed-off-by: Linus Walleij
    Signed-off-by: Jonathan Cameron

    Linus Walleij
     
  • The current buffer read code tries to optimize reads from the
    sensor data registers by issuing a single read operation across
    all the indata registers.

    This doesn't work: when the LIS331DL accelerometer sensor is
    configured to open drain, active low interrupt mode, this will
    just clear the XDA (X-axis data available) bit in the STATUS_REG
    register (0x27), while YDA, ZDA and even ZYXDA remain set to 1,
    and the internal logic of the sensor holds the DRDY (INT1) line
    asserted (the value of the status register is 0xee).

    If we instead issue one read operation per enabled channel
    (X, Y, Z) things start working and we can use open drain and
    active low interrupts.

    Note that a backported patch fixing this issue will be heading
    via the fixes branch but changes in this file already in staging-next
    will make that patch 'look' rather different. The code in here
    is the correct one when that clash hits.

    Cc: Giuseppe Barba
    Cc: Denis Ciocca
    Signed-off-by: Linus Walleij
    Signed-off-by: Jonathan Cameron

    Linus Walleij
     
  • This patch moves the STMP reset out of ADC init function so as to remove
    the possiblity of an error return which will be necessary for PM ops support
    patches to follow.

    Signed-off-by: Stefan Wahren
    Tested-by: Marek Vasut
    Signed-off-by: Jonathan Cameron

    Stefan Wahren
     
  • This patch moves the touchscreen type configuration into
    a more suitable function. Btw this simplifies PM ops later.

    Signed-off-by: Stefan Wahren
    Reviewed-by: Marek Vasut
    Tested-by: Marek Vasut
    Acked-by: Dmitry Torokhov
    Signed-off-by: Jonathan Cameron

    Stefan Wahren
     

19 Apr, 2016

2 commits


17 Apr, 2016

6 commits

  • Set INPUT_PROP_DIRECT to indicate that it is a touchscreen on the
    device to help userspace classify it.

    Signed-off-by: Ksenija Stanojevic
    Acked-by: Dmitry Torokhov
    Signed-off-by: Jonathan Cameron

    Ksenija Stanojevic
     
  • Using this requires software triggers like CONFIG_IIO_HRTIMER_TRIGGER.

    The device can be configured to do internal periodic sampling but does not
    offer some sort of interrupt on data ready. Interrupts can only trigger when
    values get out of a specific range.

    Signed-off-by: Crestez Dan Leonard
    Signed-off-by: Jonathan Cameron

    Crestez Dan Leonard
     
  • These chips have an almost identical interface but support a different
    number of value bits. Datasheet links for comparison:

    * http://www.ti.com/lit/ds/symlink/adc081c021.pdf
    * http://www.ti.com/lit/ds/symlink/adc101c021.pdf
    * http://www.ti.com/lit/ds/symlink/adc121c021.pdf

    Signed-off-by: Crestez Dan Leonard
    Signed-off-by: Jonathan Cameron

    Crestez Dan Leonard
     
  • This fix checkpatch warnings:

    WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

    Signed-off-by: Slawomir Stepien
    Signed-off-by: Jonathan Cameron

    Slawomir Stepien
     
  • This is a reimplementation of the old misc device driver for the
    ROHM BH1780 ambient light sensor (drivers/misc/bh1780gli.c).

    Differences from the old driver:
    - Uses the IIO framework
    - Uses runtime PM to idle the hardware after 5 seconds
    - No weird custom power management from userspace
    - No homebrewn values in sysfs

    This uses the same (undocumented) device tree compatible-string
    as the old driver ("rohm,bh1780gli").

    Cc: Arnd Bergmann
    Cc: Ulf Hansson
    Cc: Daniel Mack
    Cc: Peter Meerwald-Stadler
    Signed-off-by: Linus Walleij
    Reviewed-by: Ulf Hansson
    Signed-off-by: Jonathan Cameron

    Linus Walleij
     
  • Indent lines inside if statement.

    Signed-off-by: Ksenija Stanojevic
    Signed-off-by: Jonathan Cameron

    Ksenija Stanojevic
     

16 Apr, 2016

1 commit