diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-08-15 20:56:26 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-09-04 01:45:00 +0200 |
commit | ac18e02dc022a5413219f41d000bc637c7c5d957 (patch) | |
tree | ef974a4084f0536fe8aec27f382b3e81f49f61a0 /arch/arm/mach-shmobile/setup-sh7372.c | |
parent | b42879e2e9b130e9ea0df3f076a0742df46e143a (diff) | |
download | talos-obmc-linux-ac18e02dc022a5413219f41d000bc637c7c5d957.tar.gz talos-obmc-linux-ac18e02dc022a5413219f41d000bc637c7c5d957.zip |
ARM: shmobile: Rework adding devices to PM domains on Mackerel
On SH7372 and Mackerel devices are added to PM domains through a
series of rmobile_add_device_to_domain_td() calls where the last
argument is always the same. This is quite inefficient, so add
a common function for adding devices to PM domains that reads the
domain-device pairs information from a table and use it during SH7372
and Mackerel initialization.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Magnus Damm <damm@opensource.se>
Diffstat (limited to 'arch/arm/mach-shmobile/setup-sh7372.c')
-rw-r--r-- | arch/arm/mach-shmobile/setup-sh7372.c | 58 |
1 files changed, 27 insertions, 31 deletions
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c index 5bcde8a79c53..a07954fbcd22 100644 --- a/arch/arm/mach-shmobile/setup-sh7372.c +++ b/arch/arm/mach-shmobile/setup-sh7372.c @@ -999,15 +999,33 @@ static struct platform_device *sh7372_late_devices[] __initdata = { &spu1_device, }; -#define DEV_LATENCY_NS 250000 - void __init sh7372_add_standard_devices(void) { - struct gpd_timing_data latencies = { - .stop_latency_ns = DEV_LATENCY_NS, - .start_latency_ns = DEV_LATENCY_NS, - .save_state_latency_ns = DEV_LATENCY_NS, - .restore_state_latency_ns = DEV_LATENCY_NS, + struct pm_domain_device domain_devices[] = { + { "A3RV", &vpu_device, }, + { "A4MP", &spu0_device, }, + { "A4MP", &spu1_device, }, + { "A3SP", &scif0_device, }, + { "A3SP", &scif1_device, }, + { "A3SP", &scif2_device, }, + { "A3SP", &scif3_device, }, + { "A3SP", &scif4_device, }, + { "A3SP", &scif5_device, }, + { "A3SP", &scif6_device, }, + { "A3SP", &iic1_device, }, + { "A3SP", &dma0_device, }, + { "A3SP", &dma1_device, }, + { "A3SP", &dma2_device, }, + { "A3SP", &usb_dma0_device, }, + { "A3SP", &usb_dma1_device, }, + { "A4R", &iic0_device, }, + { "A4R", &veu0_device, }, + { "A4R", &veu1_device, }, + { "A4R", &veu2_device, }, + { "A4R", &veu3_device, }, + { "A4R", &jpu_device, }, + { "A4R", &tmu00_device, }, + { "A4R", &tmu01_device, }, }; sh7372_init_pm_domains(); @@ -1018,30 +1036,8 @@ void __init sh7372_add_standard_devices(void) platform_add_devices(sh7372_late_devices, ARRAY_SIZE(sh7372_late_devices)); - rmobile_add_device_to_domain_td("A3RV", &vpu_device, &latencies); - rmobile_add_device_to_domain_td("A4MP", &spu0_device, &latencies); - rmobile_add_device_to_domain_td("A4MP", &spu1_device, &latencies); - rmobile_add_device_to_domain_td("A3SP", &scif0_device, &latencies); - rmobile_add_device_to_domain_td("A3SP", &scif1_device, &latencies); - rmobile_add_device_to_domain_td("A3SP", &scif2_device, &latencies); - rmobile_add_device_to_domain_td("A3SP", &scif3_device, &latencies); - rmobile_add_device_to_domain_td("A3SP", &scif4_device, &latencies); - rmobile_add_device_to_domain_td("A3SP", &scif5_device, &latencies); - rmobile_add_device_to_domain_td("A3SP", &scif6_device, &latencies); - rmobile_add_device_to_domain_td("A3SP", &iic1_device, &latencies); - rmobile_add_device_to_domain_td("A3SP", &dma0_device, &latencies); - rmobile_add_device_to_domain_td("A3SP", &dma1_device, &latencies); - rmobile_add_device_to_domain_td("A3SP", &dma2_device, &latencies); - rmobile_add_device_to_domain_td("A3SP", &usb_dma0_device, &latencies); - rmobile_add_device_to_domain_td("A3SP", &usb_dma1_device, &latencies); - rmobile_add_device_to_domain_td("A4R", &iic0_device, &latencies); - rmobile_add_device_to_domain_td("A4R", &veu0_device, &latencies); - rmobile_add_device_to_domain_td("A4R", &veu1_device, &latencies); - rmobile_add_device_to_domain_td("A4R", &veu2_device, &latencies); - rmobile_add_device_to_domain_td("A4R", &veu3_device, &latencies); - rmobile_add_device_to_domain_td("A4R", &jpu_device, &latencies); - rmobile_add_device_to_domain_td("A4R", &tmu00_device, &latencies); - rmobile_add_device_to_domain_td("A4R", &tmu01_device, &latencies); + rmobile_add_devices_to_domains(domain_devices, + ARRAY_SIZE(domain_devices)); } static void __init sh7372_earlytimer_init(void) |