Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310798
b: refs/heads/master
c: c91c3fa
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Jun 9, 2012
1 parent a7d8fab commit d9b9931
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8393ec4a13889339bacfb8b038fb13716eef7a2b
refs/heads/master: c91c3faea500da34d42a14735f1f67bb137b6413
14 changes: 8 additions & 6 deletions trunk/drivers/gpu/vga/vga_switcheroo.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,6 @@ static int vga_switchto_stage1(struct vga_switcheroo_client *new_client)
vga_switchon(new_client);

vga_set_default_device(new_client->pdev);
set_audio_state(new_client->id, VGA_SWITCHEROO_ON);

return 0;
}

Expand All @@ -321,6 +319,8 @@ static int vga_switchto_stage2(struct vga_switcheroo_client *new_client)

active->active = false;

set_audio_state(active->id, VGA_SWITCHEROO_OFF);

if (new_client->fb_info) {
struct fb_event event;
event.info = new_client->fb_info;
Expand All @@ -334,11 +334,11 @@ static int vga_switchto_stage2(struct vga_switcheroo_client *new_client)
if (new_client->ops->reprobe)
new_client->ops->reprobe(new_client->pdev);

set_audio_state(active->id, VGA_SWITCHEROO_OFF);

if (active->pwr_state == VGA_SWITCHEROO_ON)
vga_switchoff(active);

set_audio_state(new_client->id, VGA_SWITCHEROO_ON);

new_client->active = true;
return 0;
}
Expand Down Expand Up @@ -384,8 +384,9 @@ vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf,
/* pwr off the device not in use */
if (strncmp(usercmd, "OFF", 3) == 0) {
list_for_each_entry(client, &vgasr_priv.clients, list) {
if (client->active)
if (client->active || client_is_audio(client))
continue;
set_audio_state(client->id, VGA_SWITCHEROO_OFF);
if (client->pwr_state == VGA_SWITCHEROO_ON)
vga_switchoff(client);
}
Expand All @@ -394,10 +395,11 @@ vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf,
/* pwr on the device not in use */
if (strncmp(usercmd, "ON", 2) == 0) {
list_for_each_entry(client, &vgasr_priv.clients, list) {
if (client->active)
if (client->active || client_is_audio(client))
continue;
if (client->pwr_state == VGA_SWITCHEROO_OFF)
vga_switchon(client);
set_audio_state(client->id, VGA_SWITCHEROO_ON);
}
goto out;
}
Expand Down

0 comments on commit d9b9931

Please sign in to comment.