05 Jun, 2018

1 commit

  • commit c043ec1ca5baae63726aae32abbe003192bc6eec upstream.

    Currently, we use int for buffer length and bytes_per_datum. However,
    kfifo uses unsigned int for length and size_t for element size. We need
    to make sure these matches or we will have bugs related to overflow (in
    the range between INT_MAX and UINT_MAX for length, for example).

    In addition, set_bytes_per_datum uses size_t while bytes_per_datum is an
    int, which would cause bugs for large values of bytes_per_datum.

    Change buffer length to use unsigned int and bytes_per_datum to use
    size_t.

    Signed-off-by: Martin Kelly
    Cc:
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Martin Kelly
     

25 Dec, 2017

1 commit

  • [ Upstream commit e72a060151e5bb673af24993665e270fc4f674a7 ]

    Introduce register mask for data-ready status register since
    pressure sensors (e.g. LPS22HB) export just two channels
    (BIT(0) and BIT(1)) and BIT(2) is marked reserved while in
    st_sensors_new_samples_available() value read from status register
    is masked using 0x7.
    Moreover do not mask status register using active_scan_mask since
    now status value is properly masked and if the result is not zero the
    interrupt has to be consumed by the driver. This fix an issue on LPS25H
    and LPS331AP where channel definition is swapped respect to status
    register.
    Furthermore that change allows to properly support new devices
    (e.g LIS2DW12) that report just ZYXDA (data-ready) field in status register
    to figure out if the interrupt has been generated by the device.

    Fixes: 97865fe41322 (iio: st_sensors: verify interrupt event to status)
    Signed-off-by: Lorenzo Bianconi
    Reviewed-by: Linus Walleij
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Lorenzo Bianconi
     

14 Dec, 2017

1 commit

  • commit 6d745ee8b5e81f3a33791e3c854fbbfd6f3e585e upstream.

    The ADC driver can trigger on either the timer or the lptim
    trigger, but it only uses a Kconfig 'select' statement
    to ensure that the first of the two is present. When the lptim
    trigger is enabled as a loadable module, and the adc driver
    is built-in, we now get a link error:

    drivers/iio/adc/stm32-adc.o: In function `stm32_adc_get_trig_extsel':
    stm32-adc.c:(.text+0x4e0): undefined reference to `is_stm32_lptim_trigger'

    We could use a second 'select' statement and always have both
    trigger drivers enabled when the adc driver is, but it seems that
    the lptimer trigger was intentionally left optional, so it seems
    better to keep it that way.

    This adds a hack to use 'IS_REACHABLE()' rather than 'IS_ENABLED()',
    which avoids the link error, but instead leads to the lptimer trigger
    not being used in the broken configuration. I've added a runtime
    warning for this case to help users figure out what they did wrong
    if this should ever be done by accident.

    Fixes: f0b638a7f6db ("iio: adc: stm32: add support for lptimer triggers")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

25 Sep, 2017

1 commit

  • …/jic23/iio into staging-linus

    Jonathan writes:

    First round of IIO fixes for the 4.14 cycle

    Note this includes fixes from recent merge window. As such the tree
    is based on top of a prior staging/staging-next tree.

    * iio core
    - return and error for a failed read_reg debugfs call rather than
    eating the error.
    * ad7192
    - Use the dedicated reset function in the ad_sigma_delta library
    instead of an spi transfer with the data on the stack which
    could cause problems with DMA.
    * ad7793
    - Implement a dedicate reset function in the ad_sigma_delta library
    and use it to correctly reset this part.
    * bme280
    - ctrl_reg write must occur after any register writes
    for updates to take effect.
    * mcp320x
    - negative voltage readout was broken.
    - Fix an oops on module unload due to spi_set_drvdata not being called
    in probe.
    * st_magn
    - Fix the data ready line configuration for the lis3mdl. It is not
    configurable so the st_magn core was assuming it didn't exist
    and so wasn't consuming interrupts resulting in an unhandled
    interrupt.
    * stm32-adc
    - off by one error on max channels checking.
    * stm32-timer
    - preset should not be buffered - reorganising register writes avoids
    this.
    - fix a corner case in which write preset goes wrong when a timer is
    used first as a trigger then as a counter with preset. Odd case but
    you never know.
    * ti-ads1015
    - Fix setting of comparator polarity by fixing bitfield definition.
    * twl4030
    - Error path handling fix to cleanup in event of regulator
    registration failure.
    - Disable the vusb3v1 regulator correctly in error handling
    - Don't paper over a regulator enable failure.

    Greg Kroah-Hartman
     

