61 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			61 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 | 
						|
From: Samuel Holland <samuel@sholland.org>
 | 
						|
Date: Sun, 10 Jan 2021 00:51:31 -0600
 | 
						|
Subject: [PATCH] media: sunxi-cir: Implement suspend/resume/shutdown callbacks
 | 
						|
 | 
						|
Signed-off-by: Samuel Holland <samuel@sholland.org>
 | 
						|
---
 | 
						|
 drivers/media/rc/sunxi-cir.c | 21 +++++++++++++++++++++
 | 
						|
 1 file changed, 21 insertions(+)
 | 
						|
 | 
						|
--- a/drivers/media/rc/sunxi-cir.c
 | 
						|
+++ b/drivers/media/rc/sunxi-cir.c
 | 
						|
@@ -242,6 +242,18 @@ static void sunxi_ir_hw_exit(struct devi
 | 
						|
 	reset_control_assert(ir->rst);
 | 
						|
 }
 | 
						|
 
 | 
						|
+static int __maybe_unused sunxi_ir_suspend(struct device *dev)
 | 
						|
+{
 | 
						|
+	sunxi_ir_hw_exit(dev);
 | 
						|
+
 | 
						|
+	return 0;
 | 
						|
+}
 | 
						|
+
 | 
						|
+static int __maybe_unused sunxi_ir_resume(struct device *dev)
 | 
						|
+{
 | 
						|
+	return sunxi_ir_hw_init(dev);
 | 
						|
+}
 | 
						|
+
 | 
						|
 static int sunxi_ir_probe(struct platform_device *pdev)
 | 
						|
 {
 | 
						|
 	int ret = 0;
 | 
						|
@@ -364,6 +376,11 @@ static int sunxi_ir_remove(struct platfo
 | 
						|
 	return 0;
 | 
						|
 }
 | 
						|
 
 | 
						|
+static void sunxi_ir_shutdown(struct platform_device *pdev)
 | 
						|
+{
 | 
						|
+	sunxi_ir_hw_exit(&pdev->dev);
 | 
						|
+}
 | 
						|
+
 | 
						|
 static const struct sunxi_ir_quirks sun4i_a10_ir_quirks = {
 | 
						|
 	.has_reset = false,
 | 
						|
 	.fifo_size = 16,
 | 
						|
@@ -396,12 +413,16 @@ static const struct of_device_id sunxi_i
 | 
						|
 };
 | 
						|
 MODULE_DEVICE_TABLE(of, sunxi_ir_match);
 | 
						|
 
 | 
						|
+static SIMPLE_DEV_PM_OPS(sunxi_ir_pm_ops, sunxi_ir_suspend, sunxi_ir_resume);
 | 
						|
+
 | 
						|
 static struct platform_driver sunxi_ir_driver = {
 | 
						|
 	.probe          = sunxi_ir_probe,
 | 
						|
 	.remove         = sunxi_ir_remove,
 | 
						|
+	.shutdown       = sunxi_ir_shutdown,
 | 
						|
 	.driver = {
 | 
						|
 		.name = SUNXI_IR_DEV,
 | 
						|
 		.of_match_table = sunxi_ir_match,
 | 
						|
+		.pm = &sunxi_ir_pm_ops,
 | 
						|
 	},
 | 
						|
 };
 | 
						|
 
 |