Commit b7b5bc91 authored by Benoit Cousson's avatar Benoit Cousson Committed by Kevin Hilman

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: default avatarBenoit Cousson <b-cousson@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: default avatarKevin Hilman <khilman@ti.com>
parent 766e7afc
...@@ -97,6 +97,14 @@ ...@@ -97,6 +97,14 @@
static int omap_device_register(struct platform_device *pdev); static int omap_device_register(struct platform_device *pdev);
static int omap_early_device_register(struct platform_device *pdev); static int omap_early_device_register(struct platform_device *pdev);
static struct omap_device_pm_latency omap_default_latency[] = {
{
.deactivate_func = omap_device_idle_hwmods,
.activate_func = omap_device_enable_hwmods,
.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
}
};
/* Private functions */ /* Private functions */
/** /**
...@@ -510,8 +518,17 @@ struct platform_device *omap_device_build_ss(const char *pdev_name, int pdev_id, ...@@ -510,8 +518,17 @@ struct platform_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
if (ret) if (ret)
goto odbs_exit3; goto odbs_exit3;
od->pm_lats = pm_lats; if (!pm_lats) {
pm_lats = omap_default_latency;
pm_lats_cnt = ARRAY_SIZE(omap_default_latency);
}
od->pm_lats_cnt = pm_lats_cnt; od->pm_lats_cnt = pm_lats_cnt;
od->pm_lats = kmemdup(pm_lats,
sizeof(struct omap_device_pm_latency) * pm_lats_cnt,
GFP_KERNEL);
if (!od->pm_lats)
goto odbs_exit3;
for (i = 0; i < oh_cnt; i++) { for (i = 0; i < oh_cnt; i++) {
hwmods[i]->od = od; hwmods[i]->od = od;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment