提交 cd9b6fdf 编写于 作者: O Oskar Schirmer 提交者: Dmitry Torokhov

Input: ad7877 - fix spi word size to 16 bit

With no word size given in the users platform data, a generic spi host
controller driver will assume a default word size of eight bit. This
causes transmission to be performed bytewise, which will fail on little
endian machines for sure. Failure on big endian depends on usage
of slave select to mark word boundaries.

Anyway, ad7877 is specified to work with 16 bit per word, so
unconditionally set the word size accordingly. Flag an error where 16
bit per word is not available.
Signed-off-by: NOskar Schirmer <os@emlix.com>
Signed-off-by: NDaniel Glöckner <dg@emlix.com>
Signed-off-by: NOliver Schneidewind <osw@emlix.com>
Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
上级 0b75f775
......@@ -679,6 +679,13 @@ static int __devinit ad7877_probe(struct spi_device *spi)
return -EINVAL;
}
spi->bits_per_word = 16;
err = spi_setup(spi);
if (err) {
dev_dbg(&spi->dev, "spi master doesn't support 16 bits/word\n");
return err;
}
ts = kzalloc(sizeof(struct ad7877), GFP_KERNEL);
input_dev = input_allocate_device();
if (!ts || !input_dev) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册