19 Nov, 2015

1 commit

  • …ic23/iio into staging-linus

    Jonathan writes:

    First set of IIO fixes for the 4.4 cycle.

    This set does not include those for issues introduced during the merge
    window. Fixes of those will follow in a future series.

    * ad5064
    - Make sure the local i2c_write returns 0 on success rather than the
    number of bytes transfered. Otherwise we report an error on all writes.
    - Fix a shift for ad5629 and ad5669 which gives incorrect DAC output on
    these parts.
    * ad7793
    - The product ID on the datasheet is wrong. Fix it in the driver.
    * IIO_DUMMY_EVGEN
    - select IRQ_WORK as a dependency.
    * lpc32xx
    - make sure clock is prepared before enabling.
    * si7020
    - data byte order was reversed. Fix it.
    * vf610
    - Internal temperature calculation was wrong if a different
    reference voltage was used. Now use a linear interpolation
    function to make it work over the full range.
    - Fix a division by zero in the case of a device tree property
    not being present (same issue two fixes).
    * xilinx XADC
    - VREFN scale was wrong - fix it.

    Greg Kroah-Hartman
     

15 Nov, 2015

2 commits

  • The scaling factor for VREFN is 3.0/4096 (not 1.0/4096), just as for
    VREFP. This is not immediately obvious from the specification (Xilinx
    UG480), but has been confirmed by Xilinx support.

    Suggested-by: Hartmut Knaack
    Signed-off-by: Thomas Betker
    Cc:
    Signed-off-by: Jonathan Cameron

    Thomas Betker
     
  • The Silicon Labs Si7013, Si7020, and Si7021 family of I2C humidity and
    temperature sensors deliver 16 bit data high byte first.

    See the datasheet available at:
    https://www.silabs.com/Support%20Documents%2fTechnicalDocs%2fSi7020-A20.pdf

    But as documented in Documentation/i2c/smbus-protocol,
    i2c_smbus_read_word_data() expects the low byte first.

    Change the driver to use i2c_smbus_read_word_swapped to get correct byte
    order.

    Signed-off-by: Chris Lesiak
    Cc:
    Signed-off-by: Jonathan Cameron

    Chris Lesiak
     

08 Nov, 2015

1 commit

  • In case the fsl,adck-max-frequency property is not present in
    the device tree, a division by zero error results during the
    probe call on kernel boot (see below). This patch fixes it and
    also restores device tree compatibility in case kernels are
    booting with old device trees without this property specified.

    [ 1.063229] Division by zero in kernel.
    [ 1.067152] CPU: 0 PID: 1 Comm: swapper Not tainted
    4.3.0-rc5-00212-gcc88cef #37
    [ 1.074650] Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree)
    [ 1.081135] Backtrace:
    [ 1.083694] [] (dump_backtrace) from []
    (show_stack+0x18/0x1c)
    [ 1.091340] r7:00000008 r6:8e0ae210 r5:00000000 r4:8e299800
    [ 1.097146] [] (show_stack) from []
    (dump_stack+0x24/0x28)
    [ 1.104483] [] (dump_stack) from []
    (__div0+0x1c/0x20)
    [ 1.111421] [] (__div0) from [] (Ldiv0+0x8/0x10)
    [ 1.117865] [] (vf610_adc_probe) from []
    (platform_drv_probe+0x4c/0xac)
    [ 1.126311] r10:00000000 r9:8076a5ec r8:00000000 r7:fffffdfb
    r6:807cc67c r5:8e0ae210
    [ 1.134319] r4:807f6c54
    [ 1.136915] [] (platform_drv_probe) from []
    (driver_probe_device+0x20c/0x2f8)
    [ 1.145882] r7:807cc67c r6:00000000 r5:8e0ae210 r4:807f6c54
    [ 1.151657] [] (driver_probe_device) from []
    (__driver_attach+0x94/0x98)
    [ 1.160190] r9:8076a5ec r8:00000098 r7:00000000 r6:8e0ae244
    r5:807cc67c r4:8e0ae210
    [ 1.168112] [] (__driver_attach) from []
    (bus_for_each_dev+0x70/0xa4)
    [ 1.176383] r7:00000000 r6:803139a8 r5:807cc67c r4:00000000
    [ 1.182159] [] (bus_for_each_dev) from []
    (driver_attach+0x24/0x28)
    [ 1.190260] r6:807bb568 r5:8e2a5b00 r4:807cc67c
    [ 1.194996] [] (driver_attach) from []
    (bus_add_driver+0x1a4/0x21c)
    [ 1.203113] [] (bus_add_driver) from []
    (driver_register+0x80/0x100)
    [ 1.211275] r7:8e2a7dc0 r6:807a8160 r5:80789e14 r4:807cc67c
    [ 1.217075] [] (driver_register) from []
    (__platform_driver_register+0x5c/0x64)
    [ 1.226216] r5:80789e14 r4:807a8160
    [ 1.229877] [] (__platform_driver_register) from
    [] (vf610_adc_driver_init+0x1c/0x20)
    [ 1.239556] [] (vf610_adc_driver_init) from []
    (do_one_initcall+0x94/0x1dc)
    [ 1.248365] [] (do_one_initcall) from []
    (kernel_init_freeable+0x13c/0x1e0)
    [ 1.257155] r10:80794830 r9:8076a5ec r8:00000098 r7:807d5780
    r6:807d5780 r5:00000006
    [ 1.265153] r4:807a0ee8
    [ 1.267753] [] (kernel_init_freeable) from []
    (kernel_init+0x18/0xf0)
    [ 1.276021] r10:00000000 r9:00000000 r8:00000000 r7:00000000
    r6:00000000 r5:80590ed8
    [ 1.284015] r4:807d5780
    [ 1.286615] [] (kernel_init) from []
    (ret_from_fork+0x14/0x3c)
    [ 1.294278] r5:80590ed8 r4:00000000

    Signed-off-by: Sanchayan Maity
    Acked-by: Fugang Duan
    Acked-by: Stefan Agner
    Cc:
    Signed-off-by: Jonathan Cameron

    Sanchayan Maity
     

