Skip to content

Commit

Permalink
regulator/rpi-panel: Power off display on shutdown
Browse files Browse the repository at this point in the history
Adds a shutdown function to turn off the backlight, bridge, and
touch controller on shutdown.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
  • Loading branch information
6by9 committed Apr 30, 2024
1 parent ca6c31b commit cfc21bf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/regulator/rpi-panel-attiny-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,14 @@ static void attiny_i2c_remove(struct i2c_client *client)
mutex_destroy(&state->lock);
}

static void attiny_i2c_shutdown(struct i2c_client *client)
{
struct attiny_lcd *state = i2c_get_clientdata(client);

regmap_write(state->regmap, REG_PWM, 0);
regmap_write(state->regmap, REG_POWERON, 0);
}

static const struct of_device_id attiny_dt_ids[] = {
{ .compatible = "raspberrypi,7inch-touchscreen-panel-regulator" },
{},
Expand All @@ -384,6 +392,7 @@ static struct i2c_driver attiny_regulator_driver = {
},
.probe = attiny_i2c_probe,
.remove = attiny_i2c_remove,
.shutdown = attiny_i2c_shutdown,
};

module_i2c_driver(attiny_regulator_driver);
Expand Down

0 comments on commit cfc21bf

Please sign in to comment.