Xilinx: ARM: GPIO: Fix for small bit-bang GPIO set value problem
commit863f3a832220932e8256df7d045d9b37793ff231
authorDavid Luman <dluman@cmlab.biz>
Fri, 30 Mar 2012 19:58:19 +0000 (30 13:58 -0600)
committerJohn Linn <john.linn@xilinx.com>
Mon, 9 Apr 2012 19:05:18 +0000 (9 12:05 -0700)
treef13c5276cded7456b65984fd41805a99a7fcabba
parenta32b69069ad0713e21d72375b2180860367647c3
Xilinx: ARM: GPIO: Fix for small bit-bang GPIO set value problem

Using GPIO to bit-bang an SPI interface, a problem was found. When the kernel
code needed to set the MOSI signal to TRUE, it called gpio_set_value. But
gpio_set_value was called with a value greater than 1 instead of 1 (10000000).

Since the xgpiops_set_value function was expecting to see the variable state
set to be a value of 0 or 1, the value, while not zero, was seen as zero due
to the AND'ing of the variable state with 1.

This change corrects this behavior by testing the variable state and setting it
to be 1 if it is initially a non-zero value.

Signed-off-by: David Luman dluman@cmlab.biz
drivers/gpio/xilinx_gpiops.c