platform/kernel/linux-rpi.git
3 years agodt-bindings:iio:potentiometer:maxim,ds1803 move to trivial devices.
Jonathan Cameron [Sat, 31 Oct 2020 18:29:18 +0000 (18:29 +0000)]
dt-bindings:iio:potentiometer:maxim,ds1803 move to trivial devices.

Simple binding where there is no obvious benefit in maintaining a
separate file.  Hence document in trivial-devices.yaml and drop
the txt file.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Slawomir Stepien <sst@poczta.fm>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Slawomir Stepien <sst@poczta.fm>
Link: https://lore.kernel.org/r/20201031182922.743153-4-jic23@kernel.org
3 years agodt-bindings:iio:chemical:bosch,bme680: Move to trivial devices
Jonathan Cameron [Sat, 31 Oct 2020 18:29:17 +0000 (18:29 +0000)]
dt-bindings:iio:chemical:bosch,bme680: Move to trivial devices

Very simple binding so no need to maintain a separate file.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Sebastien Bourdelin <sebastien.bourdelin@gmail.com>
Cc: Himanshu Jha <himanshujha199640@gmail.com>
Link: https://lore.kernel.org/r/20201031182922.743153-3-jic23@kernel.org
3 years agodt-bindings:iio:chemical:sensirion,sgp30: Move to trivial-bindings.yaml
Jonathan Cameron [Sat, 31 Oct 2020 18:29:16 +0000 (18:29 +0000)]
dt-bindings:iio:chemical:sensirion,sgp30: Move to trivial-bindings.yaml

The binding for this device and the sgpc3 is very simple so lets
not maintain a seperate document for this one.  Of course we can
always add a document again if the binding becomes more complex in
future.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Andreas Brauchli <andreas.brauchli@sensirion.com>
Link: https://lore.kernel.org/r/20201031182922.743153-2-jic23@kernel.org
3 years agodt-bindings:iio:temperature:ti,tmp07 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:41:10 +0000 (13:41 +0000)]
dt-bindings:iio:temperature:ti,tmp07 yaml conversion

Simple conversion from txt to yaml.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://lore.kernel.org/r/20201031134110.724233-30-jic23@kernel.org
3 years agodt-bindings:iio:temperature:maxim_thermocouple.txt to maxim,max31855k.yaml
Jonathan Cameron [Sat, 31 Oct 2020 13:41:09 +0000 (13:41 +0000)]
dt-bindings:iio:temperature:maxim_thermocouple.txt to maxim,max31855k.yaml

Given we already have another maxim thermocouple driver that isn't
covered by this binding it seems a better idea to chose to name it
after a specific part.

I added an additional example for the maxim,max6755 to illustrate
the need for spi-cpha for that part.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Link: https://lore.kernel.org/r/20201031134110.724233-29-jic23@kernel.org
3 years agodt-bindings:iio:temperature:maxim,max31856 yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 13:41:08 +0000 (13:41 +0000)]
dt-bindings:iio:temperature:maxim,max31856 yaml conversion.

Simple txt to yaml conversion of this binding.
Paresh Chaudhary's email is bouncing so for now I've listed
myself as maintainer.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031134110.724233-28-jic23@kernel.org
3 years agodt-bindings:iio:temperature:meas,tsys01 move to trivial-devices.yaml
Jonathan Cameron [Sat, 31 Oct 2020 13:41:07 +0000 (13:41 +0000)]
dt-bindings:iio:temperature:meas,tsys01 move to trivial-devices.yaml

The existing binding description brings little value and the similar
meas,* parts are in trivial-devices.yaml so move this one there
to join them.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20201031134110.724233-27-jic23@kernel.org
3 years agodt-bindings:iio:temperature:melexis,mlx90632 conversion to yaml
Jonathan Cameron [Sat, 31 Oct 2020 13:41:06 +0000 (13:41 +0000)]
dt-bindings:iio:temperature:melexis,mlx90632 conversion to yaml

Technically this could have gone in trivial-devices.yaml, but I have
kept it as a separate binding due to the detailed additional description
from the text file.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Crt Mori <cmo@melexis.com>
Cc: Crt Mori <cmo@melexis.com>
Link: https://lore.kernel.org/r/20201031134110.724233-26-jic23@kernel.org
3 years agodt-bindings:iio:temperature:melexis,mlx90614 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:41:05 +0000 (13:41 +0000)]
dt-bindings:iio:temperature:melexis,mlx90614 yaml conversion

Simple conversion from txt to yaml.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Crt Mori <cmo@melexis.com>
Cc: Peter Meerwald <pmeerw@pmeerw.net>
Link: https://lore.kernel.org/r/20201031134110.724233-25-jic23@kernel.org
3 years agodt-bindings:iio:dac:adi,ad5758 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:41:04 +0000 (13:41 +0000)]
dt-bindings:iio:dac:adi,ad5758 yaml conversion

I have put Michael as maintainer on this one. Happy to change it to
someone else though.

One issue in here, is I cannot have an example with a negative
limit on the range.  There are very few such yaml bindings in existence
but the thermal-zones.yaml has the same problem.  If there is
any means of fixing this let me know.  For now I'm sticking to
positive range values in the example.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Michael Hennerich <Michael.Hennerich@analog.com>
Link: https://lore.kernel.org/r/20201031134110.724233-24-jic23@kernel.org
3 years agodt-bindings:iio:dac:nxp,lpc1850-dac yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 13:41:03 +0000 (13:41 +0000)]
dt-bindings:iio:dac:nxp,lpc1850-dac yaml conversion.

Very similar binding to that for the ADC on the same device.
Conversion from txt to yaml format.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Vladimir Zapolskiy <vz@mleia.com>
Link: https://lore.kernel.org/r/20201031134110.724233-23-jic23@kernel.org
3 years agodt-bindings:iio:dac:maxim,max5821 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:41:02 +0000 (13:41 +0000)]
dt-bindings:iio:dac:maxim,max5821 yaml conversion

Simple txt to yaml conversion for this binding description.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Philippe Reynes <tremyfr@yahoo.fr>
Link: https://lore.kernel.org/r/20201031134110.724233-22-jic23@kernel.org
3 years agodt-bindings:iio:dac:microchip,mcp4725 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:41:01 +0000 (13:41 +0000)]
dt-bindings:iio:dac:microchip,mcp4725 yaml conversion

I'm not sure vdd-supply absolutely has to be provided if vref-supply
is, but as the previous binding docs stated it was required it seems
reasonable to leave it as such.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Tomas Novotny <tomas@novotny.cz>
Link: https://lore.kernel.org/r/20201031134110.724233-21-jic23@kernel.org
3 years agodt-bindings:iio:dac:fsl,vf610-dac yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:41:00 +0000 (13:41 +0000)]
dt-bindings:iio:dac:fsl,vf610-dac yaml conversion

Simple binding to convert.  Example expanded a little to include
an example bus.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Sanchayan Maity <maitysanchayan@gmail.com>
Link: https://lore.kernel.org/r/20201031134110.724233-20-jic23@kernel.org
3 years agodt-bindings:iio:dac:maxim,ds4424 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:40:59 +0000 (13:40 +0000)]
dt-bindings:iio:dac:maxim,ds4424 yaml conversion

Simple conversion of this straight forward binding.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Ismail H. Kose <ihkose@gmail.com>
Link: https://lore.kernel.org/r/20201031134110.724233-19-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings:iio:dac:adi,ad7303 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:40:58 +0000 (13:40 +0000)]
dt-bindings:iio:dac:adi,ad7303 yaml conversion

Converted to maintain the requirement for Vdd-supply as per original file.
It is possible we could relax this requirement to make it at least one
of Vdd-supply and REF-supply.  We need to establish the scaling of the
output channel and if REF-supply is provided that is used instead of
Vdd-supply, hence I cannot see why a dummy regulator cannot be used for
Vdd-supply if this happens.

For now, let us keep it simple.

Drop adi,use-external-reference from binding example as no such binding
exists.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201031134110.724233-18-jic23@kernel.org
3 years agodt-bindings:iio:dac:ti,dac7612 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:40:56 +0000 (13:40 +0000)]
dt-bindings:iio:dac:ti,dac7612 yaml conversion

Simple conversion from txt to yaml.  No significant adjustments.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Ricardo Ribalda Delgado <ricardo@ribalda.com>
Link: https://lore.kernel.org/r/20201031134110.724233-16-jic23@kernel.org
3 years agodt-bindings:iio:dac:ti,dac7512 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:40:55 +0000 (13:40 +0000)]
dt-bindings:iio:dac:ti,dac7512 yaml conversion

This one is a bit interesting because the binding was moved from
misc a while back, but the linux support for this device is
provided via the ad5446 DAC driver which doesn't currently
have a binding.

For now, lets just convert this file over, but we may want to
think about consolidating this with proper documentation of
the bindings for the other parts supported by the ad5446 driver.

As Daniel Mack does not seem to have been active since 2015,
I've put myself as maintainer of this binding for now.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031134110.724233-15-jic23@kernel.org
3 years agodt-bindings:iio:dac:ti,dac7311 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:40:54 +0000 (13:40 +0000)]
dt-bindings:iio:dac:ti,dac7311 yaml conversion

Very simple conversion of this binding from txt to yaml.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Charles-Antoine Couret <charles-antoine.couret@essensium.com>
Link: https://lore.kernel.org/r/20201031134110.724233-14-jic23@kernel.org
3 years agodt-bindings:iio:dac:ti,dac5571 yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 13:40:53 +0000 (13:40 +0000)]
dt-bindings:iio:dac:ti,dac5571 yaml conversion.

A few tweaks in this conversion.
* The example didn't have the I2C address of 4C in the node name so
  fixed that.
* The reference voltage in the txt file is an optional binding, but
  the driver is making use of it to provide the scaling of the output
  channels.  As such I have made it required going forwards.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Sean Nyekjaer <sean@geanix.com>
Link: https://lore.kernel.org/r/20201031134110.724233-13-jic23@kernel.org
3 years agodt-bindings:iio:proximity:ams,as3935 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:40:52 +0000 (13:40 +0000)]
dt-bindings:iio:proximity:ams,as3935 yaml conversion

A straight forward conversion of this binding. I have added
a maximum SPI frequency from the datasheet.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Link: https://lore.kernel.org/r/20201031134110.724233-12-jic23@kernel.org
3 years agodt-bindings:iio:proximity:st,vl53l0x yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:40:51 +0000 (13:40 +0000)]
dt-bindings:iio:proximity:st,vl53l0x yaml conversion

Straight forward conversion from txt to yaml.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Song Qiang <songqiang1304521@gmail.com>
Link: https://lore.kernel.org/r/20201031134110.724233-11-jic23@kernel.org
3 years agodt-bindings:iio:proximity:semtech,sx9500 yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 13:40:50 +0000 (13:40 +0000)]
dt-bindings:iio:proximity:semtech,sx9500 yaml conversion.

Simple conversion.  There hasn't been much activity around this driver
for a long time and I don't think I have any up to date contact details
for the original authors.  As such, I've listed myself as the binding
maintainer.  More than happy to hand it off to someone more relevant though!

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031134110.724233-10-jic23@kernel.org
3 years agodt-bindings:iio:pressure:hoperf,hp03 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:40:49 +0000 (13:40 +0000)]
dt-bindings:iio:pressure:hoperf,hp03 yaml conversion

One quirk in the txt file was that the xclr gpio was specified as
xclr-gpio rather than xclr-gpios. I've fixed that in the
yaml version.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20201031134110.724233-9-jic23@kernel.org
3 years agodt-bindings:iio:pressure:meas,ms5611 yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 13:40:48 +0000 (13:40 +0000)]
dt-bindings:iio:pressure:meas,ms5611 yaml conversion.

One addition here was to put in a 20MHz maximum for the SPI bus
as specified in the datasheets of both support parts.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Tomasz Duszynski <tduszyns@gmail.com>
Link: https://lore.kernel.org/r/20201031134110.724233-8-jic23@kernel.org
3 years agodt-bindings:iio:pressure:murata,zpa2326 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:40:47 +0000 (13:40 +0000)]
dt-bindings:iio:pressure:murata,zpa2326 yaml conversion

Simple conversion with a few minor tweaks:
* I added 1MHz max for spi-max-frequency
* I have give myself as the maintainer.  This driver was written by
  Gregor Boirie but I don't have an up to date email address for Gregor.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031134110.724233-7-jic23@kernel.org
3 years agodt-bindings:iio:pressure:ms5637 Drop separate doc + add to trivial-devices
Jonathan Cameron [Sat, 31 Oct 2020 13:40:46 +0000 (13:40 +0000)]
dt-bindings:iio:pressure:ms5637 Drop separate doc + add to trivial-devices

Very simple binding for this i2c device with no properties beyond
reg and compatible.  Hence doesn't need it's own document.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031134110.724233-6-jic23@kernel.org
3 years agodt-bindings:iio:humidity:dht11 yaml conversion
Jonathan Cameron [Sat, 31 Oct 2020 13:40:45 +0000 (13:40 +0000)]
dt-bindings:iio:humidity:dht11 yaml conversion

The conversion is straight forward, but leaves an open question.
The compatible for this device has never had a vendor.

Harald Geyer has identified as probably being made by aosong,
but we have no current match to any of their more specific part
numbers.  As such, this is noted in the file but the
compatible doesn't include the vendor prefix.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-By: Harald Geyer <harald@ccbib.org>
Link: https://lore.kernel.org/r/20201031134110.724233-5-jic23@kernel.org
3 years agodt-bindings:iio:humidity:st,hts221 yaml conversion.
Jonathan Cameron [Sat, 31 Oct 2020 13:40:44 +0000 (13:40 +0000)]
dt-bindings:iio:humidity:st,hts221 yaml conversion.

