| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Backlight driver for Maxim MAX8925 |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2009 Marvell International Ltd. |
|---|
| 5 | 6 | * Haojian Zhuang <haojian.zhuang@marvell.com> |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 8 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 9 | | - * published by the Free Software Foundation. |
|---|
| 10 | 7 | */ |
|---|
| 11 | 8 | |
|---|
| 12 | 9 | #include <linux/init.h> |
|---|
| .. | .. |
|---|
| 67 | 64 | |
|---|
| 68 | 65 | static int max8925_backlight_update_status(struct backlight_device *bl) |
|---|
| 69 | 66 | { |
|---|
| 70 | | - int brightness = bl->props.brightness; |
|---|
| 71 | | - |
|---|
| 72 | | - if (bl->props.power != FB_BLANK_UNBLANK) |
|---|
| 73 | | - brightness = 0; |
|---|
| 74 | | - |
|---|
| 75 | | - if (bl->props.fb_blank != FB_BLANK_UNBLANK) |
|---|
| 76 | | - brightness = 0; |
|---|
| 77 | | - |
|---|
| 78 | | - if (bl->props.state & BL_CORE_SUSPENDED) |
|---|
| 79 | | - brightness = 0; |
|---|
| 80 | | - |
|---|
| 81 | | - return max8925_backlight_set(bl, brightness); |
|---|
| 67 | + return max8925_backlight_set(bl, backlight_get_brightness(bl)); |
|---|
| 82 | 68 | } |
|---|
| 83 | 69 | |
|---|
| 84 | 70 | static int max8925_backlight_get_brightness(struct backlight_device *bl) |
|---|