aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/accel (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-06-04iio: adis: Cleanout unused headersJonathan Cameron2-12/+0
0-day recently added the include-what-you-use header checker and it gave a warning on an adis patch. As such I decided to run it on all the adis drivers and see if it made sensible suggestions. Note this doesn't represent a complete list of what it suggested changing as I filtered out a few on the basis they are standard headers used to effectively include a bunch of other headers. Could split this into a patch per driver if people prefer. Note to anyone else trying this tool is that it is somewhat of a loose cannon so you will be wanting to carefully check any suggestions before proposing patches! I thought about also reorganising the headers whilst here, but that would make this patch harder to read, or lead to another rather noisy patch across most of the files. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com> Link: https://lore.kernel.org/r/20210603193616.3708447-1-jic23@kernel.org
2020-10-26staging: iio: adis16240: add blank line before struct definitionDeepak R Varma1-0/+1
Add a blank line before starting structure definition as per coding style guidelines. Issue reported by checkpatch script. Acked-by: Julia Lawall <julia.lawall@inria.fr> Signed-off-by: Deepak R Varma <mh12gx2825@gmail.com> Link: https://lore.kernel.org/r/20201011104800.GA29412@ubuntu204 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-16staging: iio: adis16240: Use Managed device functionsNuno Sá1-22/+3
Use the adis managed device functions to setup the buffer and the trigger. The ultimate goal will be to completely drop the non devm version from the lib. Since we are here, drop the `.remove` callback by further using devm functions. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20200915120258.161587-10-nuno.sa@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-09-16staging: iio: adis16203: Use Managed device functionsNuno Sá1-23/+3
Use the adis managed device functions to setup the buffer and the trigger. The ultimate goal will be to completely drop the non devm version from the lib. Since we are here, drop the `.remove` callback by further using devm functions. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20200915120258.161587-9-nuno.sa@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-06-14iio: remove explicit IIO device parent assignmentAlexandru Ardelean2-2/+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-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-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-0/+14
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-15staging: iio: accel: adis16240: enforce SPI mode on probe functionRodrigo Carvalho1-0/+7
According to the datasheet, this driver supports only SPI mode 3, so we should enforce it on probe function. Signed-off-by: Rodrigo Carvalho <rodrigorsdc@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-09-15staging: iio: ADIS16240: Remove unused includeRohit Sarkar1-1/+0
'#include<linux/gpio.h>' isn't being used anywhere. Remove it. Signed-off-by: Rohit Sarkar <rohitsarkar5398@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-08-18staging: iio: accel: adis16240: Improve readability on write_raw functionRodrigo Ribeiro1-4/+1
Replace shift and minus operation by GENMASK macro and remove the local variables used to store intermediate data. Signed-off-by: Rodrigo Ribeiro Carvalho <rodrigorsdc@gmail.com> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-06-26iio: adis162xx: fix low-power docs & reportsAlexandru Ardelean2-3/+3
All current ADIS162XX drivers have incorrect values defined via comments. Also, when an error is reported the printed value is incorrect. The functionality itself isn't affected, so it's not a critical issue. And since the change is trivial, it was included in a single patch that fixes these in one go. All values were correlated with the ones specified in the data-sheets. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-05-26staging: iio: adis16240: add of_match_table entryRodrigo Ribeiro1-0/+1
This patch adds of_match_table entry in device driver in order to enable spi fallback probing. Signed-off-by: Rodrigo Ribeiro <rodrigorsdc@gmail.com> Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-05-26staging: iio: adis16240: add device to module device tableLucas Oshiro1-0/+6
Add a of_device_id struct and MODULE_DEVICE_TABLE call, in order to add device-tree support for this driver. Signed-off-by: Lucas Oshiro <lucasseikioshiro@gmail.com> Signed-off-by: Rodrigo Ribeiro <rodrigorsdc@gmail.com> Co-developed-by: Rodrigo Ribeiro <rodrigorsdc@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-05-26staging: iio: adis16203: Add of_device_id tableThiago Estrela1-0/+8
Accomplish device tree compatibility to driver ADIS16203 by adding of_device_id table and making a subsequent call to MODULE_DEVICE_TABLE. Signed-off-by: Thiago Estrela <thiagestrela@gmail.com> Signed-off-by: Tiago Napoli <napoli.tiago96@gmail.com> Co-developed-by: Tiago Napoli <napoli.tiago96@gmail.com> Signed-off-by: Pedro Sousa <pedroteosousa@gmail.com> Co-developed-by: Pedro Sousa <pedroteosousa@gmail.com> Reviewed-by: Matheus Tavares <matheus.bernardino@usp.br> Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-03staging: iio: add proper SPDX identifiers to remaining driver filesGreg Kroah-Hartman2-4/+2
There are a number of IIO staging drivers that do not have a proper SPDX identifier on it. So fix that up and at the same time, remove the "free form" license text, as that's pretty much impossible for any tool to parse. Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Michael Hennerich <Michael.Hennerich@analog.com> Cc: Jonathan Cameron <jic23@kernel.org> Cc: Hartmut Knaack <knaack.h@gmx.de> Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-03staging: add missing SPDX lines to Makefile filesGreg Kroah-Hartman1-0/+1
There are a few remaining drivers/staging/*/Makefile files that do not have SPDX identifiers in them. Add the correct GPL-2.0 identifier to them to make scanning tools happy. Reviewed-by: Mukesh Ojha <mojha@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-03staging: add missing SPDX lines to Kconfig filesGreg Kroah-Hartman1-0/+1
There are a few remaining drivers/staging/*/Kconfig files that do not have SPDX identifiers in them. Add the correct GPL-2.0 identifier to them to make scanning tools happy. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-24staging:iio:accel:adis16240: sign extend function replace hard code duplicationKarim Eshapa1-9/+2
Use sign_extend32 kernel function instead of code duplication, Safe also for 16 bit. and remove declaration of bits variable not needed. Signed-off-by: Karim Eshapa <karim.eshapa@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-06-16staging:iio:accel:adis16203: sign extend function rather code duplicationKarim Eshapa1-5/+1
Use sign_extend32 kernel function instead of code duplication. This function is also safe for 16 bits. Signed-off-by: Karim Eshapa <karim.eshapa@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-30Staging: iio: adis16209: Move adis16209 driver out of stagingShreeya Patel3-343/+0
Move the adis16209 driver out of staging directory and merge to the mainline IIO subsystem. Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-30Staging: iio: adis16209: Use GENMASKShreeya Patel1-17/+14
Use GENMASK to improve readability and remove the local variables used to store intermediate data. Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-30Staging: iio: adis16209: Remove unused headersShreeya Patel1-3/+0
Remove few unused header files since the adis core handles the sysfs and buffer support. Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-30Staging: iio: adis16209: Add a blank line after return statementsShreeya Patel1-0/+2
Add a blank line after return statements to improve the code readability. Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-30Staging: iio: adis16209: Prefer reverse christmas tree orderingShreeya Patel1-2/+2
Prefer reverse christmas tree ordering of declarations to improve readability. Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-30Staging: iio: adis16209: Indent the field definitionsShreeya Patel1-5/+5
Have indentation in field definitions to make them clearly different from the register addresses. Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-24Staging: iio: accel: adis16201: Move adis16201 driver out of stagingHimanshu Jha3-334/+0
Move adis16201 driver out of staging and merge into mainline IIO subsystem. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-24Staging: iio: accel: adis16201: Fix 80 character line limitHimanshu Jha1-1/+2
Split the line over 80 characters limit to fix checkpatch warning. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-24Staging: iio: accel: adis16201: Use GENMASKHimanshu Jha1-19/+15
Use GENMASK to improve readability and remove the local variables used to store intermediate data. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-24Staging: iio: accel: adis16201: Remove unused headersHimanshu Jha1-3/+0
Remove few unused headers files since the adis core handles the buffer and sysfs support. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-18Staging: iio: accel: adis16201: Adjust argument to match open parenthesesHimanshu Jha1-1/+1
In adis16201_read_raw() adjust an argument to match an open parentheses using tabs and spaces. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-18Staging: iio: accel: adis16201: Prefer reverse christmas tree orderingHimanshu Jha1-2/+2
Prefer reverse christmas tree ordering of declarations to improve readability. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-18Staging: iio: accel: adis16201: Use sign_extend32 functionHimanshu Jha1-3/+2
Use sign_extned32() for 32 bit sign extending rather than hard coding. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-18Staging: iio: accel: adis16201: Add comments about units in read_raw()Himanshu Jha1-9/+18
Clarify the conversion and formation of resultant data in the adis16201_read_raw() with sufficient comments and remove the unnecessary comments. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-18Staging: iio: accel: adis16201: Group register definitionsHimanshu Jha1-84/+54
Group register definitions with its register field bits to improve readability and easy identification. A small comment is also added to denote the purpose/functionality of the grouped register definitions. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-18Staging: iio: accel: adis16201: Add _REG suffix to registersHimanshu Jha1-42/+42
Add a _REG suffix to distinguish between registers and the register bit fileds. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-18Staging: iio: accel: adis16201: Remove unnecessary commentsHimanshu Jha1-36/+0
Remove few unnecessary comments since the macro definitions clearly justify their purpose. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-18Staging: iio: accel: adis16201: Rename few macro definitionsHimanshu Jha1-7/+7
Rename the macro definitions with suitable names specifying their purpose. * ADIS16201_STARTUP_DELAY_MS: Remove the comment specifying the delay in microseconds and rename it with addtition of _MS suffix. * ADIS16201_MSC_CTRL_ACTIVE_DATA_RDY_HIGH: Rename the macro to make it similar to other misc control registers which denotes the data ready polarity. * ADIS16201_DIAG_STAT_FLASH_UPT_FAIL_BIT: Rename to denote it is a failure bit. * ADIS16201_GLOB_CMD_FACTORY_RESET: Remove ambiguous _CAL suffix and add _RESET suffix instead to denote factory reset command. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-07Staging: iio: adis16209: Use sign_extend32 functionShreeya Patel1-3/+2
Use sign_extend32 function instead of manually coding it. Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-07Staging: iio: adis16209: Adjust a switch statementShreeya Patel1-2/+8
Adjust a switch block to explicitly match channels and return -EINVAL as default case which makes the code semantically more clear. Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-07Staging: iio: adis16209: Change some macro namesShreeya Patel1-24/+24
Make some of the macro names according to the names given in the datasheet of the adis16209 driver. Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-07Staging: iio: adis16209: Remove and add some comments and group the definitionsShreeya Patel1-93/+39
Remove some unnecessay comments and group the control register and register field macros together. Some of the register names does not make it's puporse very clear and hence, add some comments for more information. Also there are certain unit based comments which are not providing sufficient information, so expand those comments. Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-07Staging: iio: accel: adis16201: Add a blank space before returnsHimanshu Jha1-0/+4
Adding a blank space before/after some returns improves readability. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-07Staging: iio: accel: adis16201: Prefer alphabetical sequence of header filesHimanshu Jha1-3/+3
Arrange header files in alphabetical sequence to improve readability. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-03Staging: iio: adis16209: Add _REG postfix for registersShreeya Patel1-42/+43
The defined names for registers does not make it very clear that they are registers and hence, add _REG postfix. This improves the readability of the code. Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-03Staging: iio: adis16209: Change the definition nameShreeya Patel1-2/+2
The change in the definition name makes it then obvious what the units are throughout the driver and there will be no need of the comment. Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-03Staging: iio: adis16209: Arrange headers in alphabetical orderShreeya Patel1-2/+2
Arrange the headers in alphabetical order for cleanup purpose. Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-08-22staging:iio:accel: drop assignment of iio_info.driver_moduleJonathan Cameron4-4/+0
The equivalent this is now done via macro magic when the relevant register call is made. The actual structure elements will shortly go away. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2017-04-14Staging: iio: accel: adis16203: fixed a brace coding style issueRené Hickersberger?=1-2/+1
Fixed a brace coding style issue. Signed-off-by: René Hickersberger <renehickersberger@gmx.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-25staging: iio: accel: remove unneeded braces around single statementsMark Stenglein2-6/+3
Fixes three checkpatch warnings due to braces used when single statements are sufficient. Signed-off-by: Mark Stenglein <mark@stengle.in> Signed-off-by: Jonathan Cameron <jic23@kernel.org>