Commit 8e52e279 authored by Grazvydas Ignotas's avatar Grazvydas Ignotas Committed by Samuel Ortiz

mfd: Fix TWL4030 COR bit polarity for BCI SIH block

The chip TRM documentation contradicts itself about this bit, page 174
of swcu050e says bit should be 0 for clear-on-read behavior, while
page 487 says it should be 1. Testing shows it should be 1, so set
the .set_cor flag accordingly. This is needed for upcoming BCI
charging driver to function.
Signed-off-by: default avatarGrazvydas Ignotas <notasas@gmail.com>
Acked-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent a28dbea0
...@@ -144,6 +144,7 @@ static const struct sih sih_modules_twl4030[6] = { ...@@ -144,6 +144,7 @@ static const struct sih sih_modules_twl4030[6] = {
.name = "bci", .name = "bci",
.module = TWL4030_MODULE_INTERRUPTS, .module = TWL4030_MODULE_INTERRUPTS,
.control_offset = TWL4030_INTERRUPTS_BCISIHCTRL, .control_offset = TWL4030_INTERRUPTS_BCISIHCTRL,
.set_cor = true,
.bits = 12, .bits = 12,
.bytes_ixr = 2, .bytes_ixr = 2,
.edr_offset = TWL4030_INTERRUPTS_BCIEDR1, .edr_offset = TWL4030_INTERRUPTS_BCIEDR1,
...@@ -408,7 +409,7 @@ static int twl4030_init_sih_modules(unsigned line) ...@@ -408,7 +409,7 @@ static int twl4030_init_sih_modules(unsigned line)
* set Clear-On-Read (COR) bit. * set Clear-On-Read (COR) bit.
* *
* NOTE that sometimes COR polarity is documented as being * NOTE that sometimes COR polarity is documented as being
* inverted: for MADC and BCI, COR=1 means "clear on write". * inverted: for MADC, COR=1 means "clear on write".
* And for PWR_INT it's not documented... * And for PWR_INT it's not documented...
*/ */
if (sih->set_cor) { if (sih->set_cor) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment