| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Backlight driver for Wolfson Microelectronics WM831x PMICs |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright 2009 Wolfson Microelectonics plc |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 8 | | - * published by the Free Software Foundation. |
|---|
| 9 | 6 | */ |
|---|
| 10 | 7 | |
|---|
| 11 | 8 | #include <linux/kernel.h> |
|---|
| .. | .. |
|---|
| 94 | 91 | |
|---|
| 95 | 92 | static int wm831x_backlight_update_status(struct backlight_device *bl) |
|---|
| 96 | 93 | { |
|---|
| 97 | | - int brightness = bl->props.brightness; |
|---|
| 98 | | - |
|---|
| 99 | | - if (bl->props.power != FB_BLANK_UNBLANK) |
|---|
| 100 | | - brightness = 0; |
|---|
| 101 | | - |
|---|
| 102 | | - if (bl->props.fb_blank != FB_BLANK_UNBLANK) |
|---|
| 103 | | - brightness = 0; |
|---|
| 104 | | - |
|---|
| 105 | | - if (bl->props.state & BL_CORE_SUSPENDED) |
|---|
| 106 | | - brightness = 0; |
|---|
| 107 | | - |
|---|
| 108 | | - return wm831x_backlight_set(bl, brightness); |
|---|
| 94 | + return wm831x_backlight_set(bl, backlight_get_brightness(bl)); |
|---|
| 109 | 95 | } |
|---|
| 110 | 96 | |
|---|
| 111 | 97 | static int wm831x_backlight_get_brightness(struct backlight_device *bl) |
|---|