06 Nov, 2015

1 commit

  • Pull spi updates from Mark Brown:
    "Quite a lot of activity in SPI this cycle, almost all of it in drivers
    with a few minor improvements and tweaks in the core.

    - Updates to pxa2xx to support Intel Broxton and multiple chip selects.
    - Support for big endian in the bcm63xx driver.
    - Multiple slave support for the mt8173
    - New driver for the auxiliary SPI controller in bcm2835 SoCs.
    - Support for Layerscale SoCs in the Freescale DSPI driver"

    * tag 'spi-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (87 commits)
    spi: pxa2xx: Rework self-initiated platform data creation for non-ACPI
    spi: pxa2xx: Add support for Intel Broxton
    spi: pxa2xx: Detect number of enabled Intel LPSS SPI chip select signals
    spi: pxa2xx: Add output control for multiple Intel LPSS chip selects
    spi: pxa2xx: Use LPSS prefix for defines that are Intel LPSS specific
    spi: Add DSPI support for layerscape family
    spi: ti-qspi: improve ->remove() callback
    spi/spi-xilinx: Fix race condition on last word read
    spi: Drop owner assignment from spi_drivers
    spi: Add THIS_MODULE to spi_driver in SPI core
    spi: Setup the master controller driver before setting the chipselect
    spi: dw: replace magic constant by DW_SPI_DR
    spi: mediatek: mt8173 spi multiple devices support
    spi: mediatek: handle controller_data in mtk_spi_setup
    spi: mediatek: remove mtk_spi_config
    spi: mediatek: Update document devicetree bindings to support multiple devices
    spi: fix kernel-doc warnings about missing return desc in spi.c
    spi: fix kernel-doc warnings about missing return desc in spi.h
    spi: pxa2xx: Align a few defines
    spi: pxa2xx: Save other reg_cs_ctrl bits when configuring chip select
    ...

    Linus Torvalds
     

04 Nov, 2015

1 commit


28 Oct, 2015

1 commit


27 Oct, 2015

1 commit


25 Oct, 2015

