Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 354c879d authored by Viorel Suman's avatar Viorel Suman Committed by Jonathan Cameron
Browse files

iio: magnetometer: mmc35240: fix SET/RESET sequence



The RESET operation invoked in the last instance will align
in the natural way all 3 axis and the chip top view.

Without this, north and south are swapped.

Signed-off-by: default avatarViorel Suman <viorel.suman@intel.com>
Signed-off-by: default avatarDaniel Baluta <daniel.baluta@intel.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 3ceaa2c2
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -222,14 +222,15 @@ static int mmc35240_init(struct mmc35240_data *data)

	/*
	 * make sure we restore sensor characteristics, by doing
	 * a RESET/SET sequence
	 * a SET/RESET sequence, the axis polarity being naturally
	 * aligned after RESET
	 */
	ret = mmc35240_hw_set(data, false);
	ret = mmc35240_hw_set(data, true);
	if (ret < 0)
		return ret;
	usleep_range(MMC53240_WAIT_SET_RESET, MMC53240_WAIT_SET_RESET + 1);

	ret = mmc35240_hw_set(data, true);
	ret = mmc35240_hw_set(data, false);
	if (ret < 0)
		return ret;