aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/adc/berlin2-adc.c
Commit message (Collapse)AuthorAge
* iio:adc:berlin2-adc: coding style cleanupHartmut Knaack2015-08-12
| | | | | | | | Some adjustment of indentation to make checkpatch.pl happy in strict mode. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:adc:berlin2-adc: enable interrupts with mutex lockedHartmut Knaack2015-08-12
| | | | | | | | | Move the call to enable channel interrupts into its _read() function to have it protected by a mutex. This ensures that only one channel is sampled at a time. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:adc:berlin2-adc: use GENMASK and BIT for masksHartmut Knaack2015-08-12
| | | | | | | | Make use of GENMASK for consecutive bitmasks and BIT for single bitmasks. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:adc:berlin2-adc: Fix register definitionHartmut Knaack2015-08-12
| | | | | | | | | | | | | | Active channel number is stored in BERLIN2_SM_CTRL as value, instead of a bit map. The masks for channel interrupts and data ready are a 16 bits wide bit map each, instead of just 4 bits. Also correct the data mask for the temperature sensor, which was Reported-by: Antoine Tenart <antoine.tenart@free-electrons.com> Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:adc:berlin2-adc: use channel-array size directlyHartmut Knaack2015-08-02
| | | | | | | | | Drop the otherwise unused definition of the channel-array size and use it directly in _probe - makes it a bit more obvious. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:adc:berlin2-adc: use short operator formatHartmut Knaack2015-08-02
| | | | | | | | | | | | Use augmented assignment to subtract the offset for negative temperature values. Specify the amount of private data to be allocated through devm_iio_device_alloc() with sizeof(*priv), as it is shorter and common practice in IIO. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:adc:berlin2-adc: constify iio_chan_specHartmut Knaack2015-08-02
| | | | | | | | Mark berlin2_adc_channels array as constant. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:adc:berlin2-adc: pass up real error codeHartmut Knaack2015-08-02
| | | | | | | | Pass up the real error code returned by platform_get_irq_byname(). Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: adc: add support for BerlinAntoine Tenart2015-05-23
This patch adds the support of the Berlin ADC, available on Berlin SoCs. This ADC has 8 channels available, with one connected to a temperature sensor. The particularity here, is that the temperature sensor connected to the ADC has its own registers, and both the ADC and the temperature sensor must be configured when using it. Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>