Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@cam.ac.uk>
To: Michael Hennerich <michael.hennerich@analog.com>
Cc: linux-iio@vger.kernel.org, drivers@analog.com
Subject: Re: [PATCH] staging: iio: ring_generic: provide IIO_CONST_ATTR_SCAN_EL_TYPE_WITH_SHIFT
Date: Tue, 05 Oct 2010 15:01:07 +0100	[thread overview]
Message-ID: <4CAB2FA3.6030005@cam.ac.uk> (raw)
In-Reply-To: <1286283606-6849-1-git-send-email-michael.hennerich@analog.com>

On 10/05/10 14:00, Michael Hennerich wrote:
> 
> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>

Send it to Greg with the first user... Also need to update the
documentation in sysfs-bus-iio to cover this, but that can be
a separate patch.

Jonathan
> ---
>  drivers/staging/iio/ring_generic.h |   17 +++++++++++++++++
>  1 files changed, 17 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/staging/iio/ring_generic.h b/drivers/staging/iio/ring_generic.h
> index abd52ea..728aa41 100644
> --- a/drivers/staging/iio/ring_generic.h
> +++ b/drivers/staging/iio/ring_generic.h
> @@ -292,6 +292,23 @@ ssize_t iio_scan_el_ts_show(struct device *dev, struct device_attribute *attr,
>   **/
>  #define IIO_CONST_ATTR_SCAN_EL_TYPE(_name, _sign, _bits, _storagebits) \
>  	IIO_CONST_ATTR(_name##_type, #_sign#_bits"/"#_storagebits);
> +
> +/**
> + * IIO_CONST_ATTR_SCAN_EL_TYPE_WITH_SHIFT - attr to specify the data format of a scan el
> + * @name: the scan el name (may be more general and cover a set of scan elements
> + * @_sign: either s or u for signed or unsigned
> + * @_bits: number of actual bits occuplied by the value
> + * @_storagebits: number of bits _bits is padded to when read out of buffer
> + * @_shiftbits: number of bits _shiftbits the result must be shifted
> + **/
> +#define IIO_CONST_ATTR_SCAN_EL_TYPE_WITH_SHIFT(_name, _sign, _bits, \
> +					       _storagebits, _shiftbits) \
> +	IIO_CONST_ATTR(_name##_type, #_sign#_bits"/"#_storagebits \
> +		       ">>"#_shiftbits);
> +
> +#define IIO_SCAN_EL_TYPE_SIGNED         's'
> +#define IIO_SCAN_EL_TYPE_UNSIGNED       'u'
> +
>  /*
>   * These are mainly provided to allow for a change of implementation if a device
>   * has a large number of scan elements


  reply	other threads:[~2010-10-05 13:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-05 13:00 [PATCH] staging: iio: ring_generic: provide IIO_CONST_ATTR_SCAN_EL_TYPE_WITH_SHIFT Michael Hennerich
2010-10-05 14:01 ` Jonathan Cameron [this message]
2010-10-05 14:11   ` Hennerich, Michael
2010-10-05 15:06     ` Jonathan Cameron
  -- strict thread matches above, loose matches on Subject: below --
2010-10-07 12:24 michael.hennerich
2010-10-07 12:51 ` Jonathan Cameron
2010-10-05 12:29 michael.hennerich

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=4CAB2FA3.6030005@cam.ac.uk \
    --to=jic23@cam.ac.uk \
    --cc=drivers@analog.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=michael.hennerich@analog.com \
    /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