| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Backlight driver for Marvell Semiconductor 88PM8606 |
|---|
| 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> |
|---|
| .. | .. |
|---|
| 124 | 121 | |
|---|
| 125 | 122 | static int pm860x_backlight_update_status(struct backlight_device *bl) |
|---|
| 126 | 123 | { |
|---|
| 127 | | - int brightness = bl->props.brightness; |
|---|
| 128 | | - |
|---|
| 129 | | - if (bl->props.power != FB_BLANK_UNBLANK) |
|---|
| 130 | | - brightness = 0; |
|---|
| 131 | | - |
|---|
| 132 | | - if (bl->props.fb_blank != FB_BLANK_UNBLANK) |
|---|
| 133 | | - brightness = 0; |
|---|
| 134 | | - |
|---|
| 135 | | - if (bl->props.state & BL_CORE_SUSPENDED) |
|---|
| 136 | | - brightness = 0; |
|---|
| 137 | | - |
|---|
| 138 | | - return pm860x_backlight_set(bl, brightness); |
|---|
| 124 | + return pm860x_backlight_set(bl, backlight_get_brightness(bl)); |
|---|
| 139 | 125 | } |
|---|
| 140 | 126 | |
|---|
| 141 | 127 | static int pm860x_backlight_get_brightness(struct backlight_device *bl) |
|---|
| .. | .. |
|---|
| 174 | 160 | return -ENODEV; |
|---|
| 175 | 161 | } |
|---|
| 176 | 162 | for_each_child_of_node(nproot, np) { |
|---|
| 177 | | - if (!of_node_cmp(np->name, name)) { |
|---|
| 163 | + if (of_node_name_eq(np, name)) { |
|---|
| 178 | 164 | of_property_read_u32(np, "marvell,88pm860x-iset", |
|---|
| 179 | 165 | &iset); |
|---|
| 180 | 166 | data->iset = PM8606_WLED_CURRENT(iset); |
|---|