staging: fbtft: convert fbtft_reset() to be non-atomic
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 19 Jan 2017 10:45:41 +0000 (12:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jan 2017 11:50:27 +0000 (12:50 +0100)
commit9ed2bfb3e39bfbe79ddcf2d03eef28242ea60253
tree2322a2986a6509c2067cd25644f519b6f4f83afa
parentf17331eb4bbb1db8a05ac1c63d39f4d5adec8835
staging: fbtft: convert fbtft_reset() to be non-atomic

First of all, fbtft in current state doesn't allow to override GPIOs to be
optional, like "reset" one. It might be a bug somewhere, but rather out of
scope of this fix.

Second, not all GPIOs available on the board would be SoC based, some of them
might sit on I2C GPIO expanders, for example, on Intel Edison/Arduino, and thus
any communication with them might sleep.

Besides that using udelay() and mdelay() is kinda resource wasteful.

Summarize all of the above, convert fbtft_reset() function to non-atomic
variant by using gpio_set_value_cansleep(), usleep_range(), and msleep().

Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fbtft/fbtft-core.c