4 commits

  • While the datasheet for the AD7785 lists 0xXB as the product ID the actual
    product ID is 0xX3.

    Fix the product ID otherwise the driver will reject the device due to non
    matching IDs.

    Fixes: e786cc26dcc5 ("staging:iio:ad7793: Implement stricter id checking")
    Signed-off-by: Lars-Peter Clausen
    Cc:
    Signed-off-by: Jonathan Cameron

    Lars-Peter Clausen
     
  • The ad5629/ad5669 are the I2C variant of the ad5628/ad5668, which has a SPI
    interface. They are mostly identical with the exception that the shift
    factor is different. Currently the driver does not take care of this
    difference which leads to incorrect DAC output values.

    Fix this by introducing a custom channel spec for the ad5629/ad5669 with
    the correct shift factor.

    Fixes: commit 6a17a0768f77 ("iio:dac:ad5064: Add support for the ad5629r and ad5669r")
    Signed-off-by: Lars-Peter Clausen
    Cc:
    Signed-off-by: Jonathan Cameron

    Lars-Peter Clausen
     
  • i2c_master_send() returns the number of bytes transferred on success while
    the ad5064 driver expects that the write() callback returns 0 on success.
    Fix that by translating any non negative return value of i2c_master_send()
    to 0.

    Fixes: commit 6a17a0768f77 ("iio:dac:ad5064: Add support for the ad5629r and ad5669r")
    Signed-off-by: Michael Hennerich
    Signed-off-by: Lars-Peter Clausen
    Cc:
    Signed-off-by: Jonathan Cameron

    Michael Hennerich
     
  • Calculate ADCR_VTEMP25 using VTEMP25 at VREFH_ADC 3V3. Existing
    calculations consider the typical values provided in datasheet.
    Those typical values are valid for VREFH_ADC at 3.0V. VTEMP25
    is different for different VREFH_ADC voltages. With VREFH_ADC
    at 3.3V, voltage at 25°C is 0.699V. Hence update the VTEMP25
    to 0.699V which gives ADCR@Temp25 as 867.

    Formula for finding ADCR@Temp25:
    ADCR@Temp25 = (ADCR@Vdd * V@TEMP25 * 10) / VDDconv

    ADCR@Vdd for 12-Bit ADC = 4095
    VDDconv = VREFH_ADC * 10

    VREFH_ADC@3.3V
    ADCR@Temp25 = (4095 * .699 * 10) / 33
    ADCR@Temp25 ~= 867

    | VREFH_ADC | V@TEMP25 | VDDconv | ADCR@Temp25 |
    | 3.0V | 0.696mV | 30 | 950 |
    | 3.3V | 0.699mV | 33 | 867 |

    Signed-off-by: Bhuvanchandra DV
    Acked-by: Fugang Duan
    Cc:
    Signed-off-by: Jonathan Cameron

    Bhuvanchandra DV
     

13 Oct, 2015

