Home | History | Annotate | Download | only in acpi

Lines Matching refs:ad

198 	struct acpi_devnode *ad = acpi_match_node(hdl);
201 if (ad == NULL)
208 (void)acpi_power_res_deref(res, ad->ad_handle);
217 struct acpi_devnode *ad = acpi_match_node(hdl);
220 if (ad == NULL)
228 rv = acpi_power_get_indirect(ad);
231 rv = acpi_power_get_direct(ad);
236 KASSERT(ad->ad_state != ACPI_STATE_ERROR);
238 if (ad->ad_state < ACPI_STATE_D0 || ad->ad_state > ACPI_STATE_D3) {
244 *state = ad->ad_state;
249 ad->ad_state = ACPI_STATE_ERROR;
252 *state = ad->ad_state;
255 "for %s: %s\n", ad->ad_name, AcpiFormatException(rv)));
261 acpi_power_get_direct(struct acpi_devnode *ad)
266 rv = acpi_eval_integer(ad->ad_handle, "_PSC", &val);
270 ad->ad_state = (int)val;
276 acpi_power_get_indirect(struct acpi_devnode *ad)
292 for (ad->ad_state = ACPI_STATE_D3, i = 0; i < ACPI_STATE_D3; i++) {
294 pkg = acpi_power_pkg_get(ad->ad_handle, i);
303 rv = acpi_foreach_package_object(pkg, acpi_power_res_sta, ad);
309 ad->ad_state = i;
316 KASSERT(ad->ad_state == ACPI_STATE_D3);
332 struct acpi_devnode *ad = acpi_match_node(hdl);
337 if (ad == NULL)
345 if (acpi_power_get(ad->ad_handle, &old) != true) {
350 KASSERT(ad->ad_state == old);
351 KASSERT(ad->ad_state != ACPI_STATE_ERROR);
353 if (ad->ad_state == state) {
361 if (ad->ad_state == ACPI_STATE_D3 && state != ACPI_STATE_D0) {
372 if ((ad->ad_parent != NULL) &&
373 (ad->ad_parent->ad_flags & ACPI_DEVICE_POWER) != 0) {
375 if (ad->ad_parent->ad_state > state) {
387 rv = acpi_power_switch(ad, state, true);
392 rv = acpi_power_switch(ad, ad->ad_state, false);
403 (void)AcpiEvaluateObject(ad->ad_handle, path, NULL, NULL);
406 "D%d to D%d\n", ad->ad_name, old, state));
408 ad->ad_state = state;
413 ad->ad_state = ACPI_STATE_ERROR;
416 "for %s: %s\n", state, ad->ad_name, AcpiFormatException(rv)));
422 acpi_power_switch(struct acpi_devnode *ad, int state, bool on)
435 pkg = acpi_power_pkg_get(ad->ad_handle, state);
450 (void)acpi_power_res(hdl, ad->ad_handle, on);
674 acpi_power_add(struct acpi_devnode *ad)
679 KASSERT(ad != NULL && ad->ad_root != NULL);
680 KASSERT((ad->ad_flags & ACPI_DEVICE_POWER) != 0);
686 if (ad->ad_device != NULL)
687 str = device_xname(ad->ad_device);
690 device_t dev = acpi_pcidev_find_dev(ad);
702 NULL, acpi_power_sysctl, 0, (void *)ad, 0, CTL_HW,
707 aprint_error_dev(ad->ad_root, "sysctl_createv"
714 struct acpi_devnode *ad;
720 ad = rnode->sysctl_data;
722 if (acpi_power_get(ad->ad_handle, &state) != true)