ARM: PXA2xx: MFP: fix potential direction bug
authorIgor Grinberg <grinberg@compulab.co.il>
Thu, 12 Apr 2012 12:43:29 +0000 (15:43 +0300)
committerHaojian Zhuang <haojian.zhuang@gmail.com>
Fri, 27 Apr 2012 03:14:06 +0000 (11:14 +0800)
commitef7c7c693b4b05a293678fd40ed1511bc94d6f61
tree9ea5270c9139d9dd1047738c5eda6d89ef311162
parenta13b878780ea98d8415203c4502a8fc5bc614656
ARM: PXA2xx: MFP: fix potential direction bug

Pins configured as input and have MFP_LPM_DRIVE_* flag set, can have a
wrong output value for some period of time (spike) during the suspend
sequence.
This can happen because the direction of the pins (GPDR) is set by
software and the output level is set by hardware (PGSR) at a later
stage.

Fix the above potential bug by setting the output levels first.
Also save the actual levels of the pins before the suspend and restore
them after the resume, but before the direction settings take place, so
the same bug as described above will not happen in the resume sequence.

Reported-by: Paul Parsons <lost.distance@yahoo.com>
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Tested-by: Paul Parsons <lost.distance@yahoo.com>
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
arch/arm/mach-pxa/mfp-pxa2xx.c