Follow up patches will add support for more complex means of powering
the backlight on and off such as using a regulator. To prevent calls to
the regulator API from becoming unbalanced, keep track of the enabled
state internally.
Signed-off-by: Thierry Reding <treding@nvidia.com>
In preparation for adding an optional regulator and enable GPIO to the
driver, split the power on and power off sequences into separate
functions to reduce code duplication at the multiple call sites.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Add more blank lines to increase readability. While at it, remove a
trailing blank line at the end of the file.
Signed-off-by: Thierry Reding <treding@nvidia.com>
BUG: sleeping function called from invalid context at mm/slub.c:926
in_atomic(): 1, irqs_disabled(): 128, pid: 0, name: swapper/3
INFO: lockdep is turned off.
irq event stamp: 45900
hardirqs last enabled at (45899): [<c009fe18>] rcu_preempt_note_context_switch+0x174/0x18c
hardirqs last disabled at (45900): [<c0605a64>] _raw_spin_lock_irq+0x18/0x50
softirqs last enabled at (45744): [<c002c424>] irq_enter+0x50/0x78
softirqs last disabled at (45743): [<c002c418>] irq_enter+0x44/0x78
CPU: 3 PID: 0 Comm: swapper/3 Tainted: G O 3.10.0 #405
[<c0013fe8>] (unwind_backtrace+0x0/0xe0) from [<c0011930>] (show_stack+0x10/0x14)
[<c0011930>] (show_stack+0x10/0x14) from [<c00fa3dc>] (__kmalloc+0x70/0x228)
[<c00fa3dc>] (__kmalloc+0x70/0x228) from [<c0148d2c>] (__proc_create+0x94/0xf0)
[<c0148d2c>] (__proc_create+0x94/0xf0) from [<c0149000>] (proc_mkdir_data+0x30/0x74)
[<c0149000>] (proc_mkdir_data+0x30/0x74) from [<c009babc>] (register_handler_proc+0xe8/0x114)
[<c009babc>] (register_handler_proc+0xe8/0x114) from [<c00982b0>] (__setup_irq+0x334/0x3fc)
[<c00982b0>] (__setup_irq+0x334/0x3fc) from [<c0098558>] (setup_irq+0x58/0x80)
[<c0098558>] (setup_irq+0x58/0x80) from [<c05ef51c>] (rk_timer_init_clockevent+0x98/0xcc)
[<c05ef51c>] (rk_timer_init_clockevent+0x98/0xcc) from [<c05ed0dc>] (percpu_timer_setup+0x54/0xa8)
[<c05ed0dc>] (percpu_timer_setup+0x54/0xa8) from [<c05ed4d8>] (secondary_start_kernel+0x128/0x160)
[<c05ed4d8>] (secondary_start_kernel+0x128/0x160) from [<600081bc>] (0x600081bc)