22 Jan, 2016

1 commit

  • Merge third patch-bomb from Andrew Morton:
    "I'm pretty much done for -rc1 now:

    - the rest of MM, basically

    - lib/ updates

    - checkpatch, epoll, hfs, fatfs, ptrace, coredump, exit

    - cpu_mask simplifications

    - kexec, rapidio, MAINTAINERS etc, etc.

    - more dma-mapping cleanups/simplifications from hch"

    * emailed patches from Andrew Morton : (109 commits)
    MAINTAINERS: add/fix git URLs for various subsystems
    mm: memcontrol: add "sock" to cgroup2 memory.stat
    mm: memcontrol: basic memory statistics in cgroup2 memory controller
    mm: memcontrol: do not uncharge old page in page cache replacement
    Documentation: cgroup: add memory.swap.{current,max} description
    mm: free swap cache aggressively if memcg swap is full
    mm: vmscan: do not scan anon pages if memcg swap limit is hit
    swap.h: move memcg related stuff to the end of the file
    mm: memcontrol: replace mem_cgroup_lruvec_online with mem_cgroup_online
    mm: vmscan: pass memcg to get_scan_count()
    mm: memcontrol: charge swap to cgroup2
    mm: memcontrol: clean up alloc, online, offline, free functions
    mm: memcontrol: flatten struct cg_proto
    mm: memcontrol: rein in the CONFIG space madness
    net: drop tcp_memcontrol.c
    mm: memcontrol: introduce CONFIG_MEMCG_LEGACY_KMEM
    mm: memcontrol: allow to disable kmem accounting for cgroup2
    mm: memcontrol: account "kmem" consumers in cgroup2 memory controller
    mm: memcontrol: move kmem accounting code to CONFIG_MEMCG
    mm: memcontrol: separate kmem code from legacy tcp accounting code
    ...

    Linus Torvalds
     

21 Jan, 2016

2 commits

  • Pull ARM SoC multiplatform code updates from Arnd Bergmann:
    "This branch is the culmination of 5 years of effort to bring the ARMv6
    and ARMv7 platforms together such that they can all be enabled and
    boot the same kernel. It has been a tremendous amount of cleanup and
    refactoring by a huge number of people, and creation of several new
    (and major) subsystems to better abstract out all the platform details
    in an appropriate manner.

    The bulk of this branch is a large patchset from Arnd that brings
    several of the more minor and older platforms we have closer to
    multiplatform support. Among these are MMP, S3C64xx, Orion5x, mv78xx0
    and realview Much of this is moving around header files from old mach
    directories, but there are also some cleanup patches of debug_ll
    (lowlevel debug per-platform options) and other parts.

    Linus Walleij also has some patchs to clean up the older ARM Realview
    platforms by finally introducing DT support, and Rob Herring has some
    for ARM Versatile which is now DT-only. Both of these platforms are
    now multiplatform.

    Finally, a couple of patches from Russell for Dove PMU, and a fix from
    Valentin Rothberg for Exynos ADC, which were rebased on top of the
    series to avoid conflicts"

    * tag 'armsoc-multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (75 commits)
    ARM: realview: don't select SMP_ON_UP for UP builds
    ARM: s3c: simplify s3c_irqwake_{e,}intallow definition
    ARM: s3c64xx: fix pm-debug compilation
    iio: exynos-adc: fix irqf_oneshot.cocci warnings
    ARM: realview: build realview-dt SMP support only when used
    ARM: realview: select apropriate targets
    ARM: realview: clean up header files
    ARM: realview: make all header files local
    ARM: no longer make CPU targets visible separately
    ARM: integrator: use explicit core module options
    ARM: realview: enable multiplatform
    ARM: make default platform work for NOMMU
    ARM: debug-ll: move DEBUG_LL_UART_EFM32 to correct Kconfig location
    ARM: defconfig: use correct debug_ll settings
    ARM: versatile: convert to multi-platform
    ARM: versatile: merge mach code into a single file
    ARM: versatile: switch to DT only booting and remove legacy code
    ARM: versatile: add DT based PCI detection
    ARM: pxa: mark ezx structures as __maybe_unused
    ARM: pxa: mark raumfeld init functions as __maybe_unused
    ...

    Linus Torvalds
     
  • drivers/iio/industrialio-sw-trigger.c:169:1-3: WARNING: PTR_ERR_OR_ZERO can be used

    Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

    Generated by: scripts/coccinelle/api/ptr_ret.cocci

    Signed-off-by: Fengguang Wu
    Cc: Joel Becker
    Cc: Lars-Peter Clausen
    Cc: Christoph Hellwig
    Cc: Hartmut Knaack
    Cc: Octavian Purdila
    Cc: Paul Bolle
    Cc: Adriana Reus
    Cc: Daniel Baluta
    Cc: Cristina Opriceana
    Cc: Peter Meerwald
    Cc: Alexander Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fengguang Wu
     

