18 Feb, 2014

3 commits

  • The driver was not able to manage the sensor: during probe function
    and wai check, the driver stops and writes: "device name and WhoAmI mismatch."
    The correct value of L3GD20H wai is 0xd7 instead of 0xd4.
    Dropped support for the sensor.

    Signed-off-by: Denis Ciocca
    Cc: stable@vger.kernel.org
    Signed-off-by: Jonathan Cameron

    Denis CIOCCA
     
  • Integration time of cm32181 is guessed about milliseconds.
    But cm32181_read_als_it function return IIO_VAL_INT.
    So fixed to return IIO_VAL_INT_PLUS_MICRO.
    Next, add .write_raw_get_fmt callback function for call iio_str_to_fixpoint.

    v2: cm32181_write_als_id function fixed as it was.

    Cc: Kevin Tsai
    Signed-off-by: Beomho Seo
    Signed-off-by: Jonathan Cameron

    Beomho Seo
     
  • This patch is fixed [read/write] integration time function.
    cm36651 have integration time from 1 to 640 milliseconds.
    But, print more then the thousand second. when call *_integration_time attribute.
    Because read_integration_time function return IIO_VAL_INT.
    read integration time function is changed return IIO_VAL_INT_PLUS_MICRO;
    And then .write_raw_get_fmt callback function for parse a fixed-point number from a string.
    Some description is revised milliseconds unit.

    v2: cm36651_write_int_time function fixed as it was.

    Signed-off-by: Beomho Seo
    Signed-off-by: Jonathan Cameron

    Beomho Seo
     

08 Feb, 2014

7 commits

  • In kernel version 3.13, devm_regulator_get() may return no error
    if a regulator is undeclared. regulator_get_voltage() will return
    -EINVAL if this happens. This causes the driver to fail loading if
    the vref regulator is not declared.

    Since vref is optional, call devm_regulator_get_optional instead.

    Signed-off-by: Guenter Roeck
    Cc: Stable@vger.kernel.org
    Signed-off-by: Jonathan Cameron

    Guenter Roeck
     
  • This driver was not complying with the ABI and the purpose of this patch
    is to bring it inline so that userspace will correctly identify the channels.

    Should use channel modifiers (X/Y/Z), not channel indices
    timestamp channel has scan index 3, not 4

    Signed-off-by: Peter Meerwald
    Cc: Kravchenko Oleksandr
    Cc: Stable@vger.kernel.org
    Signed-off-by: Jonathan Cameron

    Peter Meerwald
     
  • This is necessary since timestamp is calculated as the last element
    in iio_compute_scan_bytes().

    Without this fix any userspace code reading the layout of the buffer via
    sysfs will incorrectly interpret the data leading some nasty corruption.

    Signed-off-by: Marcus Folkesson
    Acked-by: Lars-Peter Clausen
    Cc: stable@vger.kernel.org
    Signed-off-by: Jonathan Cameron

    Marcus Folkesson
     
  • This effects the reported scale of the raw values, and thus userspace
    applications that use this value.

    One micro tesla equal 0.01 gauss. So I have fixed calculation formula And add RAW_TO_GAUSS macro.
    ASA is in the range of 0 to 255. If multiply 0.003, calculation result(in_magn_[*]_scale) is
    always 0. So multiply 3000 and return and IIO_VAL_INT_PLUS_MICRO.
    As a result, read_raw call back function return accurate scale value.

    Signed-off-by: Beomho Seo
    Cc: stable@vger.kernel.org
    Signed-off-by: Jonathan Cameron

    Beomho Seo
     
  • need to print leading zeros, hence "%d.%06d"

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

    Peter Meerwald
     
  • individual reads are not permitted concurrently with buffered reads

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

    Peter Meerwald
     
  • …/jic23/iio into staging-linus

    Jonathan writes:

    First set of IIO fixes for the 3.14 cycle.

    Included is the patch previously set as the fourth round for 3.13 which was
    to late to be appropriate.

    * Another endian fix (ad799x adc) due to missuse of the IIO_ST macro (which
    is going away very shortly)
    * A reversed error check in ad5933 which will make the probe fail.
    * A buffer overflow in the example code in the documentation.
    * ad799x was freeing an irq that might or might not have been requested.
    * tsl2563 was checking the wrong element of chan_spec for modifiers. Thus some
    sysfs reads would give the wrong values.
    * A missing dependency on HAS_IOMEM in spear_adc and lpc32xx was causing some
    test build failures (on s390 and perhaps elsewhere).

    I also have a few fixes queued up for things that went in during the 3.14
    merge window which will follow as a separate pull request (to avoid rebasing
    my tree).

    Greg Kroah-Hartman
     

