diff options
| author | Linus Walleij <linus.walleij@stericsson.com> | 2010-05-27 20:59:44 -0400 |
|---|---|---|
| committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-08-12 05:27:18 -0400 |
| commit | c0d4010e11e23d6f55f9bdda63b1974f35af71bf (patch) | |
| tree | 862ea68bf95e6f8d57d8a94c2b24d1c48ff9298b | |
| parent | eb6e8ddf06ff0d6b6548ca0b95a4edfeb2aaadd0 (diff) | |
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: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
| -rw-r--r-- | drivers/mfd/ab8500-spi.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/mfd/ab8500-spi.c b/drivers/mfd/ab8500-spi.c index b81d4f768ef6..e1c8b62b086d 100644 --- a/drivers/mfd/ab8500-spi.c +++ b/drivers/mfd/ab8500-spi.c | |||
| @@ -68,7 +68,12 @@ static int ab8500_spi_read(struct ab8500 *ab8500, u16 addr) | |||
| 68 | 68 | ||
| 69 | ret = spi_sync(spi, &msg); | 69 | ret = spi_sync(spi, &msg); |
| 70 | if (!ret) | 70 | if (!ret) |
| 71 | ret = ab8500->rx_buf[0]; | 71 | /* |
| 72 | * Only the 8 lowermost bytes are | ||
| 73 | * defined with value, the rest may | ||
| 74 | * vary depending on chip/board noise. | ||
| 75 | */ | ||
| 76 | ret = ab8500->rx_buf[0] & 0xFFU; | ||
| 72 | 77 | ||
| 73 | return ret; | 78 | return ret; |
| 74 | } | 79 | } |
