bcm27xx: add support for linux v5.15
[openwrt/staging/chunkeey.git] / target / linux / bcm27xx / patches-5.15 / 950-0516-regulator-rpi-panel-Remove-get_brightness-hook.patch
1 From 7019ea2a7587700e366729872bdec56d54842c8c Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Tue, 21 Sep 2021 15:32:50 +0100
4 Subject: [PATCH] regulator: rpi-panel: Remove get_brightness hook
5
6 The driver was implementing a get_brightness function that
7 tried to read back the PWM setting of the display to report
8 as the current brightness.
9 The controller on the display does not support that, therefore
10 we end up reporting a brightness of 0, and that confuses
11 systemd's backlight service.
12
13 Remove the hook so that the framework returns the current
14 brightness automatically.
15
16 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
17 ---
18 .../regulator/rpi-panel-attiny-regulator.c | 23 -------------------
19 1 file changed, 23 deletions(-)
20
21 --- a/drivers/regulator/rpi-panel-attiny-regulator.c
22 +++ b/drivers/regulator/rpi-panel-attiny-regulator.c
23 @@ -207,31 +207,8 @@ static int attiny_update_status(struct b
24 return ret;
25 }
26
27 -static int attiny_get_brightness(struct backlight_device *bl)
28 -{
29 - struct attiny_lcd *state = bl_get_data(bl);
30 - struct regmap *regmap = state->regmap;
31 - int ret, brightness, i;
32 -
33 - mutex_lock(&state->lock);
34 -
35 - for (i = 0; i < 10; i++) {
36 - ret = regmap_read(regmap, REG_PWM, &brightness);
37 - if (!ret)
38 - break;
39 - }
40 -
41 - mutex_unlock(&state->lock);
42 -
43 - if (ret)
44 - return ret;
45 -
46 - return brightness;
47 -}
48 -
49 static const struct backlight_ops attiny_bl = {
50 .update_status = attiny_update_status,
51 - .get_brightness = attiny_get_brightness,
52 };
53
54 static int attiny_gpio_get_direction(struct gpio_chip *gc, unsigned int off)