Straight forward conversion of this temperature and pressure sensor binding.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/20201031134110.724233-4-jic23@kernel.org
3 years agodt-bindings:iio:humidity:htu21 Drop separate doc + add to trivial-devices
Jonathan Cameron [Sat, 31 Oct 2020 13:40:43 +0000 (13:40 +0000)]
dt-bindings:iio:humidity:htu21 Drop separate doc + add to trivial-devices

Very simple binding for this i2c device with no properties beyond
reg and compatible.  Hence doesn't need it's own document.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031134110.724233-3-jic23@kernel.org
3 years agodt-bindings:iio:humidity:hdc100x Drop separate doc + add to trivial-devices
Jonathan Cameron [Sat, 31 Oct 2020 13:40:42 +0000 (13:40 +0000)]
dt-bindings:iio:humidity:hdc100x Drop separate doc + add to trivial-devices

Very simple binding for this i2c device with no properties beyond
reg and compatible.  Hence doesn't need it's own document.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Link: https://lore.kernel.org/r/20201031134110.724233-2-jic23@kernel.org
3 years agoiio: adc: ad7887: convert probe to device-managed functions
Alexandru Ardelean [Fri, 13 Nov 2020 09:16:48 +0000 (11:16 +0200)]
iio: adc: ad7887: convert probe to device-managed functions

This is conversion of the driver to use device-managed functions.
The IIO registration and triggered buffer setup both have device-managed
versions.
The regulator disable needs to be handled via an action_or_reset handler.

With these changes, the remove hook is removed, and the error path is
cleaned up in probe.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20201113091648.148589-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: stm32-adc: adapt clock duty cycle for proper operation
Fabrice Gasnier [Fri, 6 Nov 2020 16:57:26 +0000 (17:57 +0100)]
iio: adc: stm32-adc: adapt clock duty cycle for proper operation

