0
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-11-25 06:26:15 +00:00
openwrt/target/linux/bcm27xx/patches-6.6/950-1072-regulator-rpi-panel-Power-off-display-on-shutdown.patch
Álvaro Fernández Rojas 8c405cdccc bcm27xx: add 6.6 kernel patches
The patches were generated from the RPi repo with the following command:
git format-patch v6.6.34..rpi-6.1.y

Some patches needed rebasing and, as usual, the applied and reverted, wireless
drivers, Github workflows, READMEs and defconfigs patches were removed.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-06-18 18:52:49 +02:00

39 lines
1.2 KiB
Diff

From a02f1a28cf74e9593e5b2e1c18fe0cbe6cc59e42 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Thu, 25 Apr 2024 17:13:05 +0100
Subject: [PATCH 1072/1085] 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>
---
drivers/regulator/rpi-panel-attiny-regulator.c | 9 +++++++++
1 file changed, 9 insertions(+)
--- a/drivers/regulator/rpi-panel-attiny-regulator.c
+++ b/drivers/regulator/rpi-panel-attiny-regulator.c
@@ -370,6 +370,14 @@ static void attiny_i2c_remove(struct i2c
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" },
{},
@@ -384,6 +392,7 @@ static struct i2c_driver attiny_regulato
},
.probe = attiny_i2c_probe,
.remove = attiny_i2c_remove,
+ .shutdown = attiny_i2c_shutdown,
};
module_i2c_driver(attiny_regulator_driver);