Skip to content

Commit

Permalink
staging:iio:magnetometer:ak8975: set power-down mode after reading fu…
Browse files Browse the repository at this point in the history
…se ROM data

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.

Signed-off-by: Leed Aguilar <leed.aguilar@ti.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Leed Aguilar authored and Greg Kroah-Hartman committed Jun 7, 2012
1 parent 74dcd43 commit 040f3e5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/staging/iio/magnetometer/ak8975.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 040f3e5

Please sign in to comment.