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
     

28 Oct, 2015

1 commit


03 Oct, 2015

1 commit


13 Aug, 2015

1 commit

  • …3/iio into staging-next

    Jonathan writes:

    Second set of new device support, features and cleanup for the 4.3 cycle.
    Take 2 also includes a fix set that was too late for the 4.2 cycle.

    As we had a lot of tools and docs work in this set, I have broken those
    out into their own categories in this description.

    Fixes from the pull request '4th set of IIO fixes for the 4.2 cycle'.
    * Poll functions for both event chardev and the buffer one were returning
    negative error codes (via a positive value).
    * A recent change to lsiio adding some error handling that was wrong and
    stopped the tool working.
    * bmg160 was missing some dependencies in Kconfig
    * berlin2-adc had a misshandled register (wrote a value rather than a bitmap)

    New device support
    * TI opt3001 light sensor
    * TXC PA12 ALS and proximity sensor.
    * mcp3301 ADC support (in mcp320x driver)
    * ST lsm303agr accelerometer and magnetometer drivers (plus some st-sensors
    common support to allow different WHOAMI register addresses, devices with
    fixed scale and allow interrupt equiped magnetometers).
    * ADIS16305, ADIS16367, ADIS16445IMUs (in the adis16400 driver)
    * ADIS16266 gyro (in the adis16260 driver)
    * ADIS16137 gyro (in the adis16136 driver)

    New functionality
    * mmc35240 DT bindings.
    * Inverse unit conversion macros to aid handing of values written to sysfs
    attributes.

    Core cleanup
    * Forward declaration of struct iio_trigger to avoid a compile warning.

    Driver cleanup / fixes
    * mxs-lradc
    - Clarify which parts are supported.
    - Fix spelling erorrs.
    - Missing/extra includes
    - reorder includes
    - add datasheet name listings for all usable channels (to allow them
    to be bound by name from consumer drivers)
    * acpi-als - add some function prefixes as per general iio style.
    * bmc150_magn - replace a magic value with the existing define.
    * vf610 - determine possible sample frequencies taking into account the
    electrical characteristics (defining a minimum sample time)
    * dht11
    - whitespace
    - additional docs
    - avoid mulitple assignments in one line
    - Use the new funciton ktime_get_resolution_ns to cleanup a nasty trick
    previously used for timing.
    * Fix all drivers that consider 0 a valid IRQ for historical reasons.
    * Export I2C module alias info where previously missing (to allow autoprobing)
    * Export OF module alias info where previously missing.
    * mmc35240 - switch some variables into arrays to improve readability.
    * mlx90614 - define some magic numbers for readability.
    * bmc150_magn
    - expand area locked by a mutex to cover all the use of the
    data->buffer.
    - use descriptive naming for a mask instead of a magic value.
    * berin2-adc
    - pass up an error code rather that a generic error
    - constify the iio_chan_spec
    - some other little tidy ups.
    * stk8312
    - fix a dependency on triggered buffers in kconfig
    - add a check for invalid attribute values
    - improve error handling by returning error codes where possible and
    return immediately where relevant
    - rework macro defs to use GENMASK etc
    - change some variable types to reduce unnecessary casting
    - clean up code style
    - drop a local buffer copy for bulk reads and use the one in data->buffer
    instead.
    * adis16400 - the adis16448 gyroscope scale was wrong.
    * adis16480 - some more wrong scales for various parts.
    * adis16300 - has an undocumented product id and serial number registers so
    use them.
    * iio_simple_dummy - fix some wrong code indentation.
    * bmc150-accel - use the chip ID to detect the chip present rather than
    verifying the expected part was there. This was in response to a wrong
    ACPI entry on the WinBook TW100.
    * mma8452
    - fix _get_hp_filter_index
    - drop a double include
    - pass up an error code rather than rewriting it
    - range check input values to attribute writes
    - register defs tidy up using GENMASK and reordering them to be easier to
    follow.
    - various coding style cleanups
    - put the Kconfig entry in the write place (alphabetically).

    Tools related
    * Tools cleanup - drop an explicity NULL comparison, some unnecessary braces,
    use the ARRAY_SIZE macro, send error messages to stderr instead of dropping
    them in the middle of normal output.
    * Fix tools to allow that scale and offset attributes are optional.
    * More tools fixes including allowing true 32bit data (previously an overflow
    prevented more than 31bits)
    * Drop a stray header guard that ended up in a c file.
    * Make calc_digits static as it isn't exported or in the header.
    * Set ci_array pointer to NULL after free as a protection against non safe
    usage of the tools core code. Also convert a double pointer to a single
    one as the extra level of indirection was unnecessary.

    Docs
    * DocBook introduction by Daniel Baluta. Glad we are beginning to
    draw together some more introductory docs to suplement the various
    tools / examples.
    * Drop bytes_per_datum sysfs attribute docs as it no longer exists.
    * A whole load of missing / fixing of kernel-doc for the core of IIO.
    * Document the trigger name sysfs attribute in the ABI docs.
    * Minor typos in the ABI docs related to power down modes.

    Greg Kroah-Hartman
     

