diff options
| author | Dave Airlie <airlied@redhat.com> | 2010-12-05 21:31:50 -0500 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2011-01-04 22:43:05 -0500 |
| commit | 5cfb3c3a1013e7fca54c3624871755cdfd960b3b (patch) | |
| tree | eefe3260161c4ada9988e18bb9d8b49626bc0947 | |
| parent | 6c2df40ec00e52a5fb0c691b0e79324b9015aaa4 (diff) | |
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>
| -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 0a8678fe4d64..c3c213b74478 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) | |||
| 191 | 191 | ||
| 192 | static int vga_switchon(struct vga_switcheroo_client *client) | 192 | static int vga_switchon(struct vga_switcheroo_client *client) |
| 193 | { | 193 | { |
| 194 | int ret; | 194 | if (vgasr_priv.handler->power_state) |
| 195 | 195 | vgasr_priv.handler->power_state(client->id, VGA_SWITCHEROO_ON); | |
| 196 | ret = vgasr_priv.handler->power_state(client->id, VGA_SWITCHEROO_ON); | ||
| 197 | /* call the driver callback to turn on device */ | 196 | /* call the driver callback to turn on device */ |
| 198 | client->set_gpu_state(client->pdev, VGA_SWITCHEROO_ON); | 197 | client->set_gpu_state(client->pdev, VGA_SWITCHEROO_ON); |
| 199 | client->pwr_state = VGA_SWITCHEROO_ON; | 198 | client->pwr_state = VGA_SWITCHEROO_ON; |
| @@ -204,7 +203,8 @@ static int vga_switchoff(struct vga_switcheroo_client *client) | |||
| 204 | { | 203 | { |
| 205 | /* call the driver callback to turn off device */ | 204 | /* call the driver callback to turn off device */ |
| 206 | client->set_gpu_state(client->pdev, VGA_SWITCHEROO_OFF); | 205 | client->set_gpu_state(client->pdev, VGA_SWITCHEROO_OFF); |
| 207 | vgasr_priv.handler->power_state(client->id, VGA_SWITCHEROO_OFF); | 206 | if (vgasr_priv.handler->power_state) |
| 207 | vgasr_priv.handler->power_state(client->id, VGA_SWITCHEROO_OFF); | ||
| 208 | client->pwr_state = VGA_SWITCHEROO_OFF; | 208 | client->pwr_state = VGA_SWITCHEROO_OFF; |
| 209 | return 0; | 209 | return 0; |
| 210 | } | 210 | } |
