Merge tag 'arc-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc
[linux-2.6-microblaze.git] / arch / arm / mach-at91 / pm.c
index fcb2027..d6cfe7c 100644 (file)
@@ -152,6 +152,17 @@ static const struct of_device_id sam9x60_ws_ids[] = {
        { /* sentinel */ }
 };
 
+static const struct of_device_id sama7g5_ws_ids[] = {
+       { .compatible = "atmel,at91sam9x5-rtc",         .data = &ws_info[1] },
+       { .compatible = "microchip,sama7g5-ohci",       .data = &ws_info[2] },
+       { .compatible = "usb-ohci",                     .data = &ws_info[2] },
+       { .compatible = "atmel,at91sam9g45-ehci",       .data = &ws_info[2] },
+       { .compatible = "usb-ehci",                     .data = &ws_info[2] },
+       { .compatible = "microchip,sama7g5-sdhci",      .data = &ws_info[3] },
+       { .compatible = "atmel,at91sam9260-rtt",        .data = &ws_info[4] },
+       { /* sentinel */ }
+};
+
 static int at91_pm_config_ws(unsigned int pm_mode, bool set)
 {
        const struct wakeup_source_info *wsi;
@@ -783,6 +794,7 @@ securam_fail:
 static const struct of_device_id atmel_shdwc_ids[] = {
        { .compatible = "atmel,sama5d2-shdwc" },
        { .compatible = "microchip,sam9x60-shdwc" },
+       { .compatible = "microchip,sama7g5-shdwc" },
        { /* sentinel. */ }
 };
 
@@ -897,6 +909,11 @@ static const struct pmc_info pmc_infos[] __initconst = {
                .mckr = 0x28,
                .version = AT91_PMC_V2,
        },
+       {
+               .mckr = 0x28,
+               .version = AT91_PMC_V2,
+       },
+
 };
 
 static const struct of_device_id atmel_pmc_ids[] __initconst = {
@@ -912,6 +929,7 @@ static const struct of_device_id atmel_pmc_ids[] __initconst = {
        { .compatible = "atmel,sama5d4-pmc", .data = &pmc_infos[1] },
        { .compatible = "atmel,sama5d2-pmc", .data = &pmc_infos[1] },
        { .compatible = "microchip,sam9x60-pmc", .data = &pmc_infos[4] },
+       { .compatible = "microchip,sama7g5-pmc", .data = &pmc_infos[5] },
        { /* sentinel */ },
 };
 
@@ -1097,6 +1115,32 @@ void __init sama5d2_pm_init(void)
        soc_pm.config_pmc_ws = at91_sama5d2_config_pmc_ws;
 }
 
+void __init sama7_pm_init(void)
+{
+       static const int modes[] __initconst = {
+               AT91_PM_STANDBY, AT91_PM_ULP0, AT91_PM_ULP1, AT91_PM_BACKUP,
+       };
+       static const u32 iomaps[] __initconst = {
+               [AT91_PM_ULP0]          = AT91_PM_IOMAP(SFRBU),
+               [AT91_PM_ULP1]          = AT91_PM_IOMAP(SFRBU) |
+                                         AT91_PM_IOMAP(SHDWC),
+               [AT91_PM_BACKUP]        = AT91_PM_IOMAP(SFRBU) |
+                                         AT91_PM_IOMAP(SHDWC),
+       };
+
+       if (!IS_ENABLED(CONFIG_SOC_SAMA7))
+               return;
+
+       at91_pm_modes_validate(modes, ARRAY_SIZE(modes));
+
+       at91_dt_ramc(true);
+       at91_pm_modes_init(iomaps, ARRAY_SIZE(iomaps));
+       at91_pm_init(NULL);
+
+       soc_pm.ws_ids = sama7g5_ws_ids;
+       soc_pm.config_pmc_ws = at91_sam9x60_config_pmc_ws;
+}
+
 static int __init at91_pm_modes_select(char *str)
 {
        char *s;