Thread (1 message) 1 message, 1 author, 2016-03-12

Re: [PATCH v2 1/4] iio: adc: add NXP LPC18xx ADC driver

From: Joachim Eastwood <hidden>
Date: 2016-03-12 11:11:03
Also in: linux-iio

On 12 March 2016 at 11:35, Jonathan Cameron [off-list ref] wrote:
On 12/03/16 10:30, Jonathan Cameron wrote:
quoted
On 06/03/16 11:13, Joachim Eastwood wrote:
quoted
Add base support for the 10-bit SAR ADC peripheral found
on NXP LPC18xx/43xx SoCs.

This is a minimal driver that does not support burst mode,
interrupts, DMA or hardware triggers.

User manual with register description can be found on:
LPC18xx: www.nxp.com/documents/user_manual/UM10430.pdf
LPC43xx: www.nxp.com/documents/user_manual/UM10503.pdf

Signed-off-by: Joachim Eastwood <redacted>
Applied to the togreg branch of iio.git - initially pushed out as testing
for the autobuilders to play with it.
Actually I've backed this out.  Picked up on a few things lookint
at the DAC driver that apply here too.

Clearly half asleep this morning!

Sorry,

Jonathan
quoted
Thanks,

Jonathan
quoted
---
 drivers/iio/adc/Kconfig       |  10 ++
 drivers/iio/adc/Makefile      |   1 +
 drivers/iio/adc/lpc18xx_adc.c | 228 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 239 insertions(+)
 create mode 100644 drivers/iio/adc/lpc18xx_adc.c
quoted
quoted
+static int lpc18xx_adc_read_raw(struct iio_dev *indio_dev,
+                            struct iio_chan_spec const *chan,
+                            int *val, int *val2, long mask)
+{
+    struct lpc18xx_adc *adc = iio_priv(indio_dev);
+
+    switch (mask) {
+    case IIO_CHAN_INFO_RAW:
Please use a local lock to protect channels.  The mlock is specifically
for use in protecting against moving in and out of buffered mode for
drivers in which individual reads will break buffered capture.
okey, got it. I'll send out a new version later today. I'll add the
lock to the dac driver as well.

Does this mean that if buffered mode support is added to the driver
I'll have to change the lock again?


regards,
Joachim Eastwood
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help