]> Git Repo - linux.git/commitdiff
Merge tag 'iio-for-5.17a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23...
authorGreg Kroah-Hartman <[email protected]>
Wed, 22 Dec 2021 11:33:01 +0000 (12:33 +0100)
committerGreg Kroah-Hartman <[email protected]>
Wed, 22 Dec 2021 11:33:01 +0000 (12:33 +0100)
Jonathan writes:

1st set of IIO new device support, features and cleanup for 5.17

Includes some fixes that were either late breaking, low priority or
complex enough to not be good to rush in late in the cycle.

Tree rebased today to fix up some trivial issues + pull in a fix that
was previously on the fixes-togreg branch. Vast majority have been
in linux-next for some time now.

New device support
* adi,ad7293
  - New driver and bindings for this Power Amplifier drain current
    controller.  A complex device with various related monitoring functions.
* adi,ad75513R
  - New driver and bindings for this combined ADC and DAC device.
  - A few follow up fixes.
* adi,admv8818
  - New driver (and type) for this 2-18GHz filter device. Includes
    bindings and ABI documentation to allow clk_notifier based auto
    adjustment of the filters in appropriate applications.
* liteon,ltr501
  - Support for the ltr303.  ID and chip specific info table.
* xilinx,ams
  - New generic firmware function fwnode_iomap() as used in this driver.
  - New driver and bindings for this ADC and on-chip sensors as found
    in various Xilinx devices.

Core
* Introduced IIO_VAL_INT_64 which uses val and val2 in IIO callbacks to
  form a 64 bit integer when higher precision needed.
* Allow IIO_ENUM_AVAILABLE to be used with different shared values.
* Fix a long term issue with scheduling whilst atomic when iio_trig_poll()
  is called but no trigger consumers are actually enabled and hence the
  trigger may be reenabled from the interrupt handler.  Seen in the wild
  on the tsc2046.
* Mark iio_device_type const.
* buffer: Use a separate index variable to simplify code.
* buffer-dma: Clear out unused struct iio_buffer_block
* buffer-dmaengine: Switch to cheaper round_down() as power of 2 values.

Tests/tools
* format_value
  - Check against NULL returns from allocations in tests.
  - Add IIO_VAL_INT_64 test case.
* event_monitor
  - Flush the output after event to given more consistent latency
    when tool output piped to other programs.

Driver Features
* axp20x
  - Add support for NTC thermistor channel and document TS pin binding.
* arm,scmi
  - Add reading of raw channel values (using IIO_VAL_INT_64)
* liteon,ltr501
  - Add proximity-near-level support and dt-binding.

Tree wide cleanup
* Remove no-op trigger ops from multiple drivers.
* Stop using dev_get_drvdata() on the iio_dev->dev in various drivers
  and then stop assigning it to allow this to be used for other purposes.
  We can always get to the indio_dev using dev_to_iio_dev() which is
  a container_of() based approach. Also cleanup up some related unnecessary
  convoluted cases.
  - atmel,at91-sam5d2
  - nxp,imx7d
  - meas,ms5611
  - st,st_sensors
* Where available (or easy to introduce) use the scan_type.* values
  in place of a second copy for read_raw and similar paths.
  - adi,ad7266
  - bosch,bma220
  - fsl,mac3110
  - fsl,mma7455
  - fsl,mpl3115
  - kionix,kcjk-1013
  - sensortek,stk8ba50
  - sensortek,stk8312
  - ti,adc12138
  - ti,ads1015
  - vti,sca3000
  - xilinx,xadc-core
* Switch drives over to generic firmware properties including appropriate
  header changes to avoid including of.h
  - Various DACs had false CONFIG_OF dependencies.
  - dpot-dac
  - envelope-detector
  - adi,ad5755
  - adi,ad5758
  - capella,cm3605
  - maxim,max9611
  - microchip,mcp41010
  - microchip,mcp3911
  - ti,adc12138
* Trivial clang warning fixes for W=1 warnings.

Driver specific cleanup and minor fixes
* adi,ad7606
  - Comment fixes.
* ams,ad3935
  - Drop pointless cast to the same type.
* atmel,at91-sama5d2
  - Fix wrong cast of iio_dev->dev to platform_device that happened to
    be harmless.
* fsl,mma7660
  - Stop i2c remove() function returning an error code. Part of a rework
    to eventually stop returning anything from these.
* fsl,mma8452
  - Use correct type for local irqreturn_t.
* nxp,imx8mq
  - Maintainer email address update.
* nxp,lpc18xx_adc
  - Ensure clk_prepare_enable() called before clk_get_rate().
  - Switch of.h for mod_devicetable.h to reflect no of specific functions,
    just the id table.
* renesas,rzg2l
  - Drop a dev_err() that just duplicates error printed in platform_get_irq()
* sgx,vz89x
  - Drop pointless cast.
* st,lsm6dsx
  - Make it possible to disable the sensorhub from DT to avoid a corner
    case where the address of a slave device many be accidentally modified.
* st,stm32-adc
  - Stop leaking an of_node in an error path.
* st,stmp2
   - Avoid wrong sized type for bit field which could result in
     over-reading (harmless). Precursor to enabling -Warray-bounds.
* ti,adc081c
  - Put back some ACPI support for non standards compliant ADC081C
    ID because it is known to be in the wild on some Aaeon boards.
* ti,ads8688
  - Cleanup redundant local ret variable assignment.
* ti,ina2xx-adc
  - Use helper macro kthread_run() to replace some boilerplate.
  - Avoid double reference counting.
  - Drop pointless cast.
* xilinx,xadc
  - Make the IRQ optional as not always wired to the host system.

