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/voltagedomains3xxx_data.c | 34 +++++++++++++-------------- 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'arch/arm/mach-omap2/voltagedomains3xxx_data.c') diff --git a/arch/arm/mach-omap2/voltagedomains3xxx_data.c b/arch/arm/mach-omap2/voltagedomains3xxx_data.c index f831f9adc881..4bee412b673b 100644 --- a/arch/arm/mach-omap2/voltagedomains3xxx_data.c +++ b/arch/arm/mach-omap2/voltagedomains3xxx_data.c @@ -43,9 +43,6 @@ static struct omap_vdd_info omap3_vdd1_info = { .vp_data = &omap3_vp1_data, .vc_data = &omap3_vc1_data, .vfsm = &omap3_vdd1_vfsm_data, - .voltdm = { - .name = "mpu", - }, }; static const struct omap_vfsm_instance_data omap3_vdd2_vfsm_data = { @@ -60,23 +57,26 @@ static struct omap_vdd_info omap3_vdd2_info = { .vp_data = &omap3_vp2_data, .vc_data = &omap3_vc2_data, .vfsm = &omap3_vdd2_vfsm_data, - .voltdm = { - .name = "core", - }, }; -/* OMAP3 VDD structures */ -static struct omap_vdd_info *omap3_vdd_info[] = { - &omap3_vdd1_info, - &omap3_vdd2_info, +static struct voltagedomain omap3_voltdm_mpu = { + .name = "mpu", + .vdd = &omap3_vdd1_info, }; -/* OMAP3 specific voltage init functions */ -static int __init omap3xxx_voltage_early_init(void) -{ - if (!cpu_is_omap34xx()) - return 0; +static struct voltagedomain omap3_voltdm_core = { + .name = "core", + .vdd = &omap3_vdd2_info, +}; +static struct voltagedomain *voltagedomains_omap3[] __initdata = { + &omap3_voltdm_mpu, + &omap3_voltdm_core, + NULL, +}; + +void __init omap3xxx_voltagedomains_init(void) +{ /* * XXX Will depend on the process, validation, and binning * for the currently-running IC @@ -89,7 +89,5 @@ static int __init omap3xxx_voltage_early_init(void) omap3_vdd2_info.volt_data = omap34xx_vddcore_volt_data; } - return omap_voltage_early_init(omap3_vdd_info, - ARRAY_SIZE(omap3_vdd_info)); + voltdm_init(voltagedomains_omap3); }; -core_initcall(omap3xxx_voltage_early_init); -- cgit v1.2.3