17 Jan, 2016

1 commit

  • Rewrite abs() so that its return type does not depend on the
    architecture and no unexpected type conversion happen inside of it. The
    only conversion is from unsigned to signed type. char is left as a
    return type but treated as a signed type regradless of it's actual
    signedness.

    With the old version, int arguments were promoted to long and depending
    on architecture a long argument might result in s64 or long return type
    (which may or may not be the same).

    This came after some back and forth with Nicolas. The current macro has
    different return type (for the same input type) depending on
    architecture which might be midly iritating.

    An alternative version would promote to int like so:

    #define abs(x) __abs_choose_expr(x, long long, \
    __abs_choose_expr(x, long, \
    __builtin_choose_expr( \
    sizeof(x)
    Reviewed-by: Nicolas Pitre
    Cc: Srinivas Pandruvada
    Cc: Wey-Yi Guy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michal Nazarewicz
     

27 Dec, 2015

2 commits

  • …iio into staging-next

    Jonathan writes:

    Third set of new stuff for IIO in the 4.5 cycle.

    New driver features
    - us5182
    * Add interrupt support and rising / falling threshold events.

    Cleanups / fixes to new stuff / minor additions
    * Expose the IIO value formatting function for drivers to
    make use of internally.
    - ina2xx
    * Fix wrong channel order
    * Fix incorrect reporting of endianness
    * Adding documentation of ABI unique to this device
    - mma8452
    * Drop an unused register description
    * Use an enum for the channel index to aid readability
    - sca3000
    * Use standard NULL comparison style
    - us5182
    * fix an inconsistency in status of enable (a bug with no real effect until
    above patches are applied)
    * refactor the read_raw function to improve maintainability / readability.

    Greg Kroah-Hartman
     
  • …iio into staging-next

    Jonathan writes:

    Second set of IIO new drivers, functionality and cleanups for the 4.5 cycle.

    The big one here is the configfs support which has been a long time in the
    works but should allow for cleaner ways to do instantiation of those elements
    of IIO that aren't directly connected to specific hardware. Lots of cool new
    stuff we can use this for in the works!

    New core stuff (basically all configfs support related)
    * Configfs support
    - Core support (was waiting for a configfs patch that went in around 4.4rc2)
    - A little fixlet to add a configfs.h to contain a reference to the
    configfs_subsystem structure.
    * Some infrastructure to simplify handling of software based triggers
    (i.e. ones with no actual hardware associated with them)
    * A high resolution timer based trigger. This has been around for years
    but until the configfs support was ready we didn't have a sensible way
    of instantiating instances of it (the method used for the sysfs_trigger
    has never been really satisfactory)

    New Device Support
    * AMS iAQ Volatile Organic Compounds sensor support.
    * Freescale imx7d ADC driver
    * Maxim MAX30100 oximeter driver (note that for these devices most of the
    smart stuff will be in userspace - effectively they are just light sensors
    with some interesting led synchronization as far as the kernel is concerned).
    * Microchip mcp3421 support added to the mcp3422 driver.
    * TI adc124s021 support added to the adc128s052 driver.
    * TI ina219, inda226 power monitors. Note that there is an existing hwmon driver
    for these parts, the usecase is somewhat different so it is unclear at this
    point if the hwmon driver will eventually be replaced by a bridge from
    this driver. In the meantime the Kconfig dependencies should prevent both
    from being built.

    New driver functionality
    * us8152d power management support.

    Cleanups, fixups
    * Use list_for_each_entry_safe instead of list_for_each_safe with the entry
    bit coded longhand.
    * Select IRQ_WORK for IIO_DUMMY_EVGEN. This is a fix that somehow got lost
    when the driver was moved so lets do it again.
    * st-accel - drop an unused define.
    * vz89x, lidar - optimize i2c transactions by using a single i2c tranfers
    instead of multiple calls where supported (fall back to smbus calls as
    before if not).
    * Use dev_get_platdata() in staging drivers: tsl2x7x, adcs and frequency
    drivers instead of direct access to the structure element.

    Greg Kroah-Hartman
     

23 Dec, 2015

5 commits


22 Dec, 2015

1 commit

  • Since commit 1c6c69525b40 ("genirq: Reject bogus threaded irq requests")
    threaded IRQs without a primary handler need to be requested with
    IRQF_ONESHOT, otherwise the request will fail.

    So pass the IRQF_ONESHOT flag in this case.

    Generated by: scripts/coccinelle/misc/irqf_oneshot.cocci

    Signed-off-by: Fengguang Wu
    Signed-off-by: Valentin Rothberg
    Signed-off-by: Olof Johansson

    Valentin Rothberg
     

20 Dec, 2015

2 commits


19 Dec, 2015

1 commit


14 Dec, 2015

1 commit


13 Dec, 2015

6 commits

  • Use list_for_each_entry_safe instead of list_for_each_safe
    and list_entry call.

    Signed-off-by: Anshul Garg
    Signed-off-by: Jonathan Cameron

    Anshul Garg
     
  • Freescale i.MX7D soc contains a new ADC IP. This patch add this ADC
    driver support, and the driver only support ADC software trigger.

    Signed-off-by: Haibo Chen
    Signed-off-by: Jonathan Cameron

    Haibo Chen
     
  • PID PPID USER STAT VSZ %VSZ %CPU COMMAND
    144 2 root DW 0 0% 33% [ina226:1-8800us]
    141 2 root DW 0 0% 25% [ina226:0-8800us]
    40 2 root SW 0 0% 15% [irq/156-4802a00]
    147 2 root DW 0 0% 7% [ina226:2-8800us]
    145 1 root S 1236 0% 6% dd if /dev/iio:device1 of /dev/null
    148 1 root S 1236 0% 4% dd if /dev/iio:device2 of /dev/null
    149 137 root R 1244 0% 3% top -d 1
    142 1 root S 1236 0% 2% dd if /dev/iio:device0 of /dev/null

    Signed-off-by: Marc Titinger
    Signed-off-by: Jonathan Cameron

    Marc Titinger
     
  • Different probe modules use different resistor values. The front-end
    application may read a probe ID (from eeprom) and set the shunt value
    accordingly.

    Signed-off-by: Marc Titinger
    Signed-off-by: Jonathan Cameron

    Marc Titinger
     
  • This can lead to repeated or skipped samples depending on the clock beat
    between the capture thread and the chip sampling clock, but will also spare
    reading/waiting for the Capture Ready Flag and improve the available i2c
    bandwidth for reading measurements.

    Output of iio_info:
    ...snip...
    4 device-specific attributes found:
    attr 0: in_oversampling_ratio value: 4
    attr 1: in_allow_async_readout value: 0
    attr 2: integration_time_available value: 140 204 332 588 1100 2116...
    attr 3: in_sampling_frequency value: 114

    Signed-off-by: Marc Titinger
    Signed-off-by: Jonathan Cameron

    Marc Titinger
     
  • in SOFTWARE buffer mode, a kthread will capture the active scan_elements
    into a kfifo, then compute the remaining time until the next capture tick
    and do an active wait (udelay).

    This will produce a stream of up to fours channels plus a 64bits
    timestamps (ns).

    Tested with ina226, on BeagleBoneBlack.

    Datasheet: http://www.ti.com/lit/gpn/ina226

    Signed-off-by: Marc Titinger
    Signed-off-by: Jonathan Cameron

    Marc Titinger
     

12 Dec, 2015

3 commits


06 Dec, 2015

4 commits

  • The iio dummy code was recently changed to use irq_work_queue, but
    that code is compiled into the kernel only if IRQ_WORK is set, so
    we can get a link error here:

    drivers/built-in.o: In function `iio_evgen_poke':
    (.text+0x208a04): undefined reference to `irq_work_queue'

    This changes the Kconfig file to match what other drivers do.

    Signed-off-by: Arnd Bergmann
    Fixes: fd2bb310ca3d ("Staging: iio: Move evgen interrupt generation to irq_work")
    Acked-by: Daniel Baluta
    Signed-off-by: Jonathan Cameron

    Arnd Bergmann
     
  • Definition of ST_SENSORS_WAI_ADDRESS was introduced within a very
    first commit of this driver, but it was never used.
    This address is already defined as ST_SENSORS_DEFAULT_WAI_ADDRESS
    in include/linux/iio/common/st_sensors.h

    To avoid duplication of the same constant in two different places
    called almost exactly the same, the one which was never used
    should be removed.

    Signed-off-by: Robert Kmiec
    Signed-off-by: Jonathan Cameron

    Robert Kmiec
     
  • Optimize device tranactions using i2c transfers versus multiple
    possibly racey i2c_smbus_* function calls, and only one transaction
    for distance measurement. Falls back to smbus method if i2c
    functionality isn't available.

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

    Matt Ranostay
     
  • This exported element needs to be accesible to all drivers using configfs
    within IIO. Previously it was in the sw_trig.h file which only convered one
    such usecase. This also fixes a sparse warning as it is now in a header
    that makes sense to include from industrialio-configfs.c

    Signed-off-by: Jonathan Cameron < jic23@kernel.org>

    Jonathan Cameron
     

04 Dec, 2015

4 commits

  • Add an optimized i2c transfer reading function, and fallback
    to racey smbus transfers if client->adapter doesn't support this.

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

    Matt Ranostay
     
  • This patch registers a new IIO software trigger interrupt source
    based on high resolution timers.

    Notice that if configfs is enabled we create sampling_frequency
    attribute allowing users to change hrtimer period (1/sampling_frequency).

    The IIO hrtimer trigger has a long history, this patch is based on
    an older version from Marten and Lars-Peter.

    Signed-off-by: Marten Svanfeldt
    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Daniel Baluta
    Signed-off-by: Jonathan Cameron

    Daniel Baluta
     
  • A software trigger associates an IIO device trigger with a software
    interrupt source (e.g: timer, sysfs). This patch adds the generic
    infrastructure for handling software triggers.

    Software interrupts sources are kept in a iio_trigger_types_list and
    registered separately when the associated kernel module is loaded.

    Software triggers can be created directly from drivers or from user
    space via configfs interface.

    To sum up, this dynamically creates "triggers" group to be found under
    /config/iio/triggers and offers the possibility of dynamically
    creating trigger types groups. The first supported trigger type is
    "hrtimer" found under /config/iio/triggers/hrtimer.

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

    Daniel Baluta
     
  • This patch creates the IIO configfs root group. The group
    will appear under /iio/, usually /config/iio.

    We introduce configfs support in IIO in order to be able to easily
    create IIO objects from userspace. The first supported IIO objects
    are triggers introduced with next patches.

    Signed-off-by: Daniel Baluta
    Tested-by: Matt Ranostay
    Signed-off-by: Jonathan Cameron

    Daniel Baluta
     

03 Dec, 2015

4 commits


02 Dec, 2015

2 commits

  • This adds support for the touchscreen on Samsung s3c64xx.
    The driver is completely untested but shows roughly how
    it could be done, following the example of the at91 driver.

    compared to the old plat-samsung/adc driver, there is
    no support for prioritizing ts over other clients, nor
    for oversampling. From my reading of the code, the
    priorities didn't actually have any effect at all, but
    the oversampling might be needed.

    Verifying this driver is the main issue that is currently
    holding up multiplatform support for s3c64xx, so any help
    in testing is very much appreciated.

    The current version uses the IS_REACHABLE() that is
    going to be introduced in the linux-media tree, please
    comment this out for testing.

    Signed-off-by: Arnd Bergmann
    Acked-by: Dmitry Torokhov

    Arnd Bergmann
     
  • …iio into staging-next

    Jonathan writes:

    First set of new device support, features and cleanups for IIO in the 4.5 cycle

    Usual mixed bag, but the big item perhaps in this series is the DMA buffer
    support added by Lars-Peter Clausen. It's been in the works for a long time
    and it will be interesting to see what hardware support shows up now that
    this is available.

    New core features + associate cleanup.
    * Add generic DMA buffer infrastructure
    * Add a DMAengine framework based buffer
    Also associated minor changes.
    - Set the device buffer watermark based on the minimum watermark for all
    attached buffers rather than just the 'primary' one.
    - iio_buffer_init - only set the watermark default if one hasn't already
    been provided. This allows simple support for devices with a fixed
    watermark.
    - read only attribute for watermark on fixed watermark devices.
    - add explicit buffer enable/disable callbacks to allow the buffer to
    do more than trivial actions when it is being turned on and off.
    * IIO_VAL_INT support in write_raw_get_fmt function.

    New device support
    * Freescale MMA7455/7456L accelerometers
    * Memsic MXC6255XC accelerometer
    * ST lis2dh12 accelerometer
    * TI ADS8688 ADC
    * TI Palamas (twl6035/7) gpadc

    New driver features
    * mma8452
    - support either of the available interrupt pins to cope with the case
    where board layout has lead to a particular one being connected.

    Staging graduation
    * Dummy driver
    - this driver acts as both an example and a test device for those with
    out hardware to develop userspace code against.

    Cleanups and minor bits and bobs.
    * treewide
    - Sort out the ordering of iio_device_register/unregister vs runtime
    pm function calls so that it's all nice and consistent and not race
    prone.
    - Check sscanf return values. None of the cases will actually happen as
    the strings are supplied internally, but best to be consistent on this.
    * ad7780
    - switch over to the gpio descriptor interface and remove the now unused
    platform data which gets rid of a header entirely.
    * ad7793
    - drop a pointless else statement.
    * at91_adc
    - Swap kmalloc_array in for a kmalloc doing the same job.
    * dummy
    - get rid of some commented out lines that snuck in during the move of
    the driver.
    * lm3533-als
    - Print an error message on provision of an invalid resistance.
    * mcp320x
    - Add compatible strings with vendor prefix and deprecate those with
    no vendor prefix.
    * mxs-lradc
    - Use BIT macro in various places rather than shifted ones.
    * pa12203001
    - Power off the chip if the registration fails.
    * pulsedlight-lidar-lite
    - add runtime PM support.
    * xilinx XADC
    - constify an iio_buffer_setup_ops structure.

    Greg Kroah-Hartman
     

22 Nov, 2015

1 commit