]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
TWL4030: use *_SIH_CTRL.COR bit to determine whether to read or write ISR to clear
authorPaul Walmsley <paul@pwsan.com>
Tue, 22 Jul 2008 23:51:41 +0000 (17:51 -0600)
committerTony Lindgren <tony@atomide.com>
Mon, 4 Aug 2008 14:13:42 +0000 (17:13 +0300)
commit852131ad52c32245c970ffcefd8335058525516e
treed1795170a741f01cb324eb7d794b2e824ef2f315
parentf405fb3b4fef48f4b37f288d89b3ebaf88eadcb7
TWL4030: use *_SIH_CTRL.COR bit to determine whether to read or write ISR to clear

TWL4030 interrupt status register bits can be cleared in one of two ways:
either by reading from the register, or by writing a 1 to the
appropriate bit(s) in the register.  This behavior can be altered at any
time by the <twlmodule>_SIH_CTRL.COR register bit ("clear-on-read").

The TWL4030 TRM is deeply confused as to whether COR=1 means that the
registers are cleared on reads, or cleared on writes.  Peter De
Schrijver <peter.de-schrijver> confirms that COR=1 means that the registers
are cleared on read.

So, for each TWL4030 SIH, check the value of the *_SIH_CTRL.COR bit, and if
it is 1, use reads to clear the ISRs; if it is 0, use writes.

Also, use WARN_ON() to warn if the read/write failed, and don't skip
the rest of the initialization on failure either.

Thanks to Peter for his help with this patch.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/i2c/chips/twl4030-core.c