24 Sep, 2017

1 commit

  • Since most of the SD ADCs have the option of reseting the serial
    interface by sending a number of SCLKs with CS = 0 and DIN = 1,
    a dedicated function that can do this is usefull.

    Needed for the patch: iio: ad7793: Fix the serial interface reset
    Signed-off-by: Dragos Bogdan
    Acked-by: Lars-Peter Clausen
    Cc:
    Signed-off-by: Jonathan Cameron

    Dragos Bogdan
     

08 Sep, 2017

1 commit

  • Pull MFD updates from Lee Jones:
    "New Drivers
    - RK805 Power Management IC (PMIC)
    - ROHM BD9571MWV-M MFD Power Management IC (PMIC)
    - Texas Instruments TPS68470 Power Management IC (PMIC) & LEDs

    New Device Support:
    - Add support for HiSilicon Hi6421v530 to hi6421-pmic-core
    - Add support for X-Powers AXP806 to axp20x
    - Add support for X-Powers AXP813 to axp20x
    - Add support for Intel Sunrise Point LPSS to intel-lpss-pci

    New Functionality:
    - Amend API to provide register layout; atmel-smc

    Fix-ups:
    - DT re-work; omap, nokia
    - Header file location change {I2C => MFD}; dm355evm_msp, tps65010
    - Fix chip ID formatting issue(s); rk808
    - Optionally register touchscreen devices; da9052-core
    - Documentation improvements; twl-core
    - Constification; rtsx_pcr, ab8500-core, da9055-i2c, da9052-spi
    - Drop unnecessary static declaration; max8925-i2c
    - Kconfig changes (missing deps and remove module support)
    - Slim down oversized licence statement; hi6421-pmic-core
    - Use managed resources (devm_*); lp87565
    - Supply proper error checking/handling; t7l66xb

    Bug Fixes:
    - Fix counter duplication issue; da9052-core
    - Fix potential NULL deference issue; max8998
    - Leave SPI-NOR write-protection bit alone; lpc_ich
    - Ensure device is put into reset during suspend; intel-lpss
    - Correct register offset variable size; omap-usb-tll"

    * tag 'mfd-next-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (61 commits)
    mfd: intel_soc_pmic: Differentiate between Bay and Cherry Trail CRC variants
    mfd: intel_soc_pmic: Export separate mfd-cell configs for BYT and CHT
    dt-bindings: mfd: Add bindings for ZII RAVE devices
    mfd: omap-usb-tll: Fix register offsets
    mfd: da9052: Constify spi_device_id
    mfd: intel-lpss: Put I2C and SPI controllers into reset state on suspend
    mfd: da9055: Constify i2c_device_id
    mfd: intel-lpss: Add missing PCI ID for Intel Sunrise Point LPSS devices
    mfd: t7l66xb: Handle return value of clk_prepare_enable
    mfd: Add ROHM BD9571MWV-M PMIC DT bindings
    mfd: intel_soc_pmic_chtwc: Turn Kconfig option into a bool
    mfd: lp87565: Convert to use devm_mfd_add_devices()
    mfd: Add support for TPS68470 device
    mfd: lpc_ich: Do not touch SPI-NOR write protection bit on Haswell/Broadwell
    mfd: syscon: atmel-smc: Add helper to retrieve register layout
    mfd: axp20x: Use correct platform device ID for many PEK
    dt-bindings: mfd: axp20x: Introduce bindings for AXP813
    mfd: axp20x: Add support for AXP813 PMIC
    dt-bindings: mfd: axp20x: Add AXP806 to supported list of chips
    mfd: Add ROHM BD9571MWV-M MFD PMIC driver
    ...

    Linus Torvalds
     

04 Sep, 2017

1 commit

  • Add support for LPTIMx_OUT triggers that can be found on some STM32
    devices. These triggers can be used then by ADC or DAC.
    Typical usage is to configure LPTimer as PWM output (via pwm-stm32-lp)
    and have synchronised analog conversions with these triggers.

    Signed-off-by: Fabrice Gasnier
    Reviewed-by: Jonathan Cameron
    Signed-off-by: Lee Jones

    Fabrice Gasnier
     

28 Aug, 2017

1 commit


21 Aug, 2017

1 commit

  • …/iio into staging-next

    Jonathan writes:

    Second set of IIO new device support, features and cleanup for the 4.14 cycle.

    New device support:
    * ak8974
    - support the AMI306.
    * st_magnetometer
    - add support for the LIS2MDL with bindings.
    * rockchip-saradc
    - add binding for rv1108 SoC (no driver change).
    * srf08
    - add srf02 (i2c only) and srf10 support.
    * stm32-timer
    - support for the STM32H7 to existing driver.

    Features:
    * tools
    - move over to the tools buildsystem rather than hand rolling.
    - add an install section to the build.
    * ak8974
    - use serial number to add device randomness.
    - add AMI306 calibration data output.
    * ccs811
    - triggered buffer support.
    * srf08
    - add a device tree table as the old style i2c probing is going away,
    - add triggered buffer support
    * st32-adc
    - add optional st,min-sample-time-nsecs binding to allow control of
    sampling against analog circuitry.
    * stm32-timer
    - add output compare triggers.
    * ti-ads1015
    - add threshold event support.
    * ti-ads7950
    - Allow use on ACPI platforms including providing a default reference
    voltage as there is no way to obtain this on ACPI currently.

    Cleanup and fixes:
    * ad7606
    - fix an error return code in probe.
    * ads1015
    - fix incorrect data rate setting update when capture in progress,
    - fix wrong scale information for the ADS1115,
    - make conversions work when CONFIG_PM is not set,
    - make sure we don't get a stale result after a runtime resume by
    ensuring we wait long enough,
    - avoid returning a false error form the buffer setup callbacks,
    - add enough wait time to get the correct conversion,
    - remove an unnecessary config register update,
    - add a helper to set conversion mode reducing repeated boilerplate,
    - use devm_iio_triggered_buffer_setup to simplify error and remove
    paths,
    - use iio_device_claim_direct_mode instead of opencoding the same.
    * ak8974
    - mark the INT_CLEAR register as precious to prevent debugfs access.
    * apds9300
    - constify the i2c_device_id.
    * at91-sama5 adc
    - add missing Kconfig dependency.
    * bma180 accel
    - constify the i2c_device_id.
    * rockchip_saradc
    - explicitly request exclusive reset control as part of the reset rework
    on going throughout the kernel.
    * st_accel
    - fix drdy configuration for a load of accelerometers that only have
    the int1 line. Fix is unimportant as presumably no deviec tree actually
    used the non existent hardware line.
    * st_pressure
    - fix drdy configuration for LPS22HB and LPS25H by dropping int2 support
    as they don't have this. Fix is unimportant as presumably no device tree
    actually used the non existent hardware line.
    * stm32-dac
    - explicitly request exclusive reset control (part of reset being reworked).
    * tsl2583
    - constify the i2c_device_id.
    * xadc
    - coding style fixes.

    Greg Kroah-Hartman
     

20 Aug, 2017

1 commit

  • The kerneldoc description for the trig_readonly field of struct iio_dev
    lacked a colon, leading to this doc build warning:

    ./include/linux/iio/iio.h:603: warning: No description found for parameter 'trig_readonly'

    A similar issue for iio_trigger_set_immutable() in trigger.h yielded:

    ./include/linux/iio/trigger.h:151: warning: No description found for parameter 'indio_dev'
    ./include/linux/iio/trigger.h:151: warning: No description found for parameter 'trig'

    Fix the formatting and silence the warnings.

    Signed-off-by: Jonathan Corbet
    Signed-off-by: Jonathan Cameron

    Jonathan Corbet
     

