diff options
author | Scott Wood <scottwood@freescale.com> | 2014-05-14 19:37:56 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-05-14 19:37:56 (GMT) |
commit | 525def4e6e30b62ede9f7c659a7aa93e903e5426 (patch) | |
tree | ec3379f69a2be1abfbefacc95521c6088b0e0d77 /drivers/net/ethernet/freescale | |
parent | 30761af49c804f9e37f656979739940bbd814991 (diff) | |
parent | 701d1fa7c066a36d9520e3c0cacf788117f50eec (diff) | |
download | linux-fsl-qoriq-525def4e6e30b62ede9f7c659a7aa93e903e5426.tar.xz |
Merge remote-tracking branch 'origin/sdk-v1.6.x' into sdk-v1.6.x
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rwxr-xr-x | drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.c b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.c index 0ffb014..9815278 100755 --- a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.c +++ b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_fm.c @@ -1094,11 +1094,47 @@ static const struct of_device_id fm_match[] = { MODULE_DEVICE_TABLE(of, fm_match); #endif /* !MODULE */ +#ifdef CONFIG_PM + +#define SCFG_FMCLKDPSLPCR_ADDR 0xFFE0FC00C +#define SCFG_FMCLKDPSLPCR_DS_VAL 0x48402000 +#define SCFG_FMCLKDPSLPCR_NORMAL_VAL 0x00402000 + +static int fm_soc_suspend(struct device *dev) +{ + uint32_t *fmclk; + fmclk = ioremap(SCFG_FMCLKDPSLPCR_ADDR, 4); + WRITE_UINT32(*fmclk, SCFG_FMCLKDPSLPCR_DS_VAL); + return 0; +} + +static int fm_soc_resume(struct device *dev) +{ + uint32_t *fmclk; + fmclk = ioremap(SCFG_FMCLKDPSLPCR_ADDR, 4); + WRITE_UINT32(*fmclk, SCFG_FMCLKDPSLPCR_NORMAL_VAL); + return 0; +} + +static const struct dev_pm_ops fm_pm_ops = { + .suspend_noirq = fm_soc_suspend, + .resume_noirq = fm_soc_resume, +}; + +#define FM_PM_OPS (&fm_pm_ops) + +#else /* CONFIG_PM */ + +#define FM_PM_OPS NULL + +#endif /* CONFIG_PM */ + static struct platform_driver fm_driver = { .driver = { .name = "fsl-fman", .of_match_table = fm_match, .owner = THIS_MODULE, + .pm = FM_PM_OPS, }, .probe = fm_probe, .remove = fm_remove |