int __init omap3_twl_init(void) { struct voltagedomain *voltdm; if (!cpu_is_omap34xx() || cpu_is_am33xx()) return -ENODEV; if (cpu_is_omap3630()) { omap3_mpu_pmic.vp_vddmin = OMAP3630_VP1_VLIMITTO_VDDMIN; omap3_mpu_pmic.vp_vddmax = OMAP3630_VP1_VLIMITTO_VDDMAX; omap3_core_pmic.vp_vddmin = OMAP3630_VP2_VLIMITTO_VDDMIN; omap3_core_pmic.vp_vddmax = OMAP3630_VP2_VLIMITTO_VDDMAX; } /* * The smartreflex bit on twl4030 specifies if the setting of voltage * is done over the I2C_SR path. Since this setting is independent of * the actual usage of smartreflex AVS module, we enable TWL SR bit * by default irrespective of whether smartreflex AVS module is enabled * on the OMAP side or not. This is because without this bit enabled, * the voltage scaling through vp forceupdate/bypass mechanism of * voltage scaling will not function on TWL over I2C_SR. */ if (!twl_sr_enable_autoinit) omap3_twl_set_sr_bit(true); voltdm = voltdm_lookup("mpu_iva"); omap_voltage_register_pmic(voltdm, &omap3_mpu_pmic); voltdm = voltdm_lookup("core"); omap_voltage_register_pmic(voltdm, &omap3_core_pmic); return 0; }
static unsigned long twl4030_vsel_to_uv(const u8 vsel) { /* * The smartreflex bit on twl4030 needs to be enabled by * default irrespective of whether smartreflex module is * enabled on the OMAP side or not. This is because without * this bit enabled the voltage scaling through * vp forceupdate does not function properly on OMAP3. */ if (twl_sr_enable) omap3_twl_set_sr_bit(1); return (((vsel * 125) + 6000)) * 100; }
static int __init twl_set_sr(struct voltagedomain *voltdm) { int r = 0; /* * The smartreflex bit on twl4030 specifies if the setting of voltage * is done over the I2C_SR path. Since this setting is independent of * the actual usage of smartreflex AVS module, we enable TWL SR bit * by default irrespective of whether smartreflex AVS module is enabled * on the OMAP side or not. This is because without this bit enabled, * the voltage scaling through vp forceupdate/bypass mechanism of * voltage scaling will not function on TWL over I2C_SR. */ if (!twl_sr_enable_autoinit) r = omap3_twl_set_sr_bit(true); return r; }
int __init omap3_twl_init(void) { struct voltagedomain *voltdm; if (!cpu_is_omap34xx()) return -ENODEV; /* * In case of AM3517/AM3505 we should not be going down * further, since SR is not applicable there. */ if (cpu_is_omap3505() || cpu_is_omap3517()) return -ENODEV; if (cpu_is_omap3630()) { omap3_mpu_volt_info.vp_vddmin = OMAP3630_VP1_VLIMITTO_VDDMIN; omap3_mpu_volt_info.vp_vddmax = OMAP3630_VP1_VLIMITTO_VDDMAX; omap3_core_volt_info.vp_vddmin = OMAP3630_VP2_VLIMITTO_VDDMIN; omap3_core_volt_info.vp_vddmax = OMAP3630_VP2_VLIMITTO_VDDMAX; } /* * The smartreflex bit on twl4030 needs to be enabled by * default irrespective of whether smartreflex module is * enabled on the OMAP side or not. This is because without * this bit enabled the voltage scaling through * vp forceupdate does not function properly on OMAP3. */ if (twl_sr_enable) omap3_twl_set_sr_bit(1); voltdm = omap_voltage_domain_lookup("mpu"); omap_voltage_register_pmic(voltdm, &omap3_mpu_volt_info); voltdm = omap_voltage_domain_lookup("core"); omap_voltage_register_pmic(voltdm, &omap3_core_volt_info); return 0; }