From: Eva Rachel Retuya <eraretuya@gmail.com>
To: jic23@kernel.org, linux-iio@vger.kernel.org
Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net,
dmitry.torokhov@gmail.com, michael.hennerich@analog.com,
daniel.baluta@gmail.com, amsfield22@gmail.com,
florian.vaussard@heig-vd.ch, linux-kernel@vger.kernel.org,
Eva Rachel Retuya <eraretuya@gmail.com>
Subject: [PATCH v2 0/4] iio: accel: adxl345: Add support for buffered readings
Date: Sat, 29 Apr 2017 15:48:57 +0800 [thread overview]
Message-ID: <cover.1493450577.git.eraretuya@gmail.com> (raw)
Introduce the DATA_READY trigger and enable triggered buffering. Additional
changes include introduction of functions set_mode and data_ready, allow
either INT1/INT2 pin be used by specifying interrupt-names.
Triggered buffer was tested on both DATA_READY trigger and the hrtimer software
trigger.
~ # ls /sys/bus/iio/devices/
iio:device0 trigger0 trigger1
~ # ls /config/iio/triggers/hrtimer/
t1
~ # cat /sys/bus/iio/devices/trigger0/name
t1
~ # cat /sys/bus/iio/devices/trigger1/name
adxl345-dev0
~ # iio_generic_buffer -n adxl345 -t t1 -c 5 -l 20 -a
iio device number being used is 0
iio trigger number being used is 0
Enabling all channels
Enabling: in_accel_y_en
Enabling: in_accel_x_en
Enabling: in_timestamp_en
Enabling: in_accel_z_en
/sys/bus/iio/devices/iio:device0 t1
0.306400 0.880900 9.575000 1493432411145155964
0.306400 0.880900 9.575000 1493432411185154872
0.306400 0.919200 9.536700 1493432411225167667
0.306400 0.880900 9.536700 1493432411265157809
0.344700 0.919200 9.536700 1493432411295108767
Disabling: in_accel_y_en
Disabling: in_accel_x_en
Disabling: in_timestamp_en
Disabling: in_accel_z_en
~ # iio_generic_buffer -n adxl345 -t adxl345-dev0 -c 5 -l 20 -a
iio device number being used is 0
iio trigger number being used is 1
Enabling all channels
Enabling: in_accel_y_en
Enabling: in_accel_x_en
Enabling: in_timestamp_en
Enabling: in_accel_z_en
/sys/bus/iio/devices/iio:device0 adxl345-dev0
0.344700 0.919200 9.689900 1493432411336475189
0.344700 0.880900 9.575000 1493432411336475189
0.306400 0.957500 9.651600 1493432411336475189
0.306400 0.880900 9.575000 1493432411336475189
0.306400 0.919200 9.536700 1493432411336475189
Disabling: in_accel_y_en
Disabling: in_accel_x_en
Disabling: in_timestamp_en
Disabling: in_accel_z_en
~ #
Changes in v2:
* Provide a detailed commit message to those missing it
* Add Rob's Acked-by tag
* Make function naming more clear: drdy -> data_ready
* Switch from while to do..while
* Rename regval to val
* Switch to usleep_range() for shorter delay
* Add comment to justify delay
* Change error code -EIO to -EAGAIN
* Endianness issue: scrap the get_triple function entirely, make no
changes in terms of reading registers in read_raw
* Introduce mutex earlier rather than in succeeding patch
* Probe:
* Fix random whitespace omission
* Remove configuring to standby mode, the device powers on in standby
mode so this is not needed
* use variable 'regval' to hold value to be written to the register and call
regmap_write() unconditionally
* fix line splitting in devm_request_threaded_irq() and devm_iio_trigger_alloc()
* Switch to devm_iio_trigger_register()
* Switch to devm_iio_triggered_buffer_setup()
* Move the of_irq_get_byname() check in core file in order to avoid
introducing another parameter in probe()
* adxl345_irq():
* return values directly
* switch from iio_trigger_poll() to iio_trigger_poll_chained(), the former
should only be called at the top-half not at the bottom-half.
* adxl345_drdy_trigger_set_state():
* move regmap_get_device() to definition block
* regmap_update_bits(): line splitting - one parameter per line, remove extra
parenthesis
* adxl345_trigger_handler()
* if using external trigger, place a adxl345_data_ready() call before
performing a bulk read
* Since get_triple() is scrapped, place a direct bulk read here
* Move mutex unlocking below goto label
* Remove i2c_check_functionality() that could introduce regression
Eva Rachel Retuya (4):
dt-bindings: iio: accel: adxl345: Add optional interrupt-names support
iio: accel: adxl345_core: Introduce set_mode and data_ready functions
iio: accel: adxl345: Setup DATA_READY trigger
iio: accel: adxl345: Add support for triggered buffer
.../devicetree/bindings/iio/accel/adxl345.txt | 4 +
drivers/iio/accel/Kconfig | 2 +
drivers/iio/accel/adxl345.h | 2 +-
drivers/iio/accel/adxl345_core.c | 281 ++++++++++++++++++++-
drivers/iio/accel/adxl345_i2c.c | 3 +-
drivers/iio/accel/adxl345_spi.c | 2 +-
6 files changed, 278 insertions(+), 16 deletions(-)
--
2.7.4
next reply other threads:[~2017-04-29 7:49 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-29 7:48 Eva Rachel Retuya [this message]
2017-04-29 7:48 ` [PATCH v2 1/4] dt-bindings: iio: accel: adxl345: Add optional interrupt-names support Eva Rachel Retuya
2017-04-29 7:48 ` [PATCH v2 2/4] iio: accel: adxl345_core: Introduce set_mode and data_ready functions Eva Rachel Retuya
2017-05-01 0:22 ` Jonathan Cameron
2017-05-01 19:42 ` Andy Shevchenko
2017-05-01 19:48 ` Jonathan Cameron
2017-05-01 20:07 ` Andy Shevchenko
2017-05-01 20:18 ` Jonathan Cameron
2017-05-02 11:39 ` Eva Rachel Retuya
2017-05-02 16:32 ` Jonathan Cameron
2017-05-10 13:07 ` Eva Rachel Retuya
2017-05-01 11:21 ` Andy Shevchenko
2017-05-02 11:46 ` Eva Rachel Retuya
2017-04-29 7:49 ` [PATCH v2 3/4] iio: accel: adxl345: Setup DATA_READY trigger Eva Rachel Retuya
2017-05-01 0:32 ` Jonathan Cameron
2017-05-02 3:01 ` Rob Herring
2017-05-02 15:59 ` Jonathan Cameron
2017-05-10 14:33 ` Eva Rachel Retuya
2017-05-02 11:59 ` Eva Rachel Retuya
2017-05-01 11:31 ` Andy Shevchenko
2017-05-02 12:15 ` Eva Rachel Retuya
2017-05-02 21:05 ` Andy Shevchenko
2017-05-10 13:24 ` Eva Rachel Retuya
2017-05-14 15:15 ` Jonathan Cameron
2017-05-14 16:08 ` Dmitry Torokhov
2017-05-05 18:26 ` Jonathan Cameron
2017-05-10 13:31 ` Eva Rachel Retuya
2017-04-29 7:49 ` [PATCH v2 4/4] iio: accel: adxl345: Add support for triggered buffer Eva Rachel Retuya
2017-05-01 0:42 ` Jonathan Cameron
2017-05-02 12:23 ` Eva Rachel Retuya
2017-05-02 16:08 ` Jonathan Cameron
2017-05-01 11:24 ` Andy Shevchenko
2017-05-02 12:24 ` Eva Rachel Retuya
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.1493450577.git.eraretuya@gmail.com \
--to=eraretuya@gmail.com \
--cc=amsfield22@gmail.com \
--cc=daniel.baluta@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=florian.vaussard@heig-vd.ch \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.hennerich@analog.com \
--cc=pmeerw@pmeerw.net \
/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).