* tag 'iio-for-5.17a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (103 commits)
  iio: adc: ti-adc081c: Partial revert of removal of ACPI IDs
  iio:addac:ad74413r: Fix uninitialized ret in a path that won't be hit.
  MAINTAINERS: Add maintainer for xilinx-ams
  dt-bindings: iio: adc: Add Xilinx AMS binding documentation
  iio: adc: Add Xilinx AMS driver
  device property: Add fwnode_iomap()
  iio:accel:kxcjk-1013: Mark struct __maybe_unused to avoid warning.
  iio:accel:bmc150: Mark structure __maybe_unused as only needed with for pm ops.
  iio:dummy: Drop set but unused variable len.
  iio:magn:ak8975: Suppress clang W=1 warning about pointer to enum conversion.
  iio:imu:inv_mpu6050: Suppress clang W=1 warning about pointer to enum conversion.
  iio:imu:inv_icm42600: Suppress clang W=1 warning about pointer to enum conversion.
  iio:dac:mcp4725: Suppress clang W=1 warning about pointer to enum conversion.
  iio:amplifiers:hmc425a: Suppress clang W=1 warning about pointer to enum conversion.
  iio:adc:ti-ads1015: Suppress clang W=1 warning about pointer to enum conversion.
  iio:adc:rcar: Suppress clang W=1 warning about pointer to enum conversion.
  iio:adc:ina2xx-adc: Suppress clang W=1 warning about pointer to enum conversion.
  iio:accel:bma180: Suppress clang W=1 warning about pointer to enum conversion.
  drivers:iio:dac: Add AD3552R driver support
  dt-bindings: iio: dac: Add adi,ad3552r.yaml
  ...

1  2 
MAINTAINERS
drivers/iio/accel/kxcjk-1013.c
drivers/iio/accel/mma8452.c
drivers/iio/adc/Kconfig
drivers/iio/adc/at91-sama5d2_adc.c
drivers/iio/adc/axp20x_adc.c
drivers/iio/adc/stm32-adc.c
drivers/iio/industrialio-trigger.c
drivers/iio/light/ltr501.c
drivers/iio/trigger/stm32-timer-trigger.c

diff --combined MAINTAINERS
index 5ed02283e0fc9f553b308bc9cf9d00e4a9cb3ca0,2c043712600e8dbbaca0009fdd0140a56c5e5ca8..36e8dd46beede164d8e4968221edff0190b88eb5
@@@ -1069,6 -1069,15 +1069,15 @@@ W:    http://ez.analog.com/community/linux
  F:    Documentation/devicetree/bindings/iio/adc/adi,ad7780.yaml
  F:    drivers/iio/adc/ad7780.c
  
+ ANALOG DEVICES INC AD74413R DRIVER
+ M:    Cosmin Tanislav <[email protected]>
+ L:    [email protected]
+ S:    Supported
+ W:    http://ez.analog.com/community/linux-device-drivers
+ F:    Documentation/devicetree/bindings/iio/addac/adi,ad74413r.yaml
+ F:    drivers/iio/addac/ad74413r.c
+ F:    include/dt-bindings/iio/addac/adi,ad74413r.h
  ANALOG DEVICES INC AD9389B DRIVER
  M:    Hans Verkuil <[email protected]>
  L:    [email protected]
@@@ -1890,7 -1899,6 +1899,7 @@@ F:      Documentation/trace/coresight/
  F:    drivers/hwtracing/coresight/*
  F:    include/dt-bindings/arm/coresight-cti-dt.h
  F:    include/linux/coresight*
 +F:    samples/coresight/*
  F:    tools/perf/arch/arm/util/auxtrace.c
  F:    tools/perf/arch/arm/util/cs-etm.c
  F:    tools/perf/arch/arm/util/cs-etm.h
  S:    Maintained
  F:    drivers/counter/microchip-tcb-capture.c
  
 +ARM/MILBEAUT ARCHITECTURE
 +M:    Taichi Sugaya <[email protected]>
 +M:    Takao Orito <[email protected]>
 +L:    [email protected] (moderated for non-subscribers)
 +S:    Maintained
 +F:    arch/arm/boot/dts/milbeaut*
 +F:    arch/arm/mach-milbeaut/
 +N:    milbeaut
 +
  ARM/MIOA701 MACHINE SUPPORT
  M:    Robert Jarzmik <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
@@@ -2739,11 -2738,10 +2748,11 @@@ S:   Maintaine
  F:    drivers/memory/*emif*
  
  ARM/TEXAS INSTRUMENT KEYSTONE ARCHITECTURE
 +M:    Nishanth Menon <[email protected]>
  M:    Santosh Shilimkar <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git
  F:    arch/arm/boot/dts/keystone-*
  F:    arch/arm/mach-keystone/
  
  S:    Supported
  F:    drivers/net/ethernet/broadcom/b44.*
  
 -BROADCOM B53 ETHERNET SWITCH DRIVER
 +BROADCOM B53/SF2 ETHERNET SWITCH DRIVER
  M:    Florian Fainelli <[email protected]>
  L:    [email protected]
  L:    [email protected] (subscribers-only)
  S:    Supported
  F:    Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml
  F:    drivers/net/dsa/b53/*
 +F:    drivers/net/dsa/bcm_sf2*
  F:    include/linux/dsa/brcm.h
  F:    include/linux/platform_data/b53.h
  
@@@ -3745,7 -3742,7 +3754,7 @@@ F:      drivers/scsi/bnx2i
  BROADCOM BNX2X 10 GIGABIT ETHERNET DRIVER
  M:    Ariel Elior <[email protected]>
  M:    Sudarsana Kalluru <[email protected]>
 -M:    [email protected]
 +M:    Manish Chopra <[email protected]>
  L:    [email protected]
  S:    Supported
  F:    drivers/net/ethernet/broadcom/bnx2x/
@@@ -4725,8 -4722,6 +4734,8 @@@ M:      Ian Abbott <[email protected]
  M:    H Hartley Sweeten <[email protected]>
  S:    Odd Fixes
  F:    drivers/comedi/
 +F:    include/linux/comedi/
 +F:    include/uapi/linux/comedi.h
  
  COMMON CLK FRAMEWORK
  M:    Michael Turquette <[email protected]>
@@@ -9332,6 -9327,7 +9341,6 @@@ S:      Maintaine
  F:    drivers/iio/pressure/dps310.c
  
  INFINIBAND SUBSYSTEM
 -M:    Doug Ledford <[email protected]>
  M:    Jason Gunthorpe <[email protected]>
  L:    [email protected]
  S:    Supported
@@@ -10282,9 -10278,9 +10291,9 @@@ F:   lib/Kconfig.kcsa
  F:    scripts/Makefile.kcsan
  
  KDUMP
 -M:    Dave Young <[email protected]>
  M:    Baoquan He <[email protected]>
  R:    Vivek Goyal <[email protected]>
 +R:    Dave Young <[email protected]>
  L:    [email protected]
  S:    Maintained
  W:    http://lse.sourceforge.net/kdump/
@@@ -10458,7 -10454,7 +10467,7 @@@ F:   arch/riscv/include/uapi/asm/kvm
  F:    arch/riscv/kvm/
  
  KERNEL VIRTUAL MACHINE for s390 (KVM/s390)
 -M:    Christian Borntraeger <borntraeger@de.ibm.com>
 +M:    Christian Borntraeger <borntraeger@linux.ibm.com>
  M:    Janosch Frank <[email protected]>
  R:    David Hildenbrand <[email protected]>
  R:    Claudio Imbrenda <[email protected]>
@@@ -12182,8 -12178,8 +12191,8 @@@ F:   drivers/net/ethernet/mellanox/mlx5/c
  F:    include/linux/mlx5/mlx5_ifc_fpga.h
  
  MELLANOX ETHERNET SWITCH DRIVERS
 -M:    Jiri Pirko <[email protected]>
  M:    Ido Schimmel <[email protected]>
 +M:    Petr Machata <[email protected]>
  L:    [email protected]
  S:    Supported
  W:    http://www.mellanox.com
@@@ -13709,9 -13705,9 +13718,9 @@@ F:   Documentation/devicetree/bindings/di
  F:    drivers/gpu/drm/imx/dcss/
  
  NXP i.MX 8QXP ADC DRIVER
- M:    Cai Huoqing <cai[email protected]>
+ M:    Cai Huoqing <cai[email protected]>
  L:    [email protected]
- S:    Supported
+ S:    Maintained
  F:    Documentation/devicetree/bindings/iio/adc/nxp,imx8qxp-adc.yaml
  F:    drivers/iio/adc/imx8qxp-adc.c
  
@@@ -15606,7 -15602,7 +15615,7 @@@ F:   drivers/scsi/qedi
  
  QLOGIC QL4xxx ETHERNET DRIVER
  M:    Ariel Elior <[email protected]>
 -M:    [email protected]
 +M:    Manish Chopra <[email protected]>
  L:    [email protected]
  S:    Supported
  F:    drivers/net/ethernet/qlogic/qed/
@@@ -15773,15 -15769,6 +15782,15 @@@ S: Maintaine
  F:    Documentation/devicetree/bindings/net/qcom,ethqos.txt
  F:    drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
  
 +QUALCOMM FASTRPC DRIVER
 +M:    Srinivas Kandagatla <[email protected]>
 +M:    Amol Maheshwari <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/misc/qcom,fastrpc.txt
 +F:    drivers/misc/fastrpc.c
 +F:    include/uapi/misc/fastrpc.h
 +
  QUALCOMM GENERIC INTERFACE I2C DRIVER
  M:    Akash Asthana <[email protected]>
  M:    Mukesh Savaliya <[email protected]>
@@@ -15990,7 -15977,6 +15999,7 @@@ F:   arch/mips/generic/board-ranchu.
  
  RANDOM NUMBER DRIVER
  M:    "Theodore Ts'o" <[email protected]>
 +M:    Jason A. Donenfeld <[email protected]>
  S:    Maintained
  F:    drivers/char/random.c
  
@@@ -16513,12 -16499,6 +16522,12 @@@ T: git git://linuxtv.org/media_tree.gi
  F:    Documentation/devicetree/bindings/media/allwinner,sun8i-a83t-de2-rotate.yaml
  F:    drivers/media/platform/sunxi/sun8i-rotate/
  
 +RPMSG TTY DRIVER
 +M:    Arnaud Pouliquen <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    drivers/tty/rpmsg_tty.c
 +
  RTL2830 MEDIA DRIVER
  M:    Antti Palosaari <[email protected]>
  L:    [email protected]
@@@ -16602,7 -16582,7 +16611,7 @@@ F:   drivers/video/fbdev/savage
  S390
  M:    Heiko Carstens <[email protected]>
  M:    Vasily Gorbik <[email protected]>
 -M:    Christian Borntraeger <borntraeger@de.ibm.com>
 +M:    Christian Borntraeger <borntraeger@linux.ibm.com>
  R:    Alexander Gordeev <[email protected]>
  L:    [email protected]
  S:    Supported
@@@ -16640,8 -16620,8 +16649,8 @@@ W:   http://www.ibm.com/developerworks/li
  F:    drivers/iommu/s390-iommu.c
  
  S390 IUCV NETWORK LAYER
 -M:    Julian Wiedmann <jwi@linux.ibm.com>
 -M:    Karsten Graul <kgraul@linux.ibm.com>
 +M:    Alexandra Winter <wintera@linux.ibm.com>
 +M:    Wenjia Zhang <wenjia@linux.ibm.com>
  L:    [email protected]
  L:    [email protected]
  S:    Supported
@@@ -16651,8 -16631,8 +16660,8 @@@ F:   include/net/iucv
  F:    net/iucv/
  
  S390 NETWORK DRIVERS
 -M:    Julian Wiedmann <jwi@linux.ibm.com>
 -M:    Karsten Graul <kgraul@linux.ibm.com>
 +M:    Alexandra Winter <wintera@linux.ibm.com>
 +M:    Wenjia Zhang <wenjia@linux.ibm.com>
  L:    [email protected]
  L:    [email protected]
  S:    Supported
@@@ -18512,7 -18492,6 +18521,7 @@@ F:   include/uapi/linux/pkt_sched.
  F:    include/uapi/linux/tc_act/
  F:    include/uapi/linux/tc_ematch/
  F:    net/sched/
 +F:    tools/testing/selftests/tc-testing
  
  TC90522 MEDIA DRIVER
  M:    Akihiro Tsukada <[email protected]>
@@@ -19061,12 -19040,11 +19070,12 @@@ F:        drivers/mmc/host/tifm_sd.
  F:    include/linux/tifm.h
  
  TI KEYSTONE MULTICORE NAVIGATOR DRIVERS
 +M:    Nishanth Menon <[email protected]>
  M:    Santosh Shilimkar <[email protected]>
  L:    [email protected]
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git
  F:    drivers/soc/ti/*
  
  TI LM49xxx FAMILY ASoC CODEC DRIVERS
@@@ -20348,8 -20326,7 +20357,8 @@@ F:   arch/x86/include/asm/vmware.
  F:    arch/x86/kernel/cpu/vmware.c
  
  VMWARE PVRDMA DRIVER
 -M:    Adit Ranadive <[email protected]>
 +M:    Bryan Tan <[email protected]>
 +M:    Vishnu Dasa <[email protected]>
  M:    VMware PV-Drivers <[email protected]>
  L:    [email protected]
  S:    Maintained
@@@ -20894,6 -20871,13 +20903,13 @@@ F: fs/xfs
  F:    include/uapi/linux/dqblk_xfs.h
  F:    include/uapi/linux/fsmap.h
  
+ XILINX AMS DRIVER
+ M:    Anand Ashok Dumbre <[email protected]>
+ L:    [email protected]
+ S:    Maintained
+ F:    Documentation/devicetree/bindings/iio/adc/xlnx,zynqmp-ams.yaml
+ F:    drivers/iio/adc/xilinx-ams.c
  XILINX AXI ETHERNET DRIVER
  M:    Radhey Shyam Pandey <[email protected]>
  S:    Maintained
@@@ -20962,12 -20946,6 +20978,12 @@@ T: git https://github.com/Xilinx/linux-
  F:    Documentation/devicetree/bindings/phy/xlnx,zynqmp-psgtr.yaml
  F:    drivers/phy/xilinx/phy-zynqmp.c
  
 +XILINX EVENT MANAGEMENT DRIVER
 +M:    Abhyuday Godhasara <[email protected]>
 +S:    Maintained
 +F:    drivers/soc/xilinx/xlnx_event_manager.c
 +F:    include/linux/firmware/xlnx-event-manager.h
 +
  XILLYBUS DRIVER
  M:    Eli Billauer <[email protected]>
  L:    [email protected]
index 24c9387c296879cffe851bfcbac7dcaea343634a,460b1a89d5752aff82d2d5383ac1b171e61c8df6..0fe570316848276c9b1f8612618737c6e5f305a5
@@@ -315,7 -315,7 +315,7 @@@ static const char *const kxtf9_samp_fre
        "25 50 100 200 400 800";
  
  /* Refer to section 4 of the specification */
