linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Leed Aguilar <leed.aguilar@ti.com>
Cc: linux-iio@vger.kernel.org, Laxman Dewangan <ldewangan@nvidia.com>
Subject: Re: [PATCH] staging:iio:magnetometer:ak8975: set power-down mode after reading fuse ROM data
Date: Thu, 31 May 2012 08:21:42 +0100	[thread overview]
Message-ID: <4FC71C06.6080403@kernel.org> (raw)
In-Reply-To: <1338429137-27059-1-git-send-email-leed.aguilar@ti.com>

Sounds sensible, but I don't have one of these so cc'ing Laxman
> Fuse ROM data access mode is the only mode which does not
> transition to power-down mode automatically.
>
> As per the AK8975 data sheet, it is recomended to set the
> power-down mode first before attempting to change into
> another mode.
>
> Change-Id: I4013c7963b19b3fe4b67553521b1083f018507bb
> Signed-off-by: Leed Aguilar<leed.aguilar@ti.com>
> Cc: Jonathan Cameron<jic23@kernel.org>
> ---
>   drivers/staging/iio/magnetometer/ak8975.c |   11 +++++++++++
>   1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/staging/iio/magnetometer/ak8975.c b/drivers/staging/iio/magnetometer/ak8975.c
> index 52833cd..b06bd2d 100644
> --- a/drivers/staging/iio/magnetometer/ak8975.c
> +++ b/drivers/staging/iio/magnetometer/ak8975.c
> @@ -194,6 +194,17 @@ static int ak8975_setup(struct i2c_client *client)
>   		return ret;
>   	}
>
> +	/* After reading fuse ROM data set power-down mode */
> +	ret = ak8975_write_data(client,
> +				AK8975_REG_CNTL,
> +				AK8975_REG_CNTL_MODE_POWER_DOWN,
> +				AK8975_REG_CNTL_MODE_MASK,
> +				AK8975_REG_CNTL_MODE_SHIFT);
> +	if (ret<  0) {
> +		dev_err(&client->dev, "Error in setting power-down mode\n");
> +		return ret;
> +	}
> +
>   /*
>    * Precalculate scale factor (in Gauss units) for each axis and
>    * store in the device data.


  reply	other threads:[~2012-05-31  7:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-31  1:52 [PATCH] staging:iio:magnetometer:ak8975: set power-down mode after reading fuse ROM data Leed Aguilar
2012-05-31  7:21 ` Jonathan Cameron [this message]
2012-05-31  8:59   ` Laxman Dewangan

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=4FC71C06.6080403@kernel.org \
    --to=jic23@kernel.org \
    --cc=ldewangan@nvidia.com \
    --cc=leed.aguilar@ti.com \
    --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).