From 81a604823797ddb3aaf2a78cc1c6a1fa8f4d200c Mon Sep 17 00:00:00 2001 From: Kevin Hilman Date: Wed, 16 Mar 2011 14:25:45 -0700 Subject: OMAP2+: voltage: start towards a new voltagedomain layer Start cleaning up the voltage layer to have a voltage domain layer that resembles the structure of the existing clock and power domain layers. To that end: - move the 'struct voltagedomain' out of 'struct omap_vdd_info' to become the primary data structure. - convert any functions taking a pointer to struct omap_vdd_info into functions taking a struct voltagedomain pointer. - convert the register & initialize of voltage domains to look like that of powerdomains - convert omap_voltage_domain_lookup() to voltdm_lookup(), modeled after the current powerdomain and clockdomain lookup functions. - omap_voltage_late_init(): only configure VDD info when the vdd_info struct is non-NULL Signed-off-by: Kevin Hilman --- arch/arm/mach-omap2/voltagedomains44xx_data.c | 44 +++++++++++++-------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'arch/arm/mach-omap2/voltagedomains44xx_data.c') diff --git a/arch/arm/mach-omap2/voltagedomains44xx_data.c b/arch/arm/mach-omap2/voltagedomains44xx_data.c index 64dc265aa2ad..245fdf9cb4a5 100644 --- a/arch/arm/mach-omap2/voltagedomains44xx_data.c +++ b/arch/arm/mach-omap2/voltagedomains44xx_data.c @@ -42,9 +42,6 @@ static struct omap_vdd_info omap4_vdd_mpu_info = { .vp_data = &omap4_vp_mpu_data, .vc_data = &omap4_vc_mpu_data, .vfsm = &omap4_vdd_mpu_vfsm_data, - .voltdm = { - .name = "mpu", - }, }; static const struct omap_vfsm_instance_data omap4_vdd_iva_vfsm_data = { @@ -57,9 +54,6 @@ static struct omap_vdd_info omap4_vdd_iva_info = { .vp_data = &omap4_vp_iva_data, .vc_data = &omap4_vc_iva_data, .vfsm = &omap4_vdd_iva_vfsm_data, - .voltdm = { - .name = "iva", - }, }; static const struct omap_vfsm_instance_data omap4_vdd_core_vfsm_data = { @@ -72,24 +66,32 @@ static struct omap_vdd_info omap4_vdd_core_info = { .vp_data = &omap4_vp_core_data, .vc_data = &omap4_vc_core_data, .vfsm = &omap4_vdd_core_vfsm_data, - .voltdm = { - .name = "core", - }, }; -/* OMAP4 VDD structures */ -static struct omap_vdd_info *omap4_vdd_info[] = { - &omap4_vdd_mpu_info, - &omap4_vdd_iva_info, - &omap4_vdd_core_info, +static struct voltagedomain omap4_voltdm_mpu = { + .name = "mpu", + .vdd = &omap4_vdd_mpu_info, }; -/* OMAP4 specific voltage init functions */ -static int __init omap44xx_voltage_early_init(void) -{ - if (!cpu_is_omap44xx()) - return 0; +static struct voltagedomain omap4_voltdm_iva = { + .name = "iva", + .vdd = &omap4_vdd_iva_info, +}; + +static struct voltagedomain omap4_voltdm_core = { + .name = "core", + .vdd = &omap4_vdd_core_info, +}; +static struct voltagedomain *voltagedomains_omap4[] __initdata = { + &omap4_voltdm_mpu, + &omap4_voltdm_iva, + &omap4_voltdm_core, + NULL, +}; + +void __init omap44xx_voltagedomains_init(void) +{ /* * XXX Will depend on the process, validation, and binning * for the currently-running IC @@ -98,7 +100,5 @@ static int __init omap44xx_voltage_early_init(void) omap4_vdd_iva_info.volt_data = omap44xx_vdd_iva_volt_data; omap4_vdd_core_info.volt_data = omap44xx_vdd_core_volt_data; - return omap_voltage_early_init(omap4_vdd_info, - ARRAY_SIZE(omap4_vdd_info)); + voltdm_init(voltagedomains_omap4); }; -core_initcall(omap44xx_voltage_early_init); -- cgit v1.2.3-59-g8ed1b