- static const struct {
+ static __maybe_unused const struct {
        int odr_bits;
        int usec;
  } odr_start_up_times[KX_MAX_CHIPS][12] = {
@@@ -927,7 -927,8 +927,8 @@@ static int kxcjk1013_read_raw(struct ii
                                mutex_unlock(&data->mutex);
                                return ret;
                        }
-                       *val = sign_extend32(ret >> 4, 11);
+                       *val = sign_extend32(ret >> chan->scan_type.shift,
+                                            chan->scan_type.realbits - 1);
                        ret = kxcjk1013_set_power_state(data, false);
                }
                mutex_unlock(&data->mutex);
@@@ -1595,7 -1596,8 +1596,7 @@@ static int kxcjk1013_probe(struct i2c_c
        return 0;
  
  err_buffer_cleanup:
 -      if (data->dready_trig)
 -              iio_triggered_buffer_cleanup(indio_dev);
 +      iio_triggered_buffer_cleanup(indio_dev);
  err_trigger_unregister:
        if (data->dready_trig)
                iio_trigger_unregister(data->dready_trig);
@@@ -1617,8 -1619,8 +1618,8 @@@ static int kxcjk1013_remove(struct i2c_
        pm_runtime_disable(&client->dev);
        pm_runtime_set_suspended(&client->dev);
  
 +      iio_triggered_buffer_cleanup(indio_dev);
        if (data->dready_trig) {
 -              iio_triggered_buffer_cleanup(indio_dev);
                iio_trigger_unregister(data->dready_trig);
                iio_trigger_unregister(data->motion_trig);
        }
index 09c7f10fefb6e426c02736c84242e8ccf3d4d9d6,4ac4c06e970741ad249b6852f0f8b59326158e33..64b82b4503adab5912d799784557ae5c939c269b
@@@ -1053,7 -1053,7 +1053,7 @@@ static irqreturn_t mma8452_interrupt(in
  {
        struct iio_dev *indio_dev = p;
        struct mma8452_data *data = iio_priv(indio_dev);
-       int ret = IRQ_NONE;
+       irqreturn_t ret = IRQ_NONE;
        int src;
  
        src = i2c_smbus_read_byte_data(data->client, MMA8452_INT_SRC);
@@@ -1470,7 -1470,7 +1470,7 @@@ static int mma8452_trigger_setup(struc
        if (ret)
                return ret;
  
 -      indio_dev->trig = trig;
 +      indio_dev->trig = iio_trigger_get(trig);
  
        return 0;
  }
diff --combined drivers/iio/adc/Kconfig
index 3363af15a43f886ced8ae53a05b7b5db3e625158,3570c4e41708d6e965f3bfd35116d10c3a237520..4fdc8bfbb407fa1a30025de5071de8140f10f9aa
@@@ -532,7 -532,7 +532,7 @@@ config IMX7D_AD
  
  config IMX8QXP_ADC
        tristate "NXP IMX8QXP ADC driver"
 -      depends on ARCH_MXC_ARM64 || COMPILE_TEST
 +      depends on ARCH_MXC || COMPILE_TEST
        depends on HAS_IOMEM
        help
          Say yes here to build support for IMX8QXP ADC.
@@@ -1146,7 -1146,7 +1146,7 @@@ config TI_ADS795
  
  config TI_ADS8344
        tristate "Texas Instruments ADS8344"
-       depends on SPI && OF
+       depends on SPI
        help
          If you say yes here you get support for Texas Instruments ADS8344
          ADC chips
  
  config TI_ADS8688
        tristate "Texas Instruments ADS8688"
-       depends on SPI && OF
+       depends on SPI
        help
          If you say yes here you get support for Texas Instruments ADS8684 and
          and ADS8688 ADC chips
  
  config TI_ADS124S08
        tristate "Texas Instruments ADS124S08"
-       depends on SPI && OF
+       depends on SPI
        help
          If you say yes here you get support for Texas Instruments ADS124S08
          and ADS124S06 ADC chips
@@@ -1288,4 -1288,19 +1288,19 @@@ config XILINX_XAD
          The driver can also be build as a module. If so, the module will be called
          xilinx-xadc.
  
+ config XILINX_AMS
+       tristate "Xilinx AMS driver"
+       depends on ARCH_ZYNQMP || COMPILE_TEST
+       depends on HAS_IOMEM
+       help
+         Say yes here to have support for the Xilinx AMS for Ultrascale/Ultrascale+
+         System Monitor. With this you can measure and monitor the Voltages and
+         Temperature values on the SOC.
+         The driver supports Voltage and Temperature monitoring on Xilinx Ultrascale
+         devices.
+         The driver can also be built as a module. If so, the module will be called
+         xilinx-ams.
  endmenu
index 92a57cf10fba4a05d797b7308404a66255263824,a2c406276329b4cb600b2e0ca1266cb29d331fba..854b1f81d807efa5840e61b271622c7e8568fd66
@@@ -1586,8 -1586,7 +1586,8 @@@ static int at91_adc_read_info_raw(struc
                *val = st->conversion_value;
                ret = at91_adc_adjust_val_osr(st, val);
                if (chan->scan_type.sign == 's')
 -                      *val = sign_extend32(*val, 11);
 +                      *val = sign_extend32(*val,
 +                                           chan->scan_type.realbits - 1);
                st->conversion_done = false;
        }
  
@@@ -1662,10 -1661,9 +1662,9 @@@ static int at91_adc_write_raw(struct ii
        }
  }
  
- static void at91_adc_dma_init(struct platform_device *pdev)
+ static void at91_adc_dma_init(struct at91_adc_state *st)
  {
-       struct iio_dev *indio_dev = platform_get_drvdata(pdev);
-       struct at91_adc_state *st = iio_priv(indio_dev);
+       struct device *dev = &st->indio_dev->dev;
        struct dma_slave_config config = {0};
        /* we have 2 bytes for each channel */
        unsigned int sample_size = st->soc_info.platform->nr_channels * 2;
        if (st->dma_st.dma_chan)
                return;
  
-       st->dma_st.dma_chan = dma_request_chan(&pdev->dev, "rx");
+       st->dma_st.dma_chan = dma_request_chan(dev, "rx");
        if (IS_ERR(st->dma_st.dma_chan))  {
-               dev_info(&pdev->dev, "can't get DMA channel\n");
+               dev_info(dev, "can't get DMA channel\n");
                st->dma_st.dma_chan = NULL;
                goto dma_exit;
        }
                                               &st->dma_st.rx_dma_buf,
                                               GFP_KERNEL);
        if (!st->dma_st.rx_buf) {
-               dev_info(&pdev->dev, "can't allocate coherent DMA area\n");
+               dev_info(dev, "can't allocate coherent DMA area\n");
                goto dma_chan_disable;
        }
  
        config.dst_maxburst = 1;
  
        if (dmaengine_slave_config(st->dma_st.dma_chan, &config)) {
-               dev_info(&pdev->dev, "can't configure DMA slave\n");
+               dev_info(dev, "can't configure DMA slave\n");
                goto dma_free_area;
        }
  
-       dev_info(&pdev->dev, "using %s for rx DMA transfers\n",
+       dev_info(dev, "using %s for rx DMA transfers\n",
                 dma_chan_name(st->dma_st.dma_chan));
  
        return;
@@@ -1721,13 -1719,12 +1720,12 @@@ dma_chan_disable
        dma_release_channel(st->dma_st.dma_chan);
        st->dma_st.dma_chan = NULL;
  dma_exit:
-       dev_info(&pdev->dev, "continuing without DMA support\n");
+       dev_info(dev, "continuing without DMA support\n");
  }
  
- static void at91_adc_dma_disable(struct platform_device *pdev)
+ static void at91_adc_dma_disable(struct at91_adc_state *st)
  {
-       struct iio_dev *indio_dev = platform_get_drvdata(pdev);
-       struct at91_adc_state *st = iio_priv(indio_dev);
+       struct device *dev = &st->indio_dev->dev;
        /* we have 2 bytes for each channel */
        unsigned int sample_size = st->soc_info.platform->nr_channels * 2;
        unsigned int pages = DIV_ROUND_UP(AT91_HWFIFO_MAX_SIZE *
        dma_release_channel(st->dma_st.dma_chan);
        st->dma_st.dma_chan = NULL;
  
-       dev_info(&pdev->dev, "continuing without DMA support\n");
+       dev_info(dev, "continuing without DMA support\n");
  }
  
  static int at91_adc_set_watermark(struct iio_dev *indio_dev, unsigned int val)
         */
  
        if (val == 1)
-               at91_adc_dma_disable(to_platform_device(&indio_dev->dev));
+               at91_adc_dma_disable(st);
        else if (val > 1)
-               at91_adc_dma_init(to_platform_device(&indio_dev->dev));
+               at91_adc_dma_init(st);
  
        /*
         * We can start the DMA only after setting the watermark and
         */
        ret = at91_adc_buffer_prepare(indio_dev);
        if (ret)
-               at91_adc_dma_disable(to_platform_device(&indio_dev->dev));
+               at91_adc_dma_disable(st);
  
        return ret;
  }
@@@ -1828,7 -1825,7 +1826,7 @@@ static void at91_adc_hw_init(struct iio
  static ssize_t at91_adc_get_fifo_state(struct device *dev,
                                       struct device_attribute *attr, char *buf)
  {
-       struct iio_dev *indio_dev = dev_get_drvdata(dev);
+       struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct at91_adc_state *st = iio_priv(indio_dev);
  
        return scnprintf(buf, PAGE_SIZE, "%d\n", !!st->dma_st.dma_chan);
  static ssize_t at91_adc_get_watermark(struct device *dev,
                                      struct device_attribute *attr, char *buf)
  {
-       struct iio_dev *indio_dev = dev_get_drvdata(dev);
+       struct iio_dev *indio_dev = dev_to_iio_dev(dev);
        struct at91_adc_state *st = iio_priv(indio_dev);
  
        return scnprintf(buf, PAGE_SIZE, "%d\n", st->dma_st.watermark);
@@@ -2078,7 -2075,7 +2076,7 @@@ static int at91_adc_probe(struct platfo
        return 0;
  
  dma_disable:
-       at91_adc_dma_disable(pdev);
+       at91_adc_dma_disable(st);
  per_clk_disable_unprepare:
        clk_disable_unprepare(st->per_clk);
  vref_disable:
@@@ -2095,7 -2092,7 +2093,7 @@@ static int at91_adc_remove(struct platf
  
        iio_device_unregister(indio_dev);
  
-       at91_adc_dma_disable(pdev);
+       at91_adc_dma_disable(st);
  
        clk_disable_unprepare(st->per_clk);
  
index df99f1365c398306524389f376002060247b6fb0,12d469a52ceac659b3598b61ce7311dbc419af5e..53bf7d4899d2048bb37d6a8caae5d8a58b9cddf6
@@@ -186,6 -186,8 +186,8 @@@ static const struct iio_chan_spec axp20
                           AXP20X_BATT_CHRG_I_H),
        AXP20X_ADC_CHANNEL(AXP20X_BATT_DISCHRG_I, "batt_dischrg_i", IIO_CURRENT,
                           AXP20X_BATT_DISCHRG_I_H),
+       AXP20X_ADC_CHANNEL(AXP20X_TS_IN, "ts_v", IIO_VOLTAGE,
+                          AXP20X_TS_IN_H),
  };
  
  static const struct iio_chan_spec axp22x_adc_channels[] = {
                           AXP20X_BATT_CHRG_I_H),
        AXP20X_ADC_CHANNEL(AXP22X_BATT_DISCHRG_I, "batt_dischrg_i", IIO_CURRENT,
                           AXP20X_BATT_DISCHRG_I_H),
+       AXP20X_ADC_CHANNEL(AXP22X_TS_IN, "ts_v", IIO_VOLTAGE,
+                          AXP22X_TS_ADC_H),
  };
  
  static const struct iio_chan_spec axp813_adc_channels[] = {
                           AXP20X_BATT_CHRG_I_H),
        AXP20X_ADC_CHANNEL(AXP22X_BATT_DISCHRG_I, "batt_dischrg_i", IIO_CURRENT,
                           AXP20X_BATT_DISCHRG_I_H),
+       AXP20X_ADC_CHANNEL(AXP813_TS_IN, "ts_v", IIO_VOLTAGE,
+                          AXP288_TS_ADC_H),
  };
  
  static int axp20x_adc_raw(struct iio_dev *indio_dev,
@@@ -251,8 -257,19 +257,8 @@@ static int axp22x_adc_raw(struct iio_de
                          struct iio_chan_spec const *chan, int *val)
  {
        struct axp20x_adc_iio *info = iio_priv(indio_dev);
 -      int size;
  
 -      /*
 -       * N.B.: Unlike the Chinese datasheets tell, the charging current is
 -       * stored on 12 bits, not 13 bits. Only discharging current is on 13
 -       * bits.
 -       */
 -      if (chan->type == IIO_CURRENT && chan->channel == AXP22X_BATT_DISCHRG_I)
 -              size = 13;
 -      else
 -              size = 12;
 -
 -      *val = axp20x_read_variable_width(info->regmap, chan->address, size);
 +      *val = axp20x_read_variable_width(info->regmap, chan->address, 12);
        if (*val < 0)
                return *val;
  
@@@ -296,11 -313,36 +302,36 @@@ static int axp20x_adc_scale_voltage(in
                *val2 = 400000;
                return IIO_VAL_INT_PLUS_MICRO;
  
+       case AXP20X_TS_IN:
+               /* 0.8 mV per LSB */
+               *val = 0;
+               *val2 = 800000;
+               return IIO_VAL_INT_PLUS_MICRO;
        default:
                return -EINVAL;
        }
  }
  
+ static int axp22x_adc_scale_voltage(int channel, int *val, int *val2)
+ {
+       switch (channel) {
+       case AXP22X_BATT_V:
+               /* 1.1 mV per LSB */
+               *val = 1;
+               *val2 = 100000;
+               return IIO_VAL_INT_PLUS_MICRO;
+       case AXP22X_TS_IN:
+               /* 0.8 mV per LSB */
+               *val = 0;
+               *val2 = 800000;
+               return IIO_VAL_INT_PLUS_MICRO;
+       default:
+               return -EINVAL;
+       }
+ }
  static int axp813_adc_scale_voltage(int channel, int *val, int *val2)
  {
        switch (channel) {
                *val2 = 100000;
                return IIO_VAL_INT_PLUS_MICRO;
  
+       case AXP813_TS_IN:
+               /* 0.8 mV per LSB */
+               *val = 0;
+               *val2 = 800000;
+               return IIO_VAL_INT_PLUS_MICRO;
        default:
                return -EINVAL;
        }
@@@ -367,16 -415,12 +404,11 @@@ static int axp22x_adc_scale(struct iio_
  {
        switch (chan->type) {
        case IIO_VOLTAGE:
-               if (chan->channel != AXP22X_BATT_V)
-                       return -EINVAL;
-               *val = 1;
-               *val2 = 100000;
-               return IIO_VAL_INT_PLUS_MICRO;
+               return axp22x_adc_scale_voltage(chan->channel, val, val2);
  
        case IIO_CURRENT:
 -              *val = 0;
 -              *val2 = 500000;
 -              return IIO_VAL_INT_PLUS_MICRO;
 +              *val = 1;
 +              return IIO_VAL_INT;
  
        case IIO_TEMP:
                *val = 100;
@@@ -476,6 -520,7 +508,7 @@@ static int axp22x_read_raw(struct iio_d
  {
        switch (mask) {
        case IIO_CHAN_INFO_OFFSET:
+               /* For PMIC temp only */
                *val = -2677;
                return IIO_VAL_INT;
  
index 8cd258cb2682e6620bac9e7963670cf927be6eff,7f1fb36c747c5ed6fc616e3b30b6b66b8b2c2b4c..897166d9e45ce7162c0a6abf3cbe9c4ab6cda8a6
@@@ -1117,7 -1117,6 +1117,7 @@@ static void stm32h7_adc_unprepare(struc
  {
        struct stm32_adc *adc = iio_priv(indio_dev);
  
 +      stm32_adc_writel(adc, STM32H7_ADC_PCSEL, 0);
        stm32h7_adc_disable(indio_dev);
        stm32_adc_int_ch_disable(adc);
        stm32h7_adc_enter_pwr_down(adc);
@@@ -1987,7 -1986,7 +1987,7 @@@ static int stm32_adc_populate_int_ch(st
                        /* Get calibration data for vrefint channel */
                        ret = nvmem_cell_read_u16(&indio_dev->dev, "vrefint", &vrefint);
                        if (ret && ret != -ENOENT) {
 -                              return dev_err_probe(&indio_dev->dev, ret,
 +                              return dev_err_probe(indio_dev->dev.parent, ret,
                                                     "nvmem access error\n");
                        }
                        if (ret == -ENOENT)
@@@ -2025,7 -2024,8 +2025,8 @@@ static int stm32_adc_generic_chan_init(
                        if (strlen(name) >= STM32_ADC_CH_SZ) {
                                dev_err(&indio_dev->dev, "Label %s exceeds %d characters\n",
                                        name, STM32_ADC_CH_SZ);
-                               return -EINVAL;
+                               ret = -EINVAL;
+                               goto err;
                        }
                        strncpy(adc->chan_name[val], name, STM32_ADC_CH_SZ);
                        ret = stm32_adc_populate_int_ch(indio_dev, name, val);
index 93990ff1dfe39e5a760e9b8c82099f4af8f5a282,d3bdc9800b4aa855c7084b4b4a9880e50fc433dd..f504ed351b3e2e18d52568d5b262706f755a464b
@@@ -162,6 -162,39 +162,39 @@@ static struct iio_trigger *iio_trigger_
        return trig;
  }
  
+ static void iio_reenable_work_fn(struct work_struct *work)
+ {
+       struct iio_trigger *trig = container_of(work, struct iio_trigger,
+                                               reenable_work);
+       /*
+        * This 'might' occur after the trigger state is set to disabled -
+        * in that case the driver should skip reenabling.
+        */
+       trig->ops->reenable(trig);
+ }
+ /*
+  * In general, reenable callbacks may need to sleep and this path is
+  * not performance sensitive, so just queue up a work item
+  * to reneable the trigger for us.
+  *
+  * Races that can cause this.
+  * 1) A handler occurs entirely in interrupt context so the counter
+  *    the final decrement is still in this interrupt.
+  * 2) The trigger has been removed, but one last interrupt gets through.
+  *
+  * For (1) we must call reenable, but not in atomic context.
+  * For (2) it should be safe to call reenanble, if drivers never blindly
+  * reenable after state is off.
+  */
+ static void iio_trigger_notify_done_atomic(struct iio_trigger *trig)
+ {
+       if (atomic_dec_and_test(&trig->use_count) && trig->ops &&
+           trig->ops->reenable)
+               schedule_work(&trig->reenable_work);
+ }
  void iio_trigger_poll(struct iio_trigger *trig)
  {
        int i;
                        if (trig->subirqs[i].enabled)
                                generic_handle_irq(trig->subirq_base + i);
                        else
-                               iio_trigger_notify_done(trig);
+                               iio_trigger_notify_done_atomic(trig);
                }
        }
  }
@@@ -535,6 -568,7 +568,7 @@@ struct iio_trigger *viio_trigger_alloc(
        trig->dev.type = &iio_trig_type;
        trig->dev.bus = &iio_bus_type;
        device_initialize(&trig->dev);
+       INIT_WORK(&trig->reenable_work, iio_reenable_work_fn);
  
        mutex_init(&trig->pool_lock);
        trig->subirq_base = irq_alloc_descs(-1, 0,
                irq_modify_status(trig->subirq_base + i,
                                  IRQ_NOREQUEST | IRQ_NOAUTOEN, IRQ_NOPROBE);
        }
 -      get_device(&trig->dev);
  
        return trig;
  
index b2983b1a9ed1cc05ddda4ec5a08372b0b2cac493,902b9c7a96a7f38da83076fa6b30f6266c5f2e7b..47d61ec2bb50f08b7af6eb86d59a88c9c3962943
@@@ -1,6 -1,6 +1,6 @@@
  // SPDX-License-Identifier: GPL-2.0-only
  /*
-  * ltr501.c - Support for Lite-On LTR501 ambient light and proximity sensor
+  * Support for Lite-On LTR501 and similar ambient light and proximity sensors.
   *
   * Copyright 2014 Peter Meerwald <[email protected]>
   *
@@@ -98,6 -98,7 +98,7 @@@ enum 
        ltr501 = 0,
        ltr559,
        ltr301,
+       ltr303,
  };
  
  struct ltr501_gain {
@@@ -165,6 -166,7 +166,7 @@@ struct ltr501_data 
        struct regmap_field *reg_ps_rate;
        struct regmap_field *reg_als_prst;
        struct regmap_field *reg_ps_prst;
+       uint32_t near_level;
  };
  
  static const struct ltr501_samp_table ltr501_als_samp_table[] = {
@@@ -524,6 -526,25 +526,25 @@@ static int ltr501_write_intr_prst(struc
        return -EINVAL;
  }
  
+ static ssize_t ltr501_read_near_level(struct iio_dev *indio_dev,
+                                     uintptr_t priv,
+                                     const struct iio_chan_spec *chan,
+                                     char *buf)
+ {
+       struct ltr501_data *data = iio_priv(indio_dev);
+       return sprintf(buf, "%u\n", data->near_level);
+ }
+ static const struct iio_chan_spec_ext_info ltr501_ext_info[] = {
+       {
+               .name = "nearlevel",
+               .shared = IIO_SEPARATE,
+               .read = ltr501_read_near_level,
+       },
+       { /* sentinel */ }
+ };
  static const struct iio_event_spec ltr501_als_event_spec[] = {
        {
                .type = IIO_EV_TYPE_THRESH,
@@@ -608,6 -629,7 +629,7 @@@ static const struct iio_chan_spec ltr50
                },
                .event_spec = ltr501_pxs_event_spec,
                .num_event_specs = ARRAY_SIZE(ltr501_pxs_event_spec),
+               .ext_info = ltr501_ext_info,
        },
        IIO_CHAN_SOFT_TIMESTAMP(3),
  };
@@@ -1231,6 -1253,18 +1253,18 @@@ static const struct ltr501_chip_info lt
                .channels = ltr301_channels,
                .no_channels = ARRAY_SIZE(ltr301_channels),
        },
+       [ltr303] = {
+               .partid = 0x0A,
+               .als_gain = ltr559_als_gain_tbl,
+               .als_gain_tbl_size = ARRAY_SIZE(ltr559_als_gain_tbl),
+               .als_mode_active = BIT(0),
+               .als_gain_mask = BIT(2) | BIT(3) | BIT(4),
+               .als_gain_shift = 2,
+               .info = &ltr301_info,
+               .info_no_irq = &ltr301_info_no_irq,
+               .channels = ltr301_channels,
+               .no_channels = ARRAY_SIZE(ltr301_channels),
+       },
  };
  
  static int ltr501_write_contr(struct ltr501_data *data, u8 als_val, u8 ps_val)
@@@ -1275,7 -1309,7 +1309,7 @@@ static irqreturn_t ltr501_trigger_handl
                ret = regmap_bulk_read(data->regmap, LTR501_ALS_DATA1,
                                       als_buf, sizeof(als_buf));
                if (ret < 0)
 -                      return ret;
 +                      goto done;
                if (test_bit(0, indio_dev->active_scan_mask))
                        scan.channels[j++] = le16_to_cpu(als_buf[1]);
                if (test_bit(1, indio_dev->active_scan_mask))
@@@ -1518,6 -1552,10 +1552,10 @@@ static int ltr501_probe(struct i2c_clie
        if ((partid >> 4) != data->chip_info->partid)
                return -ENODEV;
  
+       if (device_property_read_u32(&client->dev, "proximity-near-level",
+                                    &data->near_level))
+               data->near_level = 0;
        indio_dev->info = data->chip_info->info;
        indio_dev->channels = data->chip_info->channels;
        indio_dev->num_channels = data->chip_info->no_channels;
@@@ -1605,6 -1643,7 +1643,7 @@@ static const struct i2c_device_id ltr50
        { "ltr501", ltr501},
        { "ltr559", ltr559},
        { "ltr301", ltr301},
+       { "ltr303", ltr303},
        { }
  };
  MODULE_DEVICE_TABLE(i2c, ltr501_id);
@@@ -1613,6 -1652,7 +1652,7 @@@ static const struct of_device_id ltr501
        { .compatible = "liteon,ltr501", },
        { .compatible = "liteon,ltr559", },
        { .compatible = "liteon,ltr301", },
+       { .compatible = "liteon,ltr303", },
        {}
  };
  MODULE_DEVICE_TABLE(of, ltr501_of_match);
index 4353b749ecef2795cd11d055f30f4c364397208b,02b87b0f9d70a7fba56eedef0295d878866e9f93..4f9461e1412cb02b955cf0abbea7730ab834d3c3
@@@ -696,9 -696,9 +696,9 @@@ static const struct iio_chan_spec_ext_i
                .write = stm32_count_set_preset
        },
        IIO_ENUM("enable_mode", IIO_SEPARATE, &stm32_enable_mode_enum),
-       IIO_ENUM_AVAILABLE("enable_mode", &stm32_enable_mode_enum),
+       IIO_ENUM_AVAILABLE("enable_mode", IIO_SHARED_BY_TYPE, &stm32_enable_mode_enum),
        IIO_ENUM("trigger_mode", IIO_SEPARATE, &stm32_trigger_mode_enum),
-       IIO_ENUM_AVAILABLE("trigger_mode", &stm32_trigger_mode_enum),
+       IIO_ENUM_AVAILABLE("trigger_mode", IIO_SHARED_BY_TYPE, &stm32_trigger_mode_enum),
        {}
  };
  
@@@ -912,6 -912,6 +912,6 @@@ static struct platform_driver stm32_tim
  };
  module_platform_driver(stm32_timer_trigger_driver);
  
 -MODULE_ALIAS("platform: stm32-timer-trigger");
 +MODULE_ALIAS("platform:stm32-timer-trigger");
  MODULE_DESCRIPTION("STMicroelectronics STM32 Timer Trigger driver");
  MODULE_LICENSE("GPL v2");
This page took 0.19077 seconds and 4 git commands to generate.