23 Jan, 2014

1 commit

  • Pull trivial tree updates from Jiri Kosina:
    "Usual rocket science stuff from trivial.git"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits)
    neighbour.h: fix comment
    sched: Fix warning on make htmldocs caused by wait.h
    slab: struct kmem_cache is protected by slab_mutex
    doc: Fix typo in USB Gadget Documentation
    of/Kconfig: Spelling s/one/once/
    mkregtable: Fix sscanf handling
    lp5523, lp8501: comment improvements
    thermal: rcar: comment spelling
    treewide: fix comments and printk msgs
    IXP4xx: remove '1 &&' from a condition check in ixp4xx_restart()
    Documentation: update /proc/uptime field description
    Documentation: Fix size parameter for snprintf
    arm: fix comment header and macro name
    asm-generic: uaccess: Spelling s/a ny/any/
    mtd: onenand: fix comment header
    doc: driver-model/platform.txt: fix a typo
    drivers: fix typo in DEVTMPFS_MOUNT Kconfig help text
    doc: Fix typo (acces_process_vm -> access_process_vm)
    treewide: Fix typos in printk
    drivers/gpu/drm/qxl/Kconfig: reformat the help text
    ...

    Linus Torvalds
     

22 Jan, 2014

1 commit

  • Pull MFD changes from Lee Jones:
    "New drivers
    - Samsung Maxim 14577; Micro USB, Regulator, IRQ Controller and
    Battery Charger
    - TI/National Semiconductor LP3943 I2C GPIO Expander and PWM
    Generator

    Existing driver adaptions
    - Expansion of Wolfson Arizona DSP and High-Pass filter controls
    - TI TWL6040 default Regmap support and Regcache addition/bypass
    - Some nice Smatch catch fixes
    - Conversion of TI OMAP-USB and TI TWL6030 to endian neutralness
    - ChromeOS EC timing (delay) adaptions and added dependency on OF
    - Many constifications of 'struct {mfd_cell,regmap_irq,et.al}'
    - Watchdog support added for NVIDIA AS3722
    - Convert functions to static in TI AM335x
    - Realigned previously defeated functionality in TI AM335x
    - IIO ADC-TSC concurrency dead-lock/timeout resolution
    - Addition of Power Management and Clock support for Samsung core
    - DEFINE_PCI_DEVICE_TABLE macro removal from MFD Subsystem
    - Greater use of irqdomain functionality in ST-E AB8500
    - Removal of 'include/linux/mfd/abx500/ab8500-gpio.h'
    - Wolfson WM831x PMIC Power Management changes s/poweroff/shutdown/
    - Device Tree documentation added for TI/Nat Semi LP3943
    - Version detection and voltage tables for TI TPS6586x PMIC devices
    - Simplification of Freescale MC13XXX (de-)initialisation routines
    - Clean-up and simplification of the Realtek parent driver
    - Added support for RTL8402 Realtek PCI-Express card reader
    - Resource leak fix for Maxim 77686
    - Possible suspend BUG() fix in OMAP USB TLL
    - Support for new Wolfson WM5110 Revision (D)
    - Testing of automatic assignment of of_node in mfd_add_device()
    - Reversion of the above when it started to cause issues
    - Remove legacy Platform Data from;
    TI TWL Core, Qualcomm SSBI and ST-E ABx500 Pinctrl
    - Clean-ups; tabbing issues, function name changes, 'drvdata = NULL'
    removal, unused uninitialised warning mitigation, error
    message clarity, removal of redundant/duplicate checks,
    licensing (GPL -> GPL2), coding consistency, duplicate
    function declaration, ret checks, commit corrections,
    redundant of_match_ptr() helper removal, spelling,
    #if-deffery removal and header guards name changes"

    * tag 'mfd-3.14-1' of git://git.linaro.org/people/ljones/mfd: (78 commits)
    mfd: wm5110: Add register patch for rev D chip
    mfd: omap-usb-tll: Don't hold lock during pm_runtime_get/put_sync()
    gpio: lp3943: Remove redundant of_match_ptr helper
    mfd: sta2x11-mfd: Use named constants for pci_power_t values
    Documentation: mfd: Fix LDO index in s2mps11.txt
    mfd: Cleanup mfd-mcp-sa11x0.h header
    mfd: max8997: Use "IS_ENABLED(CONFIG_OF)" for DT code.
    mfd: twl6030: Fix endianness problem in IRQ handler
    mfd: sec-core: Add cells for S5M8767-clocks
    mfd: max14577: Remove redundant of_match_ptr helper
    mfd: twl6040: Fix sparse non static symbol warning
    mfd: Revert "mfd: Always assign of_node in mfd_add_device()"
    mfd: rtsx: Fix sparse non static symbol warning
    mfd: max77693: Set proper maximum register for MUIC regmap
    mfd: max77686: Fix regmap resource leak on driver remove
    mfd: Represent correct filenames in file headers
    mfd: rtsx: Add support for card reader rtl8402
    mfd: rtsx: Add set pull control macro and simplify rtl8411
    mfd: max8997: Enforce mfd_add_devices() return value check
    mfd: mc13xxx: Simplify probe() & remove()
    ...

    Linus Torvalds
     

21 Jan, 2014

1 commit


18 Jan, 2014

1 commit


07 Jan, 2014

4 commits

  • The ADC driver always programs all possible ADC values and discards
    them except for the value IIO asked for. On the am335x-evm the driver
    programs four values and it takes 500us to gather them. Reducing the number
    of conversations down to the (required) one also reduces the busy loop down
    to 125us.

    This leads to another error, namely the FIFOCOUNT register is sometimes
    (like one out of 10 attempts) not updated in time leading to EBUSY.
    The next read has the FIFOCOUNT register updated.
    Checking for the ADCSTAT register for being idle isn't a good choice either.
    The problem is that if TSC is used at the same time, the HW completes the
    conversation for ADC *and* before the driver noticed it, the HW begins to
    perform a TSC conversation and so the driver never seen the HW idle. The
    next time we would have two values in the FIFO but since the driver reads
    everything we always see the current one.
    So instead of polling for the IDLE bit in ADCStatus register, we should
    check the FIFOCOUNT register. It should be one instead of zero because we
    request one value.

    This change in turn leads to another error. Sometimes if TSC & ADC are
    used together the TSC starts generating interrupts even if nobody
    actually touched the touchscreen. The interrupts seem valid because TSC's
    FIFO is filled with values for each channel of the TSC. This condition stops
    after a few ADC reads but will occur again. Not good.

    On top of this (even without the changes I just mentioned) there is a ADC
    & TSC lockup condition which was reported to me by Jeff Lance including the
    following test case:
    A busy loop of "cat /sys/bus/iio/devices/iio\:device0/in_voltage4_raw"
    and a mug on touch screen. With this setup, the hardware will lockup after
    something between 20 minutes and it could take up to a couple of hours.
    During that lockup, the ADCSTAT register says 0x30 (or 0x70) which means
    STEP_ID = IDLE and FSM_BUSY = yes. That means the hardware says that it is
    idle and busy at the same time which is an invalid condition.

    For all this reasons I decided to rework this TSC/ADC part and add a
    handshake / synchronization here:
    First the ADC signals that it needs the HW and writes a 0 mask into the
    SE register. The HW (if active) will complete the current conversation
    and become idle. The TSC driver will gather the values from the FIFO
    (woken up by an interrupt) and won't "enable" another conversation.
    Instead it will wake up the ADC driver which is already waiting. The ADC
    driver will start "its" conversation and once it is done, it will
    enable the TSC steps so the TSC will work again.

    After this rework I haven't observed the lockup so far. Plus the busy
    loop has been reduced from 500us to 125us.

    The continues-read mode remains unchanged.

    Signed-off-by: Sebastian Andrzej Siewior
    Acked-by: Jonathan Cameron
    Signed-off-by: Lee Jones

    Sebastian Andrzej Siewior
     
  • The update of the SE register in MFD doesn't look right as it has
    nothing to do with it. The better place to do it is in TSC driver (which
    is already doing it) and in the ADC driver which needs this only in the
    continues mode.

    Signed-off-by: Sebastian Andrzej Siewior
    Acked-by: Jonathan Cameron
    Signed-off-by: Lee Jones

    Sebastian Andrzej Siewior
     
  • The purpose of reg_se_cache has been defeated. It should avoid the
    read-back of the register to avoid the latency and the fact that the
    bits are reset to 0 after the individual conversation took place.

    The reason why this is required like this to work, is that read-back of
    the register removes the bits of the ADC so they do not start another
    conversation after the register is re-written from the TSC side for the
    update.
    To avoid the not required read-back I introduce a "set once" variant which
    does not update the cache mask. After the conversation completes, the
    bit is removed from the SE register anyway and we don't plan a new
    conversation "any time soon". The current set function is renamed to
    set_cache to distinguish the two operations.
    This is a small preparation for a larger sync-rework.

    Signed-off-by: Sebastian Andrzej Siewior
    Acked-by: Dmitry Torokhov
    Acked-by: Jonathan Cameron
    Signed-off-by: Lee Jones

    Sebastian Andrzej Siewior
     
  • It somehow looks like the ending bracket belongs to the if statement but
    it does belong to the while loop. This patch moves the bracket where it
    belongs.

    Signed-off-by: Sebastian Andrzej Siewior
    Acked-by: Jonathan Cameron
    Signed-off-by: Lee Jones

    Sebastian Andrzej Siewior
     

