aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-vexpress
diff options
context:
space:
mode:
authorPawel Moll <pawel.moll@arm.com>2014-04-30 11:46:29 -0400
committerPawel Moll <pawel.moll@arm.com>2014-05-15 12:02:18 -0400
commit3b9334ac835bb431e2186645230c9f1eb94b5d49 (patch)
tree631e00349363927a6e49c6810332d92295103446 /arch/arm/mach-vexpress
parentc6e126de43e7d4abfd6cf796b40589db3a046167 (diff)
mfd: vexpress: Convert custom func API to regmap
Components of the Versatile Express platform (configuration microcontrollers on motherboard and daughterboards in particular) talk to each other over a custom configuration bus. They provide miscellaneous functions (from clock generator control to energy sensors) which are represented as platform devices (and Device Tree nodes). The transactions on the bus can be generated by different "bridges" in the system, some of which are universal for the whole platform (for the price of high transfer latencies), others restricted to a subsystem (but much faster). Until now drivers for such functions were using custom "func" API, which is being replaced in this patch by regmap calls. This required: * a rework (and move to drivers/bus directory, as suggested by Samuel and Arnd) of the config bus core, which is much simpler now and uses device model infrastructure (class) to keep track of the bridges; non-DT case (soon to be retired anyway) is simply covered by a special device registration function * the new config-bus driver also takes over device population, so there is no need for special matching table for of_platform_populate nor "simple-bus" hack in the arm64 model dtsi file (relevant bindings documentation has been updated); this allows all the vexpress devices fit into normal device model, making it possible to remove plenty of early inits and other hacks in the near future * adaptation of the syscfg bridge implementation in the sysreg driver, again making it much simpler; there is a special case of the "energy" function spanning two registers, where they should be both defined in the tree now, but backward compatibility is maintained in the code * modification of the relevant drivers: * hwmon - just a straight-forward API change * power/reset driver - API change * regulator - API change plus error handling simplification * osc clock driver - this one required larger rework in order to turn in into a standard platform driver Signed-off-by: Pawel Moll <pawel.moll@arm.com> Acked-by: Mark Brown <broonie@linaro.org> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'arch/arm/mach-vexpress')
-rw-r--r--arch/arm/mach-vexpress/ct-ca9x4.c10
-rw-r--r--arch/arm/mach-vexpress/v2m.c18
2 files changed, 12 insertions, 16 deletions
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c
index 6f34497a4245..35e394aa00e5 100644
--- a/arch/arm/mach-vexpress/ct-ca9x4.c
+++ b/arch/arm/mach-vexpress/ct-ca9x4.c
@@ -128,6 +128,10 @@ static struct platform_device pmu_device = {
128 .resource = pmu_resources, 128 .resource = pmu_resources,
129}; 129};
130 130
131static struct clk_lookup osc1_lookup = {
132 .dev_id = "ct:clcd",
133};
134
131static struct platform_device osc1_device = { 135static struct platform_device osc1_device = {
132 .name = "vexpress-osc", 136 .name = "vexpress-osc",
133 .id = 1, 137 .id = 1,
@@ -135,6 +139,7 @@ static struct platform_device osc1_device = {
135 .resource = (struct resource []) { 139 .resource = (struct resource []) {
136 VEXPRESS_RES_FUNC(0xf, 1), 140 VEXPRESS_RES_FUNC(0xf, 1),
137 }, 141 },
142 .dev.platform_data = &osc1_lookup,
138}; 143};
139 144
140static void __init ct_ca9x4_init(void) 145static void __init ct_ca9x4_init(void)
@@ -155,10 +160,7 @@ static void __init ct_ca9x4_init(void)
155 amba_device_register(ct_ca9x4_amba_devs[i], &iomem_resource); 160 amba_device_register(ct_ca9x4_amba_devs[i], &iomem_resource);
156 161
157 platform_device_register(&pmu_device); 162 platform_device_register(&pmu_device);
158 platform_device_register(&osc1_device); 163 vexpress_sysreg_config_device_register(&osc1_device);
159
160 WARN_ON(clk_register_clkdev(vexpress_osc_setup(&osc1_device.dev),
161 NULL, "ct:clcd"));
162} 164}
163 165
164#ifdef CONFIG_SMP 166#ifdef CONFIG_SMP
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index 4f8b8cb17ff5..ac95220a5019 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -340,11 +340,6 @@ static void __init v2m_init(void)
340 regulator_register_fixed(0, v2m_eth_supplies, 340 regulator_register_fixed(0, v2m_eth_supplies,
341 ARRAY_SIZE(v2m_eth_supplies)); 341 ARRAY_SIZE(v2m_eth_supplies));
342 342
343 platform_device_register(&v2m_muxfpga_device);
344 platform_device_register(&v2m_shutdown_device);
345 platform_device_register(&v2m_reboot_device);
346 platform_device_register(&v2m_dvimode_device);
347
348 platform_device_register(&v2m_sysreg_device); 343 platform_device_register(&v2m_sysreg_device);
349 platform_device_register(&v2m_pcie_i2c_device); 344 platform_device_register(&v2m_pcie_i2c_device);
350 platform_device_register(&v2m_ddc_i2c_device); 345 platform_device_register(&v2m_ddc_i2c_device);
@@ -356,6 +351,11 @@ static void __init v2m_init(void)
356 for (i = 0; i < ARRAY_SIZE(v2m_amba_devs); i++) 351 for (i = 0; i < ARRAY_SIZE(v2m_amba_devs); i++)
357 amba_device_register(v2m_amba_devs[i], &iomem_resource); 352 amba_device_register(v2m_amba_devs[i], &iomem_resource);
358 353
354 vexpress_sysreg_config_device_register(&v2m_muxfpga_device);
355 vexpress_sysreg_config_device_register(&v2m_shutdown_device);
356 vexpress_sysreg_config_device_register(&v2m_reboot_device);
357 vexpress_sysreg_config_device_register(&v2m_dvimode_device);
358
359 ct_desc->init_tile(); 359 ct_desc->init_tile();
360} 360}
361 361
@@ -423,17 +423,11 @@ void __init v2m_dt_init_early(void)
423 versatile_sched_clock_init(vexpress_get_24mhz_clock_base(), 24000000); 423 versatile_sched_clock_init(vexpress_get_24mhz_clock_base(), 24000000);
424} 424}
425 425
426static const struct of_device_id v2m_dt_bus_match[] __initconst = {
427 { .compatible = "simple-bus", },
428 { .compatible = "arm,amba-bus", },
429 { .compatible = "arm,vexpress,config-bus", },
430 {}
431};
432 426
433static void __init v2m_dt_init(void) 427static void __init v2m_dt_init(void)
434{ 428{
435 l2x0_of_init(0x00400000, 0xfe0fffff); 429 l2x0_of_init(0x00400000, 0xfe0fffff);
436 of_platform_populate(NULL, v2m_dt_bus_match, NULL, NULL); 430 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
437} 431}
438 432
439static const char * const v2m_dt_match[] __initconst = { 433static const char * const v2m_dt_match[] __initconst = {