1. 03 7月, 2016 4 次提交
    • L
      iio: pressure: bmp280: split driver in logical parts · 14e8015f
      Linus Walleij 提交于
      This splits the BMP280 driver in three logical parts: the core driver
      bmp280-core that only operated on a struct device * and a struct regmap *,
      the regmap driver bmp280-regmap that can be shared between I2C and other
      transports and the I2C module driver bmp280-i2c.
      
      Cleverly bake all functionality into a single object bmp280.o so that
      we still get the same module binary built for the device in the end,
      without any fuzz exporting symbols to the left and right.
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      14e8015f
    • L
      iio: pressure: bmp280: support supply regulators · bd525e6c
      Linus Walleij 提交于
      The BMP085/BMP180/BMP280 is supplied with two power sources:
      VDDA (analog power) and VDDD (digital power). As these may come
      from regulators (as on the APQ8060 Dragonboard) we need the driver
      to attempt to fetch and enable these regulators.
      
      We FAIL if we cannot: boards should either define:
      - Proper regulators if present
      - Define fixed regulators if power is hardwired to the component
      - Rely on dummy regulators (will be present on all DT systems and
        any boardfile system that calls regulator_has_full_constraints().
      
      Cc: Mark Brown <broonie@kernel.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      bd525e6c
    • B
      drivers:iio:light:isl29125: added macros for sensing range · 60b1addb
      Bijosh Thykkoottathil 提交于
      Added macros for sensing range as the corresponding magic numbers
      were used at multiple places.
         - ISL29125_SENSING_RANGE_0 for 375 lux full range
         - ISL29125_SENSING_RANGE_1 for 10k lux full range
      Signed-off-by: NBijosh Thykkoottathil <bijosh.t@hotmail.com>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      60b1addb
    • L
      iio: st_sensors: harden interrupt handling · 90efe055
      Linus Walleij 提交于
      Leonard Crestez observed the following phenomenon: when using
      hard interrupt triggers (the DRDY line coming out of an ST
      sensor) sometimes a new value would arrive while reading the
      previous value, due to latencies in the system.
      
      We discovered that the ST hardware as far as can be observed
      is designed for level interrupts: the DRDY line will be held
      asserted as long as there are new values coming. The interrupt
      handler should be re-entered until we're out of values to
      handle from the sensor.
      
      If interrupts were handled as occurring on the edges (usually
      low-to-high) new values could appear and the line be held
      asserted after that, and these values would be missed, the
      interrupt handler would also lock up as new data was
      available, but as no new edges occurs on the DRDY signal,
      nothing happens: the edge detector only detects edges.
      
      To counter this, do the following:
      
      - Accept interrupt lines to be flagged as level interrupts
        using IRQF_TRIGGER_HIGH and IRQF_TRIGGER_LOW. If the line
        is marked like this (in the device tree node or ACPI
        table or similar) it will be utilized as a level IRQ.
        We mark the line with IRQF_ONESHOT and mask the IRQ
        while processing a sample, then the top half will be
        entered again if new values are available.
      
      - If we are flagged as using edge interrupts with
        IRQF_TRIGGER_RISING or IRQF_TRIGGER_FALLING: remove
        IRQF_ONESHOT so that the interrupt line is not
        masked while running the thread part of the interrupt.
        This way we will never miss an interrupt, then introduce
        a loop that polls the data ready registers repeatedly
        until no new samples are available, then exit the
        interrupt handler. This way we know no new values are
        available when the interrupt handler exits and
        new (edge) interrupts will be triggered when data arrives.
        Take some extra care to update the timestamp in the poll
        loop if this happens. The timestamp will not be 100%
        perfect, but it will at least be closer to the actual
        events. Usually the extra poll loop will handle the new
        samples, but once in a blue moon, we get a new IRQ
        while exiting the loop, before returning from the
        thread IRQ bottom half with IRQ_HANDLED. On these rare
        occasions, the removal of IRQF_ONESHOT means the
        interrupt will immediately fire again.
      
      - If no interrupt type is indicated from the DT/ACPI,
        choose IRQF_TRIGGER_RISING as default, as this is necessary
        for legacy boards.
      
      Tested successfully on the LIS331DL and L3G4200D by setting
      sampling frequency to 400Hz/800Hz and stressing the system:
      extra reads in the threaded interrupt handler occurs.
      
      Cc: Giuseppe Barba <giuseppe.barba@st.com>
      Cc: Denis Ciocca <denis.ciocca@st.com>
      Tested-by: NCrestez Dan Leonard <cdleonard@gmail.com>
      Reported-by: NCrestez Dan Leonard <cdleonard@gmail.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NJonathan Cameron <jic23@kernel.org>
      90efe055
  2. 01 7月, 2016 11 次提交
  3. 30 6月, 2016 1 次提交
    • G
      Merge tag 'iio-for-4.8b' of... · 3c9a6793
      Greg Kroah-Hartman 提交于
      Merge tag 'iio-for-4.8b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
      
      Jonathan writes:
      
      Second round of new iio device support, features and cleanups in the 4.8 cycle
      
      Firstly some contact detail updates:
      * NXP took over freescale. Update the mma8452 header to reflect this.
      * Martin Kepplinger email address change in mma8452 header.
      * Adriana Reus has changed email address. Update .mailmap.
      * Matt Ranostay has changed email address. Update .mailmap.
      
      New Device Support
      * max1363
        - add the missing i2c_device_ids for a couple of parts so they can actually
          be used.
      * ms5867
        - add device ids for ms5805 and ms5837 parts.
      
      New Features
      * ad5755
        - DT support.  This one was a bit controversial and under review for a long
          time.  Still no one could come up with a better solution.
      * stx104
        - add gpio support
      * ti-adc081c
        - Add ACPI device ID matching.
      
      Core changes
      * Refuse to register triggers with duplicate names.  There is no way to
        distinguish between them so this makes no sense.  A few drivers do not
        generate unique names for each instance of the device present.  We can't
        fix this without changing ABI so leave them and wait for someone to
        actually take the rare step of two identical accelerometers on the same
        board.
      * buffer-dma
        - use ARRAY_SIZE in a few appropriate locations.
      
      Tools
      * Fix the fact that the --trigger-num option in generic_buffer didn't allow
        0 which is perfectly valid in the ABI.
      
      Cleanups
      * as3935
        - improve error reporting.
        - remove redundant zeroing of a field in iio_priv.
      * gp2ap020a00f
        - use the iio_device_claim_*_mode helpers rather than open coding locking
        around mode changes.
      * isl29125
        - use the iio_device_claim_*_mode helpers rather than open coding locking.
      * lidar
        - use the iio_device_claim_*_mode helpers rather than open coding locking.
      * mma8452
        - more detail in devices supported description in comments (addresses and
        similar)
      * sca3000
        - add a missing error check.
      * tcs3414
        - use the iio_device_claim_*_mode helpers rather than open coding locking.
      * tcs3472
        - use the iio_device_claim_*_mode helpers rather than open coding locking.
      3c9a6793
  4. 28 6月, 2016 10 次提交
  5. 27 6月, 2016 11 次提交
  6. 26 6月, 2016 3 次提交