From: Jonathan Cameron <jic23@cam.ac.uk>
To: Jonathan Cameron <jic23@cam.ac.uk>
Cc: linux-iio@vger.kernel.org
Subject: Re: [PATCH 5/5] staging:iio:adc:max1363 use new demuxing support.
Date: Mon, 24 Oct 2011 14:45:40 +0100 [thread overview]
Message-ID: <4EA56C04.20502@cam.ac.uk> (raw)
In-Reply-To: <1319128169-3722-6-git-send-email-jic23@cam.ac.uk>
On 10/20/11 17:29, Jonathan Cameron wrote:
> Note that time stamps are not currently supported
> hence for now I've cheekly removed them from this
> driver. Also hence no sign off.
Also in a last minute 'cleanup' I removed the bit that set
buffer->bpe appropriately. Bad idea as now it is used
(before it wasn't).
oops.
> ---
> drivers/staging/iio/adc/max1363_core.c | 4 ----
> drivers/staging/iio/adc/max1363_ring.c | 27 ++++++---------------------
> 2 files changed, 6 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/staging/iio/adc/max1363_core.c b/drivers/staging/iio/adc/max1363_core.c
> index eb699ad..8f19d2d 100644
> --- a/drivers/staging/iio/adc/max1363_core.c
> +++ b/drivers/staging/iio/adc/max1363_core.c
> @@ -325,7 +325,6 @@ static const enum max1363_modes max1363_mode_list[] = {
> MAX1363_CHAN_B(2, 3, d2m3, 5, bits, em), \
> MAX1363_CHAN_B(1, 0, d1m0, 6, bits, em), \
> MAX1363_CHAN_B(3, 2, d3m2, 7, bits, em), \
> - IIO_CHAN_SOFT_TIMESTAMP(8) \
> }
>
> static struct iio_chan_spec max1036_channels[] = MAX1363_4X_CHANS(8, 0);
> @@ -383,7 +382,6 @@ static const enum max1363_modes max1238_mode_list[] = {
> MAX1363_CHAN_B(7, 6, d7m6, 21, bits, 0), \
> MAX1363_CHAN_B(9, 8, d9m8, 22, bits, 0), \
> MAX1363_CHAN_B(11, 10, d11m10, 23, bits, 0), \
> - IIO_CHAN_SOFT_TIMESTAMP(24) \
> }
> static struct iio_chan_spec max1038_channels[] = MAX1363_12X_CHANS(8);
> static struct iio_chan_spec max1138_channels[] = MAX1363_12X_CHANS(10);
> @@ -424,7 +422,6 @@ static const enum max1363_modes max11608_mode_list[] = {
> MAX1363_CHAN_B(3, 2, d3m2, 13, bits, 0), \
> MAX1363_CHAN_B(5, 4, d5m4, 14, bits, 0), \
> MAX1363_CHAN_B(7, 6, d7m6, 15, bits, 0), \
> - IIO_CHAN_SOFT_TIMESTAMP(16) \
> }
> static struct iio_chan_spec max11602_channels[] = MAX1363_8X_CHANS(8);
> static struct iio_chan_spec max11608_channels[] = MAX1363_8X_CHANS(10);
> @@ -439,7 +436,6 @@ static const enum max1363_modes max11644_mode_list[] = {
> MAX1363_CHAN_U(1, _s1, 1, bits, 0), \
> MAX1363_CHAN_B(0, 1, d0m1, 2, bits, 0), \
> MAX1363_CHAN_B(1, 0, d1m0, 3, bits, 0), \
> - IIO_CHAN_SOFT_TIMESTAMP(4) \
> }
>
> static struct iio_chan_spec max11646_channels[] = MAX1363_2X_CHANS(10);
> diff --git a/drivers/staging/iio/adc/max1363_ring.c b/drivers/staging/iio/adc/max1363_ring.c
> index df6893e..294dec9 100644
> --- a/drivers/staging/iio/adc/max1363_ring.c
> +++ b/drivers/staging/iio/adc/max1363_ring.c
> @@ -68,36 +68,21 @@ error_ret:
> static int max1363_ring_preenable(struct iio_dev *indio_dev)
> {
> struct max1363_state *st = iio_priv(indio_dev);
> - struct iio_buffer *ring = indio_dev->buffer;
> - size_t d_size = 0;
> - unsigned long numvals;
>
> /*
> * Need to figure out the current mode based upon the requested
> * scan mask in iio_dev
> */
> - st->current_mode = max1363_match_mode(ring->scan_mask,
> - st->chip_info);
> + st->current_mode = max1363_match_mode(indio_dev->buffer->scan_mask,
> + st->chip_info);
> if (!st->current_mode)
> return -EINVAL;
> -
> max1363_set_scan_mode(st);
>
> - numvals = bitmap_weight(st->current_mode->modemask,
> - indio_dev->masklength);
> - if (ring->access->set_bytes_per_datum) {
> - if (ring->scan_timestamp)
> - d_size += sizeof(s64);
> - if (st->chip_info->bits != 8)
> - d_size += numvals*2;
> - else
> - d_size += numvals;
> - if (ring->scan_timestamp && (d_size % 8))
> - d_size += 8 - (d_size % 8);
> - ring->access->set_bytes_per_datum(ring, d_size);
> - }
> + /* work out how to pull out the channels we actually want */
> + iio_update_demux(indio_dev);
>
> - return 0;
> + return iio_sw_buffer_preenable(indio_dev);
> }
>
> static irqreturn_t max1363_trigger_handler(int irq, void *p)
> @@ -141,7 +126,7 @@ static irqreturn_t max1363_trigger_handler(int irq, void *p)
>
> memcpy(rxbuf + d_size - sizeof(s64), &time_ns, sizeof(time_ns));
>
> - indio_dev->buffer->access->store_to(indio_dev->buffer, rxbuf, time_ns);
> + iio_push_to_buffer(indio_dev->buffer, rxbuf, time_ns);
> done:
> iio_trigger_notify_done(indio_dev->trig);
> kfree(rxbuf);
prev parent reply other threads:[~2011-10-24 13:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-20 16:29 [PATCH 0/5] staging:iio: add demux support Jonathan Cameron
2011-10-20 16:29 ` [PATCH 1/5] staging:iio:kfifo remove entirely pointless code Jonathan Cameron
2011-10-20 16:29 ` [PATCH 2/5] staging:iio:fine iio channel from scan index util function Jonathan Cameron
2011-10-20 16:29 ` [PATCH 3/5] staging:iio: trigger fixes for repeat request of same trigger and allocation failure Jonathan Cameron
2011-10-20 16:29 ` [PATCH 4/5] staging:iio: add demux optionally to path from device to buffer Jonathan Cameron
2011-10-20 16:29 ` [PATCH 5/5] staging:iio:adc:max1363 use new demuxing support Jonathan Cameron
2011-10-24 13:45 ` Jonathan Cameron [this message]
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=4EA56C04.20502@cam.ac.uk \
--to=jic23@cam.ac.uk \
--cc=linux-iio@vger.kernel.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).