From: maitysanchayan@gmail.com (Sanchayan Maity)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3] Add continuous sampling with IIO buffers for Vybrid
Date: Tue, 11 Aug 2015 14:35:00 +0530 [thread overview]
Message-ID: <cover.1439283162.git.maitysanchayan@gmail.com> (raw)
Hello,
This patch adds support for continuous sampling provided by the
ADC block on Vybrid by leveraging the IIO triggered buffers
infrastructure.
The patch has been tested on Colibri VF50 and VF61 on shawn's
tree for-next branch with the patches [1] and [2] applied.
The below script was used for testing.
#!/bin/sh
echo 0 > /sys/bus/iio/devices/iio:device0/scan_elements/in_voltage8_en
echo 0 > /sys/bus/iio/devices/iio:device0/scan_elements/in_voltage9_en
echo 1 > /sys/bus/iio/devices/iio:device0/scan_elements/in_temp_en
echo 1 > /sys/bus/iio/devices/iio:device0/scan_elements/in_timestamp_en
echo 0 > /sys/bus/iio/devices/iio_sysfs_trigger/add_trigger
/home/root/generic_buffer -n 4003b000.adc -t sysfstrig0 -l 512 -c 10
echo 0 > /sys/bus/iio/devices/iio:device0/scan_elements/in_timestamp_en
echo 0 > /sys/bus/iio/devices/iio:device0/scan_elements/in_temp_en
echo 0 > /sys/bus/iio/devices/iio:device0/scan_elements/in_voltage8_en
echo 0 > /sys/bus/iio/devices/iio:device0/scan_elements/in_voltage9_en
Feedback and comments are most welcome.
Changes since v2:
1. Fix the wrong buffer size for statically allocated buffer
2. Drop the use of .address field from the iio_chan_spec
3. Use iio_buffer_enabled call inside the lock
4. Drop wrapper function around iio_trigered_* function calls
5. Drop Kconfig select of sysfs trigger
6. Drop Kconfig select IIO_TRIGGER as it is already selected by
IIO_TRIGGERED_BUFFER
Changes since v1:
1. Use a fixed size buffer instead of kmalloc allocated during update
scan mode
2. Remove a write to read only register ADC_HS (COCO bit)
Version 2 patch can be found here
http://www.gossamer-threads.com/lists/linux/kernel/2235178
Version 1 patch can be found here
http://www.spinics.net/lists/linux-iio/msg20053.html
[1]. https://lkml.org/lkml/2015/5/27/350
[2]. https://lkml.org/lkml/2015/7/14/395
Thanks & Regards,
Sanchayan Maity.
Sanchayan Maity (1):
iio: adc: vf610: Add IIO buffer support for Vybrid ADC
drivers/iio/adc/Kconfig | 2 +
drivers/iio/adc/vf610_adc.c | 102 +++++++++++++++++++++++++++++++++++++++++---
2 files changed, 97 insertions(+), 7 deletions(-)
--
2.5.0
next reply other threads:[~2015-08-11 9:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-11 9:05 Sanchayan Maity [this message]
2015-08-11 9:05 ` [PATCH v3] iio: adc: vf610: Add IIO buffer support for Vybrid ADC Sanchayan Maity
2015-08-15 20:24 ` Jonathan Cameron
2015-08-17 13:56 ` maitysanchayan at gmail.com
2015-08-17 15:51 ` [PATCH v4] " Sanchayan Maity
2015-08-20 6:38 ` maitysanchayan at gmail.com
2015-08-20 6:50 ` Duan Andy
2015-08-31 15:20 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1439283162.git.maitysanchayan@gmail.com \
--to=maitysanchayan@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).