summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-06-07 10:15:15 (GMT)
committerTakashi Iwai <tiwai@suse.de>2012-06-08 09:24:12 (GMT)
commitc8e9cf7bb240049117d2fa64d1540476c289396d (patch)
treeccd86aa58f08cde50dcc0da35d2ea4b745d99abd /drivers
parent8260ef075bd9848ce6a8004ec73b7454d410cc15 (diff)
downloadlinux-c8e9cf7bb240049117d2fa64d1540476c289396d.tar.xz
vga_switcheroo: Add a helper function to get the client state
Add vga_switcheroo_get_client_state() to get the current state of the client. This is necessary to determine the proper initial state of audio clients in HD-audio driver. Acked-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/vga/vga_switcheroo.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
index 38f9534..eb4f64f 100644
--- a/drivers/gpu/vga/vga_switcheroo.c
+++ b/drivers/gpu/vga/vga_switcheroo.c
@@ -190,6 +190,19 @@ find_active_client(struct list_head *head)
return NULL;
}
+int vga_switcheroo_get_client_state(struct pci_dev *pdev)
+{
+ struct vga_switcheroo_client *client;
+
+ client = find_client_from_pci(&vgasr_priv.clients, pdev);
+ if (!client)
+ return VGA_SWITCHEROO_NOT_FOUND;
+ if (!vgasr_priv.active)
+ return VGA_SWITCHEROO_INIT;
+ return client->pwr_state;
+}
+EXPORT_SYMBOL(vga_switcheroo_get_client_state);
+
void vga_switcheroo_unregister_client(struct pci_dev *pdev)
{
struct vga_switcheroo_client *client;