14 Jun, 2020

1 commit

  • Since commit 84af7a6194e4 ("checkpatch: kconfig: prefer 'help' over
    '---help---'"), the number of '---help---' has been gradually
    decreasing, but there are still more than 2400 instances.

    This commit finishes the conversion. While I touched the lines,
    I also fixed the indentation.

    There are a variety of indentation styles found.

    a) 4 spaces + '---help---'
    b) 7 spaces + '---help---'
    c) 8 spaces + '---help---'
    d) 1 space + 1 tab + '---help---'
    e) 1 tab + '---help---' (correct indentation)
    f) 1 tab + 1 space + '---help---'
    g) 1 tab + 2 spaces + '---help---'

    In order to convert all of them to 1 tab + 'help', I ran the
    following commend:

    $ find . -name 'Kconfig*' | xargs sed -i 's/^[[:space:]]*---help---/\thelp/'

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

08 Jun, 2020

1 commit

  • Pull staging/IIO driver updates from Greg KH:
    "Here is the large set of staging and IIO driver changes for 5.8-rc1

    Nothing major, but a lot of new IIO drivers are included in here,
    along with other core iio cleanups and changes.

    On the staging driver front, again, nothing noticable. No new
    deletions or additions, just a ton of tiny cleanups all over the tree
    done by a lot of different people. Most coding style, but many actual
    real fixes and cleanups that are nice to see.

    All of these have been in linux-next for a while with no reported
    issues"

    * tag 'staging-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (618 commits)
    staging: rtl8723bs: Use common packet header constants
    staging: sm750fb: Add names to proc_setBLANK args
    staging: most: usb: init return value in default path of switch/case expression
    staging: vchiq: Get rid of VCHIQ_SERVICE_OPENEND callback reason
    staging: vchiq: move vchiq_release_message() into vchiq
    staging: vchi: Get rid of C++ guards
    staging: vchi: Get rid of not implemented function declarations
    staging: vchi: Get rid of vchiq_status_to_vchi()
    staging: vchi: Get rid of vchi_service_set_option()
    staging: vchi: Merge vchi_msg_queue() into vchi_queue_kernel_message()
    staging: vchiq: Move copy callback handling into vchiq
    staging: vchi: Get rid of vchi_queue_user_message()
    staging: vchi: Get rid of vchi_service_destroy()
    staging: most: usb: use function sysfs_streq
    staging: most: usb: add missing put_device calls
    staging: most: usb: use correct error codes
    staging: most: usb: replace code to calculate array index
    staging: most: usb: don't use error path to exit function on success
    staging: most: usb: move allocation of URB out of critical section
    staging: most: usb: return 0 instead of variable
    ...

    Linus Torvalds
     

05 Jun, 2020

1 commit

  • Pull MFD updates from Lee Jones:
    "Core Frameworks:
    - Constify 'properties' attribute in core header file

    New Drivers:
    - Add support for Gateworks System Controller
    - Add support for MediaTek MT6358 PMIC
    - Add support for Mediatek MT6360 PMIC
    - Add support for Monolithic Power Systems MP2629 ADC and Battery charger

    Fix-ups:
    - Use new I2C API in htc-i2cpld
    - Remove superfluous code in sprd-sc27xx-spi
    - Improve error handling in stm32-timers
    - Device Tree additions/fixes in mt6397
    - Defer probe betterment in wm8994-core
    - Improve module handling in wm8994-core
    - Staticify in stpmic1
    - Trivial (spelling, formatting) in tqmx86

    Bug Fixes:
    - Fix incorrect register/PCI IDs in intel-lpss-pci
    - Fix unbalanced Regulator API calls in wm8994-core
    - Fix double free() in wcd934x
    - Remove IRQ domain on failure in stmfx
    - Reset chip on resume in stmfx
    - Disable/enable IRQs on suspend/resume in stmfx
    - Do not use bulk writes on H/W which does not support them in max77620"

    * tag 'mfd-next-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (29 commits)
    mfd: mt6360: Remove duplicate REGMAP_IRQ_REG_LINE() entry
    mfd: Add support for PMIC MT6360
    mfd: max77620: Use single-byte writes on MAX77620
    mfd: wcd934x: Drop kfree for memory allocated with devm_kzalloc
    mfd: stmfx: Disable IRQ in suspend to avoid spurious interrupt
    mfd: stmfx: Fix stmfx_irq_init error path
    mfd: stmfx: Reset chip on resume as supply was disabled
    mfd: wm8994: Silence warning about supplies during deferred probe
    mfd: wm8994: Fix unbalanced calls to regulator_bulk_disable()
    mfd: wm8994: Fix driver operation if loaded as modules
    dt-bindings: mfd: mediatek: Add MT6397 Pin Controller
    mfd: Constify properties in mfd_cell
    mfd: stm32-timers: Use dma_request_chan() instead dma_request_slave_channel()
    mfd: sprd: Remove unnecessary spi_bus_type setting
    mfd: intel-lpss: Update LPSS UART #2 PCI ID for Jasper Lake
    mfd: tqmx86: Fix a typo in MODULE_DESCRIPTION
    mfd: stpmic1: Make stpmic1_regmap_config static
    mfd: htc-i2cpld: Convert to use i2c_new_client_device()
    MAINTAINERS: Add entry for mp2629 Battery Charger driver
    power: supply: mp2629: Add impedance compensation config
    ...

    Linus Torvalds
     

