File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -690,9 +690,44 @@ static int ulite_release(struct device *dev)
690
690
return rc ;
691
691
}
692
692
693
+ /**
694
+ * ulite_suspend - Stop the device.
695
+ *
696
+ * @dev: handle to the device structure.
697
+ * Return: 0 always.
698
+ */
699
+ static int __maybe_unused ulite_suspend (struct device * dev )
700
+ {
701
+ struct uart_port * port = dev_get_drvdata (dev );
702
+
703
+ if (port )
704
+ uart_suspend_port (& ulite_uart_driver , port );
705
+
706
+ return 0 ;
707
+ }
708
+
709
+ /**
710
+ * ulite_resume - Resume the device.
711
+ *
712
+ * @dev: handle to the device structure.
713
+ * Return: 0 on success, errno otherwise.
714
+ */
715
+ static int __maybe_unused ulite_resume (struct device * dev )
716
+ {
717
+ struct uart_port * port = dev_get_drvdata (dev );
718
+
719
+ if (port )
720
+ uart_resume_port (& ulite_uart_driver , port );
721
+
722
+ return 0 ;
723
+ }
724
+
693
725
/* ---------------------------------------------------------------------
694
726
* Platform bus binding
695
727
*/
728
+
729
+ static SIMPLE_DEV_PM_OPS (ulite_pm_ops , ulite_suspend , ulite_resume ) ;
730
+
696
731
#if defined(CONFIG_OF )
697
732
/* Match table for of_platform binding */
698
733
static const struct of_device_id ulite_of_match [] = {
@@ -768,6 +803,7 @@ static struct platform_driver ulite_platform_driver = {
768
803
.driver = {
769
804
.name = "uartlite" ,
770
805
.of_match_table = of_match_ptr (ulite_of_match ),
806
+ .pm = & ulite_pm_ops ,
771
807
},
772
808
};
773
809
You can’t perform that action at this time.
0 commit comments