提交 c0d4010e 编写于 作者: L Linus Walleij 提交者: Samuel Ortiz

mfd: AB8500 mask off irrelevant bits from the SPI message

The registers on the AB8500 are only 8 bits wide, so the content
of the remaining bits is undefined. Let's mask off the undefined
stuff when returning a register in an SPI read.
Acked-by: NRabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: NLinus Walleij <linus.walleij@stericsson.com>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 eb6e8ddf
......@@ -68,7 +68,12 @@ static int ab8500_spi_read(struct ab8500 *ab8500, u16 addr)
ret = spi_sync(spi, &msg);
if (!ret)
ret = ab8500->rx_buf[0];
/*
* Only the 8 lowermost bytes are
* defined with value, the rest may
* vary depending on chip/board noise.
*/
ret = ab8500->rx_buf[0] & 0xFFU;
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册