15 Aug, 2017

1 commit


12 Aug, 2017

2 commits


28 Jul, 2017

1 commit

  • …/iio into staging-next

    Jonathan writes:

    First round of IIO new device support, features and cleanups for the 4.14 cycle.

    4 completely new drivers in this set and plenty of other stuff.

    One ABI change due to a silly mistake a long time back. Hopefully no
    one will notice. It effects the numerical order of consumer device
    channels which was the reverse of the obvious. It's going the slow
    way to allow us some margin to spot if we have broken userspace or
    not (seems unlikely)

    New Device Support
    * ccs811
    - new driver for the Volatile Organic Compounds (VOC) sensor.
    * dln2 adc
    - new driver for the ADC on this flexible usb board.
    * EP93xx
    - new driver for this Cirrus logic SoC ADC.
    * ltc2471
    - new ADC driver support the ltc2471 and ltc2473
    * st_accel
    - add trivial table entries to support H3LIS331DL, LIS331DL, LIS3LV02DL.
    * st_gyro
    - add L3GD20H support (again) having fixed the various things that were
    broken in the first try. Includes devicetree binding.
    * stm32 dac
    - add support for the DACs in the STM32F4 series

    Features
    * Documentation
    - add missing power attribute documentation to the ABI docs.
    * at91-sama5d2
    - add hardware trigger and buffered capture support with bindings.
    - suspend and resume functionality.
    * bmc150
    - support for the BOSC0200 ACPI device id seen on some tablets.
    * hdc100x
    - devicetree bindings
    - document supported devices
    - match table and device ids.
    * hts221
    - support active low interrupts (with bindings)
    - open drain mode with bindings.
    * htu21
    - OF match table and bindings.
    * lsm6dsx
    - open drain mode with bindings
    * ltc2497
    - add support for board file based consumer mapping.
    * ms5367
    - OF match table and bindings.
    * mt7622
    - binding document and OF match table.
    - suspend and resume support.
    * rpr0521
    - triggered buffer support.
    * tsys01
    - OF match table and bindings.

    Cleanups and minor fixes
    * core
    - fix ordering of IIO channels to entry numbers when using
    iio_map_array_register rather than reversing them.
    - use the new %pOF format specifier rather than full name for the
    device tree nodes.
    * ad7280a
    - fix potential issue with macro argument reuse.
    * ad7766
    - drop a pointless NULL value check as it's done in the gpiod code.
    * adis16400
    - unsigned -> unsigned int.
    * at91 adc
    - make some init data static to reduce code size.
    * at91-sama5d2 ADC
    - make some init data static to reduce code size.
    * da311
    - make some init data static to reduce code size.
    * hid-sensor-rotation
    - drop an unnecessary static.
    * hts221
    - refactor the write_with_mask code.
    - move the BDU configuration to probe time as there is no reason for it
    to change.
    - avoid overwriting reserved data during power-down. This is a fix, but
    the infrastructure need was too invasive to send it to mainline except
    in a merge window. It's not a regression as it was always wrong.
    - avoid reconfigure the sampling frequency multiple times by just
    doing it in the write_raw function directly.
    - refactor the power_on/off calls into a set_enable.
    - move the dry-enable logic into trig_set_state as that is the only
    place it was used.
    * ina219
    - fix polling of ina226 conversion ready flag.
    * imx7d
    - add vendor name in kconfig for consistency with similar parts.
    * mcp3422
    - Change initial channel to 0 as it feels more logical.
    - Check for some errors in probe.
    * meson-saradc
    - add a check of of_match_device return value.
    * mpu3050
    - allow open drain for any interrupt type.
    * rockchip adc
    - add check on of_match_device return value.
    * sca3000
    - drop a trailing whitespace.
    * stm32 adc
    - make array stm32h7_adc_ckmodes_spec static.
    * stm32 dac
    - fix an error message.
    * stm32 timers
    - fix clock name in docs to match reality after changes.
    * st_accel
    - explicit OF table (spi).
    - add missing entries to OF table (i2c).
    - rename of_device_id table to drop the part name.
    - adding missing lis3l02dq entry to bindings.
    - rename H3LIS331DL_DRIVER_NAME to line up with similar entries in driver.
    * st_gyro
    - explicit OF table (spi).
    * st_magn
    - explicit OF table (spi).
    - enable multiread for lis3mdl.
    * st_pressure
    - explicit OF table (spi).
    * st_sensors common.
    - move st_sensors_of_i2c_probe and rename to make it available for spi
    drivers.
    * tsc3472
    - don't write an extra byte when writing the ATIME register.
    - add a link to the datasheet.
    * tsl2x7x - continued staging cleanups
    - add of_match_table.
    - drop redundant power_state sysfs attribute.
    - drop wrapper tsl2x7x_i2c_read.
    - clean up i2c calls made in tsl2x7x_als_calibrate.
    - refactor the read and write _event_value callbacks to handle additional
    elements.
    - use usleep_range instead of mdelay.
    - check return value from tsl2x7x_invoke_change.
    * zpa2326
    - add some newline to the end of logging macros.

    Greg Kroah-Hartman
     