04 Jun, 2020

1 commit

  • Pull irq updates from Thomas Gleixner:
    "The generic interrupt departement provides:

    - Cleanup of the irq_domain API

    - Overhaul of the interrupt chip simulator

    - The usual pile of new interrupt chip drivers

    - Cleanups, improvements and fixes all over the place"

    * tag 'irq-core-2020-06-02' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits)
    irqchip: Fix "Loongson HyperTransport Vector support" driver build on all non-MIPS platforms
    dt-bindings: interrupt-controller: Add Loongson PCH MSI
    irqchip: Add Loongson PCH MSI controller
    dt-bindings: interrupt-controller: Add Loongson PCH PIC
    irqchip: Add Loongson PCH PIC controller
    dt-bindings: interrupt-controller: Add Loongson HTVEC
    irqchip: Add Loongson HyperTransport Vector support
    genirq: Check irq_data_get_irq_chip() return value before use
    irqchip/sifive-plic: Improve boot prints for multiple PLIC instances
    irqchip/sifive-plic: Setup cpuhp once after boot CPU handler is present
    irqchip/sifive-plic: Set default irq affinity in plic_irqdomain_map()
    irqchip/gic-v2, v3: Drop extra IRQ_NOAUTOEN setting for (E)PPIs
    irqdomain: Allow software nodes for IRQ domain creation
    irqdomain: Get rid of special treatment for ACPI in __irq_domain_add()
    irqdomain: Make __irq_domain_add() less OF-dependent
    iio: dummy_evgen: Fix use after free on error in iio_dummy_evgen_create()
    irqchip/gic-v3-its: Balance initial LPI affinity across CPUs
    irqchip/gic-v3-its: Track LPI distribution on a per CPU basis
    genirq/irq_sim: Simplify the API
    irqdomain: Make irq_domain_reset_irq_data() available to non-hierarchical users
    ...

    Linus Torvalds
     

02 Jun, 2020

1 commit

  • Pull documentation updates from Jonathan Corbet:
    "A fair amount of stuff this time around, dominated by yet another
    massive set from Mauro toward the completion of the RST conversion. I
    *really* hope we are getting close to the end of this. Meanwhile,
    those patches reach pretty far afield to update document references
    around the tree; there should be no actual code changes there. There
    will be, alas, more of the usual trivial merge conflicts.

    Beyond that we have more translations, improvements to the sphinx
    scripting, a number of additions to the sysctl documentation, and lots
    of fixes"

    * tag 'docs-5.8' of git://git.lwn.net/linux: (130 commits)
    Documentation: fixes to the maintainer-entry-profile template
    zswap: docs/vm: Fix typo accept_threshold_percent in zswap.rst
    tracing: Fix events.rst section numbering
    docs: acpi: fix old http link and improve document format
    docs: filesystems: add info about efivars content
    Documentation: LSM: Correct the basic LSM description
    mailmap: change email for Ricardo Ribalda
    docs: sysctl/kernel: document unaligned controls
    Documentation: admin-guide: update bug-hunting.rst
    docs: sysctl/kernel: document ngroups_max
    nvdimm: fixes to maintainter-entry-profile
    Documentation/features: Correct RISC-V kprobes support entry
    Documentation/features: Refresh the arch support status files
    Revert "docs: sysctl/kernel: document ngroups_max"
    docs: move locking-specific documents to locking/
    docs: move digsig docs to the security book
    docs: move the kref doc into the core-api book
    docs: add IRQ documentation at the core-api book
    docs: debugging-via-ohci1394.txt: add it to the core-api book
    docs: fix references for ipmi.rst file
    ...

    Linus Torvalds
     

