Since the code for multicast filtering has been dropped, the function
hif_set_data_filtering() is only called to disable multicast filtering.
In fact, the multicast filtering is already disabled by default. So,
this function is useless and can be dropped.
The device allows to filter multicast frames. The driver has the
necessary code to take advantage of this feature. However, some bugs
has been reported on this feature. So, it was temporary disabled.
Finally, the things work well as-is for more than one year now. So there
is no plan to enable this feature in near future.
The Secure Link (slk) feature allows to encrypt (and authenticate) the
traffic between the host and the device. The official implementation of
this feature relies on mbedTLS. For that reason, this implementation is
not included in the current driver. To be included, the implementation
has to rely on kernel crypto API instead of mbedTLS.
So, for now, the driver contained stub functions waiting for the new
implementation based on kernel crypto API.
This new implementation represent a bunch of work and it is unlikely to
be done in near future. Moreover, we strongly dislike to maintain
useless code. So, drop all the code related to secure link.
Whoever wants to implement secure link should revert this patch before
starting to work on it.
The file hif_tx_mib.c expects to contain functions that format messages
for the hardware. It is unexpected to find function that manipulate
RCU and structures from mac80211.
Keep hif_set_association_mode() with the code necessary for message
formatting and relocate the smart part in wfx_join_finalize().
Merge tag 'iio-for-5.10a-take2' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
First set of new device support, features and cleanup for IIO in 5.10 cycle, take 2
A few changes to how I write this cover letter.
* Started to use manufacturer prefixes to group changes better.
* Stop list minor formatting etc changes.
* Whilst I appreciate those changes, we don't need to call them out here.
New device support:
* adi,adxrs290
- New driver for this gyroscope with dt bindings. One fix follows.
* ams,as73211
- New driver for this colour sensor with dt bindings. Also includes
docs for XYZ modifiers as used for the CIE colour space. Sysfs docs.
* atlas,atlas-ezo-sensor
- Support O_2 sensor, includes new modifier for concentration.
- Support humidity sensor.
* ti,hdc2010
- New driver support hdc2010 and hdc2080 humidity sensors. Includes dt
bindings.
Cleanup, minor fixes and features
* core
- Make the trigger related stub functions static inline, avoiding some build
warnings.
- buffer-dmaengine. Allow adjusting bytes_used with residue info.
* dev_error_probe to replace open coded equivalent in many drivers.
* docs and comment fixes
- Fix some typos, doubled words, capitalisation and punctuation.
* dt binding conversions to yaml
- lltc,ltc2497
- lltc,ltc2632
- maxim,max11100
- maxim,max1118
- maxim,max9611
- microchip,mcp3201
- microchip,mcp342x (add to trivial devices)
- ti,adc0832
- ti,adc108s102
- ti,adc128s052
- ti,adc161s626
- ti,ads8344
- ti,tlc4541 (includes adding an accidentally dropped original binding doc)
* adi,adi-axi-adc
- Use kobj_to_dev instead of open coding.
* adi,ad5686
- Constify iio_chan_spec
* adi,ad8366
- Add HMC1119 to kconfig help text as the driver supports it.
* adi,ad9523
- Use devm for reset of probe and drop remove.
* adi,adxl372
- Tidy up alignment
- Add OF table
- Add peak mode support with some docs.
* bosch,bma220 (general tidy up)
- Fix some return codes.
- Use read_avail callback rather than open coding attrs.
- Use dev_get_drvdata rather than dance via to_spi_device()
- Mark PM functions as __maybe_unused rather than #ifdef fun.
- Drop ACPI_PTR protections and ifdefs.
- Tidy up header ordering.
- BIT and GENMASK
* broadcom,bcm_iproc
- Drop of_match_ptr protection and switch to mod_devicetable.h
Part of general move to get this anti-pattern out of IIO.
* melexis,mlx90614
- Simplify some calculations.
- Add some kernel_doc
- Use regmap poll loop rather than open coding.
- Add extended calibration option.
* sensortec,sx9310, wide ranging set of fixes and cleanups.
- Document dt-binding.
- Rename some macros to align better with spec sheet
- Fix some issues with irq handling.
- Drop of_match_ptr and ACPI_PTR macros to avoid unused warnings etc.
- Switch to probe_new
- Fix memory alignment for iio_push_to_buffers_with_timestamp()
- Use long for bitmaps to allow use of for_each_bit_set()
- Use regmap_read_poll instead of opencoding.
- Simplify error paths
- Enabled regulators at probe.
- Use trigger flags from firmware rather than forcing them in the driver.
* ti,adc081c
- Drop ACPI IDs that are not likely to be official ones and we don't believe
anyone is using.
* ti,adc108s102
- Drop CONFIG_OF and of_match_ptr protections.
* ti,adc128s052
- Drop of_match_ptr protection and include mod_devicetable.h
* ti,dac5571
- Support powerdown for mutlichannel usecases.
* xpowers,axp20x
- Convert from OF to generic fw / device properties. Unlikely anyone will
use this with anything other than devicetree, but this is part of a
general move across IIO.
* tag 'iio-for-5.10a-take2' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (96 commits)
drivers/iio/humidity/hdc2010.c:305:2-3: Unneeded semicolon
iio: accel: bma220: Remove unneeded blank lines
iio: accel: bma220: Use BIT() and GENMASK() macros
iio: accel: bma220: Group IIO headers together
iio: accel: bma220: Drop ACPI_PTR() and accompanying ifdeffery
iio: accel: bma220: Mark PM functions as __maybe_unused
iio: accel: bma220: Use dev_get_drvdata() directly
iio: accel: bma220: Convert to use ->read_avail()
iio: accel: bma220: Fix returned codes from bma220_init(), bma220_deinit()
dt-bindings: iio: adc: microchip,mcp3201 yaml conversion.
iio: buffer-dmaengine: adjust `bytes_used` with residue info
dt-bindings: iio: adc: ti,tlc4541 binding conversion
dt-bindings: iio: adc: tlc4541 - recover accidentally dropped binding doc
dt-bindings: iio: adc: ti,ads8344 yaml conversion
dt-bindings: iio: adc: ti,adc128s052 yaml conversion.
dt-bindings: iio: adc: ti,adc0832 yaml conversion.
dt-bindings: iio: adc: ti,adc161s626 yaml conversion.
dt-bindings: iio: adc: lltc,ltc2497 yaml conversion.
dt-bindings: iio: adc: ti,adc108s102 yaml conversion
dt-bindings: trivial-devices: Add mcp342x ADCs and drop separate binding doc.
...
staging: tegra-vde: fix common struct sg_table related issues
The Documentation/DMA-API-HOWTO.txt states that the dma_map_sg() function
returns the number of the created entries in the DMA address space.
However the subsequent calls to the dma_sync_sg_for_{device,cpu}() and
dma_unmap_sg must be called with the original number of the entries
passed to the dma_map_sg().
struct sg_table is a common structure used for describing a non-contiguous
memory buffer, used commonly in the DRM and graphics subsystems. It
consists of a scatterlist with memory pages and DMA addresses (sgl entry),
as well as the number of scatterlist entries: CPU pages (orig_nents entry)
and DMA mapped pages (nents entry).
It turned out that it was a common mistake to misuse nents and orig_nents
entries, calling DMA-mapping functions with a wrong number of entries or
ignoring the number of mapped entries returned by the dma_map_sg()
function.
To avoid such issues, lets use a common dma-mapping wrappers operating
directly on the struct sg_table objects and use scatterlist page
iterators where possible. This, almost always, hides references to the
nents and orig_nents entries, making the code robust, easier to follow
and copy/paste safe.
Andy Shevchenko [Mon, 31 Aug 2020 09:08:10 +0000 (12:08 +0300)]
iio: accel: bma220: Drop ACPI_PTR() and accompanying ifdeffery
The driver is quite likely used only on ACPI based platforms and
rarely build with CONFIG_ACPI=n. Even though, the few dozens of bytes
is better than ugly ifdeffery and inclusion of heavy header.
As a result, replace acpi.h with mod_devicetable.h.
Drops the deprecated compatibles without the vendor name.
Whilst the driver continues to support these for old dt blobs,
any dt bindings that are actuallly verified against this document should
be fixed to add the vendor name.
Added the #io-channel-cells property to allow for consumers.
iio: buffer-dmaengine: adjust `bytes_used` with residue info
A transfer may fall shorter than the bytes in the block.
This information is available in the residue from the DMA engine, so we can
compute actual `bytes_used` with that by subtracting the residue.
Simple binding so easy to convert.
Dropped the stated value of maximum spi bus frequency as it does
not seem to correspond to the datasheet. The value of 200kHz
is the max sampling frequency of the ADC, not the clock frequency of
the SPI bus.
Added #io-channel-cells to allow use as a provider of channels to
other devices via the consumer binding.
Simple conversion for this ADC driver. Note that I haven't put
limits on the spi-max-sampling-frequency because the adc161s626
doesn't state one clearly defined value.
Added the #io-channel-cells property to allow for consumers.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Rob Herring <robh@kernel.org> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> Cc: Matt Ranostay <matt.ranostay@konsulko.com> Link: https://lore.kernel.org/r/20200809111753.156236-6-jic23@kernel.org
dt-bindings: trivial-devices: Add mcp342x ADCs and drop separate binding doc.
These i2c devices have simple bindings, well described by trivial-device.yaml
so rather than convert the binding doc to yaml, let us just add them to
trivial devices and drop the old binding document.
Stefan Popa [Mon, 10 Aug 2020 09:32:56 +0000 (12:32 +0300)]
iio: accel: adxl372: Add support for FIFO peak mode
By default, if all three channels (x, y, z) are enabled, sample sets of
concurrent 3-axis data is stored in the FIFO. This patch adds the option
to configure the FIFO to store peak acceleration (x, y and z) of every
over-threshold event. When pushing to iio buffer we push only enabled
axis data.
Currently the driver configures adxl372 to work in loop mode.
The inactivity and activity timings decide how fast the chip
will loop through the awake and waiting states and the
thresholds on x,y,z axis decide when activity or inactivity
will be detected.
This patch adds standard events sysfs entries for the inactivity
and activity timings: thresh_falling_period/thresh_rising_period
and for the in_accel_x_thresh_falling/rising_value.
Crt Mori [Tue, 18 Aug 2020 21:37:37 +0000 (23:37 +0200)]
iio:temperature:mlx90632: Some stylefixing leftovers
There is some inconsistency and whitespace cleanup performed in this
patch. It was done on top of my other patches, but I can rebase to head
of the togreg branch if it would go in sooner.
For some time the market wants medical grade accuracy in medical range,
while still retaining the declared accuracy outside of the medical range
within the same sensor. That is why we created extended calibration
which is automatically switched to when object temperature is too high.
This patch also introduces the object_ambient_temperature variable which
is needed for more accurate calculation of the object infra-red
footprint as sensor's ambient temperature might be totally different
than what the ambient temperature is at object and that is why we can
have some more errors which can be eliminated. Currently this temperature
is fixed at 25, but the interface to adjust it by user (with external
sensor or just IR measurement of the other object which acts as ambient),
will be introduced in another commit.
Crt Mori [Tue, 18 Aug 2020 21:37:33 +0000 (23:37 +0200)]
iio:temperature:mlx90632: Reduce number of equal calulcations
TAdut4 was calculated each iteration although it did not change. In light
of near future additions of the Extended range DSP calculations, this
function refactoring will help reduce unrelated changes in that series as
well as reduce the number of new functions needed.
iio: multiplexer: iio-mux: Simplify with dev_err_probe()
Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and also it prints the error value.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Peter Rosin <peda@axentia.se> Link: https://lore.kernel.org/r/20200829064726.26268-18-krzk@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and also it prints the error value.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Peter Rosin <peda@axentia.se> Link: https://lore.kernel.org/r/20200829064726.26268-12-krzk@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
iio: chemical: scd30: Simplify with dev_err_probe()
Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and also it prints the error value.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Tomasz Duszynski <tomasz.duszynski@octakon.com> Link: https://lore.kernel.org/r/20200829064726.26268-11-krzk@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
iio: afe: iio-rescale: Simplify with dev_err_probe()
Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and also it prints the error value.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Peter Rosin <peda@axentia.se> Link: https://lore.kernel.org/r/20200829064726.26268-9-krzk@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
iio: adc: meson_saradc: Simplify with dev_err_probe()
Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and also it prints the error value.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Link: https://lore.kernel.org/r/20200829064726.26268-6-krzk@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
iio: adc: envelope-detector: Simplify with dev_err_probe()
Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and also it prints the error value.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Peter Rosin <peda@axentia.se> Link: https://lore.kernel.org/r/20200829064726.26268-3-krzk@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: devicetree@vger.kernel.org Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Tian Tao [Thu, 20 Aug 2020 03:01:26 +0000 (11:01 +0800)]
iio: adc: adi-axi-adc: Use kobj_to_dev() instead of container_of()
Use kobj_to_dev() instead of container_of()
Signed-off-by: Tian Tao <tiantao6@hisilicon.com> Acked-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
The driver for the as73211 light sensor provides the following not yet
documented sysfs entries:
- in_intensity_(x|y|z)_raw
- in_intensity_(x|y|z)_scale
- in_intensity_sampling_frequency(_available)
- in_intensity_hardwaregain(_available)
- in_intensity_integration_time
Signed-off-by: Christian Eggers <ceggers@arri.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
iio:adc:axp20x: Convert from OF to generic fw / device properties
Whilst fairly unlikely anyone will ever use this driver with anything
other than DT, we are trying to move IIO over to the generic interfaces
where easy to do so.
In this case this involved moving to generic check on presence
of fwnode, generic device_get_match_data() and dropping the of_match_ptr
protection. Also relevant header changes to have property.h and
mod_devicetable.h only.
Also drop the casting away of a const in favour of retaining
the const throughout.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Quentin Schulz <quentin.schulz@bootlin.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Jonathan Cameron [Tue, 21 Jul 2020 17:14:41 +0000 (18:14 +0100)]
iio:adc:ti-adc081c: Drop ACPI ids that seem very unlikely to be official.
We have no known users of these in the wild.
it seems very unlikely these are real IDs having the form ADCXXXX
as that ID is owned by Achnor Datacomm not TI.
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Jonathan Cameron [Tue, 21 Jul 2020 17:14:42 +0000 (18:14 +0100)]
iio:adc:ti-adc108s102: Drop CONFIG_OF and of_match_ptr protections
I'm trying to clean this (now) anti-pattern out of IIO to avoid
cut and paste into new drivers.
Also add an include of mod_devicetable.h as the driver directly uses
struct of_device_id which is defined in there.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Jan Kiszka <jan.kiszka@siemens.com>
Jonathan Cameron [Tue, 21 Jul 2020 17:14:43 +0000 (18:14 +0100)]
iio:adc:ti-adc128s052: drop of_match_ptr protection
There is no real advantage in having these protections and
for parts that do not have an explicit ACPI ID, it prevents the
use of PRP0001. I'm trying to clear this out of IIO in general
to avoid copying in new drivers.
Include mod_devicetable.h as we are using of_device_id in here so
including that header is best practice.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Jonathan Cameron [Tue, 21 Jul 2020 17:14:44 +0000 (18:14 +0100)]
iio:adc:bcm_iproc: Drop of_match_ptr protection and switch to mod_devicetable.h
This driver cannot be instantiated from ACPI due to it's use of
syscon_regmap_lookup_by_phandle() but in the interests of clearing
this anti pattern out of IIO, let us switch to an explicit
check in Kconfig and remove the protections on the of_match_table
The switch of header is because we only use of_device_id
in here and that is defined in mod_devicetable.h not of.h.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
iio: dac: dac5571: Support powerdown for multi-channel
The driver currently only allows channel 0 to be powered down but the
multi-channel variants of the hardware allow each channel to be powered
down separately and with separate power down modes. Add support for
this.
Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com> Acked-by: Sean Nyekjaer <sean@geanix.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Add driver support for HDC2010/2080 series devices and sysfs
documentation for their heater element.
HDC2010 is an integrated high-accuracy humidity and temperature sensor
with very low power consumption. The device includes a resistive heating
element. The temperature range is -40C to 125C with 0.2C
accuracy. Humidity measurement is 0 to 100% with 2% RH accuracy.
Signed-off-by: Eugene Zaikonnikov <ez@norphonic.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Stephen Boyd [Mon, 3 Aug 2020 23:58:15 +0000 (17:58 -0600)]
iio: sx9310: Use irq trigger flags from firmware
We shouldn't need to set default irq trigger flags here as the firmware
should have properly indicated the trigger type, i.e. level low, in the
DT or ACPI tables.
Signed-off-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Daniel Campello <campello@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Stephen Boyd [Mon, 3 Aug 2020 23:58:14 +0000 (17:58 -0600)]
iio: sx9310: Enable vdd and svdd regulators at probe
Enable the main power supply (vdd) and digital IO power supply (svdd)
during probe so that the i2c communication and device works properly on
boards that aggressively power gate these supplies.
Signed-off-by: Stephen Boyd <swboyd@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Daniel Campello <campello@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Stephen Boyd [Mon, 3 Aug 2020 23:58:13 +0000 (17:58 -0600)]
iio: sx9310: Drop channel_users[]
This struct member isn't used. Drop it.
Fixes: 72ad02b15d63 ("iio: Add SEMTECH SX9310/9311 sensor driver") Signed-off-by: Stephen Boyd <swboyd@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Daniel Campello <campello@chromium.org> Signed-off-by: Daniel Campello <campello@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Daniel Campello [Mon, 3 Aug 2020 23:58:12 +0000 (17:58 -0600)]
iio: sx9310: Miscellaneous format fixes
Miscellaneous format fixes throughout the whole file.
Signed-off-by: Daniel Campello <campello@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Daniel Campello [Mon, 3 Aug 2020 23:58:11 +0000 (17:58 -0600)]
iio: sx9310: Use variable to hold &client->dev
Improves readability by storing &client->dev in a local variable.
Signed-off-by: Daniel Campello <campello@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Daniel Campello [Mon, 3 Aug 2020 23:58:10 +0000 (17:58 -0600)]
iio: sx9310: Simplify error return handling
Checks for non-zero return values to signal error conditions.
Signed-off-by: Daniel Campello <campello@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Daniel Campello [Mon, 3 Aug 2020 23:58:08 +0000 (17:58 -0600)]
iio: sx9310: Use regmap_read_poll_timeout() for compensation
Simplify compensation stage by using regmap_read_poll_timeout().
Signed-off-by: Daniel Campello <campello@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>