2 commits

  • This patch is a tidy up of warnings from the autobuilder.

    >> drivers/iio/light/apds9960.c:495:32: sparse: cast to restricted __le16
    drivers/iio/light/apds9960.c:635:24: sparse: cast to restricted __le16
    >> drivers/iio/light/apds9960.c:672:21: sparse: incorrect type in assignment (different base types)
    drivers/iio/light/apds9960.c:672:21: expected unsigned short [unsigned] [usertype] buf
    drivers/iio/light/apds9960.c:672:21: got restricted __le16 [usertype]

    Signed-off-by: Jonathan Cameron
    Cc: mranostay@gmail.com
    Signed-off-by: Jonathan Cameron

    Jonathan Cameron
     
  • This patch changes various types to the appropriate endian specific
    versions. Also introduces an additional local variable to avoid
    a single variable being used for both be and cpu endianness.

    These aren't bugs as such, but clearing them up does make the code
    clearer.

    Warning was:
    sparse warnings: (new ones prefixed by >>)

    >> drivers/iio/common/ms_sensors/ms_sensors_i2c.c:126:9: sparse: cast to restricted __be32
    >> drivers/iio/common/ms_sensors/ms_sensors_i2c.c:126:9: sparse: cast to restricted __be32
    >> drivers/iio/common/ms_sensors/ms_sensors_i2c.c:126:9: sparse: cast to restricted __be32
    >> drivers/iio/common/ms_sensors/ms_sensors_i2c.c:126:9: sparse: cast to restricted __be32
    >> drivers/iio/common/ms_sensors/ms_sensors_i2c.c:126:9: sparse: cast to restricted __be32
    >> drivers/iio/common/ms_sensors/ms_sensors_i2c.c:126:9: sparse: cast to restricted __be32
    drivers/iio/common/ms_sensors/ms_sensors_i2c.c:127:16: sparse: cast to restricted __be32
    drivers/iio/common/ms_sensors/ms_sensors_i2c.c:127:16: sparse: cast to restricted __be32
    drivers/iio/common/ms_sensors/ms_sensors_i2c.c:127:16: sparse: cast to restricted __be32
    drivers/iio/common/ms_sensors/ms_sensors_i2c.c:127:16: sparse: cast to restricted __be32
    drivers/iio/common/ms_sensors/ms_sensors_i2c.c:127:16: sparse: cast to restricted __be32
    drivers/iio/common/ms_sensors/ms_sensors_i2c.c:127:16: sparse: cast to restricted __be32
    >> drivers/iio/common/ms_sensors/ms_sensors_i2c.c:208:18: sparse: incorrect type in assignment (different base types)
    drivers/iio/common/ms_sensors/ms_sensors_i2c.c:208:18: expected unsigned short [unsigned] [addressable] [usertype] send_buf
    drivers/iio/common/ms_sensors/ms_sensors_i2c.c:208:18: got restricted __be16 [usertype]
    >> drivers/iio/common/ms_sensors/ms_sensors_i2c.c:216:19: sparse: cast to restricted __be64
    >> drivers/iio/common/ms_sensors/ms_sensors_i2c.c:216:19: sparse: cast to restricted __be64
    >> drivers/iio/common/ms_sensors/ms_sensors_i2c.c:216:19: sparse: cast to restricted __be64
    >> drivers/iio/common/ms_sensors/ms_sensors_i2c.c:216:19: sparse: cast to restricted __be64
    >> drivers/iio/common/ms_sensors/ms_sensors_i2c.c:216:19: sparse: cast to restricted __be64
    >> drivers/iio/common/ms_sensors/ms_sensors_i2c.c:216:19: sparse: cast to restricted __be64
    >> drivers/iio/common/ms_sensors/ms_sensors_i2c.c:216:19: sparse: cast to restricted __be64
    >> drivers/iio/common/ms_sensors/ms_sensors_i2c.c:216:19: sparse: cast to restricted __be64
    >> drivers/iio/common/ms_sensors/ms_sensors_i2c.c:216:19: sparse: cast to restricted __be64
    >> drivers/iio/common/ms_sensors/ms_sensors_i2c.c:216:19: sparse: cast to restricted __be64
    drivers/iio/common/ms_sensors/ms_sensors_i2c.c:230:18: sparse: incorrect type in assignment (different base types)
    drivers/iio/common/ms_sensors/ms_sensors_i2c.c:230:18: expected unsigned short [unsigned] [addressable] [usertype] send_buf
    drivers/iio/common/ms_sensors/ms_sensors_i2c.c:230:18: got restricted __be16 [usertype]
    drivers/iio/common/ms_sensors/ms_sensors_i2c.c:239:19: sparse: cast to restricted __be64
    drivers/iio/common/ms_sensors/ms_sensors_i2c.c:239:19: sparse: cast to restricted __be64
    drivers/iio/common/ms_sensors/ms_sensors_i2c.c:239:19: sparse: cast to restricted __be64
    drivers/iio/common/ms_sensors/ms_sensors_i2c.c:239:19: sparse: cast to restricted __be64
    drivers/iio/common/ms_sensors/ms_sensors_i2c.c:239:19: sparse: cast to restricted __be64
    drivers/iio/common/ms_sensors/ms_sensors_i2c.c:239:19: sparse: cast to restricted __be64
    drivers/iio/common/ms_sensors/ms_sensors_i2c.c:239:19: sparse: cast to restricted __be64
    drivers/iio/common/ms_sensors/ms_sensors_i2c.c:239:19: sparse: cast to restricted __be64
    drivers/iio/common/ms_sensors/ms_sensors_i2c.c:239:19: sparse: cast to restricted __be64
    drivers/iio/common/ms_sensors/ms_sensors_i2c.c:239:19: sparse: cast to restricted __be64

    Reported-by: kbuild test robot
    Signed-off-by: Jonathan Cameron

    Jonathan Cameron
     

11 Oct, 2015

11 commits


04 Oct, 2015

2 commits


03 Oct, 2015

