Skip to content

Commit 1d746d4

Browse files
6by9broonie
authored andcommitted
regulator: rpi-panel: Remove get_brightness hook
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> Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com> Link: https://lore.kernel.org/r/20220124220129.158891-8-detlev.casanova@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 8c518eb commit 1d746d4

1 file changed

Lines changed: 0 additions & 23 deletions

File tree

drivers/regulator/rpi-panel-attiny-regulator.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -207,31 +207,8 @@ static int attiny_update_status(struct backlight_device *bl)
207207
return ret;
208208
}
209209

210-
static int attiny_get_brightness(struct backlight_device *bl)
211-
{
212-
struct attiny_lcd *state = bl_get_data(bl);
213-
struct regmap *regmap = state->regmap;
214-
int ret, brightness, i;
215-
216-
mutex_lock(&state->lock);
217-
218-
for (i = 0; i < 10; i++) {
219-
ret = regmap_read(regmap, REG_PWM, &brightness);
220-
if (!ret)
221-
break;
222-
}
223-
224-
mutex_unlock(&state->lock);
225-
226-
if (ret)
227-
return ret;
228-
229-
return brightness;
230-
}
231-
232210
static const struct backlight_ops attiny_bl = {
233211
.update_status = attiny_update_status,
234-
.get_brightness = attiny_get_brightness,
235212
};
236213

237214
static int attiny_gpio_get_direction(struct gpio_chip *gc, unsigned int off)

0 commit comments

Comments
 (0)