diff options
author | Benoit Cousson <b-cousson@ti.com> | 2011-08-09 10:54:19 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2011-10-04 12:52:23 -0400 |
commit | b7b5bc91d422ff51ff84dfd5949e9d2f17a550c8 (patch) | |
tree | 2266e8185ed35a7f76de97f35f704db5e3561c5d | |
parent | 766e7afc38754e4bdcbf948fa523af8999a6296f (diff) |
ARM: OMAP: omap_device: Create a default omap_device_pm_latency
Most devices are using the same default omap_device_pm_latency structure
during device built. In order to avoid the duplication of the same
structure everywhere, add a default structure that will be used if
the device does not have an explicit one.
Next patches will clean the duplicated structures.
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
-rw-r--r-- | arch/arm/plat-omap/omap_device.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index f832f92013b2..cd8d9778b14e 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c | |||
@@ -97,6 +97,14 @@ | |||
97 | static int omap_device_register(struct platform_device *pdev); | 97 | static int omap_device_register(struct platform_device *pdev); |
98 | static int omap_early_device_register(struct platform_device *pdev); | 98 | static int omap_early_device_register(struct platform_device *pdev); |
99 | 99 | ||
100 | static struct omap_device_pm_latency omap_default_latency[] = { | ||
101 | { | ||
102 | .deactivate_func = omap_device_idle_hwmods, | ||
103 | .activate_func = omap_device_enable_hwmods, | ||
104 | .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, | ||
105 | } | ||
106 | }; | ||
107 | |||
100 | /* Private functions */ | 108 | /* Private functions */ |
101 | 109 | ||
102 | /** | 110 | /** |
@@ -510,8 +518,17 @@ struct platform_device *omap_device_build_ss(const char *pdev_name, int pdev_id, | |||
510 | if (ret) | 518 | if (ret) |
511 | goto odbs_exit3; | 519 | goto odbs_exit3; |
512 | 520 | ||
513 | od->pm_lats = pm_lats; | 521 | if (!pm_lats) { |
522 | pm_lats = omap_default_latency; | ||
523 | pm_lats_cnt = ARRAY_SIZE(omap_default_latency); | ||
524 | } | ||
525 | |||
514 | od->pm_lats_cnt = pm_lats_cnt; | 526 | od->pm_lats_cnt = pm_lats_cnt; |
527 | od->pm_lats = kmemdup(pm_lats, | ||
528 | sizeof(struct omap_device_pm_latency) * pm_lats_cnt, | ||
529 | GFP_KERNEL); | ||
530 | if (!od->pm_lats) | ||
531 | goto odbs_exit3; | ||
515 | 532 | ||
516 | for (i = 0; i < oh_cnt; i++) { | 533 | for (i = 0; i < oh_cnt; i++) { |
517 | hwmods[i]->od = od; | 534 | hwmods[i]->od = od; |