summaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/frequency/ad9832.c
Commit message (Collapse)AuthorAgeFilesLines
* staging: iio: ad9832: use clock framework for clock referenceMarcelo Schmitt2019-04-141-12/+25
| | | | | | | | | | Previously external clock were set through platform_data struct. Now device uses clk struct defined in include/linux/clk.h to handle external clock source. It also removes mclk from platform_data struct. Signed-off-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* staging: iio: ad9832: organize includesMarcelo Schmitt2019-04-141-6/+8
| | | | | | | Organize includes to list them in lexicographic order. Signed-off-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* staging: iio: add proper SPDX identifiers to remaining driver filesGreg Kroah-Hartman2019-04-031-2/+1Star
| | | | | | | | | | | | | | 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>
* drivers: iio: Update MODULE AUTHOR email addressMichael Hennerich2018-08-191-1/+1
| | | | | | | no functional changes Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
* staging:iio:frequency: drop assign iio_info.driver_moduleJonathan Cameron2017-08-221-1/+0Star
| | | | | | | | | The equivalent of 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>
* staging: iio: ad9832: use 4-digit octal permissionsGuru Das Srinagesh2017-04-021-10/+10
| | | | | | | | | | This fixes the coding style issue of using S_IWUSR in place of 4-digit octal numbers. Issue detected by checkpatch. Signed-off-by: Guru Das Srinagesh <gurooodas@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging: iio: ad9832: replace mlock with driver private lockAlison Schofield2017-03-131-2/+5
| | | | | | | | | | | | The IIO subsystem is redefining iio_dev->mlock to be used by the IIO core only for protecting device operating mode changes. ie. Changes between INDIO_DIRECT_MODE, INDIO_BUFFER_* modes. In this driver, mlock was being used to protect hardware state changes. Replace it with a lock in the devices global data. Signed-off-by: Alison Schofield <amsfield22@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging: iio: ad9832: Moved contents of the header to the source fileNarcisa Ana Maria Vasile2017-03-021-0/+92
| | | | | | | | | Moved the contents of the header(ad9832.h) into the corresponding source file with the exception of the platform data struct which is supposed to be used from somewhere else other than the driver. Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging: iio: ad9832: allocate data before usingArnd Bergmann2016-11-081-7/+7
| | | | | | | | | | | | | | | The regulator changes assigned data to an uninitialized pointer: drivers/staging/iio/frequency/ad9832.c: In function 'ad9832_probe': drivers/staging/iio/frequency/ad9832.c:214:11: error: 'st' may be used uninitialized in this function [-Werror=maybe-uninitialized] This moves the allocation of the 'st' structure before its first use, as it should have been. Fixes: 43a07e48af44 ("staging: iio: ad9832: clean-up regulator 'reg'") Fixes: a98461d79ba5 ("staging: iio: ad9832: add DVDD regulator") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging: iio: ad9832: clean-up regulator 'reg'Eva Rachel Retuya2016-11-051-11/+9Star
| | | | | | | | | | Rename regulator 'reg' to 'avdd' so as to be clear what regulator it stands for specifically. Additionally, get rid of local variable 'reg' and use direct assignment instead. Update also the goto label pertaining to the avdd regulator during disable. Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging: iio: ad9832: add DVDD regulatorEva Rachel Retuya2016-11-051-9/+24
| | | | | | | | | | | | The AD9832/AD9835 is supplied with two power sources: AVDD as analog supply voltage and DVDD as digital supply voltage. Attempt to fetch and enable the regulator 'dvdd'. Bail out if any error occurs. Suggested-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging: iio: rework regulator handlingEva Rachel Retuya2016-11-051-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the affected drivers ignore all errors from regulator_get(). The way it is now, it also breaks probe deferral (EPROBE_DEFER). The correct behavior is to propagate the error to the upper layers so they can handle it accordingly. Rework the regulator handling so that it matches the standard behavior. If the specific design uses a static always-on regulator and does not explicitly specify it, regulator_get() will return the dummy regulator. The following semantic patch was used to apply the change: @r1@ expression reg, dev, en, volt; @@ reg = \(devm_regulator_get\|regulator_get\)(dev, ...); if ( - ! IS_ERR(reg)) + return PTR_ERR(reg); ( - { en = regulator_enable(reg); - if (en) return en; } + + en = regulator_enable(reg); + if (en) { + dev_err(dev, "Failed to enable specified supply\n"); + return en; } | + - { en = regulator_enable(reg); - if (en) return en; - volt = regulator_get_voltage(reg); } + en = regulator_enable(reg); + if (en) { + dev_err(dev, "Failed to enable specified supply\n"); + return en; + } + volt = regulator_get_voltage(reg); ) @r2@ expression arg; @@ - if (!IS_ERR(arg)) regulator_disable(arg); + regulator_disable(arg); Hand-edit the debugging prints with the supply name to become more specific. Suggested-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging: iio: set proper supply name to devm_regulator_get()Eva Rachel Retuya2016-11-051-1/+1
| | | | | | | | | | | | | | | The name passed to devm_regulator_get() should match the name of the supply as specified in the device datasheet. This makes it clear what power supply is being referred to in case of presence of other regulators. Currently, the supply name specified on the affected devices is 'vcc'. Use lowercase version of the datasheet name to specify the supply voltage. Suggested-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* Staging: iio: ad9832: Replace 'unsigned' with 'unsigned int'Svetlana Orlik2016-03-281-1/+1
| | | | | | | Replace 'unsigned' with 'unsigned int' to avoid checkpatch.pl warning. Signed-off-by: Svetlana Orlik <sveta.orlik.code@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: iio: frequency: use dev_get_platdata()Nizam Haider2015-12-021-1/+1
| | | | | | | | Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Nizam Haider <nijamh@cdac.in> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* spi: Drop owner assignment from spi_driversAndrew F. Davis2015-10-281-1/+0Star
| | | | | | | | | An spi_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Andrew F. Davis <afd@ti.com> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* Staging: iio: Prefer using the BIT macroCristina Opriceana2015-03-161-1/+1
| | | | | | | | | | | | | | | This patch replaces bit shifting on 1 with the BIT(x) macro as it's extensively used by other function in this driver. This was done with coccinelle: @@ int g; @@ -(1 << g) +BIT(g) Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Reviewed-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: iio: Remove explicit comparison to NULLCristina Opriceana2015-03-161-1/+1
| | | | | | | | | This patch simplifies pointer comparison to NULL and makes code easier to read. Warning found by checkpatch.pl. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Reviewed-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: iio: Remove space after type castCristina Opriceana2015-03-161-3/+3
| | | | | | | | | This patch removes unnecessary space after type casts. Warning found by checkpatch.pl. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Reviewed-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: iio: ad9832: Remove redundant checkSachin Kamat2014-07-071-1/+1
| | | | | | | | 'val' is unsigned and cannot be negative. Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com> Cc: Michael Hennerich <hennerich@blackfin.uclinux.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging: iio: Coding style issues fix.Federico Di Pierro2014-06-291-8/+6Star
| | | | | | | | Fix some little style issues in drivers/staging/iio/frequency/ad9832.c . This is my latest task of the eudyptula challenge (third attempt!) Signed-off-by: Federico Di Pierro <nierro92@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging: iio: replace strict_strto*() with kstrto*()Jingoo Han2013-09-081-2/+2
| | | | | | | | | | | | | | | | | | The usage of strict_strto*() is not preferred, because strict_strto*() is obsolete. Thus, kstrto*() should be used. Previously, there were only strict_strtol(), strict_strtoul(), strict_strtoull(), and strict_strtoll(). Thus, when converting to the variables, only long, unsigned long, unsigned long long, and long long can be used. However, kstrto*() provides various functions handling all types of variables. Therefore, the types of variables can be changed properly. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging: iio: ad9832: Use devm_* APIsSachin Kamat2013-09-071-20/+12Star
| | | | | | | devm_* APIs are device managed and make code simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* staging: iio: remove use of __devexit_pBill Pemberton2012-11-221-1/+1
| | | | | | | | | CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: iio: remove use of __devexitBill Pemberton2012-11-211-1/+1
| | | | | | | | | CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: iio: remove use of __devinitBill Pemberton2012-11-211-1/+1
| | | | | | | | | CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging:iio:frequency: Use dev_to_iio_dev()Lars-Peter Clausen2012-05-141-1/+1
| | | | | | | | | Replace open-coded instances of getting a iio_dev struct from a device struct with dev_to_iio_dev(). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: frequency: Update DDS drivers to use new channel naming conventionMichael Hennerich2012-04-301-12/+12
| | | | | | Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: Rename iio/dds to iio/frequencyMichael Hennerich2012-04-301-0/+362
Generalize naming to allow other frequency synthesis techniques as well. No functional changes. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>