summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2019-10-18counter: Simplify the count_read and count_write callbacksWilliam Breathitt Gray7-212/+51
The count_read and count_write callbacks are simplified to pass val as unsigned long rather than as an opaque data structure. The opaque counter_count_read_value and counter_count_write_value structures, counter_count_value_type enum, and relevant counter_count_read_value_set and counter_count_write_value_get functions, are removed as they are no longer used. Cc: Patrick Havelange <patrick.havelange@essensium.com> Acked-by: Fabrice Gasnier <fabrice.gasnier@st.com> Acked-by: David Lechner <david@lechnology.com> Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-18Merge branch 'ib-ab8500-5.4-rc1' into HEADJonathan Cameron16-1939/+1495
Immutable branch as considerable overlap with mfd, power and hwmon.
2019-10-18mfd: Switch the AB8500 GPADC to IIOLinus Walleij5-1873/+0
The AB8500 GPADC driver is indeed a "general purpose ADC" driver, and while the IIO subsystem did not exist when the driver was first merged, it is never too late to clean things up and move it to the right place. Nowadays IIO provides the right abstractions and interfaces to do generic ADC work in the kernel. We have to cut a bunch of debugfs luggage to make this transition swift, but all these files to is read out the raw values of the ADC and the IIO subsystem already has a standard sysfs ABI for doing exactly this: no debugfs is needed. Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-18iio: adc: New driver for the AB8500 GPADCLinus Walleij4-0/+1230
This is a new driver for the ST-Ericsson AB8500 GPADC, which replaces the old driver in drivers/mfd/ab8500-gpadc.c and thus gets rid of another necessarily different custom driver from the times before IIO existed. The AB8500 GPADC can convert 10 different channels and these are used for monitoring voltages in the U8500 chipset, some are used for battery charging, some for temperature monitoring. As this is very core functionality that a lot of drivers depend on and was formerly compiled in with the AB8500 core driver, we deafault it to 'y' in Kconfig: it can be compiled out but it is really not advisible: the platform can for example overheat if we do. Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-18mfd: ab8500: Augment DT bindingsLinus Walleij1-0/+119
As we migrate the AB8500 GPADC driver to use IIO, we need to augment the bindings to account for defining the ADC channels in the device tree. Cc: devicetree@vger.kernel.org Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-18hwmon: ab8500: Convert to IIO ADCLinus Walleij2-25/+43
This switches the AB8500 hardware monitor driver to using the standard IIO ADC channel lookup and conversion routines. Acked-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-18power: supply: ab8500_fg: Convert to IIO ADCLinus Walleij1-8/+15
This switches the AB8500 fuel gauge driver to using the standard IIO ADC channel lookup and conversion routines. Acked-by: Sebastian Reichel <sre@kernel.org> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-18power: supply: ab8500_charger: Convert to IIO ADCLinus Walleij1-20/+58
This switches the AB8500 battery charger driver to using the standard IIO ADC channel lookup and conversion routines. Acked-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Sebastian Reichel <sre@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-18power: supply: ab8500_btemp: Convert to IIO ADCLinus Walleij2-13/+30
This switches the AB8500 battery temperature driver to using the standard IIO ADC channel lookup and conversion routines. Acked-by: Sebastian Reichel <sre@kernel.org> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-17Merge branch 'ib-ti-eqep-5.4-rc1' into togregJonathan Cameron10-10/+551
Immutable branch being merged in. Created as this also involves moving some dependencies around, outside of the counter subsystem. It's possible it will want to be pulled into other trees.
2019-10-17counter: new TI eQEP driverDavid Lechner5-1/+492
This adds a new counter driver for the Texas Instruments Enhanced Quadrature Encoder Pulse (eQEP) module. Only very basic functionality is currently implemented - only enough to be able to read the position. The actual device has many more features which can be added to the driver on an as-needed basis. It is not possible to read the QEPA/B signal values in hardware, so that feature is omitted. The TI_PWMSS kernel option is selected in Kconfig to enable the parent bus, which is needed for power management. Signed-off-by: David Lechner <david@lechnology.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-17dt-bindings: counter: new bindings for TI eQEPDavid Lechner1-0/+50
This documents device tree binding for the Texas Instruments Enhanced Quadrature Encoder Pulse (eQEP) Module found in various TI SoCs. Signed-off-by: David Lechner <david@lechnology.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-17bus/ti-pwmss: move TI PWMSS driver from PWM to bus subsystemDavid Lechner5-10/+10
The TI PWMSS driver is a simple bus driver for providing power power management for the PWM peripherals on TI AM33xx SoCs, namely eCAP, eHRPWM and eQEP. The eQEP is a counter rather than a PWM, so it does not make sense to have the bus driver in the PWM subsystem since the PWMSS is not exclusive to PWM devices. Signed-off-by: David Lechner <david@lechnology.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15iio: adc: intel_mrfld_adc: Add Basin Cove ADC driverVincent Pelletier3-0/+274
Exposes the ADC device present on, at least, Intel Merrifield platform. Based on work done by: Yang Bin <bin.yang@intel.com> Huiquan Zhong <huiquan.zhong@intel.com> Sumeet Pawnikar <sumeet.r.pawnikar@intel.com> Pavan Kumar S <pavan.kumar.s@intel.com> Though it has been heavily rewritten for upstream. Signed-off-by: Vincent Pelletier <plr.vincent@gmail.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15dt-bindings: iio: imu: st_lsm6dsx: add lsm6ds0 device bindingsLorenzo Bianconi1-0/+1
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15iio: imu: st_lsm6dsx: add support to LSM6DS0Lorenzo Bianconi5-2/+17
Add support to STM LSM6DS0 6-axis (acc + gyro) Mems sensor Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15iio: imu: st_lsm6dsx: fix gyro gain definitions for LSM9DS1Lorenzo Bianconi1-3/+4
Fix typos in gyro gain definitions for LSM9DS1 sensor Fixes: 52f4b1f19679 ("iio: imu: st_lsm6dsx: add support for accel/gyro unit of lsm9ds1") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15iio: dac: ad7303: replace mlock with own lockAlexandru Ardelean1-4/+9
This change replaces indio_dev's mlock with the driver's own lock. The lock is mostly needed to protect state when changing the `dac_cache` info. The lock has been extended to `ad7303_read_raw()`, to make sure that the cache is updated if an SPI-write is already in progress. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15dt-bindings: iio: maxbotix,mb1232.yaml: transform to yamlAndreas Klinger2-29/+60
transform existing documentation of maxbotix,mb1232 ultrasonic ranger from text documentation format into yaml. Changes in v3: - add a i2c node around device node to set up #address-cells and #size-cells for omitting error during make dt_binding_check Changes in v2: - removed description of reg property - added a line: additionalProperties: false Signed-off-by: Andreas Klinger <ak@it-klinger.de> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15iio: imu: st_lsm6dsx: add odr calibration featureMario Tesi3-3/+29
On LSM6DSO/LSM6DSR/LSM6DSOX/ASM330LHH and ISH330DHCX devices it is possible to trim the hardware timestamp resolution through the FREQ_FINE[7:0] bits of the INTERNAL_FREQ_FINE register, which contains the difference in percentage of the effective ODR (and timestamp rate) with respect to the typical value. The formula for calculating the effective ODR reported in the application notes has been linearized to the first order to simplify the calculation (pls. see note on source code). This change may be useful in the outcome of CTS tests regarding the SingleSensorTests and the SensorTest#testSensorTimeStamps for high ODRs Signed-off-by: Mario Tesi <mario.tesi@st.com> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15iio: imu: st_lsm6dsx: enable drdy-mask if availableLorenzo Bianconi3-0/+29
Enable drdy mask if available in order to mark invalid samples during sensor bootstrap phase Tested-by: Mario Tesi <mario.tesi@st.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15iio: dac: stm32: add power management supportFabrice Gasnier2-33/+199
Add support for runtime PM & sleep. Provide pclk to regmap as registers access doesn't need full power (e.g. regulator). Always restore HFSEL when resuming. It may get lost depending on low power level that has been achieved. Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15iio: imu: st_lsm6dsx: enable wake-up event for LSM6DSOLorenzo Bianconi1-1/+24
Add missing wake-up register info for LSM6DSO/LSM6DSOX sensor Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15dt-bindings: iio: imu: st_lsm6dsx: document missing wakeup-source propertyLorenzo Bianconi1-0/+1
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Reviewed-by: Sean Nyekjaer <sean@geanix.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15iio: imu: st_lsm6dsx: add missing kernel documenationLorenzo Bianconi1-0/+3
Add missing kernel doc for st_lsm6dsx_hw data structure Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Reviewed-by: Sean Nyekjaer <sean@geanix.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15iio: imu: st_lsm6dsx: add wakeup_source in st_sensors_platform_dataLorenzo Bianconi2-2/+6
Add the possibility to enable/disable wakeup source through st_sensors_platform_data and not only through device tree Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15iio: imu: st_lsm6dsx: fix checkpatch warningLorenzo Bianconi1-16/+19
Fix following checkpatch warnings: CHECK: Alignment should match open parenthesis +static int st_lsm6dsx_read_event(struct iio_dev *iio_dev, + const struct iio_chan_spec *chan, CHECK: Alignment should match open parenthesis +static int st_lsm6dsx_write_event(struct iio_dev *iio_dev, + const struct iio_chan_spec *chan, CHECK: Alignment should match open parenthesis +static int st_lsm6dsx_read_event_config(struct iio_dev *iio_dev, + const struct iio_chan_spec *chan, CHECK: Alignment should match open parenthesis +static int st_lsm6dsx_write_event_config(struct iio_dev *iio_dev, + const struct iio_chan_spec *chan, WARNING: line over 80 characters + if (dev->of_node && of_property_read_bool(dev->of_node, "wakeup-source")) Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15iio: imu: st_lsm6dsx: grab conf mutex in st_lsm6dsx_write_event_configLorenzo Bianconi1-0/+2
Always grub conf mutex in st_lsm6dsx_write_event_config since it can run concurrently with FIFO configuration Fixes: b5969abfa8b8 ("iio: imu: st_lsm6dsx: add motion events") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15iio: imu: st_lsm6dsx: rely on st_lsm6dsx_update_bits_locked configuring eventsLorenzo Bianconi1-11/+14
Rely on st_lsm6dsx_update_bits_locked in st_lsm6dsx_write_event and st_lsm6dsx_event_setup routines since they can run concurrently with sensor hub configuration Fixes: b5969abfa8b8 ("iio: imu: st_lsm6dsx: add motion events") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15iio: imu: st_lsm6dsx: always check enable_reg in st_lsm6dsx_event_setupLorenzo Bianconi1-12/+11
Check if enable_reg of event_settings data structure is defined before writing on it Fixes: b5969abfa8b8 ("iio: imu: st_lsm6dsx: add motion events") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Tested-by: Sean Nyekjaer <sean@geanix.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15iio: imu: st_lsm6dsx: move bdu/boot and reset register info in hw_settingsLorenzo Bianconi2-22/+99
Move bdu, boot and reset register definitions in hw_settings register map since not all supported sensors (e.g lsm9ds1) rely on the same definitions Fixes: 52f4b1f19679 ("iio: imu: st_lsm6dsx: add support for accel/gyro unit of lsm9ds1") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15iio: imu: st_lsm6dsx: do not access active-low/open-drain regs if not supportedLorenzo Bianconi2-14/+67
Move active low and open drain register definitions in hw_settings register map since not all supported sensors (e.g lsm9ds1) rely on the same definitions Fixes: 52f4b1f19679 ("iio: imu: st_lsm6dsx: add support for accel/gyro unit of lsm9ds1") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15iio: imu: st_lsm6dsx: move irq related definitions in irq_configLorenzo Bianconi2-108/+179
Group irq related definition in irq_config structure in st_lsm6dsx_settings. This is a preliminary patch to move OpenDrain/Active low registers in st_lsm6dsx_settings. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Tested-by: Sean Nyekjaer <sean@geanix.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15iio: imu: st_lsm6dsx: add sanity check for read_fifo pointerLorenzo Bianconi2-0/+6
Check read_fifo pointer before using it since we can't assume it is always set adding new sensors. This patch fixes the following crash: irq 277: nobody cared (try booting with the "irqpoll" option) CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.3.0-rc5-00322-g792b824-dirty #7 Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) [<c0112750>] (unwind_backtrace) from [<c010d018>] (show_stack+0x10/0x14) [<c010d018>] (show_stack) from [<c0c2bfc8>] (dump_stack+0xd8/0x10c) [<c0c2bfc8>] (dump_stack) from [<c01923fc>] (__report_bad_irq+0x24/0xc0) [<c01923fc>] (__report_bad_irq) from [<c0192820>] (note_interrupt+0x27c/0x2dc) [<c0192820>] (note_interrupt) from [<c018f174>] (handle_irq_event_percpu+0x54/0x7c) [<c018f174>] (handle_irq_event_percpu) from [<c018f1d4>] (handle_irq_event+0x38/0x5c) [<c018f1d4>] (handle_irq_event) from [<c0193664>] (handle_level_irq+0xc8/0x154) [<c0193664>] (handle_level_irq) from [<c018df58>] (generic_handle_irq+0x20/0x34) [<c018df58>] (generic_handle_irq) from [<c053c348>] (mxc_gpio_irq_handler+0xc4/0xf8) [<c053c348>] (mxc_gpio_irq_handler) from [<c053c3e0>] (mx3_gpio_irq_handler+0x64/0xb8) [<c053c3e0>] (mx3_gpio_irq_handler) from [<c018df58>] (generic_handle_irq+0x20/0x34) [<c018df58>] (generic_handle_irq) from [<c018e550>] (__handle_domain_irq+0x64/0xe0) [<c018e550>] (__handle_domain_irq) from [<c0529610>] (gic_handle_irq+0x4c/0xa0) [<c0529610>] (gic_handle_irq) from [<c0101a70>] (__irq_svc+0x70/0x98) Exception stack(0xc1301f10 to 0xc1301f58 1f00: 00000001 00000006 00000000 c130c340 1f20: c1300000 c1308928 00000001 c1308960 00000000 c12b9db0 c1308908 00000000 1f40: 00000000 c1301f60 c0182010 c0109508 20000013 ffffffff [<c0101a70>] (__irq_svc) from [<c0109508>] (arch_cpu_idle+0x20/0x3c) [<c0109508>] (arch_cpu_idle) from [<c015ed70>] (do_idle+0x1bc/0x2bc) [<c015ed70>] (do_idle) from [<c015f204>] (cpu_startup_entry+0x18/0x1c) [<c015f204>] (cpu_startup_entry) from [<c1200e68>] (start_kernel+0x440/0x504) [<c1200e68>] (start_kernel) from [<00000000>] (0x0) handlers: [<62052c0d>] st_lsm6dsx_handler_irq threaded [<f2004b92>] st_lsm6dsx_handler_thread Fixes: 52f4b1f19679 ("iio: imu: st_lsm6dsx: add support for accel/gyro unit of lsm9ds1") Tested-by: Bobby Jones <rjones@gateworks.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15iio: imu: st_lsm6dsx: use st_lsm6dsx_read_locked in ↵Lorenzo Bianconi1-14/+20
st_lsm6dsx_report_motion_event Rely on st_lsm6dsx_read_locked in st_lsm6dsx_report_motion_event since it can run concurrently with sensor hub configuration. Move event related code in st_lsm6dsx_report_motion_event Fixes: 1aabad1fb5e9 ("iio: imu: st_lsm6dsx: add motion report function and call from interrupt") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Tested-by: Sean Nyekjaer <sean@geanix.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15dt-bindings: Add max12xx SPI ADC series as trivial devicesMiquel Raynal1-0/+6
Update the compatible list with three Maxim ADCs compatibles. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15dt-bindings: Add 1027/1029/1031 SPI ADCs as trivial devicesMiquel Raynal2-22/+6
In the same time, remove the dedicated bindings file which is now useless. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15dt-bindings: iio: adc: max1027: Mark interrupts as optionalMiquel Raynal1-0/+2
The chips have a 'start conversion' and a 'end of conversion' pair of pins. They can be used but this is absolutely not mandatory as regular polling is supported by the chip depending on its internal clocking setup. There is no physical reason to force the use of interrupts so turn them optional. Also, once the interrupt turned optional, these devices fit perfectly the "trivial devices" described in the generic (yaml) bindings file, so instead of converting this text file to json schema, we can just add the relevant compatibles in: Documentation/devicetree/bindings/trivial-devices.yaml. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15iio: adc: max1027: Introduce 12-bit devices supportMiquel Raynal2-3/+39
Maxim's max12xx series is very similar to the max10xx series, with the difference of the measurements depth which is upgraded from 10 to 12 bits per channel. Everything else looks the same. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15iio: adc: max1027: Prepare the introduction of different resolutionsMiquel Raynal1-42/+32
Maxim's max1027/29/31 series returns the measured voltages with a resolution of 10 bits. There is a very similar series, max1227/29/31 which works identically but uses a resolution of 12 bits. Prepare the support for these chips by turning the 'depth' into a macro parameter instead of hardcoding it everywhere. Also reorganize just a bit the macros at the top to avoid repeating tens of lines when adding support for a new chip. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15iio: adc: max1027: Reset the device at probe timeMiquel Raynal1-0/+8
All the registers are configured by the driver, let's reset the chip at probe time, avoiding any conflict with a possible earlier configuration. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15iio: adc: max1027: Make it optional to use interruptsMiquel Raynal1-27/+32
The chip has a 'start conversion' and a 'end of conversion' pair of pins. They can be used but this is absolutely not mandatory as regular polling of the value is totally fine with the current internal clocking setup. Turn the interrupts optional and do not error out if they are not inquired in the device tree. This has the effect to prevent triggered buffers use though. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15iio: adc: max1027: Add debugfs register read supportMiquel Raynal1-2/+5
Until now, only write operations were supported. Force two bytes read operation when reading, which should fit most of the development purposes. Of course, extended operations like buffered reads on multiple channels or even temperature + voltage reads will not be read entirely. Usually, just starting a new operation will work but in any case a software reset (done through the debufs interface too) will return the device in a usable state. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15iio: light: Add support for ADUX1020 sensorManivannan Sadhasivam3-0/+861
Add initial support for Analog Devices ADUX1020 Photometric sensor. Only proximity mode has been enabled for now. Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15dt-bindings: iio: light: Add binding for ADUX1020Manivannan Sadhasivam1-0/+47
Add devicetree binding for Analog Devices ADUX1020 Photometric sensor. Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-14staging: wfx: fix potential vulnerability to spectreJérôme Pouiller1-0/+2
array_index_nospec() should be applied after a bound check. Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames") Reported-by: kbuild test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20191011164746.2518-1-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-14staging: wfx: fix error handling in wfx_tx_get_raw_link_id()Jérôme Pouiller1-1/+2
Since wfx_tx_get_raw_link_id() return an unsigned, it makes no sense to return a negative value. "15" is a better value since it is used by firmware for stations that have not yet associated link-ids. Note that this should never happens since driver set max_ap_assoc_sta to 14. Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames") Reported-by: kbuild test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20191011101639.31025-1-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-14staging: rtl8723bs: use DIV_ROUND_UP helper macroWambui Karuga1-3/+2
Use the DIV_ROUND_UP macro to replace open-coded divisor calculation to improve readability. Issue found using coccinelle: @@ expression n,d; @@ ( - ((n + d - 1) / d) + DIV_ROUND_UP(n,d) | - ((n + (d - 1)) / d) + DIV_ROUND_UP(n,d) ) Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Link: https://lore.kernel.org/r/20191013191027.6470-1-wambui.karugax@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-14staging: vc04_services: use DIV_ROUND_UP helper macroWambui Karuga1-2/+2
Replace open-coded division calculation with the DIV_ROUND_UP helper macro for better readability. Issue found using coccinelle: @@ expression n,d; @@ ( - ((n + d - 1) / d) + DIV_ROUND_UP(n,d) | - ((n + (d - 1)) / d) + DIV_ROUND_UP(n,d) ) Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com> Link: https://lore.kernel.org/r/20191013184750.32766-1-wambui.karugax@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-14staging: rtl8188eu: remove unnecessary conversion to boolMichael Straube1-2/+2
Comparsions evaluate to bool, explicit conversion with ternary operator is overly verbose and unnecessary, so remove it. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20191013131249.34422-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>