30 May, 2020

1 commit

  • …-platforms into irq/core

    Pull irqchip updates from Marc Zyngier:

    - A few new drivers for the Loongson MIPS platform (HTVEC, PIC, MSI)
    - A cleanup of the __irq_domain_add() API
    - A cleanup of the IRQ simulator to actually use some of
    the irq infrastructure
    - Some fixes for the Sifive PLIC when used in a multi-controller
    context
    - Fixes for the GICv3 ITS to spread interrupts according to the
    load of each CPU, and to honor managed interrupts
    - Numerous cleanups and documentation fixes

    Thomas Gleixner
     

26 May, 2020

2 commits


25 May, 2020

1 commit


23 May, 2020

4 commits

  • One of a class of bugs pointed out by Lars in a recent review.
    iio_push_to_buffers_with_timestamp assumes the buffer used is aligned
    to the size of the timestamp (8 bytes). This is not guaranteed in
    this driver which uses an array of smaller elements on the stack.
    As Lars also noted this anti pattern can involve a leak of data to
    userspace and that indeed can happen here. We close both issues by
    moving to a suitable structure in the iio_priv() data with alignment
    explicitly requested. This data is allocated with kzalloc so no
    data can leak appart from previous readings.

    Fixes: a1d642266c14 ("iio: chemical: add support for Plantower PMS7003 sensor")
    Reported-by: Lars-Peter Clausen
    Signed-off-by: Jonathan Cameron
    Cc:
    Acked-by: Tomasz Duszynski

    Jonathan Cameron
     
  • One of a class of bugs pointed out by Lars in a recent review.
    iio_push_to_buffers_with_timestamp assumes the buffer used is aligned
    to the size of the timestamp (8 bytes). This is not guaranteed in
    this driver which uses an array of smaller elements on the stack.

    Fixes: 232e0f6ddeae ("iio: chemical: add support for Sensirion SPS30 sensor")
    Reported-by: Lars-Peter Clausen
    Signed-off-by: Jonathan Cameron
    Cc:
    Acked-by: Tomasz Duszynski

    Jonathan Cameron
     
  • A wrong error message is printed out currently, like on STM32MP15:
    - stm32-adc-core 48003000.adc: IRQ index 2 not found.

    This is seen since commit 7723f4c5ecdb ("driver core: platform: Add an
    error message to platform_get_irq*()").
    The STM32 ADC core driver wrongly requests up to 3 interrupt lines. It
    should request only the necessary IRQs, based on the compatible:
    - stm32f4/h7 ADCs share a common interrupt
    - stm32mp1, has one interrupt line per ADC.
    So add the number of required interrupts to the compatible data.

    Fixes: d58c67d1d851 ("iio: adc: stm32-adc: add support for STM32MP1")
    Signed-off-by: Fabrice Gasnier
    Cc:
    Signed-off-by: Jonathan Cameron

    Fabrice Gasnier
     
  • The light sensor needs the regulators to be enabled which means
    the runtime PM needs to be on. This only happened when the
    proximity part of the chip was enabled.

    As fallout from this change, only report changes to the prox
    state in the interrupt handler when it is explicitly enabled.

    Fixes: 97d642e23037 ("iio: light: Add a driver for Sharp GP2AP002x00F")
    Signed-off-by: Jonathan Bakker
    Reviewed-by: Linus Walleij
    Signed-off-by: Jonathan Cameron

    Jonathan Bakker
     

22 May, 2020

3 commits

  • Since there will be some changes to how iio_priv_to_dev() is implemented,
    it could be that the helper becomes a bit slower, as it will be hidden away
    in the IIO core.

    But even without that rework, this looks like it can pass the 'indio_dev'
    object to ping_read() and obtain the state struct via iio_priv() which is a
    preferred practice than going back-n-forth (getting the state-struct, then
    using iio_priv_to_dev() to get the indio_dev object back).

    Signed-off-by: Alexandru Ardelean
    Signed-off-by: Jonathan Cameron

    Alexandru Ardelean
     
  • As part of the general cleanup of indio_dev->mlock, this change replaces
    it with a local lock on the device's state structure.
    This also removes unused iio_dev pointers.

    Signed-off-by: Sergiu Cuciurean
    Signed-off-by: Jonathan Cameron

    Sergiu Cuciurean
     
  • Proximity sensor driver based on light/vcnl4000.c code.
    For now supports only the single on-demand measurement.

    The VCNL3020 is a fully integrated proximity sensor. Fully
    integrated means that the infrared emitter is included in the
    package. It has 16-bit resolution. It includes a signal
    processing IC and features standard I2C communication
    interface. It features an interrupt function.

    Datasheet: http://www.vishay.com/docs/84150/vcnl3020.pdf
    Signed-off-by: Ivan Mikhaylov
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Jonathan Cameron

    Ivan Mikhaylov
     

20 May, 2020

1 commit


18 May, 2020

1 commit

  • The interrupt simulator API exposes a lot of custom data structures and
    functions and doesn't reuse the interfaces already exposed by the irq
    subsystem. This patch tries to address it.

    We hide all the simulator-related data structures from users and instead
    rely on the well-known irq domain. When creating the interrupt simulator
    the user receives a pointer to a newly created irq_domain and can use it
    to create mappings for simulated interrupts.

    It is also possible to pass a handle to fwnode when creating the simulator
    domain and retrieve it using irq_find_matching_fwnode().

    The irq_sim_fire() function is dropped as well. Instead we implement the
    irq_get/set_irqchip_state interface.

    We modify the two modules that use the simulator at the same time as
    adding these changes in order to reduce the intermediate bloat that would
    result when trying to migrate the drivers in separate patches.

    Signed-off-by: Bartosz Golaszewski
    Signed-off-by: Marc Zyngier
    Reviewed-by: Linus Walleij
    Acked-by: Jonathan Cameron #for IIO
    Link: https://lore.kernel.org/r/20200514083901.23445-3-brgl@bgdev.pl

    Bartosz Golaszewski
     

17 May, 2020

5 commits

  • The variable no longer does anything.
    It should have been removed with commit 2e036804d773e ("iio: buffer: remove
    'scan_el_attrs' attribute group from buffer struct").
    That was about the last time this was needed.

    Signed-off-by: Alexandru Ardelean
    Signed-off-by: Jonathan Cameron

    Alexandru Ardelean
     
  • Add driver for Atlas EZO line of sensors with initial support for
    CO2 the sensor. This is effectively ASCII strings proxied over I2C
    due to these series of sensors being by default UART.

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

    Matt Ranostay
     
  • The Exynos7-specific code bits in ADC driver do not play with PHY:
    the field exynos_adc_data.needs_adc_phy is not set in exynos7_adc_data
    instance. Therefore the initialization code does not have to check if
    it is true.

    Signed-off-by: Krzysztof Kozlowski
    Reviewed-by: Alim Akhtar
    Tested-by: Alim Akhtar
    Signed-off-by: Jonathan Cameron

    Krzysztof Kozlowski
     
  • Currently the driver only exposes the raw counts. As we
    have the regulator voltage and the maximum value (stored in
    the data mask), we can trivially produce a scaling fraction
    of voltage / max value.

    This assumes that the regulator voltage is in fact the max
    voltage, which appears to be the case for all mainline dts
    and cross referenced with the public Exynos4412 and S5PV210
    datasheets.

    Signed-off-by: Jonathan Bakker
    Reviewed-by: Krzysztof Kozlowski
    Signed-off-by: Jonathan Cameron

    Jonathan Bakker
     
  • It is clear that we transition to INDIO_DIRECT_MODE when disabling the
    buffer(s) and it is also clear that we transition from INDIO_DIRECT_MODE
    when enabling the buffer(s). So leaving the currentmode field
    INDIO_DIRECT_MODE until after the preenable() callback and updating it to
    INDIO_DIRECT_MODE before the postdisable() callback doesn't add additional
    value. On the other hand some drivers will need to perform different
    actions depending on which mode the device is going to operate in/was
    operating in.

    Moving the update of currentmode before preenable() and after postdisable()
    enables us to have drivers which perform mode dependent actions in those
    callbacks.

    Note, was originally not intended as such, but fixes an issue introduced
    in the at91-sama5d2 adc driver.

    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Alexandru Ardelean
    Fixes: 065056cb0d0a ("iio: at91-sama5d2_adc: split at91_adc_current_chan_is_touch() helper")
    Tested-by: Eugen Hristev
    Signed-off-by: Jonathan Cameron

    Lars-Peter Clausen
     

16 May, 2020

15 commits


15 May, 2020

1 commit

  • …iio into staging-next

    Jonathan writes:

    Second set of new device support, cleanups and features for IIO in the 5.8 cycle

    Usual mixed back but with a few subsystem wide or device type
    wide cleanups.

    New device support

    * adis16475
    - New driver supporting adis16470, adis16475, adis16477, adis16465,
    adis16467, adis16500, adis16505 and adis16507.
    Includes some rework of the adis library to simplify using it
    for this new driver.
    * ak8974
    - Add support for Alps hscdt008a. ID only. Related patches add support
    for scale.
    * atlas-sensor
    - Add support for RTD-SM OEM temperature sensor.
    * cm32181
    - Add support for CM3218 including support for SMBUS alert via
    ACPI resources.
    * ltc2632
    - Add support for ltc2634-12/10/8 DACS including handling per
    device type numbers of channels.

    Major Features

    * cm32181
    - ACPI bindings including parsing CPM0 and CPM1 custom ACPI tables.
    Includes minor tidy ups and fixes.
    * vcnl4000
    - Add event support
    - Add buffered data capture support
    - Add control of sampling frequency

    Cleanups and minor fixes.

    * core
    - Trivial rework of iio_device_alloc to use an early return and
    improve readability.
    - Precursors to addition of multiple buffer support. So far
    minor refactoring.
    * subsystem wide
    - Use get_unaligned_be24 slightly improve readability over open
    coding it.
    * adis drivers
    - Use iio_get_debugfs_dentry access function.
    * bh1780, cm32181, cm3232, gp2ap02a00f, opt3001, st_uvis25, vl6180,
    dmard06, kxsd9
    - Drop use of of_match_ptr to allow ACPI based probing via PRP0001.
    Part of clear out of this to avoid cut and paste into new drivers.
    * ad5592r, ad5593r
    - Fix typos
    * ad5933
    - Use managed interfaces to automate error handling and remove.
    * ak8974
    - Fix wrong number of 'real bits' for buffered data.
    - Refactor to pull measurement code out as separate function.
    bmp280
    - Fix lack of clamp on range during data capture.
    * at91-sama5d2_adc
    - Handle unfinished conversions correctly.
    - Allow use of triggers other than it's own.
    - Reorganize buffer setup and tear down as part of long running
    subsystem wide rework.
    * ccs811
    - Add DT binding docs and match table.
    - Support external reset and wakeup pins.
    * hid-sensors
    - Reorganize buffer setup and tear down as part of long running
    subsystem wide rework.
    * ltr501
    - Constify some structs.
    * vcnl4000
    - Fix an endian issue by using explicit byte swapped i2c accessors.

    * tag 'iio-for-5.8b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (74 commits)
    iio: light: ltr501: Constify structs
    staging: iio: ad5933: attach life-cycle of kfifo buffer to parent device and use managed calls throughout
    iio: bmp280: fix compensation of humidity
    iio: light: cm32181: Fix integartion time typo
    iio: light: cm32181: Add support for parsing CPM0 and CPM1 ACPI tables
    iio: light: cm32181: Make lux_per_bit and lux_per_bit_base_it runtime settings
    iio: light: cm32181: Use units of 1/100000th for calibscale and lux_per_bit
    iio: light: cm32181: Change reg_init to use a bitmap of which registers to init
    iio: light: cm32181: Handle CM3218 ACPI devices with 2 I2C resources
    iio: light: cm32181: Clean up the probe function a bit
    iio: light: cm32181: Add support for the CM3218
    iio: light: cm32181: Add some extra register defines
    iio: light: cm32181: Add support for ACPI enumeration
    iio: light: cm32181: Switch to new style i2c-driver probe function
    iio: hid-sensors: move triggered buffer setup into hid_sensor_setup_trigger
    iio: vcnl4000: Add buffer support for VCNL4010/20.
    iio: vcnl4000: Add sampling frequency support for VCNL4010/20.
    iio: vcnl4000: Add event support for VCNL4010/20.
    iio: vcnl4000: Factorize data reading and writing.
    iio: vcnl4000: Fix i2c swapped word reading.
    ...

    Greg Kroah-Hartman
     

12 May, 2020

1 commit

  • Constify some data structs that are never changed. In order to do so,
    also update a couple of functions that now need to accept pointers to
    const struct instead of struct. While at it, update a few more functions
    to accept pointers to const struct instead of pointers.

    This allows the compiler to put more data in the code segment instead of
    the data segment, as seen by the output of the file command:

    Before:
    text data bss dec hex filename
    27080 8144 192 35416 8a58 drivers/iio/light/ltr501.o

    After:
    text data bss dec hex filename
    27688 7536 192 35416 8a58 drivers/iio/light/ltr501.o
    Signed-off-by: Rikard Falkeborn
    Signed-off-by: Jonathan Cameron

    Rikard Falkeborn