aboutsummaryrefslogtreecommitdiff
path: root/drivers/iio/potentiostat
AgeCommit message (Collapse)AuthorFilesLines
2024-05-27iio: Drop explicit initialization of struct i2c_device_id::driver_data to 0Uwe Kleine-König1-2/+2
These drivers don't use the driver_data member of struct i2c_device_id, so don't explicitly initialize this member. This prepares putting driver_data in an anonymous union which requires either no initialization or named designators. But it's also a nice cleanup on its own. While add it, also remove commas after the sentinel entries. Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-05-21iio: Switch i2c drivers back to use .probe()Uwe Kleine-König1-1/+1
After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2023-03-11iio: Rename iio_trigger_poll_chained and add kernel-docMehdi Djait1-1/+1
Rename the function to iio_trigger_poll_nested. Add kernel-doc with a note on the context where the function is expected to be called. Signed-off-by: Mehdi Djait <[email protected]> Link: https://lore.kernel.org/r/841b533cba28ca25a8e87280c44e45979166e8e2.1677761379.git.mehdi.djait.k@gmail.com Signed-off-by: Jonathan Cameron <[email protected]>
2022-11-23iio: potentiostat: lmp91000: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2022-08-16i2c: Make remove callback return voidUwe Kleine-König1-3/+1
The value returned by an i2c driver's remove function is mostly ignored. (Only an error message is printed if the value is non-zero that the error is ignored.) So change the prototype of the remove function to return no value. This way driver authors are not tempted to assume that passing an error to the upper layer is a good idea. All drivers are adapted accordingly. There is no intended change of behaviour, all callbacks were prepared to return 0 before. Reviewed-by: Peter Senna Tschudin <[email protected]> Reviewed-by: Jeremy Kerr <[email protected]> Reviewed-by: Benjamin Mugnier <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Reviewed-by: Crt Mori <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Acked-by: Marek Behún <[email protected]> # for leds-turris-omnia Acked-by: Andy Shevchenko <[email protected]> Reviewed-by: Petr Machata <[email protected]> # for mlxsw Reviewed-by: Maximilian Luz <[email protected]> # for surface3_power Acked-by: Srinivas Pandruvada <[email protected]> # for bmc150-accel-i2c + kxcjk-1013 Reviewed-by: Hans Verkuil <[email protected]> # for media/* + staging/media/* Acked-by: Miguel Ojeda <[email protected]> # for auxdisplay/ht16k33 + auxdisplay/lcd2s Reviewed-by: Luca Ceresoli <[email protected]> # for versaclock5 Reviewed-by: Ajay Gupta <[email protected]> # for ucsi_ccg Acked-by: Jonathan Cameron <[email protected]> # for iio Acked-by: Peter Rosin <[email protected]> # for i2c-mux-*, max9860 Acked-by: Adrien Grassein <[email protected]> # for lontium-lt8912b Reviewed-by: Jean Delvare <[email protected]> # for hwmon, i2c-core and i2c/muxes Acked-by: Corey Minyard <[email protected]> # for IPMI Reviewed-by: Vladimir Oltean <[email protected]> Acked-by: Dmitry Torokhov <[email protected]> Acked-by: Sebastian Reichel <[email protected]> # for drivers/power Acked-by: Krzysztof Hałasa <[email protected]> Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2021-11-17iio: lmp91000: Remove no-op trigger opsLars-Peter Clausen1-4/+0
The IIO core handles a trigger ops with all NULL callbacks the same as if the trigger ops itself was NULL. Remove the empty trigger ops from the interrupt trigger driver to slightly reduce the boilerplate code. Object size of the driver module is also slightly reduced. Signed-off-by: Lars-Peter Clausen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2021-05-17iio: potentiostat: lmp91000: Fix alignment of buffer in ↵Jonathan Cameron1-2/+2
iio_push_to_buffers_with_timestamp() Add __aligned(8) to ensure the buffer passed to iio_push_to_buffers_with_timestamp() is suitable for the naturally aligned timestamp that will be inserted. Here structure is not used, because this buffer is also used elsewhere in the driver. Fixes: 67e17300dc1d ("iio: potentiostat: add LMP91000 support") Signed-off-by: Jonathan Cameron <[email protected]> Cc: Matt Ranostay <[email protected]> Acked-by: Matt Ranostay <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-05-17iio: core: move @id from struct iio_dev to struct iio_dev_opaqueJonathan Cameron1-1/+2
Continuing from Alexandru Ardelean's introduction of the split between driver modifiable fields and those that should only be set by the core. This could have been done in two steps to make the actual move after introducing iio_device_id() but there seemed limited point to that given how mechanical the majority of the patch is. Includes fixup from Alex for missing mxs-lradc-adc conversion. Signed-off-by: Jonathan Cameron <[email protected]> Reviewed-by: Alexandru Ardelean <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-03-25iio: lmp91000: Remove code to set trigger parentGwendal Grignou1-2/+1
iio_trigger_set_drvdata() sets the trigger device parent to first argument of viio_trigger_alloc(), no need to do it again in the driver code. Given data->dev is dev, and we call devm_iio_trigger_alloc with dev instead of data->dev, we do not have to set data->trig->dev.parent to dev anymore. Signed-off-by: Gwendal Grignou <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Matt Ranostay <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2020-09-21iio:potentiostat:lmp91000: Drop of_match_ptr and use generic fw accessorsJonathan Cameron1-6/+5
This change allows use of this driver with ACPI via PRP0001 and removes an example of an anti pattern I'm trying to remove from IIO. Signed-off-by: Jonathan Cameron <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Acked-by: Matt Ranostay <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-06-20iio: Move attach/detach of the poll func to the coreLars-Peter Clausen1-11/+2
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 <[email protected]> Signed-off-by: Alexandru Ardelean <[email protected]> Tested-by: Eugen Hristev <[email protected]> #for at91-sama5d2-adc Signed-off-by: Jonathan Cameron <[email protected]>
2020-06-14iio: remove left-over parent assignmentsAlexandru Ardelean1-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 <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2020-03-08iio: potentiostat: lmp9100: fix iio_triggered_buffer_{predisable,postenable} ↵Alexandru Ardelean1-5/+13
positions The iio_triggered_buffer_{predisable,postenable} functions attach/detach the poll functions. For the predisable hook, the disable code should occur before detaching the poll func, and for the postenable hook, the poll func should be attached before the enable code. The lmp9100 was attaching a poll function but never detaching it via any IIO disable hook. This change adds the detaching of the poll function, and moves/renames lmp91000_buffer_preenable() function to lmp91000_buffer_postenable(). The idea is to make it more symmetrical, so that when the iio_triggered_buffer_{predisable,postenable} functions get removed, it's easier to see. Fixes: 67e17300dc1d7 ("iio: potentiostat: add LMP91000 support") Signed-off-by: Alexandru Ardelean <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2019-05-21treewide: Add SPDX license identifier - Makefile/KconfigThomas Gleixner2-0/+2
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-04-04iio:potentiostat:lmp91000: change dev_err messageAnderson Reis1-1/+1
Change dev_err message on line 215 in order to inform that tia-gain-ohm is not defined and an external resistor is not specified. Signed-off-by: Anderson Reis <[email protected]> Signed-off-by: Lucas Oshiro <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2019-04-04iio:potentiostat:lmp91000: invert if statementAnderson Reis1-3/+2
Invert if statement arms in line 214, in order to make the code cleaner, solve these checkpatch.pl CHECKs: - lmp9100.c:214: CHECK: braces {} should be used on all arms of this statement - lmp9100.c:216: CHECK: Unbalanced braces around else statement Signed-off-by: Lucas Oshiro <[email protected]> Signed-off-by: Anderson Reis <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2019-04-04iio:potentiostat:lmp91000: reduce line width and remove blank lineAnderson Reis1-3/+2
Break the line 258 in order fit the line width on 80 characters. Remove the blank line 279, as the line before is also a blank line. Solve these checkpath.el WARNING and CHECK: - lmp91000.c:258: WARNING: line over 80 characters - lmp91000.c:279: CHECK: Please don't use multiple blank lines Signed-off-by: Lucas Oshiro <[email protected]> Signed-off-by: Anderson Reis <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2019-04-04iio:potentiostat:lmp91000: remove unnecessary parenthesesLucas Oshiro1-1/+1
Remove unnecessary parentheses on line 116. Signed-off-by: Lucas Oshiro <[email protected]> Signed-off-by: Anderson Reis <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2018-05-12iio: potentiostat: lmp91000: add LMP91002 supportMatt Ranostay1-0/+2
LMP91002 is register compatible so add devicetree and i2c client ids Signed-off-by: Matt Ranostay <[email protected]> Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2018-02-18iio: add SPDX identifier for various driversMatt Ranostay1-12/+4
Add GPLv2+ SPDX identifier and update email for author's drivers. Signed-off-by: Matt Ranostay <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2017-08-22iio:potentiostat:lmp91000 drop assign iio_info.driver_module and ↵Jonathan Cameron1-2/+0
iio_trigger_ops.owner The equivalent of both of these are now done via macro magic when the relevant register calls are made. The actual structure elements will shortly go away. Signed-off-by: Jonathan Cameron <[email protected]> Reviewed-by: Lars-Peter Clausen <[email protected]>
2017-02-19iio: lmp91000: Set parent deviceLars-Peter Clausen1-0/+1
Initialize the parent of the IIO device to the device that registered it. This makes sure that the IIO device appears the right level in the device hierarchy. Signed-off-by: Lars-Peter Clausen <[email protected]> Reviewed-by: Matt Ranostay <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2016-09-27iio: potentiostat: add LMP91000 supportMatt Ranostay3-0/+474
Add support for the LMP91000 potentiostat which is used for chemical sensing applications. Signed-off-by: Matt Ranostay <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>