Marko Katic 1581b088fc backlight: corgi_lcd: Use gpio_set_value_cansleep() to avoid WARN_ON
Changing backlight intensity on an Akita (Sharp Zaurus C-1000) triggers
WARN_ON message:

  WARNING: at drivers/gpio/gpiolib.c:1672 __gpio_set_value+0x38/0xa4()
  Modules linked in:
  Backtrace:
    corgi_bl_set_intensity+0x0/0x74
    corgi_bl_update_status+0x0/0x64
    corgi_lcd_probe+0x0/0x258
    spi_drv_probe+0x0/0x24
    driver_probe_device+0x0/0x208
    __driver_attach+0x0/0x94
    bus_for_each_dev+0x0/0x90
    driver_attach+0x0/0x28
    bus_add_driver+0x0/0x22c
    driver_register+0x0/0x134
    spi_register_driver+0x0/0x60
    corgi_lcd_driver_init+0x0/0x1c
    do_one_initcall+0x0/0x174
    kernel_init+0x0/0x2a8

Akita machines have backlight controls hooked to a gpio expander chip,
max7310 using i2c transfers which can sleep.  In this case,
pca953x_gpio_set_value() can be called to control gpio, and
pca953x_setup_gpio() sets can_sleep flag.  Therefore,
gpio_set_value_cansleep() should be used in order to avoid WARN_ON on
akita machines.

Akita is the only exception in this case since other users of corgi_lcd
access backlight gpio controls through a different gpio expander which
does not set the can_sleep flag.

Signed-off-by: Marko Katic <dromede@gmail.com>
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-12-17 17:15:17 -08:00
..
2012-12-15 13:03:48 -08:00
2012-04-08 14:27:08 +00:00
2012-10-12 10:21:02 +09:00
2012-10-12 10:21:02 +09:00
2011-10-03 15:52:38 +00:00
2012-04-08 14:27:09 +00:00
2011-03-31 11:26:23 -03:00
2012-03-28 18:30:03 +01:00
2012-03-28 18:30:03 +01:00
2009-01-12 20:56:32 +01:00
2012-07-24 12:58:15 +02:00
2012-03-28 18:30:03 +01:00
2012-10-12 10:21:02 +09:00
2011-09-01 00:31:05 +00:00
2011-03-22 16:18:51 +09:00
2011-03-31 11:26:23 -03:00
2012-10-12 10:21:02 +09:00
2012-07-08 14:03:17 +00:00
2010-05-25 08:07:09 -07:00
2012-09-22 21:16:20 +00:00
2012-02-15 04:31:21 +00:00
2012-07-24 12:58:15 +02:00
2011-09-27 18:08:04 +02:00
2012-10-12 10:21:02 +09:00
2012-01-22 14:50:02 +01:00
2010-02-27 18:31:14 +01:00
2011-09-14 16:40:52 +00:00
2012-03-28 18:30:03 +01:00
2012-10-12 10:21:02 +09:00
2012-10-12 10:21:02 +09:00
2012-03-28 18:30:03 +01:00
2010-12-21 01:05:43 +09:00
2012-07-08 14:03:50 +00:00
2010-05-25 08:07:09 -07:00
2011-03-31 11:26:23 -03:00
2010-06-16 18:05:05 +02:00
2012-09-01 08:51:03 -07:00
2012-10-12 10:21:02 +09:00
2011-06-24 17:14:39 +09:00
2010-02-27 18:31:13 +01:00
2011-07-04 16:02:48 +09:00
2012-10-01 19:11:38 -07:00