mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 01:11:51 -04:00
spi: use modern PM macros
Jisheng Zhang <jszhang@kernel.org> says: Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards or __maybe_unused. Compiled testd for arm, arm64, riscv and riscv64 with below combinations: !PM && !PM_SLEEP PM && !PM_SLEEP PM && PM_SLEEP Link: https://patch.msgid.link/20260803142003.12857-1-jszhang@kernel.org
This commit is contained in:
@@ -1578,7 +1578,7 @@ static void atmel_qspi_remove(struct platform_device *pdev)
|
||||
}
|
||||
}
|
||||
|
||||
static int __maybe_unused atmel_qspi_suspend(struct device *dev)
|
||||
static int atmel_qspi_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctrl = dev_get_drvdata(dev);
|
||||
struct atmel_qspi *aq = spi_controller_get_devdata(ctrl);
|
||||
@@ -1605,7 +1605,7 @@ static int __maybe_unused atmel_qspi_suspend(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused atmel_qspi_resume(struct device *dev)
|
||||
static int atmel_qspi_resume(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctrl = dev_get_drvdata(dev);
|
||||
struct atmel_qspi *aq = spi_controller_get_devdata(ctrl);
|
||||
@@ -1637,7 +1637,7 @@ static int __maybe_unused atmel_qspi_resume(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused atmel_qspi_runtime_suspend(struct device *dev)
|
||||
static int atmel_qspi_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctrl = dev_get_drvdata(dev);
|
||||
struct atmel_qspi *aq = spi_controller_get_devdata(ctrl);
|
||||
@@ -1648,7 +1648,7 @@ static int __maybe_unused atmel_qspi_runtime_suspend(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused atmel_qspi_runtime_resume(struct device *dev)
|
||||
static int atmel_qspi_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctrl = dev_get_drvdata(dev);
|
||||
struct atmel_qspi *aq = spi_controller_get_devdata(ctrl);
|
||||
@@ -1665,10 +1665,10 @@ static int __maybe_unused atmel_qspi_runtime_resume(struct device *dev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops __maybe_unused atmel_qspi_pm_ops = {
|
||||
SET_SYSTEM_SLEEP_PM_OPS(atmel_qspi_suspend, atmel_qspi_resume)
|
||||
SET_RUNTIME_PM_OPS(atmel_qspi_runtime_suspend,
|
||||
atmel_qspi_runtime_resume, NULL)
|
||||
static const struct dev_pm_ops atmel_qspi_pm_ops = {
|
||||
SYSTEM_SLEEP_PM_OPS(atmel_qspi_suspend, atmel_qspi_resume)
|
||||
RUNTIME_PM_OPS(atmel_qspi_runtime_suspend,
|
||||
atmel_qspi_runtime_resume, NULL)
|
||||
};
|
||||
|
||||
static const struct atmel_qspi_caps atmel_sama5d2_qspi_caps = {};
|
||||
|
||||
@@ -374,7 +374,6 @@ static int amlogic_spifc_a1_probe(struct platform_device *pdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int amlogic_spifc_a1_suspend(struct device *dev)
|
||||
{
|
||||
struct amlogic_spifc_a1 *spifc = dev_get_drvdata(dev);
|
||||
@@ -409,9 +408,7 @@ static int amlogic_spifc_a1_resume(struct device *dev)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_PM_SLEEP */
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int amlogic_spifc_a1_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct amlogic_spifc_a1 *spifc = dev_get_drvdata(dev);
|
||||
@@ -432,14 +429,12 @@ static int amlogic_spifc_a1_runtime_resume(struct device *dev)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
static const struct dev_pm_ops amlogic_spifc_a1_pm_ops = {
|
||||
SET_SYSTEM_SLEEP_PM_OPS(amlogic_spifc_a1_suspend,
|
||||
amlogic_spifc_a1_resume)
|
||||
SET_RUNTIME_PM_OPS(amlogic_spifc_a1_runtime_suspend,
|
||||
amlogic_spifc_a1_runtime_resume,
|
||||
NULL)
|
||||
SYSTEM_SLEEP_PM_OPS(amlogic_spifc_a1_suspend, amlogic_spifc_a1_resume)
|
||||
RUNTIME_PM_OPS(amlogic_spifc_a1_runtime_suspend,
|
||||
amlogic_spifc_a1_runtime_resume,
|
||||
NULL)
|
||||
};
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
@@ -455,7 +450,7 @@ static struct platform_driver amlogic_spifc_a1_driver = {
|
||||
.driver = {
|
||||
.name = "amlogic-spifc-a1",
|
||||
.of_match_table = of_match_ptr(amlogic_spifc_a1_dt_match),
|
||||
.pm = &amlogic_spifc_a1_pm_ops,
|
||||
.pm = pm_ptr(&amlogic_spifc_a1_pm_ops),
|
||||
},
|
||||
};
|
||||
module_platform_driver(amlogic_spifc_a1_driver);
|
||||
|
||||
@@ -571,7 +571,7 @@ static int at91_usart_spi_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
__maybe_unused static int at91_usart_spi_suspend(struct device *dev)
|
||||
static int at91_usart_spi_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctrl = dev_get_drvdata(dev);
|
||||
struct at91_usart_spi *aus = spi_controller_get_devdata(ctrl);
|
||||
@@ -587,7 +587,7 @@ __maybe_unused static int at91_usart_spi_suspend(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
__maybe_unused static int at91_usart_spi_resume(struct device *dev)
|
||||
static int at91_usart_spi_resume(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctrl = dev_get_drvdata(dev);
|
||||
struct at91_usart_spi *aus = spi_controller_get_devdata(ctrl);
|
||||
@@ -616,13 +616,13 @@ static void at91_usart_spi_remove(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops at91_usart_spi_pm_ops = {
|
||||
SET_SYSTEM_SLEEP_PM_OPS(at91_usart_spi_suspend, at91_usart_spi_resume)
|
||||
SYSTEM_SLEEP_PM_OPS(at91_usart_spi_suspend, at91_usart_spi_resume)
|
||||
};
|
||||
|
||||
static struct platform_driver at91_usart_spi_driver = {
|
||||
.driver = {
|
||||
.name = "at91_usart_spi",
|
||||
.pm = &at91_usart_spi_pm_ops,
|
||||
.pm = pm_sleep_ptr(&at91_usart_spi_pm_ops),
|
||||
},
|
||||
.probe = at91_usart_spi_probe,
|
||||
.remove = at91_usart_spi_remove,
|
||||
|
||||
@@ -902,7 +902,7 @@ static void ax_spi_remove(struct platform_device *pdev)
|
||||
*
|
||||
* Return: 0 on success and error value on error
|
||||
*/
|
||||
static int __maybe_unused ax_spi_suspend(struct device *dev)
|
||||
static int ax_spi_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctlr = dev_get_drvdata(dev);
|
||||
|
||||
@@ -917,7 +917,7 @@ static int __maybe_unused ax_spi_suspend(struct device *dev)
|
||||
*
|
||||
* Return: 0 on success and error value on error
|
||||
*/
|
||||
static int __maybe_unused ax_spi_resume(struct device *dev)
|
||||
static int ax_spi_resume(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctlr = dev_get_drvdata(dev);
|
||||
struct ax_spi *xspi = spi_controller_get_devdata(ctlr);
|
||||
@@ -934,7 +934,7 @@ static int __maybe_unused ax_spi_resume(struct device *dev)
|
||||
*
|
||||
* Return: 0 on success and error value on error
|
||||
*/
|
||||
static int __maybe_unused ax_spi_runtime_resume(struct device *dev)
|
||||
static int ax_spi_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctlr = dev_get_drvdata(dev);
|
||||
struct ax_spi *xspi = spi_controller_get_devdata(ctlr);
|
||||
@@ -963,7 +963,7 @@ static int __maybe_unused ax_spi_runtime_resume(struct device *dev)
|
||||
*
|
||||
* Return: Always 0
|
||||
*/
|
||||
static int __maybe_unused ax_spi_runtime_suspend(struct device *dev)
|
||||
static int ax_spi_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctlr = dev_get_drvdata(dev);
|
||||
struct ax_spi *xspi = spi_controller_get_devdata(ctlr);
|
||||
@@ -975,9 +975,8 @@ static int __maybe_unused ax_spi_runtime_suspend(struct device *dev)
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops ax_spi_dev_pm_ops = {
|
||||
SET_RUNTIME_PM_OPS(ax_spi_runtime_suspend,
|
||||
ax_spi_runtime_resume, NULL)
|
||||
SET_SYSTEM_SLEEP_PM_OPS(ax_spi_suspend, ax_spi_resume)
|
||||
RUNTIME_PM_OPS(ax_spi_runtime_suspend, ax_spi_runtime_resume, NULL)
|
||||
SYSTEM_SLEEP_PM_OPS(ax_spi_suspend, ax_spi_resume)
|
||||
};
|
||||
|
||||
static const struct of_device_id ax_spi_of_match[] = {
|
||||
@@ -993,7 +992,7 @@ static struct platform_driver ax_spi_driver = {
|
||||
.driver = {
|
||||
.name = AX_SPI_NAME,
|
||||
.of_match_table = ax_spi_of_match,
|
||||
.pm = &ax_spi_dev_pm_ops,
|
||||
.pm = pm_ptr(&ax_spi_dev_pm_ops),
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -1689,7 +1689,7 @@ void bcm_qspi_remove(struct platform_device *pdev)
|
||||
/* function to be called by SoC specific platform driver remove() */
|
||||
EXPORT_SYMBOL_GPL(bcm_qspi_remove);
|
||||
|
||||
static int __maybe_unused bcm_qspi_suspend(struct device *dev)
|
||||
static int bcm_qspi_suspend(struct device *dev)
|
||||
{
|
||||
struct bcm_qspi *qspi = dev_get_drvdata(dev);
|
||||
int ret;
|
||||
@@ -1709,7 +1709,7 @@ static int __maybe_unused bcm_qspi_suspend(struct device *dev)
|
||||
return 0;
|
||||
};
|
||||
|
||||
static int __maybe_unused bcm_qspi_resume(struct device *dev)
|
||||
static int bcm_qspi_resume(struct device *dev)
|
||||
{
|
||||
struct bcm_qspi *qspi = dev_get_drvdata(dev);
|
||||
int ret = 0;
|
||||
@@ -1728,7 +1728,7 @@ static int __maybe_unused bcm_qspi_resume(struct device *dev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
SIMPLE_DEV_PM_OPS(bcm_qspi_pm_ops, bcm_qspi_suspend, bcm_qspi_resume);
|
||||
DEFINE_SIMPLE_DEV_PM_OPS(bcm_qspi_pm_ops, bcm_qspi_suspend, bcm_qspi_resume);
|
||||
|
||||
/* pm_ops to be called by SoC specific platform driver */
|
||||
EXPORT_SYMBOL_GPL(bcm_qspi_pm_ops);
|
||||
|
||||
@@ -884,7 +884,6 @@ static void bcm63xx_hsspi_remove(struct platform_device *pdev)
|
||||
sysfs_remove_group(&pdev->dev.kobj, &bcm63xx_hsspi_group);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int bcm63xx_hsspi_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
@@ -929,10 +928,9 @@ static int bcm63xx_hsspi_resume(struct device *dev)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(bcm63xx_hsspi_pm_ops, bcm63xx_hsspi_suspend,
|
||||
bcm63xx_hsspi_resume);
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(bcm63xx_hsspi_pm_ops, bcm63xx_hsspi_suspend,
|
||||
bcm63xx_hsspi_resume);
|
||||
|
||||
static const struct of_device_id bcm63xx_hsspi_of_match[] = {
|
||||
{ .compatible = "brcm,bcm6328-hsspi", },
|
||||
@@ -944,7 +942,7 @@ MODULE_DEVICE_TABLE(of, bcm63xx_hsspi_of_match);
|
||||
static struct platform_driver bcm63xx_hsspi_driver = {
|
||||
.driver = {
|
||||
.name = "bcm63xx-hsspi",
|
||||
.pm = &bcm63xx_hsspi_pm_ops,
|
||||
.pm = pm_sleep_ptr(&bcm63xx_hsspi_pm_ops),
|
||||
.of_match_table = bcm63xx_hsspi_of_match,
|
||||
},
|
||||
.probe = bcm63xx_hsspi_probe,
|
||||
|
||||
@@ -563,7 +563,6 @@ static void bcmbca_hsspi_remove(struct platform_device *pdev)
|
||||
sysfs_remove_group(&pdev->dev.kobj, &bcmbca_hsspi_group);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int bcmbca_hsspi_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
@@ -608,10 +607,9 @@ static int bcmbca_hsspi_resume(struct device *dev)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(bcmbca_hsspi_pm_ops, bcmbca_hsspi_suspend,
|
||||
bcmbca_hsspi_resume);
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(bcmbca_hsspi_pm_ops, bcmbca_hsspi_suspend,
|
||||
bcmbca_hsspi_resume);
|
||||
|
||||
static const struct of_device_id bcmbca_hsspi_of_match[] = {
|
||||
{ .compatible = "brcm,bcmbca-hsspi-v1.1", },
|
||||
@@ -623,7 +621,7 @@ MODULE_DEVICE_TABLE(of, bcmbca_hsspi_of_match);
|
||||
static struct platform_driver bcmbca_hsspi_driver = {
|
||||
.driver = {
|
||||
.name = "bcmbca-hsspi",
|
||||
.pm = &bcmbca_hsspi_pm_ops,
|
||||
.pm = pm_sleep_ptr(&bcmbca_hsspi_pm_ops),
|
||||
.of_match_table = bcmbca_hsspi_of_match,
|
||||
},
|
||||
.probe = bcmbca_hsspi_probe,
|
||||
|
||||
@@ -31,7 +31,7 @@ static struct platform_driver brcmstb_qspi_driver = {
|
||||
.remove = brcmstb_qspi_remove,
|
||||
.driver = {
|
||||
.name = "brcmstb_qspi",
|
||||
.pm = &bcm_qspi_pm_ops,
|
||||
.pm = pm_sleep_ptr(&bcm_qspi_pm_ops),
|
||||
.of_match_table = brcmstb_qspi_of_match,
|
||||
}
|
||||
};
|
||||
|
||||
@@ -807,7 +807,7 @@ static void cdns_spi_remove(struct platform_device *pdev)
|
||||
*
|
||||
* Return: 0 on success and error value on error
|
||||
*/
|
||||
static int __maybe_unused cdns_spi_suspend(struct device *dev)
|
||||
static int cdns_spi_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctlr = dev_get_drvdata(dev);
|
||||
|
||||
@@ -822,7 +822,7 @@ static int __maybe_unused cdns_spi_suspend(struct device *dev)
|
||||
*
|
||||
* Return: 0 on success and error value on error
|
||||
*/
|
||||
static int __maybe_unused cdns_spi_resume(struct device *dev)
|
||||
static int cdns_spi_resume(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctlr = dev_get_drvdata(dev);
|
||||
struct cdns_spi *xspi = spi_controller_get_devdata(ctlr);
|
||||
@@ -839,7 +839,7 @@ static int __maybe_unused cdns_spi_resume(struct device *dev)
|
||||
*
|
||||
* Return: 0 on success and error value on error
|
||||
*/
|
||||
static int __maybe_unused cdns_spi_runtime_resume(struct device *dev)
|
||||
static int cdns_spi_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctlr = dev_get_drvdata(dev);
|
||||
struct cdns_spi *xspi = spi_controller_get_devdata(ctlr);
|
||||
@@ -868,7 +868,7 @@ static int __maybe_unused cdns_spi_runtime_resume(struct device *dev)
|
||||
*
|
||||
* Return: Always 0
|
||||
*/
|
||||
static int __maybe_unused cdns_spi_runtime_suspend(struct device *dev)
|
||||
static int cdns_spi_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctlr = dev_get_drvdata(dev);
|
||||
struct cdns_spi *xspi = spi_controller_get_devdata(ctlr);
|
||||
@@ -880,9 +880,8 @@ static int __maybe_unused cdns_spi_runtime_suspend(struct device *dev)
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops cdns_spi_dev_pm_ops = {
|
||||
SET_RUNTIME_PM_OPS(cdns_spi_runtime_suspend,
|
||||
cdns_spi_runtime_resume, NULL)
|
||||
SET_SYSTEM_SLEEP_PM_OPS(cdns_spi_suspend, cdns_spi_resume)
|
||||
RUNTIME_PM_OPS(cdns_spi_runtime_suspend, cdns_spi_runtime_resume, NULL)
|
||||
SYSTEM_SLEEP_PM_OPS(cdns_spi_suspend, cdns_spi_resume)
|
||||
};
|
||||
|
||||
static const struct of_device_id cdns_spi_of_match[] = {
|
||||
@@ -900,7 +899,7 @@ static struct platform_driver cdns_spi_driver = {
|
||||
.driver = {
|
||||
.name = CDNS_SPI_NAME,
|
||||
.of_match_table = cdns_spi_of_match,
|
||||
.pm = &cdns_spi_dev_pm_ops,
|
||||
.pm = pm_ptr(&cdns_spi_dev_pm_ops),
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -437,7 +437,6 @@ static void mcfqspi_remove(struct platform_device *pdev)
|
||||
mcfqspi_cs_teardown(mcfqspi);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int mcfqspi_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
@@ -462,9 +461,7 @@ static int mcfqspi_resume(struct device *dev)
|
||||
|
||||
return spi_controller_resume(host);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int mcfqspi_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
@@ -484,17 +481,16 @@ static int mcfqspi_runtime_resume(struct device *dev)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static const struct dev_pm_ops mcfqspi_pm = {
|
||||
SET_SYSTEM_SLEEP_PM_OPS(mcfqspi_suspend, mcfqspi_resume)
|
||||
SET_RUNTIME_PM_OPS(mcfqspi_runtime_suspend, mcfqspi_runtime_resume,
|
||||
NULL)
|
||||
SYSTEM_SLEEP_PM_OPS(mcfqspi_suspend, mcfqspi_resume)
|
||||
RUNTIME_PM_OPS(mcfqspi_runtime_suspend, mcfqspi_runtime_resume,
|
||||
NULL)
|
||||
};
|
||||
|
||||
static struct platform_driver mcfqspi_driver = {
|
||||
.driver.name = DRIVER_NAME,
|
||||
.driver.pm = &mcfqspi_pm,
|
||||
.driver.pm = pm_ptr(&mcfqspi_pm),
|
||||
.probe = mcfqspi_probe,
|
||||
.remove = mcfqspi_remove,
|
||||
};
|
||||
|
||||
@@ -787,7 +787,6 @@ static void dln2_spi_remove(struct platform_device *pdev)
|
||||
dev_err(&pdev->dev, "Failed to disable SPI module\n");
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int dln2_spi_suspend(struct device *dev)
|
||||
{
|
||||
int ret;
|
||||
@@ -834,9 +833,7 @@ static int dln2_spi_resume(struct device *dev)
|
||||
|
||||
return spi_controller_resume(host);
|
||||
}
|
||||
#endif /* CONFIG_PM_SLEEP */
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int dln2_spi_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
@@ -852,18 +849,16 @@ static int dln2_spi_runtime_resume(struct device *dev)
|
||||
|
||||
return dln2_spi_enable(dln2, true);
|
||||
}
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
static const struct dev_pm_ops dln2_spi_pm = {
|
||||
SET_SYSTEM_SLEEP_PM_OPS(dln2_spi_suspend, dln2_spi_resume)
|
||||
SET_RUNTIME_PM_OPS(dln2_spi_runtime_suspend,
|
||||
dln2_spi_runtime_resume, NULL)
|
||||
SYSTEM_SLEEP_PM_OPS(dln2_spi_suspend, dln2_spi_resume)
|
||||
RUNTIME_PM_OPS(dln2_spi_runtime_suspend, dln2_spi_runtime_resume, NULL)
|
||||
};
|
||||
|
||||
static struct platform_driver spi_dln2_driver = {
|
||||
.driver = {
|
||||
.name = "dln2-spi",
|
||||
.pm = &dln2_spi_pm,
|
||||
.pm = pm_ptr(&dln2_spi_pm),
|
||||
},
|
||||
.probe = dln2_spi_probe,
|
||||
.remove = dln2_spi_remove,
|
||||
|
||||
@@ -154,7 +154,6 @@ static void dw_spi_pci_remove(struct pci_dev *pdev)
|
||||
dw_spi_remove_controller(dws);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int dw_spi_pci_suspend(struct device *dev)
|
||||
{
|
||||
struct dw_spi *dws = dev_get_drvdata(dev);
|
||||
@@ -168,9 +167,8 @@ static int dw_spi_pci_resume(struct device *dev)
|
||||
|
||||
return dw_spi_resume_controller(dws);
|
||||
}
|
||||
#endif
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(dw_spi_pci_pm_ops, dw_spi_pci_suspend, dw_spi_pci_resume);
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(dw_spi_pci_pm_ops, dw_spi_pci_suspend, dw_spi_pci_resume);
|
||||
|
||||
static const struct pci_device_id dw_spi_pci_ids[] = {
|
||||
/* Intel MID platform SPI controller 0 */
|
||||
@@ -197,7 +195,7 @@ static struct pci_driver dw_spi_pci_driver = {
|
||||
.probe = dw_spi_pci_probe,
|
||||
.remove = dw_spi_pci_remove,
|
||||
.driver = {
|
||||
.pm = &dw_spi_pci_pm_ops,
|
||||
.pm = pm_sleep_ptr(&dw_spi_pci_pm_ops),
|
||||
},
|
||||
};
|
||||
module_pci_driver(dw_spi_pci_driver);
|
||||
|
||||
@@ -1460,7 +1460,6 @@ static int dspi_init(struct fsl_dspi *dspi)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int dspi_suspend(struct device *dev)
|
||||
{
|
||||
struct fsl_dspi *dspi = dev_get_drvdata(dev);
|
||||
@@ -1515,9 +1514,8 @@ static int dspi_resume(struct device *dev)
|
||||
clk_disable_unprepare(dspi->clk);
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_PM_SLEEP */
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(dspi_pm, dspi_suspend, dspi_resume);
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(dspi_pm, dspi_suspend, dspi_resume);
|
||||
|
||||
static int dspi_target_abort(struct spi_controller *host)
|
||||
{
|
||||
@@ -1742,7 +1740,7 @@ static void dspi_shutdown(struct platform_device *pdev)
|
||||
static struct platform_driver fsl_dspi_driver = {
|
||||
.driver.name = DRIVER_NAME,
|
||||
.driver.of_match_table = fsl_dspi_dt_ids,
|
||||
.driver.pm = &dspi_pm,
|
||||
.driver.pm = pm_sleep_ptr(&dspi_pm),
|
||||
.probe = dspi_probe,
|
||||
.remove = dspi_remove,
|
||||
.shutdown = dspi_shutdown,
|
||||
|
||||
@@ -580,7 +580,6 @@ static irqreturn_t fsl_espi_irq(s32 irq, void *context_data)
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int fsl_espi_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
@@ -606,7 +605,6 @@ static int fsl_espi_runtime_resume(struct device *dev)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static size_t fsl_espi_max_message_size(struct spi_device *spi)
|
||||
{
|
||||
@@ -785,7 +783,6 @@ static void of_fsl_espi_remove(struct platform_device *dev)
|
||||
pm_runtime_disable(&dev->dev);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int of_fsl_espi_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
@@ -811,12 +808,10 @@ static int of_fsl_espi_resume(struct device *dev)
|
||||
|
||||
return spi_controller_resume(host);
|
||||
}
|
||||
#endif /* CONFIG_PM_SLEEP */
|
||||
|
||||
static const struct dev_pm_ops espi_pm = {
|
||||
SET_RUNTIME_PM_OPS(fsl_espi_runtime_suspend,
|
||||
fsl_espi_runtime_resume, NULL)
|
||||
SET_SYSTEM_SLEEP_PM_OPS(of_fsl_espi_suspend, of_fsl_espi_resume)
|
||||
RUNTIME_PM_OPS(fsl_espi_runtime_suspend, fsl_espi_runtime_resume, NULL)
|
||||
SYSTEM_SLEEP_PM_OPS(of_fsl_espi_suspend, of_fsl_espi_resume)
|
||||
};
|
||||
|
||||
static const struct of_device_id of_fsl_espi_match[] = {
|
||||
@@ -829,7 +824,7 @@ static struct platform_driver fsl_espi_driver = {
|
||||
.driver = {
|
||||
.name = "fsl_espi",
|
||||
.of_match_table = of_fsl_espi_match,
|
||||
.pm = &espi_pm,
|
||||
.pm = pm_ptr(&espi_pm),
|
||||
},
|
||||
.probe = of_fsl_espi_probe,
|
||||
.remove = of_fsl_espi_remove,
|
||||
|
||||
@@ -842,7 +842,6 @@ static irqreturn_t fsl_lpspi_isr(int irq, void *dev_id)
|
||||
return IRQ_NONE;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int fsl_lpspi_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct spi_controller *controller = dev_get_drvdata(dev);
|
||||
@@ -876,7 +875,6 @@ static int fsl_lpspi_runtime_suspend(struct device *dev)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int fsl_lpspi_init_rpm(struct fsl_lpspi_data *fsl_lpspi)
|
||||
{
|
||||
@@ -1056,8 +1054,8 @@ static int fsl_lpspi_resume(struct device *dev)
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops fsl_lpspi_pm_ops = {
|
||||
SET_RUNTIME_PM_OPS(fsl_lpspi_runtime_suspend,
|
||||
fsl_lpspi_runtime_resume, NULL)
|
||||
RUNTIME_PM_OPS(fsl_lpspi_runtime_suspend,
|
||||
fsl_lpspi_runtime_resume, NULL)
|
||||
SYSTEM_SLEEP_PM_OPS(fsl_lpspi_suspend, fsl_lpspi_resume)
|
||||
};
|
||||
|
||||
|
||||
@@ -1157,7 +1157,7 @@ static int spi_geni_probe(struct platform_device *pdev)
|
||||
return devm_spi_register_controller(dev, spi);
|
||||
}
|
||||
|
||||
static int __maybe_unused spi_geni_runtime_suspend(struct device *dev)
|
||||
static int spi_geni_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *spi = dev_get_drvdata(dev);
|
||||
struct spi_geni_master *mas = spi_controller_get_devdata(spi);
|
||||
@@ -1166,7 +1166,7 @@ static int __maybe_unused spi_geni_runtime_suspend(struct device *dev)
|
||||
mas->dev_data->power_off(&mas->se) : 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused spi_geni_runtime_resume(struct device *dev)
|
||||
static int spi_geni_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct spi_controller *spi = dev_get_drvdata(dev);
|
||||
struct spi_geni_master *mas = spi_controller_get_devdata(spi);
|
||||
@@ -1184,7 +1184,7 @@ static int __maybe_unused spi_geni_runtime_resume(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused spi_geni_suspend(struct device *dev)
|
||||
static int spi_geni_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *spi = dev_get_drvdata(dev);
|
||||
int ret;
|
||||
@@ -1200,7 +1200,7 @@ static int __maybe_unused spi_geni_suspend(struct device *dev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int __maybe_unused spi_geni_resume(struct device *dev)
|
||||
static int spi_geni_resume(struct device *dev)
|
||||
{
|
||||
struct spi_controller *spi = dev_get_drvdata(dev);
|
||||
int ret;
|
||||
@@ -1217,9 +1217,8 @@ static int __maybe_unused spi_geni_resume(struct device *dev)
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops spi_geni_pm_ops = {
|
||||
SET_RUNTIME_PM_OPS(spi_geni_runtime_suspend,
|
||||
spi_geni_runtime_resume, NULL)
|
||||
SET_SYSTEM_SLEEP_PM_OPS(spi_geni_suspend, spi_geni_resume)
|
||||
RUNTIME_PM_OPS(spi_geni_runtime_suspend, spi_geni_runtime_resume, NULL)
|
||||
SYSTEM_SLEEP_PM_OPS(spi_geni_suspend, spi_geni_resume)
|
||||
};
|
||||
|
||||
static const struct geni_spi_desc geni_spi = {
|
||||
@@ -1245,7 +1244,7 @@ static struct platform_driver spi_geni_driver = {
|
||||
.probe = spi_geni_probe,
|
||||
.driver = {
|
||||
.name = "geni_spi",
|
||||
.pm = &spi_geni_pm_ops,
|
||||
.pm = pm_ptr(&spi_geni_pm_ops),
|
||||
.of_match_table = spi_geni_dt_match,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -677,7 +677,6 @@ static void img_spfi_remove(struct platform_device *pdev)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int img_spfi_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
@@ -706,9 +705,7 @@ static int img_spfi_runtime_resume(struct device *dev)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int img_spfi_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
@@ -730,12 +727,10 @@ static int img_spfi_resume(struct device *dev)
|
||||
|
||||
return spi_controller_resume(host);
|
||||
}
|
||||
#endif /* CONFIG_PM_SLEEP */
|
||||
|
||||
static const struct dev_pm_ops img_spfi_pm_ops = {
|
||||
SET_RUNTIME_PM_OPS(img_spfi_runtime_suspend, img_spfi_runtime_resume,
|
||||
NULL)
|
||||
SET_SYSTEM_SLEEP_PM_OPS(img_spfi_suspend, img_spfi_resume)
|
||||
RUNTIME_PM_OPS(img_spfi_runtime_suspend, img_spfi_runtime_resume, NULL)
|
||||
SYSTEM_SLEEP_PM_OPS(img_spfi_suspend, img_spfi_resume)
|
||||
};
|
||||
|
||||
static const struct of_device_id img_spfi_of_match[] = {
|
||||
@@ -747,7 +742,7 @@ MODULE_DEVICE_TABLE(of, img_spfi_of_match);
|
||||
static struct platform_driver img_spfi_driver = {
|
||||
.driver = {
|
||||
.name = "img-spfi",
|
||||
.pm = &img_spfi_pm_ops,
|
||||
.pm = pm_ptr(&img_spfi_pm_ops),
|
||||
.of_match_table = of_match_ptr(img_spfi_of_match),
|
||||
},
|
||||
.probe = img_spfi_probe,
|
||||
|
||||
@@ -141,7 +141,7 @@ static struct platform_driver bcm_iproc_driver = {
|
||||
.remove = bcm_iproc_remove,
|
||||
.driver = {
|
||||
.name = "bcm_iproc",
|
||||
.pm = &bcm_qspi_pm_ops,
|
||||
.pm = pm_sleep_ptr(&bcm_qspi_pm_ops),
|
||||
.of_match_table = bcm_iproc_of_match,
|
||||
}
|
||||
};
|
||||
|
||||
@@ -229,7 +229,7 @@ int loongson_spi_init_controller(struct device *dev, void __iomem *regs)
|
||||
}
|
||||
EXPORT_SYMBOL_NS_GPL(loongson_spi_init_controller, "SPI_LOONGSON_CORE");
|
||||
|
||||
static int __maybe_unused loongson_spi_suspend(struct device *dev)
|
||||
static int loongson_spi_suspend(struct device *dev)
|
||||
{
|
||||
struct loongson_spi *loongson_spi;
|
||||
struct spi_controller *controller;
|
||||
@@ -249,7 +249,7 @@ static int __maybe_unused loongson_spi_suspend(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused loongson_spi_resume(struct device *dev)
|
||||
static int loongson_spi_resume(struct device *dev)
|
||||
{
|
||||
struct loongson_spi *loongson_spi;
|
||||
struct spi_controller *controller;
|
||||
|
||||
@@ -43,7 +43,7 @@ static struct pci_driver loongson_spi_pci_driver = {
|
||||
.probe = loongson_spi_pci_register,
|
||||
.driver = {
|
||||
.bus = &pci_bus_type,
|
||||
.pm = &loongson_spi_dev_pm_ops,
|
||||
.pm = pm_sleep_ptr(&loongson_spi_dev_pm_ops),
|
||||
},
|
||||
};
|
||||
module_pci_driver(loongson_spi_pci_driver);
|
||||
|
||||
@@ -35,7 +35,7 @@ static struct platform_driver loongson_spi_plat_driver = {
|
||||
.driver = {
|
||||
.name = "loongson-spi",
|
||||
.bus = &platform_bus_type,
|
||||
.pm = &loongson_spi_dev_pm_ops,
|
||||
.pm = pm_sleep_ptr(&loongson_spi_dev_pm_ops),
|
||||
.of_match_table = loongson_spi_id_table,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -348,7 +348,6 @@ static void meson_spifc_remove(struct platform_device *pdev)
|
||||
pm_runtime_put_noidle(&pdev->dev);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int meson_spifc_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
@@ -385,9 +384,7 @@ static int meson_spifc_resume(struct device *dev)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_PM_SLEEP */
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int meson_spifc_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
@@ -405,13 +402,12 @@ static int meson_spifc_runtime_resume(struct device *dev)
|
||||
|
||||
return clk_prepare_enable(spifc->clk);
|
||||
}
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
static const struct dev_pm_ops meson_spifc_pm_ops = {
|
||||
SET_SYSTEM_SLEEP_PM_OPS(meson_spifc_suspend, meson_spifc_resume)
|
||||
SET_RUNTIME_PM_OPS(meson_spifc_runtime_suspend,
|
||||
meson_spifc_runtime_resume,
|
||||
NULL)
|
||||
SYSTEM_SLEEP_PM_OPS(meson_spifc_suspend, meson_spifc_resume)
|
||||
RUNTIME_PM_OPS(meson_spifc_runtime_suspend,
|
||||
meson_spifc_runtime_resume,
|
||||
NULL)
|
||||
};
|
||||
|
||||
static const struct of_device_id meson_spifc_dt_match[] = {
|
||||
@@ -427,7 +423,7 @@ static struct platform_driver meson_spifc_driver = {
|
||||
.driver = {
|
||||
.name = "meson-spifc",
|
||||
.of_match_table = of_match_ptr(meson_spifc_dt_match),
|
||||
.pm = &meson_spifc_pm_ops,
|
||||
.pm = pm_ptr(&meson_spifc_pm_ops),
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -1367,7 +1367,6 @@ static void mtk_spi_remove(struct platform_device *pdev)
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int mtk_spi_suspend(struct device *dev)
|
||||
{
|
||||
int ret;
|
||||
@@ -1419,9 +1418,7 @@ static int mtk_spi_resume(struct device *dev)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_PM_SLEEP */
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int mtk_spi_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
@@ -1473,18 +1470,16 @@ static int mtk_spi_runtime_resume(struct device *dev)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
static const struct dev_pm_ops mtk_spi_pm = {
|
||||
SET_SYSTEM_SLEEP_PM_OPS(mtk_spi_suspend, mtk_spi_resume)
|
||||
SET_RUNTIME_PM_OPS(mtk_spi_runtime_suspend,
|
||||
mtk_spi_runtime_resume, NULL)
|
||||
SYSTEM_SLEEP_PM_OPS(mtk_spi_suspend, mtk_spi_resume)
|
||||
RUNTIME_PM_OPS(mtk_spi_runtime_suspend, mtk_spi_runtime_resume, NULL)
|
||||
};
|
||||
|
||||
static struct platform_driver mtk_spi_driver = {
|
||||
.driver = {
|
||||
.name = "mtk-spi",
|
||||
.pm = &mtk_spi_pm,
|
||||
.pm = pm_ptr(&mtk_spi_pm),
|
||||
.of_match_table = mtk_spi_of_match,
|
||||
},
|
||||
.probe = mtk_spi_probe,
|
||||
|
||||
@@ -947,7 +947,7 @@ static void mtk_nor_remove(struct platform_device *pdev)
|
||||
mtk_nor_disable_clk(sp);
|
||||
}
|
||||
|
||||
static int __maybe_unused mtk_nor_runtime_suspend(struct device *dev)
|
||||
static int mtk_nor_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctlr = dev_get_drvdata(dev);
|
||||
struct mtk_nor *sp = spi_controller_get_devdata(ctlr);
|
||||
@@ -957,7 +957,7 @@ static int __maybe_unused mtk_nor_runtime_suspend(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused mtk_nor_runtime_resume(struct device *dev)
|
||||
static int mtk_nor_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctlr = dev_get_drvdata(dev);
|
||||
struct mtk_nor *sp = spi_controller_get_devdata(ctlr);
|
||||
@@ -965,12 +965,12 @@ static int __maybe_unused mtk_nor_runtime_resume(struct device *dev)
|
||||
return mtk_nor_enable_clk(sp);
|
||||
}
|
||||
|
||||
static int __maybe_unused mtk_nor_suspend(struct device *dev)
|
||||
static int mtk_nor_suspend(struct device *dev)
|
||||
{
|
||||
return pm_runtime_force_suspend(dev);
|
||||
}
|
||||
|
||||
static int __maybe_unused mtk_nor_resume(struct device *dev)
|
||||
static int mtk_nor_resume(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctlr = dev_get_drvdata(dev);
|
||||
struct mtk_nor *sp = spi_controller_get_devdata(ctlr);
|
||||
@@ -986,16 +986,15 @@ static int __maybe_unused mtk_nor_resume(struct device *dev)
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops mtk_nor_pm_ops = {
|
||||
SET_RUNTIME_PM_OPS(mtk_nor_runtime_suspend,
|
||||
mtk_nor_runtime_resume, NULL)
|
||||
SET_SYSTEM_SLEEP_PM_OPS(mtk_nor_suspend, mtk_nor_resume)
|
||||
RUNTIME_PM_OPS(mtk_nor_runtime_suspend, mtk_nor_runtime_resume, NULL)
|
||||
SYSTEM_SLEEP_PM_OPS(mtk_nor_suspend, mtk_nor_resume)
|
||||
};
|
||||
|
||||
static struct platform_driver mtk_nor_driver = {
|
||||
.driver = {
|
||||
.name = DRIVER_NAME,
|
||||
.of_match_table = mtk_nor_match,
|
||||
.pm = &mtk_nor_pm_ops,
|
||||
.pm = pm_ptr(&mtk_nor_pm_ops),
|
||||
},
|
||||
.probe = mtk_nor_probe,
|
||||
.remove = mtk_nor_remove,
|
||||
|
||||
@@ -721,7 +721,7 @@ static int mxic_spi_mem_ecc_probe(struct platform_device *pdev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused mxic_spi_runtime_suspend(struct device *dev)
|
||||
static int mxic_spi_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
struct mxic_spi *mxic = spi_controller_get_devdata(host);
|
||||
@@ -732,7 +732,7 @@ static int __maybe_unused mxic_spi_runtime_suspend(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused mxic_spi_runtime_resume(struct device *dev)
|
||||
static int mxic_spi_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
struct mxic_spi *mxic = spi_controller_get_devdata(host);
|
||||
@@ -748,8 +748,7 @@ static int __maybe_unused mxic_spi_runtime_resume(struct device *dev)
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops mxic_spi_dev_pm_ops = {
|
||||
SET_RUNTIME_PM_OPS(mxic_spi_runtime_suspend,
|
||||
mxic_spi_runtime_resume, NULL)
|
||||
RUNTIME_PM_OPS(mxic_spi_runtime_suspend, mxic_spi_runtime_resume, NULL)
|
||||
};
|
||||
|
||||
static int mxic_spi_probe(struct platform_device *pdev)
|
||||
@@ -850,7 +849,7 @@ static struct platform_driver mxic_spi_driver = {
|
||||
.driver = {
|
||||
.name = "mxic-spi",
|
||||
.of_match_table = mxic_spi_of_ids,
|
||||
.pm = &mxic_spi_dev_pm_ops,
|
||||
.pm = pm_ptr(&mxic_spi_dev_pm_ops),
|
||||
},
|
||||
};
|
||||
module_platform_driver(mxic_spi_driver);
|
||||
|
||||
@@ -1620,7 +1620,7 @@ static void omap2_mcspi_remove(struct platform_device *pdev)
|
||||
/* work with hotplug and coldplug */
|
||||
MODULE_ALIAS("platform:omap2_mcspi");
|
||||
|
||||
static int __maybe_unused omap2_mcspi_suspend(struct device *dev)
|
||||
static int omap2_mcspi_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctlr = dev_get_drvdata(dev);
|
||||
struct omap2_mcspi *mcspi = spi_controller_get_devdata(ctlr);
|
||||
@@ -1639,7 +1639,7 @@ static int __maybe_unused omap2_mcspi_suspend(struct device *dev)
|
||||
return pm_runtime_force_suspend(dev);
|
||||
}
|
||||
|
||||
static int __maybe_unused omap2_mcspi_resume(struct device *dev)
|
||||
static int omap2_mcspi_resume(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctlr = dev_get_drvdata(dev);
|
||||
struct omap2_mcspi *mcspi = spi_controller_get_devdata(ctlr);
|
||||
@@ -1654,8 +1654,7 @@ static int __maybe_unused omap2_mcspi_resume(struct device *dev)
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops omap2_mcspi_pm_ops = {
|
||||
SET_SYSTEM_SLEEP_PM_OPS(omap2_mcspi_suspend,
|
||||
omap2_mcspi_resume)
|
||||
SYSTEM_SLEEP_PM_OPS(omap2_mcspi_suspend, omap2_mcspi_resume)
|
||||
.runtime_suspend = omap_mcspi_runtime_suspend,
|
||||
.runtime_resume = omap_mcspi_runtime_resume,
|
||||
};
|
||||
@@ -1663,7 +1662,7 @@ static const struct dev_pm_ops omap2_mcspi_pm_ops = {
|
||||
static struct platform_driver omap2_mcspi_driver = {
|
||||
.driver = {
|
||||
.name = "omap2_mcspi",
|
||||
.pm = &omap2_mcspi_pm_ops,
|
||||
.pm = pm_ptr(&omap2_mcspi_pm_ops),
|
||||
.of_match_table = omap_mcspi_of_match,
|
||||
},
|
||||
.probe = omap2_mcspi_probe,
|
||||
|
||||
@@ -100,10 +100,8 @@ struct orion_spi {
|
||||
struct orion_child_options child[ORION_NUM_CHIPSELECTS];
|
||||
};
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int orion_spi_runtime_suspend(struct device *dev);
|
||||
static int orion_spi_runtime_resume(struct device *dev);
|
||||
#endif
|
||||
|
||||
static inline void __iomem *spi_reg(struct orion_spi *orion_spi, u32 reg)
|
||||
{
|
||||
@@ -804,7 +802,6 @@ static void orion_spi_remove(struct platform_device *pdev)
|
||||
|
||||
MODULE_ALIAS("platform:" DRIVER_NAME);
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int orion_spi_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
@@ -823,18 +820,17 @@ static int orion_spi_runtime_resume(struct device *dev)
|
||||
clk_prepare_enable(spi->axi_clk);
|
||||
return clk_prepare_enable(spi->clk);
|
||||
}
|
||||
#endif
|
||||
|
||||
static const struct dev_pm_ops orion_spi_pm_ops = {
|
||||
SET_RUNTIME_PM_OPS(orion_spi_runtime_suspend,
|
||||
orion_spi_runtime_resume,
|
||||
NULL)
|
||||
RUNTIME_PM_OPS(orion_spi_runtime_suspend,
|
||||
orion_spi_runtime_resume,
|
||||
NULL)
|
||||
};
|
||||
|
||||
static struct platform_driver orion_spi_driver = {
|
||||
.driver = {
|
||||
.name = DRIVER_NAME,
|
||||
.pm = &orion_spi_pm_ops,
|
||||
.pm = pm_ptr(&orion_spi_pm_ops),
|
||||
.of_match_table = of_match_ptr(orion_spi_of_match_table),
|
||||
},
|
||||
.probe = orion_spi_probe,
|
||||
|
||||
@@ -2011,7 +2011,6 @@ pl022_remove(struct amba_device *adev)
|
||||
amba_release_regions(adev);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int pl022_suspend(struct device *dev)
|
||||
{
|
||||
struct pl022 *pl022 = dev_get_drvdata(dev);
|
||||
@@ -2049,9 +2048,7 @@ static int pl022_resume(struct device *dev)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int pl022_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct pl022 *pl022 = dev_get_drvdata(dev);
|
||||
@@ -2071,11 +2068,10 @@ static int pl022_runtime_resume(struct device *dev)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static const struct dev_pm_ops pl022_dev_pm_ops = {
|
||||
SET_SYSTEM_SLEEP_PM_OPS(pl022_suspend, pl022_resume)
|
||||
SET_RUNTIME_PM_OPS(pl022_runtime_suspend, pl022_runtime_resume, NULL)
|
||||
SYSTEM_SLEEP_PM_OPS(pl022_suspend, pl022_resume)
|
||||
RUNTIME_PM_OPS(pl022_runtime_suspend, pl022_runtime_resume, NULL)
|
||||
};
|
||||
|
||||
static struct vendor_data vendor_arm = {
|
||||
@@ -2166,7 +2162,7 @@ MODULE_DEVICE_TABLE(amba, pl022_ids);
|
||||
static struct amba_driver pl022_driver = {
|
||||
.drv = {
|
||||
.name = "ssp-pl022",
|
||||
.pm = &pl022_dev_pm_ops,
|
||||
.pm = pm_ptr(&pl022_dev_pm_ops),
|
||||
},
|
||||
.id_table = pl022_ids,
|
||||
.probe = pl022_probe,
|
||||
|
||||
@@ -829,7 +829,7 @@ static void qcom_qspi_remove(struct platform_device *pdev)
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
}
|
||||
|
||||
static int __maybe_unused qcom_qspi_runtime_suspend(struct device *dev)
|
||||
static int qcom_qspi_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
struct qcom_qspi *ctrl = spi_controller_get_devdata(host);
|
||||
@@ -873,7 +873,7 @@ static int __maybe_unused qcom_qspi_runtime_suspend(struct device *dev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int __maybe_unused qcom_qspi_runtime_resume(struct device *dev)
|
||||
static int qcom_qspi_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
struct qcom_qspi *ctrl = spi_controller_get_devdata(host);
|
||||
@@ -917,7 +917,7 @@ static int __maybe_unused qcom_qspi_runtime_resume(struct device *dev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int __maybe_unused qcom_qspi_suspend(struct device *dev)
|
||||
static int qcom_qspi_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
int ret;
|
||||
@@ -933,7 +933,7 @@ static int __maybe_unused qcom_qspi_suspend(struct device *dev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int __maybe_unused qcom_qspi_resume(struct device *dev)
|
||||
static int qcom_qspi_resume(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
int ret;
|
||||
@@ -950,9 +950,9 @@ static int __maybe_unused qcom_qspi_resume(struct device *dev)
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops qcom_qspi_dev_pm_ops = {
|
||||
SET_RUNTIME_PM_OPS(qcom_qspi_runtime_suspend,
|
||||
qcom_qspi_runtime_resume, NULL)
|
||||
SET_SYSTEM_SLEEP_PM_OPS(qcom_qspi_suspend, qcom_qspi_resume)
|
||||
RUNTIME_PM_OPS(qcom_qspi_runtime_suspend,
|
||||
qcom_qspi_runtime_resume, NULL)
|
||||
SYSTEM_SLEEP_PM_OPS(qcom_qspi_suspend, qcom_qspi_resume)
|
||||
};
|
||||
|
||||
static const struct of_device_id qcom_qspi_dt_match[] = {
|
||||
@@ -964,7 +964,7 @@ MODULE_DEVICE_TABLE(of, qcom_qspi_dt_match);
|
||||
static struct platform_driver qcom_qspi_driver = {
|
||||
.driver = {
|
||||
.name = "qcom_qspi",
|
||||
.pm = &qcom_qspi_dev_pm_ops,
|
||||
.pm = pm_ptr(&qcom_qspi_dev_pm_ops),
|
||||
.of_match_table = qcom_qspi_dt_match,
|
||||
},
|
||||
.probe = qcom_qspi_probe,
|
||||
|
||||
@@ -1211,7 +1211,6 @@ static int spi_qup_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int spi_qup_pm_suspend_runtime(struct device *device)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(device);
|
||||
@@ -1253,9 +1252,7 @@ static int spi_qup_pm_resume_runtime(struct device *device)
|
||||
writel_relaxed(config, controller->base + QUP_CONFIG);
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int spi_qup_suspend(struct device *device)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(device);
|
||||
@@ -1312,7 +1309,6 @@ static int spi_qup_resume(struct device *device)
|
||||
clk_disable_unprepare(controller->iclk);
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_PM_SLEEP */
|
||||
|
||||
static void spi_qup_remove(struct platform_device *pdev)
|
||||
{
|
||||
@@ -1352,16 +1348,16 @@ static const struct of_device_id spi_qup_dt_match[] = {
|
||||
MODULE_DEVICE_TABLE(of, spi_qup_dt_match);
|
||||
|
||||
static const struct dev_pm_ops spi_qup_dev_pm_ops = {
|
||||
SET_SYSTEM_SLEEP_PM_OPS(spi_qup_suspend, spi_qup_resume)
|
||||
SET_RUNTIME_PM_OPS(spi_qup_pm_suspend_runtime,
|
||||
spi_qup_pm_resume_runtime,
|
||||
NULL)
|
||||
SYSTEM_SLEEP_PM_OPS(spi_qup_suspend, spi_qup_resume)
|
||||
RUNTIME_PM_OPS(spi_qup_pm_suspend_runtime,
|
||||
spi_qup_pm_resume_runtime,
|
||||
NULL)
|
||||
};
|
||||
|
||||
static struct platform_driver spi_qup_driver = {
|
||||
.driver = {
|
||||
.name = "spi_qup",
|
||||
.pm = &spi_qup_dev_pm_ops,
|
||||
.pm = pm_ptr(&spi_qup_dev_pm_ops),
|
||||
.of_match_table = spi_qup_dt_match,
|
||||
},
|
||||
.probe = spi_qup_probe,
|
||||
|
||||
@@ -751,7 +751,6 @@ static void rockchip_sfc_remove(struct platform_device *pdev)
|
||||
clk_disable_unprepare(sfc->hclk);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int rockchip_sfc_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct rockchip_sfc *sfc = dev_get_drvdata(dev);
|
||||
@@ -777,9 +776,7 @@ static int rockchip_sfc_runtime_resume(struct device *dev)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int rockchip_sfc_suspend(struct device *dev)
|
||||
{
|
||||
pinctrl_pm_select_sleep_state(dev);
|
||||
@@ -810,12 +807,11 @@ static int rockchip_sfc_resume(struct device *dev)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_PM_SLEEP */
|
||||
|
||||
static const struct dev_pm_ops rockchip_sfc_pm_ops = {
|
||||
SET_RUNTIME_PM_OPS(rockchip_sfc_runtime_suspend,
|
||||
rockchip_sfc_runtime_resume, NULL)
|
||||
SET_SYSTEM_SLEEP_PM_OPS(rockchip_sfc_suspend, rockchip_sfc_resume)
|
||||
RUNTIME_PM_OPS(rockchip_sfc_runtime_suspend,
|
||||
rockchip_sfc_runtime_resume, NULL)
|
||||
SYSTEM_SLEEP_PM_OPS(rockchip_sfc_suspend, rockchip_sfc_resume)
|
||||
};
|
||||
|
||||
static const struct of_device_id rockchip_sfc_dt_ids[] = {
|
||||
@@ -828,7 +824,7 @@ static struct platform_driver rockchip_sfc_driver = {
|
||||
.driver = {
|
||||
.name = "rockchip-sfc",
|
||||
.of_match_table = rockchip_sfc_dt_ids,
|
||||
.pm = &rockchip_sfc_pm_ops,
|
||||
.pm = pm_ptr(&rockchip_sfc_pm_ops),
|
||||
},
|
||||
.probe = rockchip_sfc_probe,
|
||||
.remove = rockchip_sfc_remove,
|
||||
|
||||
@@ -938,7 +938,6 @@ static void rockchip_spi_remove(struct platform_device *pdev)
|
||||
dma_release_channel(ctlr->dma_rx);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int rockchip_spi_suspend(struct device *dev)
|
||||
{
|
||||
int ret;
|
||||
@@ -972,9 +971,7 @@ static int rockchip_spi_resume(struct device *dev)
|
||||
|
||||
return spi_controller_resume(ctlr);
|
||||
}
|
||||
#endif /* CONFIG_PM_SLEEP */
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int rockchip_spi_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctlr = dev_get_drvdata(dev);
|
||||
@@ -1002,12 +999,11 @@ static int rockchip_spi_runtime_resume(struct device *dev)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
static const struct dev_pm_ops rockchip_spi_pm = {
|
||||
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(rockchip_spi_suspend, rockchip_spi_resume)
|
||||
SET_RUNTIME_PM_OPS(rockchip_spi_runtime_suspend,
|
||||
rockchip_spi_runtime_resume, NULL)
|
||||
NOIRQ_SYSTEM_SLEEP_PM_OPS(rockchip_spi_suspend, rockchip_spi_resume)
|
||||
RUNTIME_PM_OPS(rockchip_spi_runtime_suspend,
|
||||
rockchip_spi_runtime_resume, NULL)
|
||||
};
|
||||
|
||||
static const struct of_device_id rockchip_spi_dt_match[] = {
|
||||
@@ -1030,7 +1026,7 @@ MODULE_DEVICE_TABLE(of, rockchip_spi_dt_match);
|
||||
static struct platform_driver rockchip_spi_driver = {
|
||||
.driver = {
|
||||
.name = DRIVER_NAME,
|
||||
.pm = &rockchip_spi_pm,
|
||||
.pm = pm_ptr(&rockchip_spi_pm),
|
||||
.of_match_table = of_match_ptr(rockchip_spi_dt_match),
|
||||
},
|
||||
.probe = rockchip_spi_probe,
|
||||
|
||||
@@ -1408,7 +1408,6 @@ static void s3c64xx_spi_remove(struct platform_device *pdev)
|
||||
pm_runtime_set_suspended(&pdev->dev);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int s3c64xx_spi_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
@@ -1444,9 +1443,7 @@ static int s3c64xx_spi_resume(struct device *dev)
|
||||
|
||||
return spi_controller_resume(host);
|
||||
}
|
||||
#endif /* CONFIG_PM_SLEEP */
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int s3c64xx_spi_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
@@ -1494,12 +1491,11 @@ static int s3c64xx_spi_runtime_resume(struct device *dev)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
static const struct dev_pm_ops s3c64xx_spi_pm = {
|
||||
SET_SYSTEM_SLEEP_PM_OPS(s3c64xx_spi_suspend, s3c64xx_spi_resume)
|
||||
SET_RUNTIME_PM_OPS(s3c64xx_spi_runtime_suspend,
|
||||
s3c64xx_spi_runtime_resume, NULL)
|
||||
SYSTEM_SLEEP_PM_OPS(s3c64xx_spi_suspend, s3c64xx_spi_resume)
|
||||
RUNTIME_PM_OPS(s3c64xx_spi_runtime_suspend,
|
||||
s3c64xx_spi_runtime_resume, NULL)
|
||||
};
|
||||
|
||||
static const struct s3c64xx_spi_port_config s3c6410_spi_port_config = {
|
||||
@@ -1655,7 +1651,7 @@ MODULE_DEVICE_TABLE(of, s3c64xx_spi_dt_match);
|
||||
static struct platform_driver s3c64xx_spi_driver = {
|
||||
.driver = {
|
||||
.name = "s3c64xx-spi",
|
||||
.pm = &s3c64xx_spi_pm,
|
||||
.pm = pm_ptr(&s3c64xx_spi_pm),
|
||||
.of_match_table = of_match_ptr(s3c64xx_spi_dt_match),
|
||||
},
|
||||
.probe = s3c64xx_spi_probe,
|
||||
|
||||
@@ -471,7 +471,6 @@ static void mtk_spi_slave_remove(struct platform_device *pdev)
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int mtk_spi_slave_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctlr = dev_get_drvdata(dev);
|
||||
@@ -508,9 +507,7 @@ static int mtk_spi_slave_resume(struct device *dev)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_PM_SLEEP */
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int mtk_spi_slave_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctlr = dev_get_drvdata(dev);
|
||||
@@ -535,18 +532,17 @@ static int mtk_spi_slave_runtime_resume(struct device *dev)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
static const struct dev_pm_ops mtk_spi_slave_pm = {
|
||||
SET_SYSTEM_SLEEP_PM_OPS(mtk_spi_slave_suspend, mtk_spi_slave_resume)
|
||||
SET_RUNTIME_PM_OPS(mtk_spi_slave_runtime_suspend,
|
||||
mtk_spi_slave_runtime_resume, NULL)
|
||||
SYSTEM_SLEEP_PM_OPS(mtk_spi_slave_suspend, mtk_spi_slave_resume)
|
||||
RUNTIME_PM_OPS(mtk_spi_slave_runtime_suspend,
|
||||
mtk_spi_slave_runtime_resume, NULL)
|
||||
};
|
||||
|
||||
static struct platform_driver mtk_spi_slave_driver = {
|
||||
.driver = {
|
||||
.name = "mtk-spi-slave",
|
||||
.pm = &mtk_spi_slave_pm,
|
||||
.pm = pm_ptr(&mtk_spi_slave_pm),
|
||||
.of_match_table = mtk_spi_slave_of_match,
|
||||
},
|
||||
.probe = mtk_spi_slave_probe,
|
||||
|
||||
@@ -1016,7 +1016,7 @@ static void sprd_spi_remove(struct platform_device *pdev)
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
}
|
||||
|
||||
static int __maybe_unused sprd_spi_runtime_suspend(struct device *dev)
|
||||
static int sprd_spi_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *sctlr = dev_get_drvdata(dev);
|
||||
struct sprd_spi *ss = spi_controller_get_devdata(sctlr);
|
||||
@@ -1029,7 +1029,7 @@ static int __maybe_unused sprd_spi_runtime_suspend(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused sprd_spi_runtime_resume(struct device *dev)
|
||||
static int sprd_spi_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct spi_controller *sctlr = dev_get_drvdata(dev);
|
||||
struct sprd_spi *ss = spi_controller_get_devdata(sctlr);
|
||||
@@ -1050,8 +1050,7 @@ static int __maybe_unused sprd_spi_runtime_resume(struct device *dev)
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops sprd_spi_pm_ops = {
|
||||
SET_RUNTIME_PM_OPS(sprd_spi_runtime_suspend,
|
||||
sprd_spi_runtime_resume, NULL)
|
||||
RUNTIME_PM_OPS(sprd_spi_runtime_suspend, sprd_spi_runtime_resume, NULL)
|
||||
};
|
||||
|
||||
static const struct of_device_id sprd_spi_of_match[] = {
|
||||
@@ -1064,7 +1063,7 @@ static struct platform_driver sprd_spi_driver = {
|
||||
.driver = {
|
||||
.name = "sprd-spi",
|
||||
.of_match_table = sprd_spi_of_match,
|
||||
.pm = &sprd_spi_pm_ops,
|
||||
.pm = pm_ptr(&sprd_spi_pm_ops),
|
||||
},
|
||||
.probe = sprd_spi_probe,
|
||||
.remove = sprd_spi_remove,
|
||||
|
||||
@@ -498,7 +498,7 @@ static void sp7021_spi_controller_remove(struct platform_device *pdev)
|
||||
pm_runtime_set_suspended(&pdev->dev);
|
||||
}
|
||||
|
||||
static int __maybe_unused sp7021_spi_controller_suspend(struct device *dev)
|
||||
static int sp7021_spi_controller_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctlr = dev_get_drvdata(dev);
|
||||
struct sp7021_spi_ctlr *pspim = spi_controller_get_devdata(ctlr);
|
||||
@@ -506,7 +506,7 @@ static int __maybe_unused sp7021_spi_controller_suspend(struct device *dev)
|
||||
return reset_control_assert(pspim->rstc);
|
||||
}
|
||||
|
||||
static int __maybe_unused sp7021_spi_controller_resume(struct device *dev)
|
||||
static int sp7021_spi_controller_resume(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctlr = dev_get_drvdata(dev);
|
||||
struct sp7021_spi_ctlr *pspim = spi_controller_get_devdata(ctlr);
|
||||
@@ -515,7 +515,6 @@ static int __maybe_unused sp7021_spi_controller_resume(struct device *dev)
|
||||
return clk_prepare_enable(pspim->spi_clk);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int sp7021_spi_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *ctlr = dev_get_drvdata(dev);
|
||||
@@ -531,13 +530,12 @@ static int sp7021_spi_runtime_resume(struct device *dev)
|
||||
|
||||
return reset_control_deassert(pspim->rstc);
|
||||
}
|
||||
#endif
|
||||
|
||||
static const struct dev_pm_ops sp7021_spi_pm_ops = {
|
||||
SET_RUNTIME_PM_OPS(sp7021_spi_runtime_suspend,
|
||||
sp7021_spi_runtime_resume, NULL)
|
||||
SET_SYSTEM_SLEEP_PM_OPS(sp7021_spi_controller_suspend,
|
||||
sp7021_spi_controller_resume)
|
||||
RUNTIME_PM_OPS(sp7021_spi_runtime_suspend,
|
||||
sp7021_spi_runtime_resume, NULL)
|
||||
SYSTEM_SLEEP_PM_OPS(sp7021_spi_controller_suspend,
|
||||
sp7021_spi_controller_resume)
|
||||
};
|
||||
|
||||
static const struct of_device_id sp7021_spi_controller_ids[] = {
|
||||
@@ -552,7 +550,7 @@ static struct platform_driver sp7021_spi_controller_driver = {
|
||||
.driver = {
|
||||
.name = "sunplus,sp7021-spi-controller",
|
||||
.of_match_table = sp7021_spi_controller_ids,
|
||||
.pm = &sp7021_spi_pm_ops,
|
||||
.pm = pm_ptr(&sp7021_spi_pm_ops),
|
||||
},
|
||||
};
|
||||
module_platform_driver(sp7021_spi_controller_driver);
|
||||
|
||||
@@ -738,7 +738,7 @@ static void synquacer_spi_remove(struct platform_device *pdev)
|
||||
clk_disable_unprepare(sspi->clk);
|
||||
}
|
||||
|
||||
static int __maybe_unused synquacer_spi_suspend(struct device *dev)
|
||||
static int synquacer_spi_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
struct synquacer_spi *sspi = spi_controller_get_devdata(host);
|
||||
@@ -754,7 +754,7 @@ static int __maybe_unused synquacer_spi_suspend(struct device *dev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int __maybe_unused synquacer_spi_resume(struct device *dev)
|
||||
static int synquacer_spi_resume(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
struct synquacer_spi *sspi = spi_controller_get_devdata(host);
|
||||
@@ -786,8 +786,8 @@ static int __maybe_unused synquacer_spi_resume(struct device *dev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(synquacer_spi_pm_ops, synquacer_spi_suspend,
|
||||
synquacer_spi_resume);
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(synquacer_spi_pm_ops, synquacer_spi_suspend,
|
||||
synquacer_spi_resume);
|
||||
|
||||
static const struct of_device_id synquacer_spi_of_match[] = {
|
||||
{.compatible = "socionext,synquacer-spi"},
|
||||
@@ -806,7 +806,7 @@ MODULE_DEVICE_TABLE(acpi, synquacer_hsspi_acpi_ids);
|
||||
static struct platform_driver synquacer_spi_driver = {
|
||||
.driver = {
|
||||
.name = "synquacer-spi",
|
||||
.pm = &synquacer_spi_pm_ops,
|
||||
.pm = pm_sleep_ptr(&synquacer_spi_pm_ops),
|
||||
.of_match_table = synquacer_spi_of_match,
|
||||
.acpi_match_table = ACPI_PTR(synquacer_hsspi_acpi_ids),
|
||||
},
|
||||
|
||||
@@ -1450,7 +1450,6 @@ static void tegra_spi_remove(struct platform_device *pdev)
|
||||
tegra_spi_runtime_suspend(&pdev->dev);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int tegra_spi_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
@@ -1476,7 +1475,6 @@ static int tegra_spi_resume(struct device *dev)
|
||||
|
||||
return spi_controller_resume(host);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int tegra_spi_runtime_suspend(struct device *dev)
|
||||
{
|
||||
@@ -1505,14 +1503,14 @@ static int tegra_spi_runtime_resume(struct device *dev)
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops tegra_spi_pm_ops = {
|
||||
SET_RUNTIME_PM_OPS(tegra_spi_runtime_suspend,
|
||||
tegra_spi_runtime_resume, NULL)
|
||||
SET_SYSTEM_SLEEP_PM_OPS(tegra_spi_suspend, tegra_spi_resume)
|
||||
RUNTIME_PM_OPS(tegra_spi_runtime_suspend,
|
||||
tegra_spi_runtime_resume, NULL)
|
||||
SYSTEM_SLEEP_PM_OPS(tegra_spi_suspend, tegra_spi_resume)
|
||||
};
|
||||
static struct platform_driver tegra_spi_driver = {
|
||||
.driver = {
|
||||
.name = "spi-tegra114",
|
||||
.pm = &tegra_spi_pm_ops,
|
||||
.pm = pm_ptr(&tegra_spi_pm_ops),
|
||||
.of_match_table = tegra_spi_of_match,
|
||||
},
|
||||
.probe = tegra_spi_probe,
|
||||
|
||||
@@ -533,7 +533,6 @@ static void tegra_sflash_remove(struct platform_device *pdev)
|
||||
tegra_sflash_runtime_suspend(&pdev->dev);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int tegra_sflash_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
@@ -557,7 +556,6 @@ static int tegra_sflash_resume(struct device *dev)
|
||||
|
||||
return spi_controller_resume(host);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int tegra_sflash_runtime_suspend(struct device *dev)
|
||||
{
|
||||
@@ -586,14 +584,14 @@ static int tegra_sflash_runtime_resume(struct device *dev)
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops slink_pm_ops = {
|
||||
SET_RUNTIME_PM_OPS(tegra_sflash_runtime_suspend,
|
||||
tegra_sflash_runtime_resume, NULL)
|
||||
SET_SYSTEM_SLEEP_PM_OPS(tegra_sflash_suspend, tegra_sflash_resume)
|
||||
RUNTIME_PM_OPS(tegra_sflash_runtime_suspend,
|
||||
tegra_sflash_runtime_resume, NULL)
|
||||
SYSTEM_SLEEP_PM_OPS(tegra_sflash_suspend, tegra_sflash_resume)
|
||||
};
|
||||
static struct platform_driver tegra_sflash_driver = {
|
||||
.driver = {
|
||||
.name = "spi-tegra-sflash",
|
||||
.pm = &slink_pm_ops,
|
||||
.pm = pm_ptr(&slink_pm_ops),
|
||||
.of_match_table = tegra_sflash_of_match,
|
||||
},
|
||||
.probe = tegra_sflash_probe,
|
||||
|
||||
@@ -1144,7 +1144,6 @@ static void tegra_slink_remove(struct platform_device *pdev)
|
||||
tegra_slink_deinit_dma_param(tspi, true);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int tegra_slink_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
@@ -1169,9 +1168,8 @@ static int tegra_slink_resume(struct device *dev)
|
||||
|
||||
return spi_controller_resume(host);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int __maybe_unused tegra_slink_runtime_suspend(struct device *dev)
|
||||
static int tegra_slink_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
struct tegra_slink_data *tspi = spi_controller_get_devdata(host);
|
||||
@@ -1183,7 +1181,7 @@ static int __maybe_unused tegra_slink_runtime_suspend(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused tegra_slink_runtime_resume(struct device *dev)
|
||||
static int tegra_slink_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
struct tegra_slink_data *tspi = spi_controller_get_devdata(host);
|
||||
@@ -1198,14 +1196,14 @@ static int __maybe_unused tegra_slink_runtime_resume(struct device *dev)
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops slink_pm_ops = {
|
||||
SET_RUNTIME_PM_OPS(tegra_slink_runtime_suspend,
|
||||
tegra_slink_runtime_resume, NULL)
|
||||
SET_SYSTEM_SLEEP_PM_OPS(tegra_slink_suspend, tegra_slink_resume)
|
||||
RUNTIME_PM_OPS(tegra_slink_runtime_suspend,
|
||||
tegra_slink_runtime_resume, NULL)
|
||||
SYSTEM_SLEEP_PM_OPS(tegra_slink_suspend, tegra_slink_resume)
|
||||
};
|
||||
static struct platform_driver tegra_slink_driver = {
|
||||
.driver = {
|
||||
.name = "spi-tegra-slink",
|
||||
.pm = &slink_pm_ops,
|
||||
.pm = pm_ptr(&slink_pm_ops),
|
||||
.of_match_table = tegra_slink_of_match,
|
||||
},
|
||||
.probe = tegra_slink_probe,
|
||||
|
||||
@@ -1837,14 +1837,14 @@ static void tegra_qspi_remove(struct platform_device *pdev)
|
||||
tegra_qspi_deinit_dma(tqspi);
|
||||
}
|
||||
|
||||
static int __maybe_unused tegra_qspi_suspend(struct device *dev)
|
||||
static int tegra_qspi_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
|
||||
return spi_controller_suspend(host);
|
||||
}
|
||||
|
||||
static int __maybe_unused tegra_qspi_resume(struct device *dev)
|
||||
static int tegra_qspi_resume(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
struct tegra_qspi *tqspi = spi_controller_get_devdata(host);
|
||||
@@ -1863,7 +1863,7 @@ static int __maybe_unused tegra_qspi_resume(struct device *dev)
|
||||
return spi_controller_resume(host);
|
||||
}
|
||||
|
||||
static int __maybe_unused tegra_qspi_runtime_suspend(struct device *dev)
|
||||
static int tegra_qspi_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
struct tegra_qspi *tqspi = spi_controller_get_devdata(host);
|
||||
@@ -1879,7 +1879,7 @@ static int __maybe_unused tegra_qspi_runtime_suspend(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused tegra_qspi_runtime_resume(struct device *dev)
|
||||
static int tegra_qspi_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct spi_controller *host = dev_get_drvdata(dev);
|
||||
struct tegra_qspi *tqspi = spi_controller_get_devdata(host);
|
||||
@@ -1896,14 +1896,14 @@ static int __maybe_unused tegra_qspi_runtime_resume(struct device *dev)
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops tegra_qspi_pm_ops = {
|
||||
SET_RUNTIME_PM_OPS(tegra_qspi_runtime_suspend, tegra_qspi_runtime_resume, NULL)
|
||||
SET_SYSTEM_SLEEP_PM_OPS(tegra_qspi_suspend, tegra_qspi_resume)
|
||||
RUNTIME_PM_OPS(tegra_qspi_runtime_suspend, tegra_qspi_runtime_resume, NULL)
|
||||
SYSTEM_SLEEP_PM_OPS(tegra_qspi_suspend, tegra_qspi_resume)
|
||||
};
|
||||
|
||||
static struct platform_driver tegra_qspi_driver = {
|
||||
.driver = {
|
||||
.name = "tegra-qspi",
|
||||
.pm = &tegra_qspi_pm_ops,
|
||||
.pm = pm_ptr(&tegra_qspi_pm_ops),
|
||||
.of_match_table = tegra_qspi_of_match,
|
||||
.acpi_match_table = ACPI_PTR(tegra_qspi_acpi_match),
|
||||
},
|
||||
|
||||
@@ -1438,19 +1438,17 @@ static void pch_spi_pd_remove(struct platform_device *plat_dev)
|
||||
|
||||
spi_controller_put(data->host);
|
||||
}
|
||||
#ifdef CONFIG_PM
|
||||
static int pch_spi_pd_suspend(struct platform_device *pd_dev,
|
||||
pm_message_t state)
|
||||
|
||||
static int pch_spi_pd_suspend(struct device *dev)
|
||||
{
|
||||
u8 count;
|
||||
struct pch_spi_board_data *board_dat = dev_get_platdata(&pd_dev->dev);
|
||||
struct pch_spi_data *data = platform_get_drvdata(pd_dev);
|
||||
struct pch_spi_board_data *board_dat = dev_get_platdata(dev);
|
||||
struct pch_spi_data *data = dev_get_drvdata(dev);
|
||||
|
||||
dev_dbg(&pd_dev->dev, "%s ENTRY\n", __func__);
|
||||
dev_dbg(dev, "%s ENTRY\n", __func__);
|
||||
|
||||
if (!board_dat) {
|
||||
dev_err(&pd_dev->dev,
|
||||
"%s pci_get_drvdata returned NULL\n", __func__);
|
||||
dev_err(dev, "%s pci_get_drvdata returned NULL\n", __func__);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
@@ -1471,22 +1469,20 @@ static int pch_spi_pd_suspend(struct platform_device *pd_dev,
|
||||
free_irq(board_dat->pdev->irq, data);
|
||||
|
||||
data->irq_reg_sts = false;
|
||||
dev_dbg(&pd_dev->dev,
|
||||
"%s free_irq invoked successfully.\n", __func__);
|
||||
dev_dbg(dev, "%s free_irq invoked successfully.\n", __func__);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pch_spi_pd_resume(struct platform_device *pd_dev)
|
||||
static int pch_spi_pd_resume(struct device *dev)
|
||||
{
|
||||
struct pch_spi_board_data *board_dat = dev_get_platdata(&pd_dev->dev);
|
||||
struct pch_spi_data *data = platform_get_drvdata(pd_dev);
|
||||
struct pch_spi_board_data *board_dat = dev_get_platdata(dev);
|
||||
struct pch_spi_data *data = dev_get_drvdata(dev);
|
||||
int retval;
|
||||
|
||||
if (!board_dat) {
|
||||
dev_err(&pd_dev->dev,
|
||||
"%s pci_get_drvdata returned NULL\n", __func__);
|
||||
dev_err(dev, "%s pci_get_drvdata returned NULL\n", __func__);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
@@ -1495,8 +1491,7 @@ static int pch_spi_pd_resume(struct platform_device *pd_dev)
|
||||
retval = request_irq(board_dat->pdev->irq, pch_spi_handler,
|
||||
IRQF_SHARED, KBUILD_MODNAME, data);
|
||||
if (retval < 0) {
|
||||
dev_err(&pd_dev->dev,
|
||||
"%s request_irq failed\n", __func__);
|
||||
dev_err(dev, "%s request_irq failed\n", __func__);
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -1507,19 +1502,17 @@ static int pch_spi_pd_resume(struct platform_device *pd_dev)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
#define pch_spi_pd_suspend NULL
|
||||
#define pch_spi_pd_resume NULL
|
||||
#endif
|
||||
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(pch_spi_pd_pm_ops,
|
||||
pch_spi_pd_suspend, pch_spi_pd_resume);
|
||||
|
||||
static struct platform_driver pch_spi_pd_driver = {
|
||||
.driver = {
|
||||
.name = "pch-spi",
|
||||
.pm = pm_sleep_ptr(&pch_spi_pd_pm_ops),
|
||||
},
|
||||
.probe = pch_spi_pd_probe,
|
||||
.remove = pch_spi_pd_remove,
|
||||
.suspend = pch_spi_pd_suspend,
|
||||
.resume = pch_spi_pd_resume
|
||||
};
|
||||
|
||||
static int pch_spi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
@@ -1618,7 +1611,7 @@ static void pch_spi_remove(struct pci_dev *pdev)
|
||||
kfree(pd_dev_save);
|
||||
}
|
||||
|
||||
static int __maybe_unused pch_spi_suspend(struct device *dev)
|
||||
static int pch_spi_suspend(struct device *dev)
|
||||
{
|
||||
struct pch_pd_dev_save *pd_dev_save = dev_get_drvdata(dev);
|
||||
|
||||
@@ -1629,7 +1622,7 @@ static int __maybe_unused pch_spi_suspend(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused pch_spi_resume(struct device *dev)
|
||||
static int pch_spi_resume(struct device *dev)
|
||||
{
|
||||
struct pch_pd_dev_save *pd_dev_save = dev_get_drvdata(dev);
|
||||
|
||||
@@ -1641,14 +1634,14 @@ static int __maybe_unused pch_spi_resume(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(pch_spi_pm_ops, pch_spi_suspend, pch_spi_resume);
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(pch_spi_pm_ops, pch_spi_suspend, pch_spi_resume);
|
||||
|
||||
static struct pci_driver pch_spi_pcidev_driver = {
|
||||
.name = "pch_spi",
|
||||
.id_table = pch_spi_pcidev_id,
|
||||
.probe = pch_spi_probe,
|
||||
.remove = pch_spi_remove,
|
||||
.driver.pm = &pch_spi_pm_ops,
|
||||
.driver.pm = pm_sleep_ptr(&pch_spi_pm_ops),
|
||||
};
|
||||
|
||||
static int __init pch_spi_init(void)
|
||||
|
||||
@@ -935,7 +935,7 @@ static int zynqmp_qspi_read_op(struct zynqmp_qspi *xqspi, u8 rx_nbits,
|
||||
*
|
||||
* Return: Always 0
|
||||
*/
|
||||
static int __maybe_unused zynqmp_qspi_suspend(struct device *dev)
|
||||
static int zynqmp_qspi_suspend(struct device *dev)
|
||||
{
|
||||
struct zynqmp_qspi *xqspi = dev_get_drvdata(dev);
|
||||
struct spi_controller *ctlr = xqspi->ctlr;
|
||||
@@ -959,7 +959,7 @@ static int __maybe_unused zynqmp_qspi_suspend(struct device *dev)
|
||||
*
|
||||
* Return: 0 on success; error value otherwise
|
||||
*/
|
||||
static int __maybe_unused zynqmp_qspi_resume(struct device *dev)
|
||||
static int zynqmp_qspi_resume(struct device *dev)
|
||||
{
|
||||
struct zynqmp_qspi *xqspi = dev_get_drvdata(dev);
|
||||
struct spi_controller *ctlr = xqspi->ctlr;
|
||||
@@ -979,7 +979,7 @@ static int __maybe_unused zynqmp_qspi_resume(struct device *dev)
|
||||
*
|
||||
* Return: Always 0
|
||||
*/
|
||||
static int __maybe_unused zynqmp_runtime_suspend(struct device *dev)
|
||||
static int zynqmp_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct zynqmp_qspi *xqspi = dev_get_drvdata(dev);
|
||||
|
||||
@@ -997,7 +997,7 @@ static int __maybe_unused zynqmp_runtime_suspend(struct device *dev)
|
||||
*
|
||||
* Return: 0 on success and error value on error
|
||||
*/
|
||||
static int __maybe_unused zynqmp_runtime_resume(struct device *dev)
|
||||
static int zynqmp_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct zynqmp_qspi *xqspi = dev_get_drvdata(dev);
|
||||
int ret;
|
||||
@@ -1186,9 +1186,8 @@ static int zynqmp_qspi_exec_op(struct spi_mem *mem,
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops zynqmp_qspi_dev_pm_ops = {
|
||||
SET_RUNTIME_PM_OPS(zynqmp_runtime_suspend,
|
||||
zynqmp_runtime_resume, NULL)
|
||||
SET_SYSTEM_SLEEP_PM_OPS(zynqmp_qspi_suspend, zynqmp_qspi_resume)
|
||||
RUNTIME_PM_OPS(zynqmp_runtime_suspend, zynqmp_runtime_resume, NULL)
|
||||
SYSTEM_SLEEP_PM_OPS(zynqmp_qspi_suspend, zynqmp_qspi_resume)
|
||||
};
|
||||
|
||||
static const struct qspi_platform_data versal_qspi_def = {
|
||||
@@ -1382,7 +1381,7 @@ static struct platform_driver zynqmp_qspi_driver = {
|
||||
.driver = {
|
||||
.name = "zynqmp-qspi",
|
||||
.of_match_table = zynqmp_qspi_of_match,
|
||||
.pm = &zynqmp_qspi_dev_pm_ops,
|
||||
.pm = pm_ptr(&zynqmp_qspi_dev_pm_ops),
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user