Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 267094
b: refs/heads/master
c: d93f5cd
h: refs/heads/master
v: v3
  • Loading branch information
Magnus Damm authored and Rafael J. Wysocki committed Oct 21, 2011
1 parent cdd1e43 commit 2f98d6c
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4ca46ff3e0d8c234cb40ebb6457653b59584426c
refs/heads/master: d93f5cdea968284f05aa9905ee9752874885a6fa
4 changes: 4 additions & 0 deletions trunk/arch/arm/mach-shmobile/board-ap4evb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1409,6 +1409,10 @@ static void __init ap4evb_init(void)
sh7372_add_device_to_domain(&sh7372_a4lc, &lcdc_device);
sh7372_add_device_to_domain(&sh7372_a4mp, &fsi_device);

sh7372_add_device_to_domain(&sh7372_a3sp, &sh_mmcif_device);
sh7372_add_device_to_domain(&sh7372_a3sp, &sdhi0_device);
sh7372_add_device_to_domain(&sh7372_a3sp, &sdhi1_device);

hdmi_init_pm_clock();
fsi_init_pm_clock();
sh7372_pm_init();
Expand Down
8 changes: 8 additions & 0 deletions trunk/arch/arm/mach-shmobile/board-mackerel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1588,6 +1588,14 @@ static void __init mackerel_init(void)
sh7372_add_device_to_domain(&sh7372_a4lc, &lcdc_device);
sh7372_add_device_to_domain(&sh7372_a4lc, &hdmi_lcdc_device);
sh7372_add_device_to_domain(&sh7372_a4mp, &fsi_device);
sh7372_add_device_to_domain(&sh7372_a3sp, &usbhs0_device);
sh7372_add_device_to_domain(&sh7372_a3sp, &usbhs1_device);
sh7372_add_device_to_domain(&sh7372_a3sp, &sh_mmcif_device);
sh7372_add_device_to_domain(&sh7372_a3sp, &sdhi0_device);
#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
sh7372_add_device_to_domain(&sh7372_a3sp, &sdhi1_device);
#endif
sh7372_add_device_to_domain(&sh7372_a3sp, &sdhi2_device);

hdmi_init_pm_clock();
sh7372_pm_init();
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/arm/mach-shmobile/include/mach/sh7372.h
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,9 @@ struct platform_device;

struct sh7372_pm_domain {
struct generic_pm_domain genpd;
struct dev_power_governor *gov;
unsigned int bit_shift;
bool no_debug;
};

static inline struct sh7372_pm_domain *to_sh7372_pd(struct generic_pm_domain *d)
Expand All @@ -493,6 +495,7 @@ extern struct sh7372_pm_domain sh7372_a4mp;
extern struct sh7372_pm_domain sh7372_d4;
extern struct sh7372_pm_domain sh7372_a3rv;
extern struct sh7372_pm_domain sh7372_a3ri;
extern struct sh7372_pm_domain sh7372_a3sp;
extern struct sh7372_pm_domain sh7372_a3sg;

extern void sh7372_init_pm_domain(struct sh7372_pm_domain *sh7372_pd);
Expand Down
30 changes: 25 additions & 5 deletions trunk/arch/arm/mach-shmobile/pm-sh7372.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ static int pd_power_down(struct generic_pm_domain *genpd)
}
}

pr_debug("sh7372 power domain down 0x%08x -> PSTR = 0x%08x\n",
mask, __raw_readl(PSTR));
if (!sh7372_pd->no_debug)
pr_debug("sh7372 power domain down 0x%08x -> PSTR = 0x%08x\n",
mask, __raw_readl(PSTR));

return 0;
}
Expand Down Expand Up @@ -122,8 +123,9 @@ static int pd_power_up(struct generic_pm_domain *genpd)
ret = -EIO;

