A local variable hiding the one with the same name at an upper scope,
resulted in storing the register address instead of the desired value in
LCD registers.
In register writes there is no extra cycle after the command, so we use
only 9-bit word size.
Fix from Peter Ujfalusi <peter.ujfalusi@nokia.com>.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Signed-off-by: Juha Yrjölä <juha.yrjola@nokia.com>
spi_message_init(&m);
m.spi = lph8923.spi;
-
- if (len > 1) {
- cmd <<= 1;
- set_spi_data_width(10);
- } else {
- set_spi_data_width(9);
- }
+ set_spi_data_width(9);
t.cs_change = 0;
w = cmd;
if (!len)
return;
- set_spi_data_width(9);
-
t.tx_buf = &w;
for (i = 0; i < len; i++) {
- u16 w;
-
spi_message_init(&m);
m.spi = lph8923.spi;
spi_message_add_tail(&t, &m);