diff options
-rw-r--r-- | drivers/pinctrl/pinctrl-single.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c index 2899c866a3fb..6866548fab31 100644 --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c | |||
@@ -1483,6 +1483,29 @@ static int pcs_add_gpio_func(struct device_node *node, struct pcs_device *pcs) | |||
1483 | return ret; | 1483 | return ret; |
1484 | } | 1484 | } |
1485 | 1485 | ||
1486 | static int pinctrl_single_suspend(struct platform_device *pdev, | ||
1487 | pm_message_t state) | ||
1488 | { | ||
1489 | struct pcs_device *pcs; | ||
1490 | |||
1491 | pcs = platform_get_drvdata(pdev); | ||
1492 | if (!pcs) | ||
1493 | return -EINVAL; | ||
1494 | |||
1495 | return pinctrl_force_sleep(pcs->pctl); | ||
1496 | } | ||
1497 | |||
1498 | static int pinctrl_single_resume(struct platform_device *pdev) | ||
1499 | { | ||
1500 | struct pcs_device *pcs; | ||
1501 | |||
1502 | pcs = platform_get_drvdata(pdev); | ||
1503 | if (!pcs) | ||
1504 | return -EINVAL; | ||
1505 | |||
1506 | return pinctrl_force_default(pcs->pctl); | ||
1507 | } | ||
1508 | |||
1486 | static int pcs_probe(struct platform_device *pdev) | 1509 | static int pcs_probe(struct platform_device *pdev) |
1487 | { | 1510 | { |
1488 | struct device_node *np = pdev->dev.of_node; | 1511 | struct device_node *np = pdev->dev.of_node; |
@@ -1631,6 +1654,10 @@ static struct platform_driver pcs_driver = { | |||
1631 | .name = DRIVER_NAME, | 1654 | .name = DRIVER_NAME, |
1632 | .of_match_table = pcs_of_match, | 1655 | .of_match_table = pcs_of_match, |
1633 | }, | 1656 | }, |
1657 | #ifdef CONFIG_PM | ||
1658 | .suspend = pinctrl_single_suspend, | ||
1659 | .resume = pinctrl_single_resume, | ||
1660 | #endif | ||
1634 | }; | 1661 | }; |
1635 | 1662 | ||
1636 | module_platform_driver(pcs_driver); | 1663 | module_platform_driver(pcs_driver); |