For proper operation, STM32 ADC should be used with a clock duty cycle
of 50%, in the range of 49% to 51%. Depending on the clock tree, divider
can be used in case clock duty cycle is out of this range.
In case clk_get_scaled_duty_cycle() returns an error, kindly apply a
divider by default (don't make the probe fail).

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Link: https://lore.kernel.org/r/1604681846-31234-1-git-send-email-fabrice.gasnier@st.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: core: centralize ioctl() calls to the main chardev
Alexandru Ardelean [Thu, 24 Sep 2020 08:41:55 +0000 (11:41 +0300)]
iio: core: centralize ioctl() calls to the main chardev

The aim of this is to improve a bit the organization of ioctl() calls in
IIO core. Currently the chardev is split across IIO core sub-modules/files.
The main chardev has to be able to handle ioctl() calls, and if we need to
add buffer ioctl() calls, this would complicate things.

The 'industrialio-core.c' file will provide a 'iio_device_ioctl()' which
will iterate over a list of ioctls registered with the IIO device. These
can be event ioctl() or buffer ioctl() calls, or something else.

Each ioctl() handler will have to return a IIO_IOCTL_UNHANDLED code (which
is positive 1), if the ioctl() did not handle the call in any. This
eliminates any potential ambiguities about negative error codes, which
should fail the call altogether.

If any ioctl() returns 0, it was considered that it was serviced
successfully and the loop will exit.

This change also moves the handling of the IIO_GET_EVENT_FD_IOCTL command
inside 'industrialio-event.c', where this is better suited.

This patch is a combination of 2 other patches from an older series:
Patch 1: iio: core: add simple centralized mechanism for ioctl() handlers
Link: https://lore.kernel.org/linux-iio/20200427131100.50845-6-alexandru.ardelean@analog.com/
Patch 2: iio: core: use new common ioctl() mechanism
Link: https://lore.kernel.org/linux-iio/20200427131100.50845-7-alexandru.ardelean@analog.com/
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20200924084155.99406-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: mt6360: Add ADC driver for MT6360
Gene Chen [Tue, 20 Oct 2020 08:07:47 +0000 (16:07 +0800)]
iio: adc: mt6360: Add ADC driver for MT6360

Add MT6360 ADC driver including Charger Current, Voltage, and
Temperature.

Signed-off-by: Gene Chen <gene_chen@richtek.com>
Link: https://lore.kernel.org/r/1603181267-15610-4-git-send-email-gene.chen.richtek@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoDocumentation: ABI: testing: mt6360: Add ADC sysfs guideline
Gene Chen [Tue, 20 Oct 2020 08:07:46 +0000 (16:07 +0800)]
Documentation: ABI: testing: mt6360: Add ADC sysfs guideline

Add ABI documentation for mt6360 ADC sysfs interfaces.

Signed-off-by: Gene Chen <gene_chen@richtek.com>
Link: https://lore.kernel.org/r/1603181267-15610-3-git-send-email-gene.chen.richtek@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: adc: add bindings doc for MT6360 ADC
Gene Chen [Tue, 20 Oct 2020 08:07:45 +0000 (16:07 +0800)]
dt-bindings: iio: adc: add bindings doc for MT6360 ADC

This change adds the binding doc for the MT6360 ADC.

Signed-off-by: Gene Chen <gene_chen@richtek.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/1603181267-15610-2-git-send-email-gene.chen.richtek@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: stm32-adc: dma transfers cleanup
Olivier Moysan [Thu, 5 Nov 2020 14:29:41 +0000 (15:29 +0100)]
iio: adc: stm32-adc: dma transfers cleanup

- Remove processing related to DMA in irq handler as this
data transfer is managed directly in DMA callback.
- Update comment in stm32_adc_set_watermark() function.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Reviewed-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Link: https://lore.kernel.org/r/20201105142941.27301-1-olivier.moysan@st.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings:iio:adc:adc.txt: Add documentation for channel label attribute
Cristian Pop [Mon, 28 Sep 2020 09:09:59 +0000 (12:09 +0300)]
dt-bindings:iio:adc:adc.txt: Add documentation for channel label attribute

Optional attribute for better identification of the channels.

Signed-off-by: Cristian Pop <cristian.pop@analog.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20200928090959.88842-5-cristian.pop@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings:iio:adc:adi,ad7768-1: Add documentation for channel label
Cristian Pop [Mon, 28 Sep 2020 09:09:58 +0000 (12:09 +0300)]
dt-bindings:iio:adc:adi,ad7768-1: Add documentation for channel label

Optional attribute for better identification of the channels.

Signed-off-by: Cristian Pop <cristian.pop@analog.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20200928090959.88842-4-cristian.pop@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: ad7768-1: Add channel labels.
Cristian Pop [Mon, 28 Sep 2020 09:09:57 +0000 (12:09 +0300)]
iio: adc: ad7768-1: Add channel labels.

For better identification of the channels.

Signed-off-by: Cristian Pop <cristian.pop@analog.com>
Link: https://lore.kernel.org/r/20200928090959.88842-3-cristian.pop@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio:Documentation: Add documentation for label channel attribute
Cristian Pop [Mon, 28 Sep 2020 09:09:56 +0000 (12:09 +0300)]
iio:Documentation: Add documentation for label channel attribute

If a label is defined for this channel add that to the channel specific
attributes. This is useful for userspace to be able to identify an
individual channel.

Signed-off-by: Cristian Pop <cristian.pop@analog.com>
Link: https://lore.kernel.org/r/20200928090959.88842-2-cristian.pop@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: core: Add optional symbolic label to a device channel
Cristian Pop [Mon, 28 Sep 2020 09:09:55 +0000 (12:09 +0300)]
iio: core: Add optional symbolic label to a device channel

If a label is defined in the device tree for this channel add that
to the channel specific attributes. This is useful for userspace to
be able to identify an individual channel.

Signed-off-by: Cristian Pop <cristian.pop@analog.com>
Link: https://lore.kernel.org/r/20200928090959.88842-1-cristian.pop@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoMAINTAINERS: Fix 'W:' prefix in Invensense IMU entry
Jonathan Neuschäfer [Sun, 8 Nov 2020 01:37:38 +0000 (02:37 +0100)]
MAINTAINERS: Fix 'W:' prefix in Invensense IMU entry

The colon is missing, which can confuse scripts/parse-maintainers.pl.

Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Link: https://lore.kernel.org/r/20201108013738.1410528-1-j.neuschaefer@gmx.net
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: remove unneeded break
Tom Rix [Mon, 19 Oct 2020 17:28:24 +0000 (10:28 -0700)]
iio: remove unneeded break

A break is not needed if it is preceded by a return

Signed-off-by: Tom Rix <trix@redhat.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Link: https://lore.kernel.org/r/20201019172824.32166-1-trix@redhat.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio:light:tsl2563 use generic fw accessors
Vaishnav M A [Sun, 18 Oct 2020 20:35:52 +0000 (02:05 +0530)]
iio:light:tsl2563 use generic fw accessors

Replace of_property_read_u32() with device_property_read_u32(),
when reading the amstaos,cover-comp-gain.This opens up the
possibility of passing the properties during platform instantiation
of the device by a suitable populated struct property_entry.
Additionally, a minor change in logic is added to remove the
of_node present check.

Signed-off-by: Vaishnav M A <vaishnav@beagleboard.org>
Link: https://lore.kernel.org/r/20201018203552.GA816421@ubuntu
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: light: vcnl4035 add i2c_device_id
Vaishnav M A [Sun, 18 Oct 2020 19:53:57 +0000 (01:23 +0530)]
iio: light: vcnl4035 add i2c_device_id

Add i2c_device_id table for the vcnl4035 driver,
enabling device instantiation using i2c_new_client_device()
or from userspace in cases where device-tree based description
is not possible now, like device(s) on a gbphy i2c adapter
created by greybus.

Signed-off-by: Vaishnav M A <vaishnav@beagleboard.org>
Link: https://lore.kernel.org/r/20201018195357.GA814864@ubuntu
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: proximity: vl53l0x-i2c add i2c_device_id
Vaishnav M A [Sun, 18 Oct 2020 19:51:02 +0000 (01:21 +0530)]
iio: proximity: vl53l0x-i2c add i2c_device_id

Add i2c_device_id table for the vl53l0x-i2c driver,
helps in device instantiation using i2c_new_client_device()
or from userspace in cases where device-tree based description
is not possible now, like device(s) on a gbphy i2c adapter
created by greybus.

Signed-off-by: Vaishnav M A <vaishnav@beagleboard.org>
Link: https://lore.kernel.org/r/20201018195102.GA814713@ubuntu
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: magnetometer: bmc150: remove unneeded semicolon
Tom Rix [Sat, 31 Oct 2020 13:43:19 +0000 (06:43 -0700)]
iio: magnetometer: bmc150: remove unneeded semicolon

A semicolon is not needed after a switch statement.

Signed-off-by: Tom Rix <trix@redhat.com>
Link: https://lore.kernel.org/r/20201031134319.2134314-1-trix@redhat.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: pressure: bmp280: remove unneeded semicolon
Tom Rix [Sat, 31 Oct 2020 13:45:06 +0000 (06:45 -0700)]
iio: pressure: bmp280: remove unneeded semicolon

A semicolon is not needed after a switch statement.

Signed-off-by: Tom Rix <trix@redhat.com>
Link: https://lore.kernel.org/r/20201031134506.2134698-1-trix@redhat.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: fix a kernel-doc markup
Mauro Carvalho Chehab [Fri, 23 Oct 2020 16:33:32 +0000 (18:33 +0200)]
iio: fix a kernel-doc markup

A function has a different name between their prototype
and its kernel-doc markup.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/46622c3bdcffb76e79719f0fe5011c2952960b32.1603469755.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: at91-sama5d2_adc: remove unneeded semicolon
Tom Rix [Tue, 27 Oct 2020 20:08:53 +0000 (13:08 -0700)]
iio: adc: at91-sama5d2_adc: remove unneeded semicolon

A semicolon is not needed after a switch statement.

Signed-off-by: Tom Rix <trix@redhat.com>
Link: https://lore.kernel.org/r/20201027200853.1596699-1-trix@redhat.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio/adc: ingenic: remove unneeded semicolon
Tom Rix [Tue, 27 Oct 2020 20:11:28 +0000 (13:11 -0700)]
iio/adc: ingenic: remove unneeded semicolon

A semicolon is not needed after a switch statement.

Signed-off-by: Tom Rix <trix@redhat.com>
Link: https://lore.kernel.org/r/20201027201128.1597230-1-trix@redhat.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: light: apds9960: remove unneeded semicolon
Tom Rix [Tue, 27 Oct 2020 20:14:36 +0000 (13:14 -0700)]
iio: light: apds9960: remove unneeded semicolon

A semicolon is not needed after a switch statement.

Signed-off-by: Tom Rix <trix@redhat.com>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Link: https://lore.kernel.org/r/20201027201436.1597726-1-trix@redhat.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: adc: ti,adc084s021 yaml conversion
Jonathan Cameron [Sun, 9 Aug 2020 11:17:47 +0000 (12:17 +0100)]
dt-bindings: iio: adc: ti,adc084s021 yaml conversion

Simple conversion.

Added the #io-channel-cells optional property to allow for consumer
bindings if appropriate on a given board.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Mårten Lindahl <martenli@axis.com>
Link: https://lore.kernel.org/r/20200809111753.156236-8-jic23@kernel.org
3 years agodt-bindings: fxas21002c: convert bindings to yaml
Rui Miguel Silva [Wed, 14 Oct 2020 10:49:26 +0000 (11:49 +0100)]
dt-bindings: fxas21002c: convert bindings to yaml

Convert fxas21002c gyroscope sensor bindings documentation to
yaml schema, remove the textual bindings document and update MAINTAINERS entry.

Signed-off-by: Rui Miguel Silva <rmfrfs@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201014104926.688666-1-rmfrfs@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: adc: auxadc: add doc for MT8516 SoC
Fabien Parent [Mon, 12 Oct 2020 20:52:17 +0000 (22:52 +0200)]
dt-bindings: iio: adc: auxadc: add doc for MT8516 SoC

Add documentation for the auxadc binding for MT8516 SoC.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201012205218.3010868-1-fparent@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agostaging: iio: adis16240: add blank line before struct definition
Deepak R Varma [Sun, 11 Oct 2020 10:48:00 +0000 (16:18 +0530)]
staging: iio: adis16240: add blank line before struct definition

Add a blank line before starting structure definition as per coding
style guidelines. Issue reported by checkpatch script.

Signed-off-by: Deepak R Varma <mh12gx2825@gmail.com>
Acked-by: Julia Lawall <julia.lawall@inria.fr>
Link: https://lore.kernel.org/r/20201011104800.GA29412@ubuntu204
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: accel: mma8452: Constify static struct attribute_group
Rikard Falkeborn [Wed, 30 Sep 2020 23:29:39 +0000 (01:29 +0200)]
iio: accel: mma8452: Constify static struct attribute_group

The only usage of mma8452_event_attribute_group is to assign its address
to the event_attrs field in the iio_info struct, which is a const
pointer. Make it const to allow the compiler to put it in read-only
memory. This was the only non-const static struct in drivers/iio.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20200930232939.31131-1-rikard.falkeborn@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: dac: ad7303: remove platform data header
Alexandru Ardelean [Thu, 1 Oct 2020 14:10:04 +0000 (17:10 +0300)]
iio: dac: ad7303: remove platform data header

The information in the ad7303 platform_data header is unused, so it's dead
code.
This change removes it and it's inclusion from the driver.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20201001141004.53846-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: ad7298: rework external ref setup & remove platform data
Alexandru Ardelean [Thu, 1 Oct 2020 14:10:48 +0000 (17:10 +0300)]
iio: adc: ad7298: rework external ref setup & remove platform data

This change removes the old platform data for ad7298. It is only used to
provide whether to use an external regulator as a reference.

So, the logic is inverted a bit. The driver now tries to obtain a
regulator. If one is provided, then the external ref is used. The rest of
the logic should work as before.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20201001141048.69050-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: core: Fix IIO_VAL_FRACTIONAL calculation for negative values
Anand Ashok Dumbre [Mon, 5 Oct 2020 15:05:16 +0000 (08:05 -0700)]
iio: core: Fix IIO_VAL_FRACTIONAL calculation for negative values

Fixes IIO_VAL_FRACTIONAL for case when the result is negative and
exponent is 0.

example: if the result is -0.75, tmp0 will be 0 and tmp1 = 75
This causes the output to lose sign because of %d in snprintf
which works for tmp0 <= -1.

Reported-by: kernel test robot <lkp@intel.com> #error: uninitialized symbol tmp
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Anand Ashok Dumbre <anand.ashok.dumbre@xilinx.com>
Link: https://lore.kernel.org/r/1601910316-24111-1-git-send-email-anand.ashok.dumbre@xilinx.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: exynos: do not rely on 'users' counter in ISR
dmitry.torokhov@gmail.com [Tue, 6 Oct 2020 21:55:09 +0000 (14:55 -0700)]
iio: adc: exynos: do not rely on 'users' counter in ISR

The order in which 'users' counter is decremented vs calling drivers'
close() method is implementation specific, and we should not rely on
it. Let's introduce driver private flag and use it to signal ISR
to exit when device is being closed.

This has a side-effect of fixing issue of accessing inut->users
outside of input->mutex protection.

Reported-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201006215509.GA2556081@dtor-ws
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Set various settings from DT
Stephen Boyd [Wed, 7 Oct 2020 01:17:35 +0000 (18:17 -0700)]
iio: sx9310: Set various settings from DT

These properties need to be set during driver probe. Parse any DT
properties and replace the default register settings with the ones
parsed from DT.

Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Cc: Daniel Campello <campello@chromium.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: <devicetree@vger.kernel.org>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Gwendal Grignou <gwendal@chromium.org>
Cc: Evan Green <evgreen@chromium.org>
Link: https://lore.kernel.org/r/20201007011735.1346994-7-swboyd@chromium.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: sx9310: Add various settings as DT properties
Stephen Boyd [Wed, 7 Oct 2020 01:17:34 +0000 (18:17 -0700)]
dt-bindings: iio: sx9310: Add various settings as DT properties

We need to set various bits in the hardware registers for this device to
operate properly depending on how it is installed. Add a handful of DT
properties to configure these things.

Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Daniel Campello <campello@chromium.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: <devicetree@vger.kernel.org>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Gwendal Grignou <gwendal@chromium.org>
Cc: Evan Green <evgreen@chromium.org>
Link: https://lore.kernel.org/r/20201007011735.1346994-6-swboyd@chromium.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Support setting debounce values
Stephen Boyd [Wed, 7 Oct 2020 01:17:33 +0000 (18:17 -0700)]
iio: sx9310: Support setting debounce values

The rising and falling directions can be debounced in the hardware as
"close" and "far" debounce settings. Add support for these as rising and
falling debounce settings.

Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Cc: Daniel Campello <campello@chromium.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Gwendal Grignou <gwendal@chromium.org>
Cc: Evan Green <evgreen@chromium.org>
Link: https://lore.kernel.org/r/20201007011735.1346994-5-swboyd@chromium.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Support setting hysteresis values
Stephen Boyd [Wed, 7 Oct 2020 01:17:32 +0000 (18:17 -0700)]
iio: sx9310: Support setting hysteresis values

Add support for setting the hysteresis as a shifted value of a channel's
proximity threshold. Each channel can have a different threshold, but
the hysteresis applies to all channels as a right shift factor.
Therefore, duplicate the hysteresis value across all channels and make
it depend on the channel's proximity threshold. This is sort of odd but
seems to work in practice as most of the time only one channel is used.

Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Cc: Daniel Campello <campello@chromium.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Gwendal Grignou <gwendal@chromium.org>
Cc: Evan Green <evgreen@chromium.org>
Link: https://lore.kernel.org/r/20201007011735.1346994-4-swboyd@chromium.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Support setting proximity thresholds
Stephen Boyd [Wed, 7 Oct 2020 01:17:31 +0000 (18:17 -0700)]
iio: sx9310: Support setting proximity thresholds

Add support to set the proximity thresholds for each channel.

Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Cc: Daniel Campello <campello@chromium.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Gwendal Grignou <gwendal@chromium.org>
Cc: Evan Green <evgreen@chromium.org>
Link: https://lore.kernel.org/r/20201007011735.1346994-3-swboyd@chromium.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Support hardware gain factor
Stephen Boyd [Wed, 7 Oct 2020 01:17:30 +0000 (18:17 -0700)]
iio: sx9310: Support hardware gain factor

Add support to set the hardware gain of the channels as a multiplier of
2x, 4x, or 8x.

Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Cc: Daniel Campello <campello@chromium.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Gwendal Grignou <gwendal@chromium.org>
Cc: Evan Green <evgreen@chromium.org>
Link: https://lore.kernel.org/r/20201007011735.1346994-2-swboyd@chromium.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: imu: st_lsm6dsx: add lsm6dst device bindings
Lorenzo Bianconi [Tue, 6 Oct 2020 12:07:42 +0000 (14:07 +0200)]
dt-bindings: iio: imu: st_lsm6dsx: add lsm6dst device bindings

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/05e4273f2544230049b2cd82c6bf1be788a8e483.1601985763.git.lorenzo@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: imu: st_lsm6dsx: add support to LSM6DST
Lorenzo Bianconi [Tue, 6 Oct 2020 12:07:41 +0000 (14:07 +0200)]
iio: imu: st_lsm6dsx: add support to LSM6DST

Add support to STM LSM6DST (acc + gyro) Mems sensor
https://www.st.com/resource/en/datasheet/lsm6dst.pdf

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/835127b76ef5ad05aa2aac58298aee5f3073fb71.1601985763.git.lorenzo@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: ad7887: invert/rework external ref logic
Alexandru Ardelean [Fri, 2 Oct 2020 08:27:23 +0000 (11:27 +0300)]
iio: adc: ad7887: invert/rework external ref logic

This change inverts/reworks the logic to use an external reference via a
provided regulator.

Now the driver tries to obtain a regulator. If one is found, then it is
used. The rest of the driver logic already checks if there is a non-NULL
reference to a regulator, so it should be fine.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20201002082723.184810-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: at91_adc: remove platform data and move defs in driver file
Alexandru Ardelean [Wed, 30 Sep 2020 13:50:48 +0000 (16:50 +0300)]
iio: adc: at91_adc: remove platform data and move defs in driver file

The AT91 ADC driver no longer uses the 'at91_add_device_adc' platform data
type. This is no longer used (at least in mainline boards).

This change removes the platform-data initialization from the driver, since
it is mostly dead code now.

Some definitions [from the platform data at91_adc.h include] have been
moved in the driver, since they are needed in the driver.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20200930135048.11530-5-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: at91_adc: add Kconfig dep on the OF symbol and remove of_match_ptr()
Alexandru Ardelean [Wed, 30 Sep 2020 13:50:47 +0000 (16:50 +0300)]
iio: adc: at91_adc: add Kconfig dep on the OF symbol and remove of_match_ptr()

This tries to solve a warning reported by the lkp bot:

>> drivers/iio/adc/at91_adc.c:1439:34: warning: unused variable
>> 'at91_adc_dt_ids' [-Wunused-const-variable]
   static const struct of_device_id at91_adc_dt_ids[] = {
                                    ^
   1 warning generated.

This warning has appeared after the AT91_ADC driver compilation has been
enabled via the COMPILE_TEST symbol dependency.

The warning is caused by the 'of_match_ptr()' helper which returns NULL if
OF is undefined. This driver should build only for device-tree context, so
a dependency on the OF Kconfig symbol has been added.
Also, the usage of of_match_ptr() helper has been removed since it
shouldn't ever return NULL (because the driver should not be built for the
non-OF context).

Fixes: 4027860dcc4c ("iio: Kconfig: at91_adc: add COMPILE_TEST dependency to driver")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20200930135048.11530-4-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: at91_adc: const-ify some driver data
Alexandru Ardelean [Wed, 30 Sep 2020 13:50:46 +0000 (16:50 +0300)]
iio: adc: at91_adc: const-ify some driver data

The main intent is to get rid of the cast for the void-pointer returned by
of_device_get_match_data().

This requires const-ifying the 'caps' and 'registers' references on the
at91_adc_state struct.

The caps can be obtained also from the old platform_data (in the
at91_adc_probe_pdata() function), but that cast is not touched in this
patch, since the old platform_data should be removed/cleaned-away.
Also, that cast deals with converting a kernel_ulong_t type to a pointer.
So, updating that cast doesn't yield any benefit.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20200930135048.11530-3-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adc: at91_adc: use of_device_get_match_data() helper
Alexandru Ardelean [Wed, 30 Sep 2020 13:50:45 +0000 (16:50 +0300)]
iio: adc: at91_adc: use of_device_get_match_data() helper

This is a small tidy-up. The of_device_get_match_data() helper retrieves
the driver data from the OF table, without needed to explicitly know the
table variable (since it can retrieve it from the driver object).

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20200930135048.11530-2-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: dac: ad5686: add binding
Michael Auchter [Thu, 24 Sep 2020 19:52:14 +0000 (14:52 -0500)]
dt-bindings: iio: dac: ad5686: add binding

Add a binding for AD5686

Signed-off-by: Michael Auchter <michael.auchter@ni.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20200924195215.49443-3-michael.auchter@ni.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: dac: ad5686: add of_match_table
Michael Auchter [Thu, 24 Sep 2020 19:52:13 +0000 (14:52 -0500)]
iio: dac: ad5686: add of_match_table

Add of_match_table to this driver, so devices can be probed based on
device tree contents.

Signed-off-by: Michael Auchter <michael.auchter@ni.com>
Link: https://lore.kernel.org/r/20200924195215.49443-2-michael.auchter@ni.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: dac: ad5686: add support for AD5338R
Michael Auchter [Thu, 24 Sep 2020 19:52:12 +0000 (14:52 -0500)]
iio: dac: ad5686: add support for AD5338R

The AD5338R is a 10-bit DAC with 2 outputs and an internal 2.5V
reference (enabled by default). The register configuration is nearly
identical to the AD5696R DAC that's already supported by this driver,
with the channel selection bits being the only thing different.

Signed-off-by: Michael Auchter <michael.auchter@ni.com>
Link: https://lore.kernel.org/r/20200924195215.49443-1-michael.auchter@ni.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agostaging: rtl8188eu: Fix long lines
Fan Fei [Thu, 8 Oct 2020 18:55:24 +0000 (20:55 +0200)]
staging: rtl8188eu: Fix long lines

This patch fix long lines found by checkpatch.

Signed-off-by: Fan Fei <ffclaire1224@gmail.com>
Link: https://lore.kernel.org/r/20201008185524.brl467kucslxoxci@ubuntu-T470
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agodt-bindings: staging: wfx: silabs,wfx yaml conversion
Jérôme Pouiller [Wed, 7 Oct 2020 10:19:42 +0000 (12:19 +0200)]
dt-bindings: staging: wfx: silabs,wfx yaml conversion

The device can be connected on SPI or on SDIO. The original file
described the two options separately. So, most of the file had to be
rewritten in order to match with the Yaml requirements.

Some device requirements are still written in the comments since they
cannot been expressed with the current scheme (e.g. reg must be set to 1
with SDIO, interrupt is mandatory with SPI, reset-gpio in SPI is
replaced by mmc-pwrseq in SDIO, etc...).

The examples provided have also been reworked in order to make
dt_binding_check happy.

Finally, also fix typo in the name of the file (siliabs instead of
silabs)

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20201007101943.749898-7-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: update copyrights dates
Jérôme Pouiller [Wed, 7 Oct 2020 10:19:41 +0000 (12:19 +0200)]
staging: wfx: update copyrights dates

Most of the files have been modified in 2020, so update the copyright
notices.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20201007101943.749898-6-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: fix QoS priority for slow buses
Jérôme Pouiller [Wed, 7 Oct 2020 10:19:40 +0000 (12:19 +0200)]
staging: wfx: fix QoS priority for slow buses

The device is in charge of respecting the QoS constraints. The driver
have to ensure that all the queues contain data and the device choose
the right queue to send.

The things starts to be more difficult when the bandwidth of the bus is
lower than the bandwidth of the WiFi. The device quickly sends the
frames of the highest priority queue. Then, it starts to send frames
from a lower priority queue. Though, there are still some high priority
frames waiting in the driver.

To work around this problem, this patch add some priorities to each
queue. The weigh of the queue was (roughly) calculated experimentally by
checking the speed ratio of each queue when the bus does not limit the
traffic:
    - Be/Bk -> 20Mbps/10Mbps
    - Vi/Be -> 36Mbps/180Kbps
    - Vo/Be -> 35Mbps/600Kbps
    - Vi/Vo -> 24Mbps/12Mbps

So, if we fix the weigh of the Background to 1, the weight of Best
Effort should be 2. The weight of Video should be 116. However, since
there is only 32 queues, it make no sense to use a value greater than
64[1]. And finally, the weight of the Voice is set to 128.

[1] Because of this approximation, with very slow bus, we can still
observe frame starvation when we measure the speed ratio of Vi/Be. It is
around 35Mbps/1Mbps (instead of 36Mbps/180Kbps). However, it is still in
accepted error range.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20201007101943.749898-5-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: fix BA sessions for older firmwares
Jérôme Pouiller [Wed, 7 Oct 2020 10:19:39 +0000 (12:19 +0200)]
staging: wfx: fix BA sessions for older firmwares

Firmwares with API < 3.6 do not forward DELBA requests. Thus, when a
Block Ack session is restarted, the reordering buffer is not flushed and
the received sequence number is not contiguous. Therefore, mac80211
starts to wait some missing frames that it will never receive.

This patch disables the reordering buffer for old firmware. It is
harmless when the network is unencrypted. When the network is encrypted,
the non-contiguous frames will be thrown away by the TKIP/CCMP replay
protection. So, the user will observe some packet loss with UDP and
performance drop with TCP.

Fixes: e5da5fbd7741 ("staging: wfx: fix CCMP/TKIP replay protection")
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20201007101943.749898-4-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: remove remaining code of 'secure link' feature
Jérôme Pouiller [Wed, 7 Oct 2020 10:19:38 +0000 (12:19 +0200)]
staging: wfx: remove remaining code of 'secure link' feature

Commit e8d607ce0c81 ("staging: wfx: drop 'secure link' feature") had
removed the 'secure link' feature. However, a few lines of codes were
yet here.

Fixes: e8d607ce0c81 ("staging: wfx: drop 'secure link' feature")
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20201007101943.749898-3-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: fix handling of MMIC error
Jérôme Pouiller [Wed, 7 Oct 2020 10:19:37 +0000 (12:19 +0200)]
staging: wfx: fix handling of MMIC error

As expected, when the device detect a MMIC error, it returns a specific
status. However, it also strip IV from the frame (don't ask me why).

So, with the current code, mac80211 detects a corrupted frame and it
drops it before it handle the MMIC error. The expected behavior would be
to detect MMIC error then to renegotiate the EAP session.

So, this patch correctly informs mac80211 that IV is not available. So,
mac80211 correctly takes into account the MMIC error.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20201007101943.749898-2-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: vchiq: Fix list_for_each exit tests
Dan Carpenter [Tue, 6 Oct 2020 13:47:48 +0000 (16:47 +0300)]
staging: vchiq: Fix list_for_each exit tests

After a list_for_each_entry() loop, the list iterator is always non-NULL
so these conditions don't work.  If the "waiter" is not found then this
results in an out of bounds access.

I have fixed it by introducing a new "found" variable.  In one case, I
used an else statement for readability.

Fixes: 46e4b9ec4fa4 ("staging: vchiq_arm: use list_for_each_entry when accessing bulk_waiter_list")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20201006134748.GA2076872@mwanda
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: greybus: use __force when assigning __u8 value to snd_ctl_elem_type_t
Coiby Xu [Fri, 2 Oct 2020 23:30:56 +0000 (07:30 +0800)]
staging: greybus: use __force when assigning __u8 value to snd_ctl_elem_type_t

(struct gb_audio_ctl_elem_info*)->type has the type of __u8 so there is no
concern about the byte order. __force is safe to use.

Found by sparse,

$ make C=2 drivers/staging/greybus/
drivers/staging/greybus/audio_topology.c:185:24: warning: cast to restricted snd_ctl_elem_type_t

Suggested-by: Alex Elder <elder@linaro.org>
Signed-off-by: Coiby Xu <coiby.xu@gmail.com>
Link: https://lore.kernel.org/r/20201002233057.74462-3-coiby.xu@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: greybus: codecs: use SNDRV_PCM_FMTBIT_S16_LE for format bitmask
Coiby Xu [Fri, 2 Oct 2020 23:30:55 +0000 (07:30 +0800)]
staging: greybus: codecs: use SNDRV_PCM_FMTBIT_S16_LE for format bitmask

snd_soc_pcm_stream.formats should use the bitmask SNDRV_PCM_FMTBIT_*
instead of the sequential integers SNDRV_PCM_FORMAT_* as explained by
commit e712bfca1ac1f63f622f87c2f33b57608f2a4d19
("ASoC: codecs: use SNDRV_PCM_FMTBIT_* for format bitmask").

Found by sparse,

$ make C=2 drivers/staging/greybus/
drivers/staging/greybus/audio_codec.c:691:36: warning: incorrect type in initializer (different base types)
drivers/staging/greybus/audio_codec.c:691:36:    expected unsigned long long [usertype] formats
drivers/staging/greybus/audio_codec.c:691:36:    got restricted snd_pcm_format_t [usertype]
drivers/staging/greybus/audio_codec.c:701:36: warning: incorrect type in initializer (different base types)
drivers/staging/greybus/audio_codec.c:701:36:    expected unsigned long long [usertype] formats
drivers/staging/greybus/audio_codec.c:701:36:    got restricted snd_pcm_format_t [usertype]

Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Coiby Xu <coiby.xu@gmail.com>
Link: https://lore.kernel.org/r/20201002233057.74462-2-coiby.xu@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: greybus: fix warnings about endianness detected by sparse
Coiby Xu [Fri, 2 Oct 2020 23:30:54 +0000 (07:30 +0800)]
staging: greybus: fix warnings about endianness detected by sparse

This patch fix the following warnings from sparse,

$ make C=2 drivers/staging/greybus/
drivers/staging/greybus/audio_module.c:222:25: warning: incorrect type in assignment (different base types)
drivers/staging/greybus/audio_module.c:222:25:    expected restricted __le16 [usertype] data_cport
drivers/staging/greybus/audio_module.c:222:25:    got unsigned short [usertype] intf_cport_id
drivers/staging/greybus/audio_topology.c:460:40: warning: restricted __le32 degrades to integer
drivers/staging/greybus/audio_topology.c:691:41: warning: incorrect type in assignment (different base types)
drivers/staging/greybus/audio_topology.c:691:41:    expected unsigned int access
drivers/staging/greybus/audio_topology.c:691:41:    got restricted __le32 [usertype] access
drivers/staging/greybus/audio_topology.c:746:44: warning: incorrect type in assignment (different base types)
drivers/staging/greybus/audio_topology.c:746:44:    expected unsigned int
drivers/staging/greybus/audio_topology.c:746:44:    got restricted __le32
drivers/staging/greybus/audio_topology.c:748:52: warning: incorrect type in assignment (different base types)
drivers/staging/greybus/audio_topology.c:748:52:    expected unsigned int
drivers/staging/greybus/audio_topology.c:748:52:    got restricted __le32
drivers/staging/greybus/audio_topology.c:802:42: warning: restricted __le32 degrades to integer
drivers/staging/greybus/audio_topology.c:805:50: warning: incorrect type in assignment (different base types)
drivers/staging/greybus/audio_topology.c:805:50:    expected restricted __le32
drivers/staging/greybus/audio_topology.c:805:50:    got unsigned int
drivers/staging/greybus/audio_topology.c:814:50: warning: restricted __le32 degrades to integer
drivers/staging/greybus/audio_topology.c:817:58: warning: incorrect type in assignment (different base types)
drivers/staging/greybus/audio_topology.c:817:58:    expected restricted __le32
drivers/staging/greybus/audio_topology.c:817:58:    got unsigned int
drivers/staging/greybus/audio_topology.c:889:25: warning: incorrect type in assignment (different base types)
drivers/staging/greybus/audio_topology.c:889:25:    expected unsigned int access
drivers/staging/greybus/audio_topology.c:889:25:    got restricted __le32 [usertype] access

Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Coiby Xu <coiby.xu@gmail.com>
Link: https://lore.kernel.org/r/20201002233057.74462-1-coiby.xu@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove unnecessary type casts (struct wlan_bssid_ex *)
Ivan Safonov [Sun, 4 Oct 2020 06:09:22 +0000 (09:09 +0300)]
staging: r8188eu: remove unnecessary type casts (struct wlan_bssid_ex *)

Reduce line length, simplify refactoring.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Link: https://lore.kernel.org/r/20201004060921.8908-1-insafonov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: replace _cancel_timer with del_timer_sync
Ross Schmidt [Sun, 4 Oct 2020 01:17:43 +0000 (20:17 -0500)]
staging: rtl8723bs: replace _cancel_timer with del_timer_sync

Replace _cancel_timer with API function del_timer_sync.

One instance of del_timer_sync is moved and an unnecessary pair of spin
locks are removed.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201004011743.10750-8-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: replace RTW_GET_BE16 with get_unaligned_be16
Ross Schmidt [Sun, 4 Oct 2020 01:17:42 +0000 (20:17 -0500)]
staging: rtl8723bs: replace RTW_GET_BE16 with get_unaligned_be16

Replace RTW_GET_BE16 macro with get_unlaligned_be16.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201004011743.10750-7-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: replace RTW_GET_LE16 with get_unaligned_le16
Ross Schmidt [Sun, 4 Oct 2020 01:17:41 +0000 (20:17 -0500)]
staging: rtl8723bs: replace RTW_GET_LE16 with get_unaligned_le16

Replace RTW_GET_LE16 macro with get_unaligned_le16.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201004011743.10750-6-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: replace RTW_GET_BE24 with get_unaligned_be24
Ross Schmidt [Sun, 4 Oct 2020 01:17:40 +0000 (20:17 -0500)]
staging: rtl8723bs: replace RTW_GET_BE24 with get_unaligned_be24

Replace RTW_GET_BE24 macro with get_unaligned_be24.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201004011743.10750-5-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove unused macros
Ross Schmidt [Sun, 4 Oct 2020 01:17:39 +0000 (20:17 -0500)]
staging: rtl8723bs: remove unused macros

Remove several macros in osdep_service.h because they are not used.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201004011743.10750-4-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: replace _RND8 with round_up()
Ross Schmidt [Sun, 4 Oct 2020 01:17:38 +0000 (20:17 -0500)]
staging: rtl8723bs: replace _RND8 with round_up()

Use round_up instead of inline _RND8.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201004011743.10750-3-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: replace _RND4 with round_up()
Ross Schmidt [Sun, 4 Oct 2020 01:17:37 +0000 (20:17 -0500)]
staging: rtl8723bs: replace _RND4 with round_up()

Use round_up instead of inline _RND4.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201004011743.10750-2-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: replace RND4 with round_up()
Ross Schmidt [Sun, 4 Oct 2020 01:17:36 +0000 (20:17 -0500)]
staging: rtl8723bs: replace RND4 with round_up()

Use round_up instead of define RND4.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201004011743.10750-1-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: qlge: fix build breakage with dumping enabled
Coiby Xu [Fri, 2 Oct 2020 23:59:41 +0000 (07:59 +0800)]
staging: qlge: fix build breakage with dumping enabled

This fixes commit 0107635e15ac
("staging: qlge: replace pr_err with netdev_err") which introduced an
build breakage of missing `struct ql_adapter *qdev` for some functions
and a warning of type mismatch with dumping enabled, i.e.,

$ make CFLAGS_MODULE="-DQL_ALL_DUMP -DQL_OB_DUMP -DQL_CB_DUMP \
    -DQL_IB_DUMP -DQL_REG_DUMP -DQL_DEV_DUMP" M=drivers/staging/qlge

qlge_dbg.c: In function ‘ql_dump_ob_mac_rsp’:
qlge_dbg.c:2051:13: error: ‘qdev’ undeclared (first use in this function); did you mean ‘cdev’?
 2051 |  netdev_err(qdev->ndev, "%s\n", __func__);
      |             ^~~~
qlge_dbg.c: In function ‘ql_dump_routing_entries’:
qlge_dbg.c:1435:10: warning: format ‘%s’ expects argument of type ‘char *’, but argument 3 has type ‘int’ [-Wformat=]
 1435 |        "%s: Routing Mask %d = 0x%.08x\n",
      |         ~^
      |          |
      |          char *
      |         %d
 1436 |        i, value);
      |        ~
      |        |
      |        int
qlge_dbg.c:1435:37: warning: format ‘%x’ expects a matching ‘unsigned int’ argument [-Wformat=]
 1435 |        "%s: Routing Mask %d = 0x%.08x\n",
      |                                 ~~~~^
      |                                     |
      |                                     unsigned int

Note that now ql_dump_rx_ring/ql_dump_tx_ring won't check if the passed
parameter is a null pointer.

Fixes: 0107635e15ac ("staging: qlge: replace pr_err with netdev_err")
Reported-by: Benjamin Poirier <benjamin.poirier@gmail.com>
Suggested-by: Benjamin Poirier <benjamin.poirier@gmail.com>
Reviewed-by: Benjamin Poirier <benjamin.poirier@gmail.com>
Signed-off-by: Coiby Xu <coiby.xu@gmail.com>
Link: https://lore.kernel.org/r/20201002235941.77062-1-coiby.xu@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>