Lines Matching refs:tegra
39 static int tegra20_core_limit(struct tegra_regulator_coupler *tegra, in tegra20_core_limit() argument
57 if (tegra_pmc_core_domain_state_synced() && !tegra->sys_reboot_mode) { in tegra20_core_limit()
62 if (tegra->core_min_uV > 0) in tegra20_core_limit()
63 return tegra->core_min_uV; in tegra20_core_limit()
80 tegra->core_min_uV = core_max_uV; in tegra20_core_limit()
82 pr_info("core voltage initialized to %duV\n", tegra->core_min_uV); in tegra20_core_limit()
84 return tegra->core_min_uV; in tegra20_core_limit()
108 static int tegra20_core_rtc_update(struct tegra_regulator_coupler *tegra, in tegra20_core_rtc_update() argument
134 core_min_uV = tegra20_core_limit(tegra, core_rdev); in tegra20_core_rtc_update()
222 static int tegra20_core_voltage_update(struct tegra_regulator_coupler *tegra, in tegra20_core_voltage_update() argument
233 return tegra20_core_rtc_update(tegra, core_rdev, rtc_rdev, in tegra20_core_voltage_update()
237 static int tegra20_cpu_voltage_update(struct tegra_regulator_coupler *tegra, in tegra20_cpu_voltage_update() argument
267 if (!tegra->cpu_min_uV) in tegra20_cpu_voltage_update()
268 tegra->cpu_min_uV = cpu_uV; in tegra20_cpu_voltage_update()
279 if (tegra->sys_reboot_mode) in tegra20_cpu_voltage_update()
280 cpu_min_uV = max(cpu_min_uV, tegra->cpu_min_uV); in tegra20_cpu_voltage_update()
283 err = tegra20_core_rtc_update(tegra, core_rdev, rtc_rdev, in tegra20_cpu_voltage_update()
298 err = tegra20_core_rtc_update(tegra, core_rdev, rtc_rdev, in tegra20_cpu_voltage_update()
311 struct tegra_regulator_coupler *tegra = to_tegra_coupler(coupler); in tegra20_regulator_balance_voltage() local
312 struct regulator_dev *core_rdev = tegra->core_rdev; in tegra20_regulator_balance_voltage()
313 struct regulator_dev *cpu_rdev = tegra->cpu_rdev; in tegra20_regulator_balance_voltage()
314 struct regulator_dev *rtc_rdev = tegra->rtc_rdev; in tegra20_regulator_balance_voltage()
322 tegra->sys_reboot_mode = READ_ONCE(tegra->sys_reboot_mode_req); in tegra20_regulator_balance_voltage()
325 return tegra20_cpu_voltage_update(tegra, cpu_rdev, in tegra20_regulator_balance_voltage()
329 return tegra20_core_voltage_update(tegra, cpu_rdev, in tegra20_regulator_balance_voltage()
337 static int tegra20_regulator_prepare_reboot(struct tegra_regulator_coupler *tegra, in tegra20_regulator_prepare_reboot() argument
342 if (!tegra->core_rdev || !tegra->rtc_rdev || !tegra->cpu_rdev) in tegra20_regulator_prepare_reboot()
345 WRITE_ONCE(tegra->sys_reboot_mode_req, true); in tegra20_regulator_prepare_reboot()
352 err = regulator_sync_voltage_rdev(tegra->cpu_rdev); in tegra20_regulator_prepare_reboot()
356 err = regulator_sync_voltage_rdev(tegra->core_rdev); in tegra20_regulator_prepare_reboot()
360 WRITE_ONCE(tegra->sys_reboot_mode_req, sys_reboot_mode); in tegra20_regulator_prepare_reboot()
368 struct tegra_regulator_coupler *tegra; in tegra20_regulator_reboot() local
374 tegra = container_of(notifier, struct tegra_regulator_coupler, in tegra20_regulator_reboot()
377 ret = tegra20_regulator_prepare_reboot(tegra, true); in tegra20_regulator_reboot()
385 struct tegra_regulator_coupler *tegra = to_tegra_coupler(coupler); in tegra20_regulator_attach() local
389 !tegra->core_rdev) { in tegra20_regulator_attach()
390 tegra->core_rdev = rdev; in tegra20_regulator_attach()
395 !tegra->rtc_rdev) { in tegra20_regulator_attach()
396 tegra->rtc_rdev = rdev; in tegra20_regulator_attach()
401 !tegra->cpu_rdev) { in tegra20_regulator_attach()
402 tegra->cpu_rdev = rdev; in tegra20_regulator_attach()
412 struct tegra_regulator_coupler *tegra = to_tegra_coupler(coupler); in tegra20_regulator_detach() local
422 if (tegra->core_rdev == rdev) { in tegra20_regulator_detach()
423 tegra->core_rdev = NULL; in tegra20_regulator_detach()
427 if (tegra->rtc_rdev == rdev) { in tegra20_regulator_detach()
428 tegra->rtc_rdev = NULL; in tegra20_regulator_detach()
432 if (tegra->cpu_rdev == rdev) { in tegra20_regulator_detach()
433 tegra->cpu_rdev = NULL; in tegra20_regulator_detach()