1. 12 Nov, 2016 7 commits
    • Brian Masney's avatar
      staging: iio: tsl2583: split out functionality of taos_chip_on() · c908fb76
      Brian Masney authored
      taos_chip_on() reads an eight member array called taos_config
      that contains the desired state of the chip's registers. Only four
      of the registers actually need to be written to. The four that do
      not need to be written to are for the {low,high} byte of the lower
      interrupt threshold and the {low,high} byte of the upper interrupt
      threshold. Interrupts are currently not supported by this driver
      so there is no need to write to these registers.
      
      This patch removes the taos_config array and separates out the
      i2c calls that write to the CONTROL, TIMING, INTERRUPT and ANALOG
      registers. This is part of a larger refactor that was split up to
      make the code review easier.
      Signed-off-by: default avatarBrian Masney <masneyb@onstation.org>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      c908fb76
    • Linus Walleij's avatar
      iio: pressure: st_pressure: inline per-sensor data · 91a86a3b
      Linus Walleij authored
      We have #defines for all the individual sensor registers and
      value/mask pairs #defined at the top of the file and used at
      exactly one spot.
      
      This is usually good if the #defines give a meaning to the
      opaque magic numbers.
      
      However in this case, the semantic meaning is inherent in the
      name of the C99-addressable fields, and that means duplication
      of information, and only makes the code hard to maintain since
      you every time have to add a new #define AND update the site
      where it is to be used.
      
      Get rid of the #defines and just open code the values into the
      appropriate struct elements. Make sure to explicitly address
      the .hz and .value fields in the st_sensor_odr_avl struct
      so that the meaning of all values is clear.
      
      This patch is purely syntactic should have no semantic effect.
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      91a86a3b
    • Linus Walleij's avatar
      iio: magn: st_magn: inline per-sensor data · 57d03554
      Linus Walleij authored
      We have #defines for all the individual sensor registers and
      value/mask pairs #defined at the top of the file and used at
      exactly one spot.
      
      This is usually good if the #defines give a meaning to the
      opaque magic numbers.
      
      However in this case, the semantic meaning is inherent in the
      name of the C99-addressable fields, and that means duplication
      of information, and only makes the code hard to maintain since
      you every time have to add a new #define AND update the site
      where it is to be used.
      
      Get rid of the #defines and just open code the values into the
      appropriate struct elements. Make sure to explicitly address
      the .hz and .value fields in the st_sensor_odr_avl struct
      so that the meaning of all values is clear.
      
      This patch is purely syntactic should have no semantic effect.
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      57d03554
    • Linus Walleij's avatar
      iio: gyro: st_gyro: inline per-sensor data · d8594fa2
      Linus Walleij authored
      We have #defines for all the individual sensor registers and
      value/mask pairs #defined at the top of the file and used at
      exactly one spot.
      
      This is usually good if the #defines give a meaning to the
      opaque magic numbers.
      
      However in this case, the semantic meaning is inherent in the
      name of the C99-addressable fields, and that means duplication
      of information, and only makes the code hard to maintain since
      you every time have to add a new #define AND update the site
      where it is to be used.
      
      Get rid of the #defines and just open code the values into the
      appropriate struct elements. Make sure to explicitly address
      the .hz and .value fields in the st_sensor_odr_avl struct
      so that the meaning of all values is clear.
      
      This patch is purely syntactic should have no semantic effect.
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      d8594fa2
    • Peter Rosin's avatar
      iio: imu: inv_mpu6050: inform the i2c mux core about how it is used · 08f3ffce
      Peter Rosin authored
      The i2c mux core can then take appropriate action depending on if it is
      used for an actual i2c mux, or for an arbitrator or gate. In this case
      it is used as a gate.
      
      This will make devicetree bindings simpler when they are eventually
      added.
      Signed-off-by: default avatarPeter Rosin <peda@axentia.se>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      08f3ffce
    • Colin Ian King's avatar
      iio: cros_ec_sensors_core: fix unsigned compared less than zero on status · 6c02e33f
      Colin Ian King authored
      status is a u8 hence the check if status is less than zero has no effect.
      Fix this by replacing status with int ret so the less than zero compare
      will correctly detect errors.
      
      Issue found with static analysis with CoverityScan, CID 1375919
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Fixes: 974e6f02 ("iio: cros_ec_sensors_core: Add common functions for the ChromeOS EC Sensor Hub")
      Reviewed-by: default avatarGuenter Roeck <groeck@chromium.org>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      6c02e33f
    • Dan Carpenter's avatar
      iio:adc: ad7766: testing the wrong variable in probe · 0d8391f3
      Dan Carpenter authored
      We should be testing "ret" here.
      
      Fixes: aa16c6bd ("iio:adc: Add support for AD7766/AD7767")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Acked-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      0d8391f3
  2. 08 Nov, 2016 4 commits
  3. 07 Nov, 2016 29 commits