01 Jan, 2014

1 commit


25 Dec, 2013

2 commits

  • …/iio into staging-next

    Jonathan writes:

    2nd round of new IIO drivers, features and cleanups for the 3.14 cycle.

    New drivers

    * HID inclinometer driver.

    * DHT11 humidity driver. Note that previous humidity drivers have been in
    hwmon, but no one was ever entirely happy with that, and they should find
    a more comfortable home in IIO (their original placement in hwmon was my
    fault - oops). As this is our first humidity driver, core support is also
    added.

    New features

    * Two of mxs-lradc channels are internally wired to a temperature sensor,
    make this explicit in the driver by providing the relevant temperature
    channel.

    * Add support for blocking IO on buffers.

    * Add a data_available call back to the interface between buffer implementations
    and the core. This is much cleaner than the old, 'stufftoread' flag.
    Implemented in the kfifo buffer.

    Cleanups

    * Last user of the old event configuration interface is converted and the
    old interface dropped. Nice to be rid of this thanks to Lars-Peter's hard
    work!

    * Replace all remaining instances of the IIO_ST macro with explicit filling
    of the scan_type structure within struct iio_chan_spec. This macro was a
    bad idea, that rapidly ceased to cover all elements of the structure.
    Miss reading of the macro arguements has led to a number of bugs so lets
    just get rid of it. The final removal patch is awaiting for some fixes
    to make their way into mainline.
    In a couple of drivers, no elements of scan_type were even being used so
    in those case, it has been dropped entirely.

    * Drop a couple of of_match_ptr helper uses in drivers where devicetree is
    not optional and hence the structures being protected by this always exist.

    * Fix up some cases where data was read from a device in a particular
    byte order, but he code placed it into a s16 or similar. These were
    highlighted by Sparse.

    * Use the new ATTRIBUTE_GROUPS macro to drop some boiler plate in the triggers
    core code.

    * ad7746 and ad7280a - stop storing buffers on the stack, giving cleaner code
    and possibly avoiding issues with i2c bus drivers that assume they can dma
    directly into the buffer. Note that this cannot currently happen as the the
    i2c_smbus_read_i2c_block_data function has a memcpy from the buffer actually
    passed to the bus driver. I missed this element of the commit message
    and don't think it is major enough to rebase the iio tree.

    * ad5791 and ad5504 stop storing buffers on the stack for an SPI driver.
    Unlike the i2c drivers, this is a real issue for SPI drivers which can dma
    directly into the buffer supplied.

    Greg Kroah-Hartman
     
  • This resolves a merge issue with drivers/staging/imx-drm/imx-drm-core.c

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

23 Dec, 2013

1 commit


19 Dec, 2013

1 commit


18 Dec, 2013

17 commits