Lines Matching refs:bpmp
22 struct tegra_bpmp *bpmp; member
32 static int tegra_bpmp_powergate_set_state(struct tegra_bpmp *bpmp, in tegra_bpmp_powergate_set_state() argument
49 err = tegra_bpmp_transfer(bpmp, &msg); in tegra_bpmp_powergate_set_state()
58 static int tegra_bpmp_powergate_get_state(struct tegra_bpmp *bpmp, in tegra_bpmp_powergate_get_state() argument
79 err = tegra_bpmp_transfer(bpmp, &msg); in tegra_bpmp_powergate_get_state()
88 static int tegra_bpmp_powergate_get_max_id(struct tegra_bpmp *bpmp) in tegra_bpmp_powergate_get_max_id() argument
107 err = tegra_bpmp_transfer(bpmp, &msg); in tegra_bpmp_powergate_get_max_id()
116 static char *tegra_bpmp_powergate_get_name(struct tegra_bpmp *bpmp, in tegra_bpmp_powergate_get_name() argument
137 err = tegra_bpmp_transfer(bpmp, &msg); in tegra_bpmp_powergate_get_name()
144 static inline bool tegra_bpmp_powergate_is_powered(struct tegra_bpmp *bpmp, in tegra_bpmp_powergate_is_powered() argument
147 return tegra_bpmp_powergate_get_state(bpmp, id) != PG_STATE_OFF; in tegra_bpmp_powergate_is_powered()
153 struct tegra_bpmp *bpmp = powergate->bpmp; in tegra_powergate_power_on() local
155 return tegra_bpmp_powergate_set_state(bpmp, powergate->id, in tegra_powergate_power_on()
162 struct tegra_bpmp *bpmp = powergate->bpmp; in tegra_powergate_power_off() local
164 return tegra_bpmp_powergate_set_state(bpmp, powergate->id, in tegra_powergate_power_off()
169 tegra_powergate_add(struct tegra_bpmp *bpmp, in tegra_powergate_add() argument
176 off = !tegra_bpmp_powergate_is_powered(bpmp, info->id); in tegra_powergate_add()
178 powergate = devm_kzalloc(bpmp->dev, sizeof(*powergate), GFP_KERNEL); in tegra_powergate_add()
183 powergate->bpmp = bpmp; in tegra_powergate_add()
201 struct tegra_bpmp *bpmp = powergate->bpmp; in tegra_powergate_remove() local
206 dev_err(bpmp->dev, "failed to remove power domain %s: %d\n", in tegra_powergate_remove()
213 tegra_bpmp_probe_powergates(struct tegra_bpmp *bpmp, in tegra_bpmp_probe_powergates() argument
221 err = tegra_bpmp_powergate_get_max_id(bpmp); in tegra_bpmp_probe_powergates()
227 dev_dbg(bpmp->dev, "maximum powergate ID: %u\n", max_id); in tegra_bpmp_probe_powergates()
236 info->name = tegra_bpmp_powergate_get_name(bpmp, id); in tegra_bpmp_probe_powergates()
246 dev_dbg(bpmp->dev, "holes: %u\n", num_holes); in tegra_bpmp_probe_powergates()
253 static int tegra_bpmp_add_powergates(struct tegra_bpmp *bpmp, in tegra_bpmp_add_powergates() argument
257 struct genpd_onecell_data *genpd = &bpmp->genpd; in tegra_bpmp_add_powergates()
268 powergate = tegra_powergate_add(bpmp, &powergates[i]); in tegra_bpmp_add_powergates()
274 dev_dbg(bpmp->dev, "added power domain %s\n", in tegra_bpmp_add_powergates()
294 static void tegra_bpmp_remove_powergates(struct tegra_bpmp *bpmp) in tegra_bpmp_remove_powergates() argument
296 struct genpd_onecell_data *genpd = &bpmp->genpd; in tegra_bpmp_remove_powergates()
301 dev_dbg(bpmp->dev, "removing power domain %s\n", in tegra_bpmp_remove_powergates()
328 int tegra_bpmp_init_powergates(struct tegra_bpmp *bpmp) in tegra_bpmp_init_powergates() argument
330 struct device_node *np = bpmp->dev->of_node; in tegra_bpmp_init_powergates()
332 struct device *dev = bpmp->dev; in tegra_bpmp_init_powergates()
336 err = tegra_bpmp_probe_powergates(bpmp, &powergates); in tegra_bpmp_init_powergates()
344 err = tegra_bpmp_add_powergates(bpmp, powergates, count); in tegra_bpmp_init_powergates()
348 bpmp->genpd.xlate = tegra_powergate_xlate; in tegra_bpmp_init_powergates()
350 err = of_genpd_add_provider_onecell(np, &bpmp->genpd); in tegra_bpmp_init_powergates()
353 tegra_bpmp_remove_powergates(bpmp); in tegra_bpmp_init_powergates()