2 * Copyright 2012 Advanced Micro Devices, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
24 #include <linux/pci.h>
25 #include <linux/acpi.h>
26 #include <linux/slab.h>
27 #include <linux/power_supply.h>
28 #include <linux/pm_runtime.h>
29 #include <acpi/video.h>
31 #include <drm/drm_crtc_helper.h>
33 #include "amdgpu_pm.h"
34 #include "amdgpu_display.h"
38 struct amdgpu_atif_notification_cfg {
43 struct amdgpu_atif_notifications {
45 bool expansion_mode_change;
47 bool forced_power_state;
48 bool system_power_state;
49 bool display_conf_change;
51 bool brightness_change;
52 bool dgpu_display_event;
55 struct amdgpu_atif_functions {
58 bool select_active_disp;
62 bool get_panel_expansion_mode;
63 bool set_panel_expansion_mode;
64 bool temperature_change;
65 bool graphics_device_types;
71 struct amdgpu_atif_notifications notifications;
72 struct amdgpu_atif_functions functions;
73 struct amdgpu_atif_notification_cfg notification_cfg;
74 struct amdgpu_encoder *encoder_for_bl;
77 /* Call the ATIF method
80 * amdgpu_atif_call - call an ATIF method
82 * @handle: acpi handle
83 * @function: the ATIF function to execute
84 * @params: ATIF function params
86 * Executes the requested ATIF function (all asics).
87 * Returns a pointer to the acpi output buffer.
89 static union acpi_object *amdgpu_atif_call(struct amdgpu_atif *atif,
91 struct acpi_buffer *params)
94 union acpi_object atif_arg_elements[2];
95 struct acpi_object_list atif_arg;
96 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
99 atif_arg.pointer = &atif_arg_elements[0];
101 atif_arg_elements[0].type = ACPI_TYPE_INTEGER;
102 atif_arg_elements[0].integer.value = function;
105 atif_arg_elements[1].type = ACPI_TYPE_BUFFER;
106 atif_arg_elements[1].buffer.length = params->length;
107 atif_arg_elements[1].buffer.pointer = params->pointer;
109 /* We need a second fake parameter */
110 atif_arg_elements[1].type = ACPI_TYPE_INTEGER;
111 atif_arg_elements[1].integer.value = 0;
114 status = acpi_evaluate_object(atif->handle, NULL, &atif_arg,
117 /* Fail only if calling the method fails and ATIF is supported */
118 if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
119 DRM_DEBUG_DRIVER("failed to evaluate ATIF got %s\n",
120 acpi_format_exception(status));
121 kfree(buffer.pointer);
125 return buffer.pointer;
129 * amdgpu_atif_parse_notification - parse supported notifications
131 * @n: supported notifications struct
132 * @mask: supported notifications mask from ATIF
134 * Use the supported notifications mask from ATIF function
135 * ATIF_FUNCTION_VERIFY_INTERFACE to determine what notifications
136 * are supported (all asics).
138 static void amdgpu_atif_parse_notification(struct amdgpu_atif_notifications *n, u32 mask)
140 n->display_switch = mask & ATIF_DISPLAY_SWITCH_REQUEST_SUPPORTED;
141 n->expansion_mode_change = mask & ATIF_EXPANSION_MODE_CHANGE_REQUEST_SUPPORTED;
142 n->thermal_state = mask & ATIF_THERMAL_STATE_CHANGE_REQUEST_SUPPORTED;
143 n->forced_power_state = mask & ATIF_FORCED_POWER_STATE_CHANGE_REQUEST_SUPPORTED;
144 n->system_power_state = mask & ATIF_SYSTEM_POWER_SOURCE_CHANGE_REQUEST_SUPPORTED;
145 n->display_conf_change = mask & ATIF_DISPLAY_CONF_CHANGE_REQUEST_SUPPORTED;
146 n->px_gfx_switch = mask & ATIF_PX_GFX_SWITCH_REQUEST_SUPPORTED;
147 n->brightness_change = mask & ATIF_PANEL_BRIGHTNESS_CHANGE_REQUEST_SUPPORTED;
148 n->dgpu_display_event = mask & ATIF_DGPU_DISPLAY_EVENT_SUPPORTED;
152 * amdgpu_atif_parse_functions - parse supported functions
154 * @f: supported functions struct
155 * @mask: supported functions mask from ATIF
157 * Use the supported functions mask from ATIF function
158 * ATIF_FUNCTION_VERIFY_INTERFACE to determine what functions
159 * are supported (all asics).
161 static void amdgpu_atif_parse_functions(struct amdgpu_atif_functions *f, u32 mask)
163 f->system_params = mask & ATIF_GET_SYSTEM_PARAMETERS_SUPPORTED;
164 f->sbios_requests = mask & ATIF_GET_SYSTEM_BIOS_REQUESTS_SUPPORTED;
165 f->select_active_disp = mask & ATIF_SELECT_ACTIVE_DISPLAYS_SUPPORTED;
166 f->lid_state = mask & ATIF_GET_LID_STATE_SUPPORTED;
167 f->get_tv_standard = mask & ATIF_GET_TV_STANDARD_FROM_CMOS_SUPPORTED;
168 f->set_tv_standard = mask & ATIF_SET_TV_STANDARD_IN_CMOS_SUPPORTED;
169 f->get_panel_expansion_mode = mask & ATIF_GET_PANEL_EXPANSION_MODE_FROM_CMOS_SUPPORTED;
170 f->set_panel_expansion_mode = mask & ATIF_SET_PANEL_EXPANSION_MODE_IN_CMOS_SUPPORTED;
171 f->temperature_change = mask & ATIF_TEMPERATURE_CHANGE_NOTIFICATION_SUPPORTED;
172 f->graphics_device_types = mask & ATIF_GET_GRAPHICS_DEVICE_TYPES_SUPPORTED;
176 * amdgpu_atif_verify_interface - verify ATIF
178 * @handle: acpi handle
179 * @atif: amdgpu atif struct
181 * Execute the ATIF_FUNCTION_VERIFY_INTERFACE ATIF function
182 * to initialize ATIF and determine what features are supported
184 * returns 0 on success, error on failure.
186 static int amdgpu_atif_verify_interface(struct amdgpu_atif *atif)
188 union acpi_object *info;
189 struct atif_verify_interface output;
193 info = amdgpu_atif_call(atif, ATIF_FUNCTION_VERIFY_INTERFACE, NULL);
197 memset(&output, 0, sizeof(output));
199 size = *(u16 *) info->buffer.pointer;
201 DRM_INFO("ATIF buffer is too small: %zu\n", size);
205 size = min(sizeof(output), size);
207 memcpy(&output, info->buffer.pointer, size);
209 /* TODO: check version? */
210 DRM_DEBUG_DRIVER("ATIF version %u\n", output.version);
212 amdgpu_atif_parse_notification(&atif->notifications, output.notification_mask);
213 amdgpu_atif_parse_functions(&atif->functions, output.function_bits);
220 static acpi_handle amdgpu_atif_probe_handle(acpi_handle dhandle)
222 acpi_handle handle = NULL;
223 char acpi_method_name[255] = { 0 };
224 struct acpi_buffer buffer = { sizeof(acpi_method_name), acpi_method_name };
227 /* For PX/HG systems, ATIF and ATPX are in the iGPU's namespace, on dGPU only
228 * systems, ATIF is in the dGPU's namespace.
230 status = acpi_get_handle(dhandle, "ATIF", &handle);
231 if (ACPI_SUCCESS(status))
234 if (amdgpu_has_atpx()) {
235 status = acpi_get_handle(amdgpu_atpx_get_dhandle(), "ATIF",
237 if (ACPI_SUCCESS(status))
241 DRM_DEBUG_DRIVER("No ATIF handle found\n");
244 acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
245 DRM_DEBUG_DRIVER("Found ATIF handle %s\n", acpi_method_name);
250 * amdgpu_atif_get_notification_params - determine notify configuration
252 * @handle: acpi handle
253 * @n: atif notification configuration struct
255 * Execute the ATIF_FUNCTION_GET_SYSTEM_PARAMETERS ATIF function
256 * to determine if a notifier is used and if so which one
257 * (all asics). This is either Notify(VGA, 0x81) or Notify(VGA, n)
258 * where n is specified in the result if a notifier is used.
259 * Returns 0 on success, error on failure.
261 static int amdgpu_atif_get_notification_params(struct amdgpu_atif *atif)
263 union acpi_object *info;
264 struct amdgpu_atif_notification_cfg *n = &atif->notification_cfg;
265 struct atif_system_params params;
269 info = amdgpu_atif_call(atif, ATIF_FUNCTION_GET_SYSTEM_PARAMETERS,
276 size = *(u16 *) info->buffer.pointer;
282 memset(¶ms, 0, sizeof(params));
283 size = min(sizeof(params), size);
284 memcpy(¶ms, info->buffer.pointer, size);
286 DRM_DEBUG_DRIVER("SYSTEM_PARAMS: mask = %#x, flags = %#x\n",
287 params.flags, params.valid_mask);
288 params.flags = params.flags & params.valid_mask;
290 if ((params.flags & ATIF_NOTIFY_MASK) == ATIF_NOTIFY_NONE) {
293 } else if ((params.flags & ATIF_NOTIFY_MASK) == ATIF_NOTIFY_81) {
295 n->command_code = 0x81;
302 n->command_code = params.command_code;
306 DRM_DEBUG_DRIVER("Notification %s, command code = %#x\n",
307 (n->enabled ? "enabled" : "disabled"),
314 * amdgpu_atif_get_sbios_requests - get requested sbios event
316 * @handle: acpi handle
317 * @req: atif sbios request struct
319 * Execute the ATIF_FUNCTION_GET_SYSTEM_BIOS_REQUESTS ATIF function
320 * to determine what requests the sbios is making to the driver
322 * Returns 0 on success, error on failure.
324 static int amdgpu_atif_get_sbios_requests(struct amdgpu_atif *atif,
325 struct atif_sbios_requests *req)
327 union acpi_object *info;
331 info = amdgpu_atif_call(atif, ATIF_FUNCTION_GET_SYSTEM_BIOS_REQUESTS,
336 size = *(u16 *)info->buffer.pointer;
341 memset(req, 0, sizeof(*req));
343 size = min(sizeof(*req), size);
344 memcpy(req, info->buffer.pointer, size);
345 DRM_DEBUG_DRIVER("SBIOS pending requests: %#x\n", req->pending);
347 count = hweight32(req->pending);
355 * amdgpu_atif_handler - handle ATIF notify requests
357 * @adev: amdgpu_device pointer
358 * @event: atif sbios request struct
360 * Checks the acpi event and if it matches an atif event,
364 * NOTIFY_BAD or NOTIFY_DONE, depending on the event.
366 static int amdgpu_atif_handler(struct amdgpu_device *adev,
367 struct acpi_bus_event *event)
369 struct amdgpu_atif *atif = adev->atif;
372 DRM_DEBUG_DRIVER("event, device_class = %s, type = %#x\n",
373 event->device_class, event->type);
375 if (strcmp(event->device_class, ACPI_VIDEO_CLASS) != 0)
378 /* Is this actually our event? */
380 !atif->notification_cfg.enabled ||
381 event->type != atif->notification_cfg.command_code) {
382 /* These events will generate keypresses otherwise */
383 if (event->type == ACPI_VIDEO_NOTIFY_PROBE)
389 if (atif->functions.sbios_requests) {
390 struct atif_sbios_requests req;
392 /* Check pending SBIOS requests */
393 count = amdgpu_atif_get_sbios_requests(atif, &req);
398 DRM_DEBUG_DRIVER("ATIF: %d pending SBIOS requests\n", count);
400 /* todo: add DC handling */
401 if ((req.pending & ATIF_PANEL_BRIGHTNESS_CHANGE_REQUEST) &&
402 !amdgpu_device_has_dc_support(adev)) {
403 struct amdgpu_encoder *enc = atif->encoder_for_bl;
406 struct amdgpu_encoder_atom_dig *dig = enc->enc_priv;
408 DRM_DEBUG_DRIVER("Changing brightness to %d\n",
409 req.backlight_level);
411 amdgpu_display_backlight_set_level(adev, enc, req.backlight_level);
413 #if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
414 backlight_force_update(dig->bl_dev,
415 BACKLIGHT_UPDATE_HOTKEY);
419 if (req.pending & ATIF_DGPU_DISPLAY_EVENT) {
420 if ((adev->flags & AMD_IS_PX) &&
421 amdgpu_atpx_dgpu_req_power_for_displays()) {
422 pm_runtime_get_sync(adev->ddev->dev);
423 /* Just fire off a uevent and let userspace tell us what to do */
424 drm_helper_hpd_irq_event(adev->ddev);
425 pm_runtime_mark_last_busy(adev->ddev->dev);
426 pm_runtime_put_autosuspend(adev->ddev->dev);
429 /* TODO: check other events */
432 /* We've handled the event, stop the notifier chain. The ACPI interface
433 * overloads ACPI_VIDEO_NOTIFY_PROBE, we don't want to send that to
434 * userspace if the event was generated only to signal a SBIOS
440 /* Call the ATCS method
443 * amdgpu_atcs_call - call an ATCS method
445 * @handle: acpi handle
446 * @function: the ATCS function to execute
447 * @params: ATCS function params
449 * Executes the requested ATCS function (all asics).
450 * Returns a pointer to the acpi output buffer.
452 static union acpi_object *amdgpu_atcs_call(acpi_handle handle, int function,
453 struct acpi_buffer *params)
456 union acpi_object atcs_arg_elements[2];
457 struct acpi_object_list atcs_arg;
458 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
461 atcs_arg.pointer = &atcs_arg_elements[0];
463 atcs_arg_elements[0].type = ACPI_TYPE_INTEGER;
464 atcs_arg_elements[0].integer.value = function;
467 atcs_arg_elements[1].type = ACPI_TYPE_BUFFER;
468 atcs_arg_elements[1].buffer.length = params->length;
469 atcs_arg_elements[1].buffer.pointer = params->pointer;
471 /* We need a second fake parameter */
472 atcs_arg_elements[1].type = ACPI_TYPE_INTEGER;
473 atcs_arg_elements[1].integer.value = 0;
476 status = acpi_evaluate_object(handle, "ATCS", &atcs_arg, &buffer);
478 /* Fail only if calling the method fails and ATIF is supported */
479 if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
480 DRM_DEBUG_DRIVER("failed to evaluate ATCS got %s\n",
481 acpi_format_exception(status));
482 kfree(buffer.pointer);
486 return buffer.pointer;
490 * amdgpu_atcs_parse_functions - parse supported functions
492 * @f: supported functions struct
493 * @mask: supported functions mask from ATCS
495 * Use the supported functions mask from ATCS function
496 * ATCS_FUNCTION_VERIFY_INTERFACE to determine what functions
497 * are supported (all asics).
499 static void amdgpu_atcs_parse_functions(struct amdgpu_atcs_functions *f, u32 mask)
501 f->get_ext_state = mask & ATCS_GET_EXTERNAL_STATE_SUPPORTED;
502 f->pcie_perf_req = mask & ATCS_PCIE_PERFORMANCE_REQUEST_SUPPORTED;
503 f->pcie_dev_rdy = mask & ATCS_PCIE_DEVICE_READY_NOTIFICATION_SUPPORTED;
504 f->pcie_bus_width = mask & ATCS_SET_PCIE_BUS_WIDTH_SUPPORTED;
508 * amdgpu_atcs_verify_interface - verify ATCS
510 * @handle: acpi handle
511 * @atcs: amdgpu atcs struct
513 * Execute the ATCS_FUNCTION_VERIFY_INTERFACE ATCS function
514 * to initialize ATCS and determine what features are supported
516 * returns 0 on success, error on failure.
518 static int amdgpu_atcs_verify_interface(acpi_handle handle,
519 struct amdgpu_atcs *atcs)
521 union acpi_object *info;
522 struct atcs_verify_interface output;
526 info = amdgpu_atcs_call(handle, ATCS_FUNCTION_VERIFY_INTERFACE, NULL);
530 memset(&output, 0, sizeof(output));
532 size = *(u16 *) info->buffer.pointer;
534 DRM_INFO("ATCS buffer is too small: %zu\n", size);
538 size = min(sizeof(output), size);
540 memcpy(&output, info->buffer.pointer, size);
542 /* TODO: check version? */
543 DRM_DEBUG_DRIVER("ATCS version %u\n", output.version);
545 amdgpu_atcs_parse_functions(&atcs->functions, output.function_bits);
553 * amdgpu_acpi_is_pcie_performance_request_supported
555 * @adev: amdgpu_device pointer
557 * Check if the ATCS pcie_perf_req and pcie_dev_rdy methods
558 * are supported (all asics).
559 * returns true if supported, false if not.
561 bool amdgpu_acpi_is_pcie_performance_request_supported(struct amdgpu_device *adev)
563 struct amdgpu_atcs *atcs = &adev->atcs;
565 if (atcs->functions.pcie_perf_req && atcs->functions.pcie_dev_rdy)
572 * amdgpu_acpi_pcie_notify_device_ready
574 * @adev: amdgpu_device pointer
576 * Executes the PCIE_DEVICE_READY_NOTIFICATION method
578 * returns 0 on success, error on failure.
580 int amdgpu_acpi_pcie_notify_device_ready(struct amdgpu_device *adev)
583 union acpi_object *info;
584 struct amdgpu_atcs *atcs = &adev->atcs;
586 /* Get the device handle */
587 handle = ACPI_HANDLE(&adev->pdev->dev);
591 if (!atcs->functions.pcie_dev_rdy)
594 info = amdgpu_atcs_call(handle, ATCS_FUNCTION_PCIE_DEVICE_READY_NOTIFICATION, NULL);
604 * amdgpu_acpi_pcie_performance_request
606 * @adev: amdgpu_device pointer
607 * @perf_req: requested perf level (pcie gen speed)
608 * @advertise: set advertise caps flag if set
610 * Executes the PCIE_PERFORMANCE_REQUEST method to
611 * change the pcie gen speed (all asics).
612 * returns 0 on success, error on failure.
614 int amdgpu_acpi_pcie_performance_request(struct amdgpu_device *adev,
615 u8 perf_req, bool advertise)
618 union acpi_object *info;
619 struct amdgpu_atcs *atcs = &adev->atcs;
620 struct atcs_pref_req_input atcs_input;
621 struct atcs_pref_req_output atcs_output;
622 struct acpi_buffer params;
626 if (amdgpu_acpi_pcie_notify_device_ready(adev))
629 /* Get the device handle */
630 handle = ACPI_HANDLE(&adev->pdev->dev);
634 if (!atcs->functions.pcie_perf_req)
637 atcs_input.size = sizeof(struct atcs_pref_req_input);
638 /* client id (bit 2-0: func num, 7-3: dev num, 15-8: bus num) */
639 atcs_input.client_id = adev->pdev->devfn | (adev->pdev->bus->number << 8);
640 atcs_input.valid_flags_mask = ATCS_VALID_FLAGS_MASK;
641 atcs_input.flags = ATCS_WAIT_FOR_COMPLETION;
643 atcs_input.flags |= ATCS_ADVERTISE_CAPS;
644 atcs_input.req_type = ATCS_PCIE_LINK_SPEED;
645 atcs_input.perf_req = perf_req;
647 params.length = sizeof(struct atcs_pref_req_input);
648 params.pointer = &atcs_input;
651 info = amdgpu_atcs_call(handle, ATCS_FUNCTION_PCIE_PERFORMANCE_REQUEST, ¶ms);
655 memset(&atcs_output, 0, sizeof(atcs_output));
657 size = *(u16 *) info->buffer.pointer;
659 DRM_INFO("ATCS buffer is too small: %zu\n", size);
663 size = min(sizeof(atcs_output), size);
665 memcpy(&atcs_output, info->buffer.pointer, size);
669 switch (atcs_output.ret_val) {
670 case ATCS_REQUEST_REFUSED:
673 case ATCS_REQUEST_COMPLETE:
675 case ATCS_REQUEST_IN_PROGRESS:
685 * amdgpu_acpi_event - handle notify events
687 * @nb: notifier block
691 * Calls relevant amdgpu functions in response to various
693 * Returns NOTIFY code
695 static int amdgpu_acpi_event(struct notifier_block *nb,
699 struct amdgpu_device *adev = container_of(nb, struct amdgpu_device, acpi_nb);
700 struct acpi_bus_event *entry = (struct acpi_bus_event *)data;
702 if (strcmp(entry->device_class, ACPI_AC_CLASS) == 0) {
703 if (power_supply_is_system_supplied() > 0)
704 DRM_DEBUG_DRIVER("pm: AC\n");
706 DRM_DEBUG_DRIVER("pm: DC\n");
708 amdgpu_pm_acpi_event_handler(adev);
711 /* Check for pending SBIOS requests */
712 return amdgpu_atif_handler(adev, entry);
715 /* Call all ACPI methods here */
717 * amdgpu_acpi_init - init driver acpi support
719 * @adev: amdgpu_device pointer
721 * Verifies the AMD ACPI interfaces and registers with the acpi
722 * notifier chain (all asics).
723 * Returns 0 on success, error on failure.
725 int amdgpu_acpi_init(struct amdgpu_device *adev)
727 acpi_handle handle, atif_handle;
728 struct amdgpu_atif *atif;
729 struct amdgpu_atcs *atcs = &adev->atcs;
732 /* Get the device handle */
733 handle = ACPI_HANDLE(&adev->pdev->dev);
735 if (!adev->bios || !handle)
738 /* Call the ATCS method */
739 ret = amdgpu_atcs_verify_interface(handle, atcs);
741 DRM_DEBUG_DRIVER("Call to ATCS verify_interface failed: %d\n", ret);
744 /* Probe for ATIF, and initialize it if found */
745 atif_handle = amdgpu_atif_probe_handle(handle);
749 atif = kzalloc(sizeof(*atif), GFP_KERNEL);
751 DRM_WARN("Not enough memory to initialize ATIF\n");
754 atif->handle = atif_handle;
756 /* Call the ATIF method */
757 ret = amdgpu_atif_verify_interface(atif);
759 DRM_DEBUG_DRIVER("Call to ATIF verify_interface failed: %d\n", ret);
765 if (atif->notifications.brightness_change) {
766 struct drm_encoder *tmp;
768 /* Find the encoder controlling the brightness */
769 list_for_each_entry(tmp, &adev->ddev->mode_config.encoder_list,
771 struct amdgpu_encoder *enc = to_amdgpu_encoder(tmp);
773 if ((enc->devices & (ATOM_DEVICE_LCD_SUPPORT)) &&
775 struct amdgpu_encoder_atom_dig *dig = enc->enc_priv;
777 atif->encoder_for_bl = enc;
784 if (atif->functions.sbios_requests && !atif->functions.system_params) {
785 /* XXX check this workraround, if sbios request function is
786 * present we have to see how it's configured in the system
789 atif->functions.system_params = true;
792 if (atif->functions.system_params) {
793 ret = amdgpu_atif_get_notification_params(atif);
795 DRM_DEBUG_DRIVER("Call to GET_SYSTEM_PARAMS failed: %d\n",
797 /* Disable notification */
798 atif->notification_cfg.enabled = false;
803 adev->acpi_nb.notifier_call = amdgpu_acpi_event;
804 register_acpi_notifier(&adev->acpi_nb);
810 * amdgpu_acpi_fini - tear down driver acpi support
812 * @adev: amdgpu_device pointer
814 * Unregisters with the acpi notifier chain (all asics).
816 void amdgpu_acpi_fini(struct amdgpu_device *adev)
818 unregister_acpi_notifier(&adev->acpi_nb);