Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@cam.ac.uk>
To: michael.hennerich@analog.com
Cc: linux-iio@vger.kernel.org, drivers@analog.com,
	device-drivers-devel@blackfin.uclinux.org
Subject: Re: [PATCH 3/6] IIO: GYRO: ADXRS450: Add missing parity bit generation
Date: Fri, 29 Apr 2011 13:09:22 +0100	[thread overview]
Message-ID: <4DBAAA72.8030003@cam.ac.uk> (raw)
In-Reply-To: <1304074721-18159-3-git-send-email-michael.hennerich@analog.com>

On 04/29/11 11:58, michael.hennerich@analog.com wrote:
> From: Michael Hennerich <michael.hennerich@analog.com>
> 
> Add missing parity bit generation. Failure to add the parity bit
> caused half of the register accesses to fail.
oops :)
> 
> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
> ---
>  drivers/staging/iio/gyro/adxrs450_core.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/staging/iio/gyro/adxrs450_core.c b/drivers/staging/iio/gyro/adxrs450_core.c
> index c02e3ef..5671276 100644
> --- a/drivers/staging/iio/gyro/adxrs450_core.c
> +++ b/drivers/staging/iio/gyro/adxrs450_core.c
> @@ -59,6 +59,9 @@ static int adxrs450_spi_read_reg_16(struct device *dev,
>  	st->tx[2] = 0;
>  	st->tx[3] = 0;
>  
> +	if (!(hweight32(be32_to_cpu(*(u32 *)st->tx)) & 1))
> +		st->tx[3]  |= ADXRS450_P;
> +
>  	spi_message_init(&msg);
>  	spi_message_add_tail(&xfers[0], &msg);
>  	spi_message_add_tail(&xfers[1], &msg);
> @@ -103,6 +106,10 @@ static int adxrs450_spi_write_reg_16(struct device *dev,
>  	st->tx[1] = reg_address << 1 | val >> 15;
>  	st->tx[2] = val >> 7;
>  	st->tx[3] = val << 1;
> +
> +	if (!(hweight32(be32_to_cpu(*(u32 *)st->tx)) & 1))
> +		st->tx[3]  |= ADXRS450_P;
> +
>  	spi_message_init(&msg);
>  	spi_message_add_tail(&xfers, &msg);
>  	ret = spi_sync(st->us, &msg);


  reply	other threads:[~2011-04-29 12:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-29 10:58 [PATCH 1/6] IIO: GYRO: ADXRS450: Don't issue two messages, use two transfers michael.hennerich
2011-04-29 10:58 ` [PATCH 2/6] IIO: GYRO: ADXRS450: Cleanup result extraction and update license notice michael.hennerich
2011-04-29 12:08   ` Jonathan Cameron
2011-04-29 10:58 ` [PATCH 3/6] IIO: GYRO: ADXRS450: Add missing parity bit generation michael.hennerich
2011-04-29 12:09   ` Jonathan Cameron [this message]
2011-04-29 10:58 ` [PATCH 4/6] IIO: GYRO: ADXRS450: enforce sequential transfer delay of at least 0.1ms michael.hennerich
2011-04-29 12:12   ` Jonathan Cameron
2011-04-29 10:58 ` [PATCH 5/6] IIO: GYRO: ADXRS450: Fix sign issues, properly shift results and limit values michael.hennerich
2011-04-29 12:14   ` Jonathan Cameron
2011-04-29 10:58 ` [PATCH 6/6] IIO: GYRO: ADXRS450: Don't exit probe, in case the power on default is not met michael.hennerich
2011-04-29 12:15   ` Jonathan Cameron
2011-04-29 12:05 ` [PATCH 1/6] IIO: GYRO: ADXRS450: Don't issue two messages, use two transfers Jonathan Cameron
  -- strict thread matches above, loose matches on Subject: below --
2011-04-29 12:16 michael.hennerich
2011-04-29 12:17 ` [PATCH 3/6] IIO: GYRO: ADXRS450: Add missing parity bit generation 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=4DBAAA72.8030003@cam.ac.uk \
    --to=jic23@cam.ac.uk \
    --cc=device-drivers-devel@blackfin.uclinux.org \
    --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