08 Aug, 2015

6 commits


24 Jul, 2015

1 commit

  • Since patch "i2c / ACPI: Use 0 to indicate that device does not have
    interrupt assigned" [1], 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.

    [1] http://lkml.kernel.org/g/

    Signed-off-by: Octavian Purdila
    Reviewed-by: Mika Westerberg
    Signed-off-by: Jonathan Cameron

    Octavian Purdila
     

21 Jul, 2015

1 commit


12 Jul, 2015

1 commit


14 Jun, 2015

2 commits


16 May, 2015

5 commits

  • The adis16448, unlike the other chips in this family, in addition to the
    hardware channels also sends out the DIAG_STAT register in burst mode
    before them. Handle that case by skipping over the first 2 bytes before we
    pass the received data to the buffer.

    Signed-off-by: Lars-Peter Clausen
    Fixes: 76ada52f7f5d ("iio:adis16400: Add support for the adis16448")
    Cc:
    Signed-off-by: Jonathan Cameron

    Lars-Peter Clausen
     
  • There are a few issues with the burst mode support. For one we don't setup
    the rx buffer, so the buffer will never be filled and all samples will read
    as the zero. Furthermore the tx buffer has the wrong type, which means the
    driver sends the wrong command and not the right data is returned.

    The final issue is that in burst mode all channels are transferred. Hence
    the length of the transfer length should be the number of hardware
    channels * 2 bytes. Currently the driver uses indio_dev->scan_bytes for
    this. But if the timestamp channel is enabled the scan_bytes will be larger
    than the burst length. Fix this by just calculating the burst length based
    on the number of hardware channels.

    Signed-off-by: Paul Cercueil
    Signed-off-by: Lars-Peter Clausen
    Fixes: 5eda3550a3cc ("staging:iio:adis16400: Preallocate transfer message")
    Cc:
    Signed-off-by: Jonathan Cameron

    Paul Cercueil
     
  • We unfortunately can't use ~0UL for the scan mask to indicate that the
    only valid scan mask is all channels selected. The IIO core needs the exact
    mask to work correctly and not a super-set of it. So calculate the masked
    based on the channels that are available for a particular device.

    Signed-off-by: Paul Cercueil
    Signed-off-by: Lars-Peter Clausen
    Fixes: 5eda3550a3cc ("staging:iio:adis16400: Preallocate transfer message")
    Cc:
    Signed-off-by: Jonathan Cameron

    Paul Cercueil
     
  • Previously, the two voltage channels had the same ID, which didn't cause
    conflicts in sysfs only because one channel is named and the other isn't;
    this is still violating the spec though, two indexed channels should never
    have the same index.

    Signed-off-by: Paul Cercueil
    Signed-off-by: Lars-Peter Clausen
    Cc:
    Signed-off-by: Jonathan Cameron

    Paul Cercueil
     
  • Add the scale for the pressure channel, which is currently missing.

    Signed-off-by: Lars-Peter Clausen
    Fixes: 76ada52f7f5d ("iio:adis16400: Add support for the adis16448")
    Cc:
    Signed-off-by: Jonathan Cameron

    Lars-Peter Clausen
     

07 Apr, 2015

1 commit


28 Mar, 2015

