-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 205012 b: refs/heads/master c: d7a2952 h: refs/heads/master v: v3
- Loading branch information
Alberto Milone
authored and
Dave Airlie
committed
Aug 1, 2010
1 parent
180d145
commit a5d7d3d
Showing
5 changed files
with
83 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 9bd7ef5f5a5ab6088029ad95a435f03e1314275d | ||
refs/heads/master: d7a2952f1adec32018a78ec0c2f504dd72f38e25 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#include <linux/pci.h> | ||
#include <linux/acpi.h> | ||
#include <linux/slab.h> | ||
#include <acpi/acpi_drivers.h> | ||
#include <acpi/acpi_bus.h> | ||
|
||
#include "drmP.h" | ||
#include "drm.h" | ||
#include "drm_sarea.h" | ||
#include "drm_crtc_helper.h" | ||
#include "radeon.h" | ||
|
||
#include <linux/vga_switcheroo.h> | ||
|
||
/* Call the ATIF method | ||
* | ||
* Note: currently we discard the output | ||
*/ | ||
static int radeon_atif_call(acpi_handle handle) | ||
{ | ||
acpi_status status; | ||
union acpi_object atif_arg_elements[2]; | ||
struct acpi_object_list atif_arg; | ||
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL}; | ||
|
||
atif_arg.count = 2; | ||
atif_arg.pointer = &atif_arg_elements[0]; | ||
|
||
atif_arg_elements[0].type = ACPI_TYPE_INTEGER; | ||
atif_arg_elements[0].integer.value = 0; | ||
atif_arg_elements[1].type = ACPI_TYPE_INTEGER; | ||
atif_arg_elements[1].integer.value = 0; | ||
|
||
status = acpi_evaluate_object(handle, "ATIF", &atif_arg, &buffer); | ||
|
||
/* Fail only if calling the method fails and ATIF is supported */ | ||
if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { | ||
printk(KERN_INFO "failed to evaluate ATIF got %s\n", acpi_format_exception(status)); | ||
kfree(buffer.pointer); | ||
return 1; | ||
} | ||
|
||
kfree(buffer.pointer); | ||
return 0; | ||
} | ||
|
||
/* Call all ACPI methods here */ | ||
int radeon_acpi_init(struct radeon_device *rdev) | ||
{ | ||
acpi_handle handle; | ||
int ret; | ||
|
||
/* No need to proceed if we're sure that ATIF is not supported */ | ||
if (!ASIC_IS_AVIVO(rdev) || !rdev->bios) | ||
return 0; | ||
|
||
/* Get the device handle */ | ||
handle = DEVICE_ACPI_HANDLE(&rdev->pdev->dev); | ||
|
||
/* Call the ATIF method */ | ||
ret = radeon_atif_call(handle); | ||
if (ret) | ||
return ret; | ||
|
||
return 0; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters