aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/iio/gyro (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-07-20iio: gyro: fxas21002c: Move 'fxas21002c_reg_fields' to the only file its usedLee Jones2-66/+66
'fxas21002c_reg_fields' is only used in '*core*', meaning that '*i2c*' and '*spi*' complain of a defined but not used const variable. Let's move it into the source file. Fixes the following W=1 kernel build warning(s): In file included from drivers/iio/gyro/fxas21002c_i2c.c:14: drivers/iio/gyro/fxas21002c.h:79:31: warning: ‘fxas21002c_reg_fields’ defined but not used [-Wunused-const-variable=] 79 | static const struct reg_field fxas21002c_reg_fields[] = { | ^~~~~~~~~~~~~~~~~~~~~ In file included from drivers/iio/gyro/fxas21002c_spi.c:14: drivers/iio/gyro/fxas21002c.h:79:31: warning: ‘fxas21002c_reg_fields’ defined but not used [-Wunused-const-variable=] 79 | static const struct reg_field fxas21002c_reg_fields[] = { | ^~~~~~~~~~~~~~~~~~~~~ Cc: Rui Miguel Silva <rmfrfs@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-06-20iio: Move attach/detach of the poll func to the coreLars-Peter Clausen3-21/+4
All devices using a triggered buffer need to attach and detach the trigger to the device in order to properly work. Instead of doing this in each and every driver by hand move this into the core. At this point in time, all drivers should have been resolved to attach/detach the poll-function in the same order. This patch removes all explicit calls of iio_triggered_buffer_postenable() & iio_triggered_buffer_predisable() in all drivers, since the core handles now the pollfunc attach/detach. The more peculiar change is for the 'at91-sama5d2_adc' driver, since it's not immediately obvious that removing the hooks doesn't break anything. Eugen was able to test on at91-sama5d2-adc driver, sama5d2-xplained board. All seems to be fine. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Tested-by: Eugen Hristev <eugen.hristev@microchip.com> #for at91-sama5d2-adc Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-06-14iio: remove explicit IIO device parent assignmentAlexandru Ardelean11-11/+0
This patch applies the semantic patch: @@ expression I, P, SP; @@ I = devm_iio_device_alloc(P, SP); ... - I->dev.parent = P; It updates 302 files and does 307 deletions. This semantic patch also removes some comments like '/* Establish that the iio_dev is a child of the i2c device */' But this is is only done in case where the block is left empty. The patch does not seem to cover all cases. It looks like in some cases a different variable is used in some cases to assign the parent, but it points to the same reference. In other cases, the block covered by ... may be just too big to be covered by the semantic patch. However, this looks pretty good as well, as it does cover a big bulk of the drivers that should remove the parent assignment. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-10iio: hid-sensors: move triggered buffer setup into hid_sensor_setup_triggerAlexandru Ardelean1-14/+4
The main intent here is to get rid of the iio_buffer_set_attrs() helper, or at least rework it's usage a bit. The problem with that helper is that it needs a pointer to the buffer, which makes supporting multiple buffers per IIO device a bit more cumbersome. The hid_sensor_setup_trigger() is pretty much used in the same way: - iio_triggered_buffer_setup() gets called before - then hid_sensor_setup_trigger() and hid_sensor_setup_batch_mode() gets called which may attach some fifo attributes This change merges the 2 together under the hid_sensor_setup_trigger() function. Only the &iio_pollfunc_store_time is passed to all devices, so it's not even required to pass it explicitly outside of the common hid_sensor_setup_trigger() function. Moving the devm_iio_triggered_buffer_setup/cleanup() calls into the common place code can help the rework of the buffer code, since it is in one place. One detail of the change is that there are 2 drivers that use devm_iio_triggered_buffer_setup(). That function gets implicitly replaced with iio_triggered_buffer_setup()/cleanup(), but since all drivers call both hid_sensor_setup_trigger9) & hid_sensor_remove_trigger() trigger, the iio_triggered_buffer_cleanup() piggy backs on the hid_sensor_remove_trigger() call, which should cover the cleanup. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: imu: adis16xxx: use helper to access iio core debugfs dirAlexandru Ardelean1-6/+4
The IIO core provides a iio_get_debugfs_dentry() helper. It seems that the ADIS IMU drivers access that field directly. This change converts them to use iio_get_debugfs_dentry() instead. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Acked-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-05-03iio: gyro: adis16130: Use get_unaligned_be24()Andy Shevchenko1-1/+3
This makes the driver code slightly easier to read. Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Michael Hennerich <Michael.Hennerich@analog.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19iio: gyro: mpu3050: Use vsprintf extension %pe for symbolic error nameNishant Malpani1-2/+2
Utilize %pe format specifier from vsprintf while printing error logs with dev_err(). Discards the use of unnecessary explicit casting and prints symbolic error name which might prove to be convenient during debugging. Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19iio: gyro: bmg160_spi: Use vsprintf extension %pe for symbolic error nameNishant Malpani1-2/+2
Utilize %pe format specifier from vsprintf while printing error logs with dev_err(). Discards the use of unnecessary explicit casting and prints symbolic error name which might prove to be convenient during debugging. Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19iio: gyro: bmg160_i2c: Use vsprintf extension %pe for symbolic error nameNishant Malpani1-2/+2
Utilize %pe format specifier from vsprintf while printing error logs with dev_err(). Discards the use of unnecessary explicit casting and prints symbolic error name which might prove to be convenient during debugging. Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19iio/gyro/bmg160: Add support for BMI088 chipMike Looijmans3-1/+4
The BMI088 is pin-compatible with the BMI055, and provides both gyro and accel functions. The gyro part is similar to the BMI055 and this adds the chip to the list of supported devices for the gyro part. The accel part of the chip is not compatible with anything existing already. Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-03-21iio: st_sensors: Drop unneeded explicit castingsAndy Shevchenko2-6/+6
In few places the unnecessary explicit castings are being used. Drop them for good. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-03-08iio: imu: adis: Add self_test_reg variableNuno Sá2-0/+2
This patch adds a dedicated self_test_reg variable. This is also a step to let new drivers make use of `adis_initial_startup()`. Some devices use MSG_CTRL reg to request a self_test command while others use the GLOB_CMD register. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-03-08iio: gyro: adis16136: initialize adis_data staticallyAlexandru Ardelean1-40/+21
This change overrides commit 380b107bbf944 ("iio: adis: Introduce timeouts structure"). It removes the memory allocation and moves the 'adis_data' information to be static on the chip_info struct. This also adds a timeout structure to ADIS16334, since it was initially omitted. This was omitted (by accident) when the change was done. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-01-13iio: st_sensors: Make use of device propertiesAndy Shevchenko2-10/+2
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>
2020-01-13iio: st_sensors: Drop redundant parameter from st_sensors_of_name_probe()Andy Shevchenko2-4/+2
Since we have access to the struct device_driver and thus to the ID table, there is no need to supply special parameters to st_sensors_of_name_probe(). Besides that we have a common API to get driver match data, there is no need to do matching separately for OF and ACPI. Taking into consideration above, simplify the ST sensors code. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-01-13iio: st_gyro: Correct data for LSM9DS0 gyroAndy Shevchenko1-1/+74
The commit 41c128cb25ce ("iio: st_gyro: Add lsm9ds0-gyro support") assumes that gyro in LSM9DS0 is the same as others with 0xd4 WAI ID, but datasheet tells slight different story, i.e. the first scale factor for the chip is 245 dps, and not 250 dps. Correct this by introducing a separate settings for LSM9DS0. Fixes: 41c128cb25ce ("iio: st_gyro: Add lsm9ds0-gyro support") Depends-on: 45a4e4220bf4 ("iio: gyro: st_gyro: fix L3GD20H support") Cc: Leonard Crestez <leonard.crestez@nxp.com> Cc: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-01-12iio: adis: Remove startup_delayNuno Sá2-2/+0
All timeouts are now handled by a dedicated timeout struct. This variable is no longer needed. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-01-12iio: adis: Introduce timeouts structureNuno Sá2-1/+46
The adis library only allows to define a `startup_delay` which for some devices is enough. However, other devices define different timeouts with significantly different timings which could lead to devices to not wait enough time or to wait a lot more than necessary (which is not efficient). This patch introduces a new timeout struct that must be passed into `adis_init()`. There are mainly, for now, three timeouts used. This is also an introductory patch with the goal of refactoring `adis_initial_startup()`. New driver's (eg: adis16480, adis16460) are replicating code for the device initial setup. With some changes (being this the first one) we can pass this to `adis_initial_startup()`. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-12-29iio: gyro: st_gyro: Mark gyro_pdata with __maybe_unusedAndy Shevchenko1-1/+1
Since we put static variable to a header file it's copied to each module that includes the header. But not all of them are actually used it. Mark gyro_pdata with __maybe_unused to calm a compiler down: In file included from drivers/iio/gyro/st_gyro_i2c.c:18: drivers/iio/gyro/st_gyro.h:31:46: warning: ‘gyro_pdata’ defined but not used [-Wunused-const-variable=] 31 | static const struct st_sensors_platform_data gyro_pdata = { | ^~~~~~~~~~ ... Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-12-15iio: itg3200: Drop GPIO includeLinus Walleij1-1/+0
The driver include <linux/gpio.h> yet does not use any of the symbols from the header, so drop the include. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-12-01iio: Fix Kconfig indentationKrzysztof Kozlowski1-16/+16
Adjust indentation from spaces to tab (+optional two spaces) as in coding style with command like: $ sed -e 's/^ /\t/' -i */Kconfig Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-23iio: gyro: adis16260: replace mlock with ADIS lib's state_lockAlexandru Ardelean1-3/+3
This change uses the ADIS library's state_lock to protect the state of the `max_speed_hz` change that is done during the set of the sampling frequency. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-23iio: gyro: adis16136: rework locks using ADIS library's state lockAlexandru Ardelean1-10/+21
This replaces indio_dev's mlock with the state lock/mutex from the ADIS library. The __adis16136_get_freq() function has been prefixed to mark it as unlocked. The adis16136_{set,get}_filter() functions now hold the state lock for all the ops that they do. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-03iio: gyro: adis16136: check ret val for non-zero vs less-than-zeroAlexandru Ardelean1-12/+12
The ADIS library functions return zero on success, and negative values for error. Positive values aren't returned, but we only care about the success value (which is zero). This change is mostly needed so that the compiler won't make any inferences about some about values being potentially un-initialized. This only triggers after making some functions inline, because the compiler can better follow return paths. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-27iio: st: Drop GPIO includeLinus Walleij1-1/+0
None of the ST sensor drivers use any symbols from <linux/gpio.h>, just drop the include from all of them. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-18iio: gyro: mpu3050: Explicity make a 'poison' value big endianJonathan Cameron1-1/+1
This clearly has no actual affect but it does show sparse and similar static analysers that we are doing this intentionally. CHECK drivers/iio/gyro/mpu3050-core.c drivers/iio/gyro/mpu3050-core.c:546:48: warning: incorrect type in assignment (different base types) drivers/iio/gyro/mpu3050-core.c:546:48: expected restricted __be16 <noident> drivers/iio/gyro/mpu3050-core.c:546:48: got int Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
2019-10-07iio: gyro: clean up indentation issueColin Ian King1-1/+1
There is a return statement that is indented incorrectly, add in the missing tab. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-05iio: gyro: adis16080: replace mlock with own lockAlexandru Ardelean1-2/+6
The lock is used to protect the buffer during reads. Though the spi routines have their own locks, it may be the case that the buffer needs to be protected before it's stored and passed to the IIO read hooks. indio_dev's mlock was used before. This change replaces it with the driver's own lock. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-05iio: gyro: adis16130: remove mlock usageAlexandru Ardelean1-2/+0
The use of indio_dev's mlock is discouraged. The driver already defines it's own `bus_lock` in `adis16130_spi_read()`, so using the mlock is redundant. The parts supported by this chip are obsoleted anyway, so for now we just remove mlock as part of a general cleanup, until the driver gets removed. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-08-11iio:st_sensors: remove buffer allocation at each buffer enableDenis Ciocca1-11/+1
This patch is removing the buffer allocation at each buffer enable. We just allocate enough memory in the main structure during probe to cover maximum size needed (that anyway is pretty small) [16bytes]. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-08-05iio: remove get_irq_data_ready() function pointer and use IRQ number directlyDenis Ciocca1-4/+3
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>
2019-08-05iio:gyro: preenable/postenable/predisable fixup for ST gyro bufferDenis Ciocca1-25/+24
This patch is trying to cleanup for good the buffers operation functions. There is no need of using preenable, all can be done into postenable. Let's also use logical sequence of operations as already done in accel driver. Finally also rename the goto label using operation to perform and not where it fails. Not stable material as not fixing a 'bug' but rather bringing the driver in line with general 'patterns' to allow a subsystem wide cleanup. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-07-27iio: make st_sensors drivers use regmapDenis Ciocca3-5/+5
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>
2019-07-27iio: move 3-wire spi initialization to st_sensors_spiDenis Ciocca2-4/+4
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>
2019-07-27iio:gyro: device settings are set immediately during probeDenis Ciocca2-7/+27
This patch set gyro settings right after probe start. This is done in preparation of regmap that needs different configuration based on multiread bit value. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-07-27iio:gyro: introduce st_gyro_get_settings() functionDenis Ciocca2-0/+19
The function is introduced to retrieve gyro device settings. It will be used by probe in order to configure regmap. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner2-8/+2
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Enrico Weigelt <info@metux.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 335Thomas Gleixner1-14/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms and conditions of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 51 franklin st fifth floor boston ma 02110 1301 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 111 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190530000436.567572064@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288Thomas Gleixner1-9/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms and conditions of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 263 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190529141901.208660670@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 177Thomas Gleixner7-13/+7
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>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157Thomas Gleixner1-11/+1
Based on 3 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version [author] [kishon] [vijay] [abraham] [i] [kishon]@[ti] [com] this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version [author] [graeme] [gregory] [gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i] [kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema] [hk] [hemahk]@[ti] [com] this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 1105 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: Kate Stewart <kstewart@linuxfoundation.org> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070033.202006027@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 149Thomas Gleixner3-6/+3
Based on 1 normalized pattern(s): licensed under the gpl 2 or later extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 82 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Richard Fontana <rfontana@redhat.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190524100845.150836982@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-21treewide: Add SPDX license identifier - Makefile/KconfigThomas Gleixner1-0/+1
Add SPDX license identifiers to all Make/Kconfig files which: - Have no license information of any form These files fall under the project license, GPL v2 only. The resulting SPDX license identifier is: GPL-2.0-only Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-21treewide: Add SPDX license identifier for more missed filesThomas Gleixner4-0/+4
Add SPDX license identifiers to all files which: - Have no license information of any form - Have MODULE_LICENCE("GPL*") inside which was used in the initial scan/conversion to ignore the file These files fall under the project license, GPL v2 only. The resulting SPDX license identifier is: GPL-2.0-only Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-25Merge tag 'iio-for-5.2b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-nextGreg Kroah-Hartman7-1/+1319
Jonathan writes: Second set of IIO new device support, features and cleanup for the 5.2 cycle. New device suport * ad7606 - Support the AD7616 16 channel, 12bit ADC. * fxas21002c - New driver for this gyroscope with I2C and SPI support. * lsm6dsx - Support the lsm6dsr, new device information structure and dt bindings. * srf04 - Addition device IDs for mb1000, mb1010, mb1020, mb1030 and mb1040 + support of different required trigger pulse lengths. * st-accel - Support the ls2de12, new device info and dt bindings. * ti-ads8344 - New driver for this 8 channel, 16 bit SPI ADC. Binding conversions to yaml - we have started doing these in general for IIO. * avia-hx711 * bmp085 Cleanups and minor fixes / additions * ad5758 - Fixup for some changes between preproduction parts and final part. * ad7606 - Refactor handling of oversampling to make it easy to vary between supported devices. * ad9832 - Organise includes. - Clock framework to handle clocks. * ad9834 - Drop unnecessary parenthesis. * bmc150 - Use __func__ rather than hardcoding. * dummy_evgen. - Fix a memleak on error in probe. * kxcjk1013 - Add KXCJ91008 ACPI ID as seen in the wild. - Use __func__ rather than hardcoding. * imx7d - Local dev variable to simplify code a bit. - dev_err replaces pr_err to give more info. - devm_platform_ioremap_resource for small reduction in boilerplate. - Simplify probe and remove by sharing suspend / resume logic. - Devm for iio_device_register as remove only contains the unregister. * lsm6dsx - Remove a variable that was never read. - Open code values where they are effectively described by what is assigned to them rather than using uninformative defines. * max31856 - Avoid an unintialized ret variable in a path that can't actually occur but is hard for a static checker to know. * max9611 - White space * mpu3050 - Reduce a sleep worst case by switching from msleep to usleep_range. * qcom-spmi-adc5 - Add MODULE_DEVICE_TABLE to assist autoloading of this as a module. * stm32-dfsdm - Fix missing dependencies. * stm32-timer trigger - Fix a build issue when disabled. * ti-ads7950 - Fix mising dependency on CONFIG_GPIOLIB. * tag 'iio-for-5.2b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (42 commits) iio: adc: qcom-spmi-adc5: Fix of-based module autoloading iio: dummy_evgen: fix possible memleak in evgen init iio:accel:Switch hardcoded function name with a reference to __func__ making the code more maintainable iio: adc: stm32-dfsdm: fix triggered buffer build dependency iio: adc: stm32-dfsdm: fix unmet direct dependencies detected iio: trigger: stm32-timer: fix build issue when disabled iio: imx7d_adc: Use devm_iio_device_register() iio: imx7d_adc: Simplify imx7d_adc_remove() with imx7d_adc_suspend() iio: imx7d_adc: Simplify imx7d_adc_probe() with imx7d_adc_resume() drivers/iio/gyro/mpu3050-core.c: This patch fix the following checkpatch warning. iio: dac: ad5758: Modifications for new revision iio: imu: st_lsm6dsx: inline per-sensor data iio: adc: Add driver for the TI ADS8344 A/DC chips dt-bindings: iio: adc: Add bindings for TI ADS8344 A/DC chips MAINTAINERS: add entry for fxas21002c gyro driver iio: gyro: fxas21002c: add spi driver iio: gyro: fxas21002c: add i2c driver iio: gyro: add core driver for fxas21002c iio: gyro: add DT bindings to fxas21002c Kconfig: change configuration of srf04 ultrasonic iio sensor ...
2019-04-22drivers/iio/gyro/mpu3050-core.c: This patch fix the following checkpatch warning.Mohan Kumar1-1/+1
As per Documentation/timers/timers-howto.txt Msleep < 20ms can sleep for up to 20ms. so use usleep_range. Signed-off-by: Mohan Kumar <mohankumar718@gmail.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-22iio: gyro: fxas21002c: add spi driverRui Miguel Silva3-1/+77
Add driver to talk over spi to a fxas21002c gyroscope device and use the core as main controller. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-22iio: gyro: fxas21002c: add i2c driverRui Miguel Silva3-0/+76
Add the real driver to talk over i2c and use the fxas21002c core for the main tasks. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-22iio: gyro: add core driver for fxas21002cRui Miguel Silva4-0/+1166
Add core support for the NXP fxas21002c Tri-axis gyroscope, using the iio subsystem. It supports PM operations, axis reading, temperature, scale factor of the axis, high pass and low pass filtering, and sampling frequency selection. It will have extras modules to support the communication over i2c and spi. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-21Merge 5.1-rc6 into staging-nextGreg Kroah-Hartman2-6/+8
We want the fixes in here as well as this resolves an iio driver merge issue. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>