regulator: rpi-panel: Remove get_brightness hook
authorDave Stevenson <dave.stevenson@raspberrypi.com>
Tue, 21 Sep 2021 14:32:50 +0000 (15:32 +0100)
committerPhil Elwell <8911409+pelwell@users.noreply.github.com>
Mon, 27 Sep 2021 09:16:39 +0000 (10:16 +0100)
The driver was implementing a get_brightness function that
tried to read back the PWM setting of the display to report
as the current brightness.
The controller on the display does not support that, therefore
we end up reporting a brightness of 0, and that confuses
systemd's backlight service.

Remove the hook so that the framework returns the current
brightness automatically.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
drivers/regulator/rpi-panel-attiny-regulator.c

index 998233f14085ed81a857960320de22fc29735af4..8090b9a485b5e5808e663ee377d979072c9141dd 100644 (file)
@@ -207,31 +207,8 @@ static int attiny_update_status(struct backlight_device *bl)
        return ret;
 }
 
-static int attiny_get_brightness(struct backlight_device *bl)
-{
-       struct attiny_lcd *state = bl_get_data(bl);
-       struct regmap *regmap = state->regmap;
-       int ret, brightness, i;
-
-       mutex_lock(&state->lock);
-
-       for (i = 0; i < 10; i++) {
-               ret = regmap_read(regmap, REG_PWM, &brightness);
-               if (!ret)
-                       break;
-       }
-
-       mutex_unlock(&state->lock);
-
-       if (ret)
-               return ret;
-
-       return brightness;
-}
-
 static const struct backlight_ops attiny_bl = {
        .update_status  = attiny_update_status,
-       .get_brightness = attiny_get_brightness,
 };
 
 static int attiny_gpio_get_direction(struct gpio_chip *gc, unsigned int off)