[RFC PATCH] Fix accelerometer resume path

Werner Almesberger werner at openmoko.org
Mon Oct 12 19:02:22 CEST 2009

Michael Trimarchi wrote:
> This fix the resume path of the accelerometer. If the accelerometer
> is not power up, restore to initial status.

That code looks indeed very fishy.

However, it makes me wonder why the copy is being changed in the first
place. It doesn't look like the sort of thing you do without a reason,
good or bad.

Also, the LIS302 manual is very terse on the semantics of the "power
down mode". If there are operations that aren't permitted in power
down mode, it may well be necessary to keep the chip in power up while
restoring the registers. This could be accomplished by putting
LIS302DL_REG_CTRL1 last in regs_to_save.

If all power down does is stop collecting data, then your patch would
be correct as is.

- Werner

More information about the openmoko-kernel mailing list