24 Jul, 2017

1 commit

  • …/jic23/iio into staging-linus

    Jonathan writes:

    First set of IIO fixes for the 4.13 cycle.

    * ad2s1210
    - Fix negative angular velocity reads (identified by a gcc 7 warning)
    * aspeed-adc
    - Wait for initialization sequence to finish before enabling channels.
    Without it no channels work.
    * axp288
    - Revert a patch that dropped some bogus register mods. No one is entirely
    sure why but it breaks charging on some devices.
    - Fix GPADC pin read returning 0. Turns out a small sleep is needed.
    * bmc150
    - Make sure device is restored to normal state after suspend / resume
    cycle. Otherwise, simple sysfs reads are broken.
    * tsl2563
    - fix wrong event code.
    * st-accel
    - add spi 3-wire support. Needed to fix the lsm303agr accelerometer
    which only had 3 wires in all cases. Side effect is to enable optional
    3-wire support for other devices.
    * st-pressure
    - disable multiread by default for LPS22HB (only effects SPI)
    * sun4i-gpadc-iio
    - fix unbalanced irq enable / disable
    * vf610
    - Fix VALT slection for REFSEL bits - ensures we are using the
    right reference pins.

    Greg Kroah-Hartman
     

07 Jul, 2017

1 commit

  • Add SPI Serial Interface Mode (SIM) register information
    in st_sensor_settings look up table to support devices
    (like LSM303AGR accel sensor) that allow just SPI-3wire
    communication mode. SIM mode has to be configured before any
    other operation since it is not enabled by default and the driver
    is not able to read without that configuration

    Whilst a fairly substantial patch, the actual logic is simple and it
    is better to have the generic fix than a band aid.

    Fixes: ddc05fa28606 (iio: st-accel: add support for lsm303agr accel)
    Signed-off-by: Lorenzo Bianconi
    Cc:
    Signed-off-by: Jonathan Cameron

    Lorenzo Bianconi
     

04 Jul, 2017

1 commit

  • Pull char/misc updates from Greg KH:
    "Here is the "big" char/misc driver patchset for 4.13-rc1.

    Lots of stuff in here, a large thunderbolt update, w1 driver header
    reorg, the new mux driver subsystem, google firmware driver updates,
    and a raft of other smaller things. Full details in the shortlog.

    All of these have been in linux-next for a while with the only
    reported issue being a merge problem with this tree and the jc-docs
    tree in the w1 documentation area"

    * tag 'char-misc-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (147 commits)
    misc: apds990x: Use sysfs_match_string() helper
    mei: drop unreachable code in mei_start
    mei: validate the message header only in first fragment.
    DocBook: w1: Update W1 file locations and names in DocBook
    mux: adg792a: always require I2C support
    nvmem: rockchip-efuse: add support for rk322x-efuse
    nvmem: core: add locking to nvmem_find_cell
    nvmem: core: Call put_device() in nvmem_unregister()
    nvmem: core: fix leaks on registration errors
    nvmem: correct Broadcom OTP controller driver writes
    w1: Add subsystem kernel public interface
    drivers/fsi: Add module license to core driver
    drivers/fsi: Use asynchronous slave mode
    drivers/fsi: Add hub master support
    drivers/fsi: Add SCOM FSI client device driver
    drivers/fsi/gpio: Add tracepoints for GPIO master
    drivers/fsi: Add GPIO based FSI master
    drivers/fsi: Document FSI master sysfs files in ABI
    drivers/fsi: Add error handling for slave
    drivers/fsi: Add tracepoints for low-level operations
    ...

    Linus Torvalds
     

