diff options
author | Dave Airlie <airlied@redhat.com> | 2010-12-06 02:31:50 (GMT) |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-01-05 03:43:05 (GMT) |
commit | 5cfb3c3a1013e7fca54c3624871755cdfd960b3b (patch) | |
tree | eefe3260161c4ada9988e18bb9d8b49626bc0947 /drivers/gpu/vga/vga_switcheroo.c | |
parent | 6c2df40ec00e52a5fb0c691b0e79324b9015aaa4 (diff) | |
download | linux-5cfb3c3a1013e7fca54c3624871755cdfd960b3b.tar.xz |
vga_switcheroo: make power switch handler optional
At least on the nvidia mux the power switch seems to be executed
by the ACPI PS0/PS3 methods so need to do it explicitly.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/vga/vga_switcheroo.c')
-rw-r--r-- | drivers/gpu/vga/vga_switcheroo.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c index 0a8678f..c3c213b 100644 --- a/drivers/gpu/vga/vga_switcheroo.c +++ b/drivers/gpu/vga/vga_switcheroo.c @@ -191,9 +191,8 @@ static int vga_switcheroo_debugfs_open(struct inode *inode, struct file *file) static int vga_switchon(struct vga_switcheroo_client *client) { - int ret; - - ret = vgasr_priv.handler->power_state(client->id, VGA_SWITCHEROO_ON); + if (vgasr_priv.handler->power_state) + vgasr_priv.handler->power_state(client->id, VGA_SWITCHEROO_ON); /* call the driver callback to turn on device */ client->set_gpu_state(client->pdev, VGA_SWITCHEROO_ON); client->pwr_state = VGA_SWITCHEROO_ON; @@ -204,7 +203,8 @@ static int vga_switchoff(struct vga_switcheroo_client *client) { /* call the driver callback to turn off device */ client->set_gpu_state(client->pdev, VGA_SWITCHEROO_OFF); - vgasr_priv.handler->power_state(client->id, VGA_SWITCHEROO_OFF); + if (vgasr_priv.handler->power_state) + vgasr_priv.handler->power_state(client->id, VGA_SWITCHEROO_OFF); client->pwr_state = VGA_SWITCHEROO_OFF; return 0; } |