mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] regulator: rpi-panel-v2: Add shutdown hook
@ 2025-06-16 15:40 Marek Vasut
  2025-06-17 13:21 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Marek Vasut @ 2025-06-16 15:40 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Dave Stevenson, Marek Vasut, Liam Girdwood, Mark Brown, linux-kernel

From: Dave Stevenson <dave.stevenson@raspberrypi.com>

Add shutdown hook so that the panel gets powered off with the system.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
---
Cc: Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: linux-kernel@vger.kernel.org
---
 drivers/regulator/rpi-panel-v2-regulator.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/regulator/rpi-panel-v2-regulator.c b/drivers/regulator/rpi-panel-v2-regulator.c
index c506fd699d57..30b78aa75ee3 100644
--- a/drivers/regulator/rpi-panel-v2-regulator.c
+++ b/drivers/regulator/rpi-panel-v2-regulator.c
@@ -89,9 +89,19 @@ static int rpi_panel_v2_i2c_probe(struct i2c_client *i2c)
 	if (ret)
 		return dev_err_probe(&i2c->dev, ret, "Failed to create gpiochip\n");
 
+	i2c_set_clientdata(i2c, regmap);
+
 	return devm_pwmchip_add(&i2c->dev, pc);
 }
 
+static void rpi_panel_v2_i2c_shutdown(struct i2c_client *client)
+{
+	struct regmap *regmap = i2c_get_clientdata(client);
+
+	regmap_write(regmap, REG_PWM, 0);
+	regmap_write(regmap, REG_POWERON, 0);
+}
+
 static const struct of_device_id rpi_panel_v2_dt_ids[] = {
 	{ .compatible = "raspberrypi,touchscreen-panel-regulator-v2" },
 	{ },
@@ -105,6 +115,7 @@ static struct i2c_driver rpi_panel_v2_regulator_driver = {
 		.of_match_table = rpi_panel_v2_dt_ids,
 	},
 	.probe = rpi_panel_v2_i2c_probe,
+	.shutdown = rpi_panel_v2_i2c_shutdown,
 };
 
 module_i2c_driver(rpi_panel_v2_regulator_driver);
-- 
2.47.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] regulator: rpi-panel-v2: Add shutdown hook
  2025-06-16 15:40 [PATCH] regulator: rpi-panel-v2: Add shutdown hook Marek Vasut
@ 2025-06-17 13:21 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2025-06-17 13:21 UTC (permalink / raw)
  To: linux-arm-kernel, Marek Vasut; +Cc: Dave Stevenson, Liam Girdwood, linux-kernel

On Mon, 16 Jun 2025 17:40:07 +0200, Marek Vasut wrote:
> Add shutdown hook so that the panel gets powered off with the system.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[1/1] regulator: rpi-panel-v2: Add shutdown hook
      commit: 3e1c01d06e1f52f78fe00ef26a9cf80dbb0a3115

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-06-17 13:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-16 15:40 [PATCH] regulator: rpi-panel-v2: Add shutdown hook Marek Vasut
2025-06-17 13:21 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®