Skip to content

Commit a02f1a2

Browse files
6by9pelwell
authored andcommitted
regulator/rpi-panel: Power off display on shutdown
Adds a shutdown function to turn off the backlight, bridge, and touch controller on shutdown. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
1 parent 89f1213 commit a02f1a2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,14 @@ static void attiny_i2c_remove(struct i2c_client *client)
370370
mutex_destroy(&state->lock);
371371
}
372372

373+
static void attiny_i2c_shutdown(struct i2c_client *client)
374+
{
375+
struct attiny_lcd *state = i2c_get_clientdata(client);
376+
377+
regmap_write(state->regmap, REG_PWM, 0);
378+
regmap_write(state->regmap, REG_POWERON, 0);
379+
}
380+
373381
static const struct of_device_id attiny_dt_ids[] = {
374382
{ .compatible = "raspberrypi,7inch-touchscreen-panel-regulator" },
375383
{},
@@ -384,6 +392,7 @@ static struct i2c_driver attiny_regulator_driver = {
384392
},
385393
.probe = attiny_i2c_probe,
386394
.remove = attiny_i2c_remove,
395+
.shutdown = attiny_i2c_shutdown,
387396
};
388397

389398
module_i2c_driver(attiny_regulator_driver);

0 commit comments

Comments
 (0)