1 commit

  • This patch uses iio_trigger_get to increment the reference
    count of trigger device, to avoid incorrect assignment.
    Can result in a null pointer dereference during removal if the
    trigger has been changed before removal.

    This patch refers to a similar situation encountered through the
    following discussion:
    http://www.spinics.net/lists/linux-iio/msg13669.html

    Signed-off-by: Darshana Padmadas
    Cc:
    Signed-off-by: Jonathan Cameron

    Darshana Padmadas
     

25 Mar, 2015

1 commit

  • …iio into staging-next

    Jonathan writes:

    First set of new drivers, cleanups and functionality for IIO in the 4.1 cycle.

    New drivers
    * CM3323 color sensor.
    * MS5611 pressure and temperature sensor.

    New functionality
    * mup6050 - create mux clients for devices described via ACPI. The reasoning
    and approach taken in this patch are complex. Basically there is no
    otherway of finding out what is there than by some esoteric look ups in
    the ACPI data.
    * cm3232 - PM support
    * itg3200 - suspend/resume support
    * mcp320x - add more ADCs to the kconfig to reflect what the driver supports
    (this patch and the bindings got left behind when the support was added
    a while back).

    Docs / utils
    * ti-adc128s052 - DT bindings.
    * mcp3422 - DT bindings.
    * mcp320x - DT bindings
    * ABI docs for event threshold scale attributes, in_magn_offset, proximity
    scan_element and thresh falling/rising values for accelerometers. All
    elements long in use that have slipped by being explicitly documented.
    * Tidy up the tools previously in drivers/staging/iio/Documentation and move
    them out to /tools/iio. Yet another move that should have happened long ago.
    This time Roberta Dobrescu did the leg work. Thanks!

    Core Cleanups
    * Export userspace IIO headers. We should have done the appropriate header
    splitting a long time ago. Thanks to Daniel for sorting this out.

    * Refactor the registring of attributes for buffers to move all non-custom
    ones to a vector allowing easier additions to the current set in the future.

    Driver Cleanups
    * gpiod related cleanups. Make use of the additional parameter to specify
    initial direciton to avoid extra code.
    * bmc150 - Various refactorings to reduce code repitition and prepare for
    hardware buffer support. Some of these cleanups are good even
    without the new functionality.
    * kmx61 - direct use of index to an array avoiding a structure element which
    was always the index to an element in an array of that structure.
    * vf610 - avoid incorrect type for return from wait_for_completion_timeout.
    * gp2ap020a00f - use put_unaligned_le32 for slight code simplification.
    * ade7754 - improve error handling including suppressing some build warnings.
    * ade7759 - improve error handling including suppressing some build warnings.
    * hmc5843 - Long line and indentation fixes. Also some constifying of various
    constant data.
    * ade7854 - 80+ character line splitting.
    * ad2s1210 - fix wrong printf format string.
    * mxs-lradc - fix wrong printf format string.
    * ade7954-i2c - code alignment fixes and other trivial but worthwhile bits.
    * periodic rtc trigger - make the frequency type an unsigned int as it
    is always treated as such.
    * jsa1212 - constify struct regmap_config as it is constant.
    * ad7793 - typo in the MODULE_DESCRIPTION
    * mma9551 - check gpiod_to_irq errors. Note that this doesn't actually cause
    any trouble but is worth tidying up as obviously incorrect.
    * mlx90614 - refactor the register symbols to make it clear which reads are to
    RAM not PROM.

    Greg Kroah-Hartman
     

15 Mar, 2015

2 commits


08 Mar, 2015

1 commit

  • If the in-kernel push interface is used we may have a different masks
    on the device buffer and the kernel buffer and in this case the device
    should generate data for the reunion of the buffers, which is
    available at indio_dev->active_scan_mask.

    Compiled tested only except for bmc150-accel which was tested at
    runtime with the hardware.

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

    Octavian Purdila
     

28 Feb, 2015

1 commit

  • …jic23/iio into staging-linus

    Jonathan writes:

    First round of fixes for IIO in the 4.0 cycle. Note a followup
    set dependent on patches in the recent merge windows will follow shortly.

    * dht11 - fix a read off the end of an array, add some locking to prevent
    the read function being interrupted and make sure gpio/irq lines
    are not enabled for irqs during output.
    * iadc - timeout should be in jiffies not msecs
    * mpu6050 - avoid a null id from ACPI emumeration being dereferenced.
    * mxs-lradc - fix up some interaction issues between the touchscreen driver
    and iio driver. Mostly about making sure that the adc driver
    only affects channels that are not being used for the
    touchscreen.
    * ad2s1200 - sign extension fix for a result of c type promotion.
    * adis16400 - sign extension fix for a result of c type promotion.
    * mcp3422 - scale table was transposed.
    * ad5686 - use _optional regulator get to avoid a dummy reg being allocate
    which would cause the driver to fail to initialize.
    * gp2ap020a00f - select REGMAP_I2C
    * si7020 - revert an incorrect cleanup up and then fix the issue that made
    that cleanup seem like a good idea.

    Greg Kroah-Hartman
     

25 Feb, 2015

1 commit

  • This is a follow up patches after adding i2c mux adapter for bypass
    mode. Potentially many different types of sensor can be attached to
    INVMPU6XXX device, which can be connected to main cpu i2c bus in
    bypass mode.
    Why do we need this?
    The system ACPI table entry will consist of only one device for
    INV6XXX, assuming that this driver will handle all connected sensors.
    That is not true for the Linux driver. There are bunch of IIO drivers
    for each sensors, hence we created a mux on this device. So to load
    these additional drivers, we need to create i2c devices for them
    in this driver using this mux adapter.

    There are multiple options:
    1. Use the auto detect feature, this needs a new i2c class for the
    adapter as the existing HWMON class is not acceptable. Also the
    autodetect has overhead of executing detect method for each
    matching class of adapters.
    This is a simple implementation. This option was previously submitted
    with not a happy feedback.

    2. Option is use ACPI magic and parse the configuration data. What
    we need to create a i2c device at a minimum is address and a name.
    Address can be obtained for secondary device in more or less in a
    standard way from using _CRS element. But there is no name. To get
    name we need to process proprietary vendor data. Not having name is
    not fun, as you have to create device using the device name of
    INVN6XXXX, respecting driver duplicate name space restriction.
    Also each client driver needs to have this name in the id table.
    Since multiple driver can be loaded, the driver should be able to
    detect its presence and gracefully exit for the other client driver
    to take it over.
    So we use two step process:
    - Use DMI to id platform and parse propritery data. This is not uncommon
    for many x86 platform specific driver. We will get both name and address.
    The change created necessary infrastructure to add more properitery vendor
    data parsing.
    - If DMI match fails, then create device on INV6XXX-client (we can't
    create with same name as INV6XXX as it will cause duplicate name and driver
    model will reject.) With this each client sensor driver which needs to get
    attached via INV6XXXX, need this name in the id table and detect the
    physical presence of sensor in probe and exit if not found.

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

    Srinivas Pandruvada
     

22 Feb, 2015

1 commit

  • Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions)
    which appeared in v3.17-rc1, the gpiod_get* functions take an additional
    parameter that allows to specify direction and initial value for
    outputs.

    Signed-off-by: Uwe Kleine-König
    Reviewed-by: Linus Walleij
    Reviewed-by: Alexandre Courbot
    Reviewed-by: Daniel Baluta
    Signed-off-by: Jonathan Cameron

    Uwe Kleine-König
     

04 Feb, 2015

1 commit


28 Jan, 2015

3 commits


27 Jan, 2015

1 commit

  • The intention is obviously to sign-extend a 12 bit quantity. But
    because of C's promotion rules, the assignment is equivalent to "val16
    &= 0xfff;". Use the proper API for this.

    Signed-off-by: Rasmus Villemoes
    Acked-by: Lars-Peter Clausen
    Cc: Stable@vger.kernel.org
    Signed-off-by: Jonathan Cameron

    Rasmus Villemoes
     

21 Jan, 2015

1 commit

  • After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
    selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks
    depending on CONFIG_PM_RUNTIME may now be changed to depend on
    CONFIG_PM.

    Replace CONFIG_PM_RUNTIME with CONFIG_PM everywhere under
    drivers/iio/imu/kmx61.c

    Signed-off-by: Daniel Baluta
    Signed-off-by: Jonathan Cameron

    Daniel Baluta
     

11 Jan, 2015

1 commit


06 Jan, 2015

4 commits