| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Backlight driver for Dialog Semiconductor DA9030/DA9034 |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 6 | 7 | * |
|---|
| 7 | 8 | * Copyright (C) 2006-2008 Marvell International Ltd. |
|---|
| 8 | 9 | * Eric Miao <eric.miao@marvell.com> |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 11 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 12 | | - * published by the Free Software Foundation. |
|---|
| 13 | 10 | */ |
|---|
| 14 | 11 | |
|---|
| 15 | 12 | #include <linux/kernel.h> |
|---|
| .. | .. |
|---|
| 80 | 77 | |
|---|
| 81 | 78 | static int da903x_backlight_update_status(struct backlight_device *bl) |
|---|
| 82 | 79 | { |
|---|
| 83 | | - int brightness = bl->props.brightness; |
|---|
| 84 | | - |
|---|
| 85 | | - if (bl->props.power != FB_BLANK_UNBLANK) |
|---|
| 86 | | - brightness = 0; |
|---|
| 87 | | - |
|---|
| 88 | | - if (bl->props.fb_blank != FB_BLANK_UNBLANK) |
|---|
| 89 | | - brightness = 0; |
|---|
| 90 | | - |
|---|
| 91 | | - if (bl->props.state & BL_CORE_SUSPENDED) |
|---|
| 92 | | - brightness = 0; |
|---|
| 93 | | - |
|---|
| 94 | | - return da903x_backlight_set(bl, brightness); |
|---|
| 80 | + return da903x_backlight_set(bl, backlight_get_brightness(bl)); |
|---|
| 95 | 81 | } |
|---|
| 96 | 82 | |
|---|
| 97 | 83 | static int da903x_backlight_get_brightness(struct backlight_device *bl) |
|---|