summaryrefslogtreecommitdiffstats
path: root/drivers/iio/common/st_sensors/st_sensors_spi.c
Commit message (Collapse)AuthorAgeFilesLines
* iio:st-sensors: Move exports into IIO_ST_SENSORS namespaceJonathan Cameron2022-02-181-1/+1
| | | | | | | | | | | | | | To avoid unnecessary pollution of the global symbol namespace move the driver core and type specific core exports into their a new namespace and import that where needed. For more info see https://lwn.net/Articles/760045/ Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Denis Ciocca <denis.ciocca@st.com> Link: https://lore.kernel.org/r/20220116180535.2367780-14-jic23@kernel.org
* iio: st_sensors: remove reference to parent device object on st_sensor_dataAlexandru Ardelean2021-09-141-1/+0
| | | | | | | | | | | | | | | | | | The idea behind it, is that all devm_ calls in ST sensors are bound to the parent device object. However, the reference to that object is kept on both the st_sensor_data struct and the IIO object parent (indio_dev->dev.parent). This change only adds a bit consistency and uses the reference stored on indio_dev->dev.parent, to enforce the assumption that all ST sensors' devm_ calls are bound to the same reference as the one store on st_sensor_data. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210823112204.243255-6-aardelean@deviqon.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: st-sensors: Remove some unused includes and add some that should be thereJonathan Cameron2021-07-241-2/+1
| | | | | | | | | | | | | | | | | | | | | | | The st-sensors drivers have changed in structure over time, and includes have not always kept up with this. Let's bring them back to nearer the ideal. Identified with the include-what-you-use tool and careful checking of its suggestions. Note I haven't been particularly aggressive here, so this is just the cases where the include obviously isn't needed rather than the more subtle corners. Note I took the opportunity to add mod_devicetable.h as I generally prefer to see that when acpi or of match tables are present. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Denis Ciocca <denis.ciocca@st.com> Cc: Hans de Goede <hdegoede@redhat.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210608175149.4019289-1-jic23@kernel.org
* iio: remove left-over parent assignmentsAlexandru Ardelean2020-06-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | These were found by doing some shell magic: ------------ for file in $(git grep -w devm_iio_device_alloc | cut -d: -f1 | sort | uniq) ; do if grep 'parent =' $file | grep -v trig | grep -vq devm_; then echo "$file -> $(grep "parent =" $file)" fi done ----------- The output is bearable [after the semantic patch is applied]. There is a mix of trigger assignments with some iio device parent assignments that are removed via this patch. JC: A few more added via inspection of all parent = statements in drivers/iio. Some of these may just have crossed with this series, others were less obvious to scripting due to some cross file / module boundary calls. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: st_sensors: Drop unneeded casting when print error codeAndy Shevchenko2020-03-211-2/+2
| | | | | | | | Explicit casting in printf() usually shows that something is not okay. Here, we really don't need it by providing correct specifier. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: st_sensors: Use dev_get_platdata() to get platform_dataAndy Shevchenko2020-03-211-1/+1
| | | | | | | | Use dev_get_platdata() to get the platform_data instead of referencing it directly. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: st_sensors: Make use of device propertiesAndy Shevchenko2020-01-131-5/+7
| | | | | | | | Device property API allows to gather device resources from different sources, such as ACPI. Convert the drivers to unleash the power of device property API. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: remove get_irq_data_ready() function pointer and use IRQ number directlyDenis Ciocca2019-08-051-8/+1
| | | | | | | | Not even sure why it was there since the beginning. Just use IRQ number in the sensor_data struct. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: make st_sensors drivers use regmapDenis Ciocca2019-07-271-77/+23
| | | | | | | | | This patch is meant to replace the i2c/spi transfer functions with regmap. SPI framework requires DMA safe buffers so let's add GFP_DMA flag for memory allocation used by bulk_read functions. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* iio: move 3-wire spi initialization to st_sensors_spiDenis Ciocca2019-07-271-2/+63
| | | | | | | | | | | Some devices need to be configured with special bit in order to use spi 3-wire. This was done during device identification phase. Instead, let's move this part as spi specific. Doing this the check_device_support function becomes a simple device id check, so let's rename it. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 177Thomas Gleixner2019-05-301-2/+1
| | | | | | | | | | | | | | | | | | | | | Based on 1 normalized pattern(s): licensed under the gpl 2 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 135 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Steve Winslow <swinslow@gmail.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190528170026.071193225@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: common: remove unnecessary sizeof(u8)Fabian Frederick2014-12-121-1/+1
| | | | | | | | sizeof(u8) is always 1. Signed-off-by: Fabian Frederick <fabf@skynet.be> Acked-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:common: Set the device pointer into ST common sensors libraryDenis CIOCCA2014-10-041-0/+1
| | | | | Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:common: Use spi_sync_transfer() in STMicroelectronics common libraryDenis Ciocca2013-03-161-9/+2
| | | | | | | Use the new spi_sync_transfer() helper function instead of open-coding it. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:common: Add STMicroelectronics common libraryDenis Ciocca2013-01-311-0/+128
This patch add a generic library for STMicroelectronics 3-axis sensors. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>