Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/hwspinlock
[pandora-kernel.git] / arch / arm / mach-omap2 / voltagedomains44xx_data.c
index cb64996..c4584e9 100644 (file)
 #include "vc.h"
 #include "vp.h"
 
-static const struct omap_vfsm_instance_data omap4_vdd_mpu_vfsm_data = {
+static const struct omap_vfsm_instance omap4_vdd_mpu_vfsm = {
        .voltsetup_reg = OMAP4_PRM_VOLTSETUP_MPU_RET_SLEEP_OFFSET,
 };
 
-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 omap4_vdd_iva_vfsm = {
+       .voltsetup_reg = OMAP4_PRM_VOLTSETUP_IVA_RET_SLEEP_OFFSET,
 };
 
-static const struct omap_vfsm_instance_data omap4_vdd_iva_vfsm_data = {
-       .voltsetup_reg = OMAP4_PRM_VOLTSETUP_IVA_RET_SLEEP_OFFSET,
+static const struct omap_vfsm_instance omap4_vdd_core_vfsm = {
+       .voltsetup_reg = OMAP4_PRM_VOLTSETUP_CORE_RET_SLEEP_OFFSET,
 };
 
-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 struct voltagedomain omap4_voltdm_mpu = {
+       .name = "mpu",
+       .scalable = true,
+       .read = omap4_prm_vcvp_read,
+       .write = omap4_prm_vcvp_write,
+       .rmw = omap4_prm_vcvp_rmw,
+       .vc = &omap4_vc_mpu,
+       .vfsm = &omap4_vdd_mpu_vfsm,
+       .vp = &omap4_vp_mpu,
 };
 
-static const struct omap_vfsm_instance_data omap4_vdd_core_vfsm_data = {
-       .voltsetup_reg = OMAP4_PRM_VOLTSETUP_CORE_RET_SLEEP_OFFSET,
+static struct voltagedomain omap4_voltdm_iva = {
+       .name = "iva",
+       .scalable = true,
+       .read = omap4_prm_vcvp_read,
+       .write = omap4_prm_vcvp_write,
+       .rmw = omap4_prm_vcvp_rmw,
+       .vc = &omap4_vc_iva,
+       .vfsm = &omap4_vdd_iva_vfsm,
+       .vp = &omap4_vp_iva,
 };
 
-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",
-       },
+static struct voltagedomain omap4_voltdm_core = {
+       .name = "core",
+       .scalable = true,
+       .read = omap4_prm_vcvp_read,
+       .write = omap4_prm_vcvp_write,
+       .rmw = omap4_prm_vcvp_rmw,
+       .vc = &omap4_vc_core,
+       .vfsm = &omap4_vdd_core_vfsm,
+       .vp = &omap4_vp_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_wkup = {
+       .name = "wakeup",
 };
 
-/* OMAP4 specific voltage init functions */
-static int __init omap44xx_voltage_early_init(void)
-{
-       s16 prm_mod = OMAP4430_PRM_DEVICE_INST;
-       s16 prm_irqst_ocp_mod = OMAP4430_PRM_OCP_SOCKET_INST;
+static struct voltagedomain *voltagedomains_omap4[] __initdata = {
+       &omap4_voltdm_mpu,
+       &omap4_voltdm_iva,
+       &omap4_voltdm_core,
+       &omap4_voltdm_wkup,
+       NULL,
+};
+
+static const char *sys_clk_name __initdata = "sys_clkin_ck";
 
-       if (!cpu_is_omap44xx())
-               return 0;
+void __init omap44xx_voltagedomains_init(void)
+{
+       struct voltagedomain *voltdm;
+       int i;
 
        /*
         * XXX Will depend on the process, validation, and binning
         * for the currently-running IC
         */
-       omap4_vdd_mpu_info.volt_data = omap44xx_vdd_mpu_volt_data;
-       omap4_vdd_iva_info.volt_data = omap44xx_vdd_iva_volt_data;
-       omap4_vdd_core_info.volt_data = omap44xx_vdd_core_volt_data;
+       omap4_voltdm_mpu.volt_data = omap44xx_vdd_mpu_volt_data;
+       omap4_voltdm_iva.volt_data = omap44xx_vdd_iva_volt_data;
+       omap4_voltdm_core.volt_data = omap44xx_vdd_core_volt_data;
+
+       for (i = 0; voltdm = voltagedomains_omap4[i], voltdm; i++)
+               voltdm->sys_clk.name = sys_clk_name;
 
-       return omap_voltage_early_init(prm_mod, prm_irqst_ocp_mod,
-                                      omap4_vdd_info,
-                                      ARRAY_SIZE(omap4_vdd_info));
+       voltdm_init(voltagedomains_omap4);
 };
-core_initcall(omap44xx_voltage_early_init);