01 Jul, 2017

1 commit

  • Move st_sensors_of_i2c_probe() in st_sensors_core and rename it in
    st_sensors_of_name_probe(). That change is necessary to add device-tree
    support in spi code otherwise the rest of the autodetection will fail
    since spi->modalias (and indio_dev->name) will be set using compatible
    string value that differs from standard sensor name

    Signed-off-by: Lorenzo Bianconi
    Signed-off-by: Jonathan Cameron

    Lorenzo Bianconi
     

11 Jun, 2017

1 commit

  • Devices, like stm32 timer, could be triggered by hardware events which
    are not buffer or software events. However it could be necessary to
    validate the triggers like it is done for buffer or event triggered modes.
    This patch add a new INDIO_HARDWARE_TRIGGERED operating mode for this
    kind of devices and allow this mode to register trigger consumer.

    Signed-off-by: Benjamin Gaignard
    Signed-off-by: Jonathan Cameron

    Benjamin Gaignard
     

03 Jun, 2017

1 commit


07 May, 2017

1 commit

  • Add support for TRGO2 trigger that can be found on STM32F7.
    Add additional master modes supported by TRGO2.
    Register additional "tim[1/8]_trgo2" triggers for timer1 & timer8.
    Detect TRGO2 timer capability (master mode selection 2).

    Signed-off-by: Fabrice Gasnier
    Acked-by: Benjamin Gaignard
    Signed-off-by: Jonathan Cameron

    Fabrice Gasnier
     

14 Mar, 2017

