This change switches to the new iio_triggered_buffer_setup_ext()
function and removes the iio_buffer_set_attrs() call, for assigning the
HW FIFO attributes to the buffer.
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200929125949.69934-9-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This change switches to the new devm_iio_triggered_buffer_setup_ext()
function and removes the iio_buffer_set_attrs() call, for assigning the
HW FIFO attributes to the buffer.
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200929125949.69934-8-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This change switches to the new devm_iio_triggered_buffer_setup_ext()
function and removes the iio_buffer_set_attrs() call, for assigning the
HW FIFO attributes to the buffer.
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200929125949.69934-7-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This change switches to the new iio_triggered_buffer_setup_ext()
function and removes the iio_buffer_set_attrs() call, for assigning the
HW FIFO attributes to the buffer.
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200929125949.69934-6-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This change switches to the new devm_iio_triggered_buffer_setup_ext()
function and removes the iio_buffer_set_attrs() call, for assigning the
HW FIFO attributes to the buffer.
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200929125949.69934-5-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This change adds a parameter to the {devm_}iio_triggered_buffer_setup()
functions to assign the extra sysfs buffer attributes that are typically
assigned via iio_buffer_set_attrs().
The functions also get renamed to iio_triggered_buffer_setup_ext() &
devm_iio_triggered_buffer_setup_ext().
For backwards compatibility the old {devm_}iio_triggered_buffer_setup()
functions are now macros wrap the new (renamed) functions with NULL for the
buffer attrs.
The aim is to remove iio_buffer_set_attrs(), so in the
iio_triggered_buffer_setup_ext() function the attributes are assigned
directly to 'buffer->attrs'.
When adding multiple IIO buffers per IIO device, it can be pretty
cumbersome to first allocate a set of buffers, then to dig them out of IIO
to assign extra attributes (with iio_buffer_set_attrs()).
Naturally, the best way would be to provide them at allocation time, which
is what this change does.
At this moment, buffers allocated with {devm_}iio_triggered_buffer_setup()
are the only ones in mainline IIO to call iio_buffer_set_attrs().
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200929125949.69934-4-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This change is mostly cosmetic, but it's also a pre-cursor to the
the change for 'iio_buffer_set_attrs()', where the helper gets updated to
better support multiple IIO buffers for 1 IIO device.
The only functional change is that the error message for the trigger alloc
failure is bound to the parent device vs the IIO device object.
Also, the new at91_adc_buffer_and_trigger_init() function was moved after
the definition of the 'at91_adc_fifo_attributes'.
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200929125949.69934-3-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
The iio_buffer_set_attrs() helper will be removed in this series. So, just
assign the attributes of the DMAEngine buffer logic directly.
This is IIO buffer core context, so there is direct access to the
buffer->attrs object.
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200929125949.69934-2-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Extremely 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: Jandy Gou <qingsong.gou@ck-telecom.com>
Link: https://lore.kernel.org/r/20201031182922.743153-7-jic23@kernel.org
This binding is so simple there is no obvious advantage in maintaining
a separate binding doc file for it. As such, move it to trivial-devices.yaml
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Simon Horman <horms+renesas@verge.net.au>
Link: https://lore.kernel.org/r/20201031182922.743153-6-jic23@kernel.org
Simple SPI binding that doesn't need a separate file.
During conversion I looked up the individual part number descriptions
in the datasheet so that we could give slightly more detail in
trivial-device.yaml.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Slawomir Stepien <sst@poczta.fm>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Maury Anderson <maury.anderson@rockwellcollins.com>
Cc: Matthew Weber <matthew.weber@rockwellcollins.com>
Cc: Slawomir Stepien <sst@poczta.fm>
Link: https://lore.kernel.org/r/20201031182922.743153-5-jic23@kernel.org
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
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
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
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
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
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
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
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
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
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
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
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
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
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>
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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>
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>
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>
- 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>