[PORT FROM R2] pn544: Adding suspend to ram support.
authorAymen Zayet <aymenx.zayet@intel.com>
Tue, 20 Dec 2011 10:09:47 +0000 (11:09 +0100)
committerbuildbot <buildbot@intel.com>
Thu, 29 Dec 2011 18:47:30 +0000 (10:47 -0800)
commitfed22bf41a0259a4406dc4ed758b25f085f660ec
treefc55b13f4042308bb2442949a4179765d26a489c
parent5615d5065799b5b122d6f2771162c4e9d3f78f91
[PORT FROM R2] pn544: Adding suspend to ram support.

BZ: 11182

To be able to suspend the pn544, the driver shall guarantee that the
suspend process doesn't occurs within a read cycle. For this purpose,
a read wake lock is held when reading the first byte and released
when reading the requested data.

PN544 interrupt shall wake up the platform from suspend to ram. For
this, the interrupt shall be IRQ wake capable and shall be disabled
on PM_SUSPEND_PREPARE. This is mondatory to avoid loosing interrupts
during the suspend to ram.

Note that suspend process starts by freezing the user space tasks, so
the reader thread will be signaled and wait_event_interruptible will
return -ERESTARTSYS. The upper layer shall handle such situation by
triggering the read process again.

Change-Id: I56b60ce6e7ad5f1c45c2986972219477671245bd
Signed-off-by: Aymen Zayet <aymenx.zayet@intel.com>
Reviewed-on: http://android.intel.com:8080/29255
Reviewed-by: Wahid, KenX <kenx.wahid@intel.com>
Reviewed-by: Rebraca, DejanX <dejanx.rebraca@intel.com>
Reviewed-by: Champciaux, NicolasX <nicolasx.champciaux@intel.com>
Tested-by: Champciaux, NicolasX <nicolasx.champciaux@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/nfc/pn544.c