1 commit

  • Use the IS_ENABLED() helper macro to ensure that the configfs group is
    initialized either when configfs is built-in or when configfs is built as a
    module. Otherwise software device creation will result in undefined
    behaviour when configfs is built as a module since the configfs group for
    the device not properly initialized.

    Similar to commit b2f0c09664b7 ("iio: sw-trigger: Fix config group
    initialization").

    Fixes: 0f3a8c3f34f7 ("iio: Add support for creating IIO devices via configfs")
    Reported-by: Miguel Robles
    Signed-off-by: Lars-Peter Clausen
    Acked-by: Daniel Baluta
    Cc:
    Signed-off-by: Jonathan Cameron

    Lars-Peter Clausen
     

29 Jan, 2017

1 commit


26 Jan, 2017

1 commit

  • Timers IPs can be used to generate triggers for other IPs like
    DAC or ADC.
    Each trigger may result of timer internals signals like counter enable,
    reset or edge, this configuration could be done through "master_mode"
    device attribute.

    Since triggers could be used by DAC or ADC their names are defined
    in include/ nux/iio/timer/stm32-timer-trigger.h and is_stm32_iio_timer_trigger
    function could be used to check if the trigger is valid or not.

    "trgo" trigger have a "sampling_frequency" attribute which allow to configure
    timer sampling frequency.

    version 8:
    - change kernel version from 4.10 to 4.11 in ABI documentation

    version 7:
    - remove all iio_device related code
    - move driver into trigger directory

    version 5:
    - simplify tables of triggers
    - only create an IIO device when needed

    version 4:
    - get triggers configuration from "reg" in DT
    - add tables of triggers
    - sampling frequency is enable/disable when writing in trigger
    sampling_frequency attribute
    - no more use of interruptions

    version 3:
    - change compatible to "st,stm32-timer-trigger"
    - fix attributes access right
    - use string instead of int for master_mode and slave_mode
    - document device attributes in sysfs-bus-iio-timer-stm32

    version 2:
    - keep only one compatible
    - use st,input-triggers-names and st,output-triggers-names
    to know which triggers are accepted and/or create by the device

    Signed-off-by: Benjamin Gaignard
    Acked-by: Jonathan Cameron
    Signed-off-by: Lee Jones

    Benjamin Gaignard
     

19 Jan, 2017

1 commit

  • …/iio into staging-next

    Jonathan writes:

    First round of new device support, features and cleanups for IIO in the 4.11 cycle.

    It's shaping to be another fairly busy cycle. Lots more on the way!

    New device support
    * ads7950
    - new driver supporting ads7950, ads7951, ads7952, ads7953, ads7954,
    ads7955, ads7956, ads7957, ads7958, ads7959, ads7960, and ads7961 ADCs.
    * cm3605
    - New driver for this light sensor and proximity sensor which is an
    analog part with some additional digital controls.
    * hx711
    - New driver.

    Core new stuff
    * Gravity sensor type. This is a processed datastream in which the device
    will try to work out which way is down.
    * Split the buffer.h file into two parts. One provides the interface to 'use'
    a buffer, the second provides the internals of the buffer functionality as
    needed by implementations of buffers.
    - Move documentation inline so as to allow use of private: tag when
    generating documentation.
    - Add some utility functions for the few things that are directly done
    with the buffers.
    - Stop exporting functions that no-one uses outside of the core code.
    - Push docs down by the code in the c file where they should have always
    been.
    - Fix typo in kernel-doc for buffer.
    - push down some includes that were previously happening implicitly.
    - stop enabling the timestamp of the dummy device.

    Features and cleanups
    * ad5592r
    - ACPI support
    * ad5593r
    -ACPI support.
    * ad5933
    - Fix a false comment about size of a particular register.
    * ad7150
    - replace S_IRUGO | S_IWUSR with 0644. I'm not that keen on these patches
    in general, but as it was nicely presented I took this one anyway. As a
    general rule will only take these as part of a larger driver cleanup.
    - don't eat an error but rather reutnr it in the write_event_config callback.
    * ad7606
    - replace non standard range attibute with _scale
    * ade7753
    - use usleep_range for short sleeps
    * ade7754
    - use usleep_range for short sleeps
    * ade7758
    - use usleep_range for short sleeps
    * ade7759
    - use usleep_range for short sleeps
    * ade7854
    - use usleep_range for short sleeps
    * adis16201
    - fix description
    * adis16203
    - fix description
    - fix copyright year
    * adis16209
    - fix description
    * adt7316
    - Add braces to arms of if else statement (for consistency)
    - Alignment fixes.
    * axp288
    - Fix up an issue with accidental overwrites of data.
    * bmi160
    - add deivce tables for i2c and spi to support correctly identifying the
    full dt name (including manufacturer).
    - device tree binding.
    * bmp280
    - use usleep_range for short sleeps.
    * cm3232
    - return error from cm3232_reg_init rather than eating it if the last write
    fails.
    * dummy driver
    - remove a semicolor found at end of a function defintition.
    * exynos-adc
    - use usleep_range for short sleeps.
    * hid-sensor (accel)
    - Add timestamp support. The hardware can provide timestamps so lets support
    them. If not fall back to timestamps estimated in kernel.
    * hid-sensor (light)
    - Add a duplicate ID for the light channels so as to keep existing interface
    whilst also using the more standard IIO interface.
    * hts221
    - acpi probing
    * imx25-gcq
    - Add a macro call to allow this driver to be automatically loaded.
    * isl29028
    - reorganise code to avoid deep nesting of if statements.
    - move chip test and default regs into a function suitable or sharing with
    power management code.
    - tidy up some code alignment.
    * lidar-lite-v3
    - introduce compatible strings that make it clear Garmin have consideral
    friends.
    * mma8452
    - avoid returning signed value when unsigned is appropriate
    * spmi-vadc
    - Update function for generic voltage conversion to take into account that
    different channels on this device should be handled differently.
    - Rework code to allow per channel voltage scaling and support the standard
    options for this hardware.
    - Fixup three minor issues with the above patches for this part. These all
    effect test builds rather than the native builds for the part, but good to
    clean them up anyway.
    * st_sensors
    - support device matching from the ACPI DST tables.
    - acpi based probing for accelerometers
    - acpi based probing for pressure sensors
    - Allow pressure sensors to read negative values.
    - Export sampling frequency for lps25h and lps331ap.
    - Add support for the old DT bindings from the period when these deivces
    were often supported through windows.

    Docs fixup:
    * typo in sysfs-bus-iio

    Greg Kroah-Hartman
     

11 Jan, 2017

9 commits


31 Dec, 2016

1 commit

  • The LIS3LV02 has a special bit that need to be set to get the
    read values left aligned. Before this patch we get gibberish
    like this:

    iio_generic_buffer -a -c10 -n lis3lv02dl_accel
    (...)
    0.000000 -0.010042 -0.642688 19155832931907
    0.000000 -0.010042 -0.642688 19155858751073

    Which is because we read a raw value for 1g as 64 which is
    the nominal 1024 for 1g shifted 4 bits to the left by being
    right-aligned rather than left aligned.

    Since all other sensors are left aligned, add some code to
    set the special DAS (data alignment setting) bit to 1 so that
    the right value is now read like this:

    iio_generic_buffer -a -c10 -n lis3lv02dl_accel
    (...)
    0.000000 -0.147095 -10.120135 24761614364956
    -0.029419 -0.176514 -10.120135 24761631624540

    The scaling was weird as well: we have a gain of 1000 for 1g
    and 3000 for 6g. I don't even remember how I came up with the
    old values but they are wrong.

    Fixes: 3acddf74f807 ("iio: st-sensors: add support for lis3lv02d accelerometer")
    Cc: Lorenzo Bianconi
    Cc: Giuseppe Barba
    Cc: Denis Ciocca
    Signed-off-by: Linus Walleij
    Signed-off-by: Jonathan Cameron

    Linus Walleij
     

03 Dec, 2016

1 commit


13 Nov, 2016

2 commits

  • Specifically a helper for reading the available maximum raw value of a
    channel and a helper for forwarding read_avail requests for raw values
    from one iio driver to an iio channel that is consumed.

    These rather specific helpers are in turn built with generic helpers
    making it easy to build more helpers for available values as needed.

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

    Peter Rosin
     
  • A large number of attributes can only take a limited range of values.
    Currently in IIO this is handled by directly registering additional
    *_available attributes thus providing this information to userspace.

    It is desirable to provide this information via the core for much the same
    reason this was done for the actual channel information attributes in the
    first place. If it isn't there, then it can only really be accessed from
    userspace. Other in kernel IIO consumers have no access to what valid
    parameters are.

    Two forms are currently supported:
    * list of values in one particular IIO_VAL_* format.
    e.g. 1.300000 1.500000 1.730000
    * range specification with a step size:
    e.g. [1.000000 0.500000 2.500000]
    equivalent to 1.000000 1.5000000 2.000000 2.500000

    An addition set of masks are used to allow different sharing rules for the
    *_available attributes generated.

    This allows for example:

    in_accel_x_offset
    in_accel_y_offset
    in_accel_offset_available.

    We could have gone with having a specification for each and every
    info_mask element but that would have meant changing the existing userspace
    ABI. This approach does not.

    Signed-off-by: Jonathan Cameron
    [forward ported, added some docs and fixed buffer overflows /peda]
    Acked-by: Daniel Baluta
    Signed-off-by: Peter Rosin
    Signed-off-by: Jonathan Cameron

    Jonathan Cameron
     

24 Oct, 2016

1 commit

  • MCP47x6 chip supports selection of a voltage reference (VDD, VREF buffered
    or unbuffered). MCP4725 doesn't have this feature thus the eventual setting
    is ignored and user is warned.

    The setting is stored only in the volatile memory of the chip. You need to
    manually store it to the EEPROM of the chip via 'store_eeprom' sysfs entry.

    Signed-off-by: Tomas Novotny
    Signed-off-by: Jonathan Cameron

    Tomas Novotny