out:
pr_debug("sh7372 power domain up 0x%08x -> PSTR = 0x%08x\n",
mask, __raw_readl(PSTR));
if (!sh7372_pd->no_debug)
pr_debug("sh7372 power domain up 0x%08x -> PSTR = 0x%08x\n",
mask, __raw_readl(PSTR));

return ret;
}
Expand All @@ -133,11 +135,20 @@ static bool pd_active_wakeup(struct device *dev)
return true;
}

static bool sh7372_power_down_forbidden(struct dev_pm_domain *domain)
{
return false;
}

struct dev_power_governor sh7372_always_on_gov = {
.power_down_ok = sh7372_power_down_forbidden,
};

void sh7372_init_pm_domain(struct sh7372_pm_domain *sh7372_pd)
{
struct generic_pm_domain *genpd = &sh7372_pd->genpd;

pm_genpd_init(genpd, NULL, false);
pm_genpd_init(genpd, sh7372_pd->gov, false);
genpd->stop_device = pm_clk_suspend;
genpd->start_device = pm_clk_resume;
genpd->dev_irq_safe = true;
Expand Down Expand Up @@ -183,6 +194,12 @@ struct sh7372_pm_domain sh7372_a3ri = {
.bit_shift = 8,
};

struct sh7372_pm_domain sh7372_a3sp = {
.bit_shift = 11,
.gov = &sh7372_always_on_gov,
.no_debug = true,
};

struct sh7372_pm_domain sh7372_a3sg = {
.bit_shift = 13,
};
Expand Down Expand Up @@ -422,6 +439,9 @@ void __init sh7372_pm_init(void)
__raw_writel(0x0000a501, DBGREG9);
__raw_writel(0x00000000, DBGREG1);

/* do not convert A3SM, A3SP, A3SG, A4R power down into A4S */
__raw_writel(0, PDNSEL);

sh7372_suspend_init();
sh7372_cpuidle_init();
}
14 changes: 14 additions & 0 deletions trunk/arch/arm/mach-shmobile/setup-sh7372.c
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,7 @@ void __init sh7372_add_standard_devices(void)
sh7372_init_pm_domain(&sh7372_a3rv);
sh7372_init_pm_domain(&sh7372_a3ri);
sh7372_init_pm_domain(&sh7372_a3sg);
sh7372_init_pm_domain(&sh7372_a3sp);

sh7372_pm_add_subdomain(&sh7372_a4lc, &sh7372_a3rv);

Expand All @@ -1006,6 +1007,19 @@ void __init sh7372_add_standard_devices(void)
sh7372_add_device_to_domain(&sh7372_a3rv, &vpu_device);
sh7372_add_device_to_domain(&sh7372_a4mp, &spu0_device);
sh7372_add_device_to_domain(&sh7372_a4mp, &spu1_device);
sh7372_add_device_to_domain(&sh7372_a3sp, &scif0_device);
sh7372_add_device_to_domain(&sh7372_a3sp, &scif1_device);
sh7372_add_device_to_domain(&sh7372_a3sp, &scif2_device);
sh7372_add_device_to_domain(&sh7372_a3sp, &scif3_device);
sh7372_add_device_to_domain(&sh7372_a3sp, &scif4_device);
sh7372_add_device_to_domain(&sh7372_a3sp, &scif5_device);
sh7372_add_device_to_domain(&sh7372_a3sp, &scif6_device);
sh7372_add_device_to_domain(&sh7372_a3sp, &iic1_device);
sh7372_add_device_to_domain(&sh7372_a3sp, &dma0_device);
sh7372_add_device_to_domain(&sh7372_a3sp, &dma1_device);
sh7372_add_device_to_domain(&sh7372_a3sp, &dma2_device);
sh7372_add_device_to_domain(&sh7372_a3sp, &usb_dma0_device);
sh7372_add_device_to_domain(&sh7372_a3sp, &usb_dma1_device);
}

void __init sh7372_add_early_devices(void)
Expand Down

0 comments on commit 2f98d6c

Please sign in to comment.