Lines Matching refs:bpmp
21 struct tegra_bpmp *bpmp; member
31 static int tegra_bpmp_powergate_set_state(struct tegra_bpmp *bpmp, in tegra_bpmp_powergate_set_state() argument
48 err = tegra_bpmp_transfer(bpmp, &msg); in tegra_bpmp_powergate_set_state()
57 static int tegra_bpmp_powergate_get_state(struct tegra_bpmp *bpmp, in tegra_bpmp_powergate_get_state() argument
78 err = tegra_bpmp_transfer(bpmp, &msg); in tegra_bpmp_powergate_get_state()
87 static int tegra_bpmp_powergate_get_max_id(struct tegra_bpmp *bpmp) in tegra_bpmp_powergate_get_max_id() argument
106 err = tegra_bpmp_transfer(bpmp, &msg); in tegra_bpmp_powergate_get_max_id()
115 static char *tegra_bpmp_powergate_get_name(struct tegra_bpmp *bpmp, in tegra_bpmp_powergate_get_name() argument
136 err = tegra_bpmp_transfer(bpmp, &msg); in tegra_bpmp_powergate_get_name()
143 static inline bool tegra_bpmp_powergate_is_powered(struct tegra_bpmp *bpmp, in tegra_bpmp_powergate_is_powered() argument
146 return tegra_bpmp_powergate_get_state(bpmp, id) != PG_STATE_OFF; in tegra_bpmp_powergate_is_powered()
152 struct tegra_bpmp *bpmp = powergate->bpmp; in tegra_powergate_power_on() local
154 return tegra_bpmp_powergate_set_state(bpmp, powergate->id, in tegra_powergate_power_on()
161 struct tegra_bpmp *bpmp = powergate->bpmp; in tegra_powergate_power_off() local
163 return tegra_bpmp_powergate_set_state(bpmp, powergate->id, in tegra_powergate_power_off()
168 tegra_powergate_add(struct tegra_bpmp *bpmp, in tegra_powergate_add() argument
175 off = !tegra_bpmp_powergate_is_powered(bpmp, info->id); in tegra_powergate_add()
177 powergate = devm_kzalloc(bpmp->dev, sizeof(*powergate), GFP_KERNEL); in tegra_powergate_add()
182 powergate->bpmp = bpmp; in tegra_powergate_add()
200 struct tegra_bpmp *bpmp = powergate->bpmp; in tegra_powergate_remove() local
205 dev_err(bpmp->dev, "failed to remove power domain %s: %d\n", in tegra_powergate_remove()
212 tegra_bpmp_probe_powergates(struct tegra_bpmp *bpmp, in tegra_bpmp_probe_powergates() argument
220 err = tegra_bpmp_powergate_get_max_id(bpmp); in tegra_bpmp_probe_powergates()
226 dev_dbg(bpmp->dev, "maximum powergate ID: %u\n", max_id); in tegra_bpmp_probe_powergates()
235 info->name = tegra_bpmp_powergate_get_name(bpmp, id); in tegra_bpmp_probe_powergates()
245 dev_dbg(bpmp->dev, "holes: %u\n", num_holes); in tegra_bpmp_probe_powergates()
252 static int tegra_bpmp_add_powergates(struct tegra_bpmp *bpmp, in tegra_bpmp_add_powergates() argument
256 struct genpd_onecell_data *genpd = &bpmp->genpd; in tegra_bpmp_add_powergates()
267 powergate = tegra_powergate_add(bpmp, &powergates[i]); in tegra_bpmp_add_powergates()
273 dev_dbg(bpmp->dev, "added power domain %s\n", in tegra_bpmp_add_powergates()
293 static void tegra_bpmp_remove_powergates(struct tegra_bpmp *bpmp) in tegra_bpmp_remove_powergates() argument
295 struct genpd_onecell_data *genpd = &bpmp->genpd; in tegra_bpmp_remove_powergates()
300 dev_dbg(bpmp->dev, "removing power domain %s\n", in tegra_bpmp_remove_powergates()
327 int tegra_bpmp_init_powergates(struct tegra_bpmp *bpmp) in tegra_bpmp_init_powergates() argument
329 struct device_node *np = bpmp->dev->of_node; in tegra_bpmp_init_powergates()
331 struct device *dev = bpmp->dev; in tegra_bpmp_init_powergates()
335 err = tegra_bpmp_probe_powergates(bpmp, &powergates); in tegra_bpmp_init_powergates()
343 err = tegra_bpmp_add_powergates(bpmp, powergates, count); in tegra_bpmp_init_powergates()
347 bpmp->genpd.xlate = tegra_powergate_xlate; in tegra_bpmp_init_powergates()
349 err = of_genpd_add_provider_onecell(np, &bpmp->genpd); in tegra_bpmp_init_powergates()
352 tegra_bpmp_remove_powergates(bpmp); in tegra_bpmp_init_powergates()