9 commits

  • Add a simple SPI driver which initializes the spi regmap for the bmc150
    core driver.

    Signed-off-by: Markus Pargmann
    Signed-off-by: Jonathan Cameron

    Markus Pargmann
     
  • Signed-off-by: Markus Pargmann
    Tested-by: Irina Tirdea
    Signed-off-by: Jonathan Cameron

    Markus Pargmann
     
  • i2c_client struct is now only used for debugging output. We can use the
    device struct as well so we can remove all struct i2c_client usage.

    Signed-off-by: Markus Pargmann
    Tested-by: Irina Tirdea
    Signed-off-by: Jonathan Cameron

    Markus Pargmann
     
  • This replaces all usage of direct i2c accesses with regmap accesses.

    Signed-off-by: Markus Pargmann
    Tested-by: Irina Tirdea
    Signed-off-by: Jonathan Cameron

    Markus Pargmann
     
  • Commit 845c877009cf014b ("i2c / ACPI: Assign IRQ for devices that have
    GpioInt automatically") automatically assigns the first ACPI GPIO
    interrupt in client->irq, so we can remove the probing code from
    drivers that use only one interrupt.

    Signed-off-by: Octavian Purdila
    Signed-off-by: Jonathan Cameron

    Octavian Purdila
     
  • Since commit dab472eb931bc291 ("i2c / ACPI: Use 0 to indicate that
    device does not have interrupt assigned") 0 is not a valid i2c
    client irq anymore, so change all driver's checks accordingly.

    The same issue occurs when the device is instantiated via device tree
    with no IRQ, or from the i2c sysfs interface, even before the patch
    above.

    Signed-off-by: Octavian Purdila
    Signed-off-by: Jonathan Cameron

    Octavian Purdila
     
  • This accelerometer accidentally either emits a DRDY signal or an
    IRQ signal. Accidentally I activated the IRQ signal as I thought
    it was analogous to the interrupt generator on other ST
    accelerometers. This was wrong. After this patch generic_buffer
    gives a nice stream of accelerometer readings.

    Fixes: 3acddf74f807778f "iio: st-sensors: add support for lis3lv02d accelerometer"
    Cc: Denis CIOCCA
    Signed-off-by: Linus Walleij
    Cc:
    Signed-off-by: Jonathan Cameron

    Linus Walleij
     
  • MADC[3:6] reads incorrect values without these two following changes:

    - enable the 3v1 bias regulator for ADC[3:6]
    - configure ADC[3:6] lines as input, not as USB

    Signed-off-by: Adam YH Lee
    Signed-off-by: Jonathan Cameron

    Adam YH Lee
     
  • Dan Carpenter reported a static checker report and after his mail I
    noticed that we actually return from function if positive value is
    obtained from i2c read. This was remainder from when code was not in
    separate function (which I changed during the review process).

    Static checker reported
    drivers/iio/temperature/mlx90614.c:167
    mlx90614_iir_search()
    warn: this cast is a no-op
    which meant that cast before negating is useless. Dan also proposed a
    solution on nicer bit operation form.

    Also changed magic number to macro in process as that was confusing.

    Reported-by: Dan Carpenter
    Signed-off-by: Crt Mori
    Signed-off-by: Jonathan Cameron

    Crt Mori
     

01 Oct, 2015

4 commits

  • Add support for Microchip digital potentiometers and rheostats
    MCP4531, MCP4532, MCP4551, MCP4552
    MCP4631, MCP4632, MCP4651, MCP4652

    DEVICE Wipers Steps Resistor Opts (kOhm) i2c address
    MCP4531 1 129 5, 10, 50, 100 010111x
    MCP4532 1 129 5, 10, 50, 100 01011xx
    MCP4551 1 257 5, 10, 50, 100 010111x
    MCP4552 1 257 5, 10, 50, 100 01011xx
    MCP4631 2 129 5, 10, 50, 100 0101xxx
    MCP4632 2 129 5, 10, 50, 100 01011xx
    MCP4651 2 257 5, 10, 50, 100 0101xxx
    MCP4652 2 257 5, 10, 50, 100 01011xx

    Datasheet: http://www.microchip.com/downloads/en/DeviceDoc/22096b.pdf

    Signed-off-by: Peter Rosin
    Signed-off-by: Jonathan Cameron

    Peter Rosin
     
  • The device tree compatible strings weren't properly
    registered for the pulsedlight-lidar-lite-v2 driver.

    Signed-off-by: Matt Ranostay
    Signed-off-by: Jonathan Cameron

    Matt Ranostay
     
  • Chipset sometime updates in the middle of a reading causing it
    to reset the data pointer, and causing invalid reading of previous data.

    We can check for this invalid state by reading MSB of the resistance
    reading that is always zero, and by also confirming the VOC_short isn't
    zero.

    Signed-off-by: Matt Ranostay
    Signed-off-by: Jonathan Cameron

    Matt Ranostay
     
  • This shouldn't actually change anything since the core calls the events
    sysfs folder "events" anyways.

    Signed-off-by: Martin Kepplinger
    Acked-by: Lars-Peter Clausen
    Signed-off-by: Jonathan Cameron

    Martin Kepplinger