aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/amplifiers/ad8366.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-06-17iio: amplifiers: ad8366: Add support for ADL5240 VGAAlexandru Ardelean1-0/+17
The ADL5240 is a high performance, digitally controlled variable gain amplifier (VGA) operating from 100 MHz to 4000 MHz. The VGA integrates a high performance, 20 dB gain, internally matched amplifier (AMP) with a 6-bit digital step attenuator (DSA) that has a gain control range of 31.5 dB in 0.5 dB steps with ±0.25 dB step accuracy. Datasheet link: https://www.analog.com/media/en/technical-documentation/data-sheets/adl5240.pdf Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-06-17iio: amplifiers: ad8366: Add support for the ADA4961 DGAPaul Cercueil1-2/+32
This change adds support for the ADA4961 BiCMOS RF Digital Gain Amplifier, (DGA), which is optimized for driving heavy loads out 2.0 GHz and beyond. The device typically achieves -90 dBc IMD3 performance at 500 MHz and -85 dBc at 1.5 GHz. Datasheet link: http://www.analog.com/media/en/technical-documentation/data-sheets/ADA4961.pdf This change re-uses the existing ad8366 driver, as most logic is similar. Also, this chip has a reset pin which is initialized during probe. Signed-off-by: Paul Cercueil <paul.cercueil@analog.com> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-06-17iio: amplifiers: ad8366: rework driver to allow other chipsAlexandru Ardelean1-19/+62
The SPI gain amplifiers are simple devices, with 1 or 2 channels, to which are read-from/written-to. The gain computation in ad8366_write_raw() has been updated to compute gain in dB for negative values. This driver will be extended to support other chips as well. To do that, this rework handles the AD8366 device as a special-case (via switch-statements). This will make things easier when adding new chips. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-06-17iio: amplifiers: ad8366: use own lock to guard stateAlexandru Ardelean1-4/+6
This driver is still using iio_dev's mlock to guard against inconsistent state. This has been discouraged for some time. This change switches to using it's own mutex, defined on the state struct. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-06-17iio: amplifiers: update license informationAlexandru Ardelean1-3/+2
Use the new `SPDX-License-Identifier` tag to specify the license. For ad8366, also update copyright years in the header part. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-08-19drivers: iio: Update MODULE AUTHOR email addressMichael Hennerich1-1/+1
no functional changes Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-22iio: amplifiers: ad8366: move channel init before iio_device_register()Alexandru Ardelean1-2/+4
Otherwise a race condition can occur, where userspace can start operations before the channels have been properly initialized. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-08-22iio:amplifiers:ad8366 drop assign iio_info.driver_module and iio_trigger_ops.ownerJonathan Cameron1-1/+0
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 <Jonathan.Cameron@huawei.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2015-11-05Merge tag 'spi-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spiLinus Torvalds1-1/+0
Pull spi updates from Mark Brown: "Quite a lot of activity in SPI this cycle, almost all of it in drivers with a few minor improvements and tweaks in the core. - Updates to pxa2xx to support Intel Broxton and multiple chip selects. - Support for big endian in the bcm63xx driver. - Multiple slave support for the mt8173 - New driver for the auxiliary SPI controller in bcm2835 SoCs. - Support for Layerscale SoCs in the Freescale DSPI driver" * tag 'spi-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (87 commits) spi: pxa2xx: Rework self-initiated platform data creation for non-ACPI spi: pxa2xx: Add support for Intel Broxton spi: pxa2xx: Detect number of enabled Intel LPSS SPI chip select signals spi: pxa2xx: Add output control for multiple Intel LPSS chip selects spi: pxa2xx: Use LPSS prefix for defines that are Intel LPSS specific spi: Add DSPI support for layerscape family spi: ti-qspi: improve ->remove() callback spi/spi-xilinx: Fix race condition on last word read spi: Drop owner assignment from spi_drivers spi: Add THIS_MODULE to spi_driver in SPI core spi: Setup the master controller driver before setting the chipselect spi: dw: replace magic constant by DW_SPI_DR spi: mediatek: mt8173 spi multiple devices support spi: mediatek: handle controller_data in mtk_spi_setup spi: mediatek: remove mtk_spi_config spi: mediatek: Update document devicetree bindings to support multiple devices spi: fix kernel-doc warnings about missing return desc in spi.c spi: fix kernel-doc warnings about missing return desc in spi.h spi: pxa2xx: Align a few defines spi: pxa2xx: Save other reg_cs_ctrl bits when configuring chip select ...
2015-10-28spi: Drop owner assignment from spi_driversAndrew F. Davis1-1/+0
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>
2015-08-22iio: Export SPI module alias information in missing driversJavier Martinez Canillas1-0/+1
The SPI core always reports the MODALIAS uevent as "spi:<modalias>" regardless of the mechanism that was used to register the device (i.e: OF or board code) and the table that is used later to match the driver with the device (i.e: SPI id table or OF match table). So drivers needs to export the SPI id table and this be built into the module or udev won't have the necessary information to autoload the needed driver module when the device is added. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-01-01iio: amplifiers: ad8366: Use right order for type specificationRoberta Dobrescu1-1/+1
This patch fixes the following checkpatch.pl warning: WARNING: type 'char unsigned' should be specified in [[un]signed] [short|int|long|long long] order Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-01-01iio: amplifiers: ad8366: Remove space before ','Roberta Dobrescu1-1/+1
This patch fixes the following checkpatch.pl error: ERROR: space prohibited before that ',' (ctx:WxW) Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-28iio: amplifiers: ad8366: Remove regulator_putSachin Kamat1-3/+1
Since devm_regulator_get is used, regulator_put should not be used. Remove it. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03iio: amplifiers: ad8366: Use devm_* APIsSachin Kamat1-10/+3
devm_* APIs are device managed and make code simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Michael Hennerich <hennerich@blackfin.uclinux.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-03-17iio:amplifiers:ad8366 move to info_mask_(shared_by_type/separate)Jonathan Cameron1-1/+1
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Michael Hennerich <michael.hennerich@analog.com>
2013-01-03Drivers: iio: remove __dev* attributes.Greg Kroah-Hartman1-3/+3
CONFIG_HOTPLUG is going away as an option. As a result, the __dev* markings need to be removed. This change removes the use of __devinit, __devexit_p, and __devexit from these drivers. Based on patches originally written by Bill Pemberton, but redone by me in order to handle some of the coding style issues better, by hand. Cc: Bill Pemberton <wfp5p@virginia.edu> Cc: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14iio: amplifiers: New driver for AD8366 Dual-Digital Variable Gain AmplifierMichael Hennerich1-0/+222
Changes since V1: Apply review feedback: Introduce and use IIO_CHAN_INFO_HARDWAREGAIN Introduce and use Use IIO_VAL_INT_PLUS_MICRO_DB Modify out of staging include paths. Convert to new iio core API naming. Changes since V2: more sanity checking in write_raw 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>