diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-06-07 06:15:15 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-06-08 05:24:12 -0400 |
commit | c8e9cf7bb240049117d2fa64d1540476c289396d (patch) | |
tree | ccd86aa58f08cde50dcc0da35d2ea4b745d99abd /include/linux | |
parent | 8260ef075bd9848ce6a8004ec73b7454d410cc15 (diff) |
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 'include/linux')
-rw-r--r-- | include/linux/vga_switcheroo.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/vga_switcheroo.h b/include/linux/vga_switcheroo.h index b455c7c212eb..b176342ca031 100644 --- a/include/linux/vga_switcheroo.h +++ b/include/linux/vga_switcheroo.h | |||
@@ -12,6 +12,9 @@ | |||
12 | enum vga_switcheroo_state { | 12 | enum vga_switcheroo_state { |
13 | VGA_SWITCHEROO_OFF, | 13 | VGA_SWITCHEROO_OFF, |
14 | VGA_SWITCHEROO_ON, | 14 | VGA_SWITCHEROO_ON, |
15 | /* below are referred only from vga_switcheroo_get_client_state() */ | ||
16 | VGA_SWITCHEROO_INIT, | ||
17 | VGA_SWITCHEROO_NOT_FOUND, | ||
15 | }; | 18 | }; |
16 | 19 | ||
17 | enum vga_switcheroo_client_id { | 20 | enum vga_switcheroo_client_id { |
@@ -50,6 +53,8 @@ void vga_switcheroo_unregister_handler(void); | |||
50 | 53 | ||
51 | int vga_switcheroo_process_delayed_switch(void); | 54 | int vga_switcheroo_process_delayed_switch(void); |
52 | 55 | ||
56 | int vga_switcheroo_get_client_state(struct pci_dev *dev); | ||
57 | |||
53 | #else | 58 | #else |
54 | 59 | ||
55 | static inline void vga_switcheroo_unregister_client(struct pci_dev *dev) {} | 60 | static inline void vga_switcheroo_unregister_client(struct pci_dev *dev) {} |
@@ -62,5 +67,7 @@ static inline int vga_switcheroo_register_audio_client(struct pci_dev *pdev, | |||
62 | int id, bool active) { return 0; } | 67 | int id, bool active) { return 0; } |
63 | static inline void vga_switcheroo_unregister_handler(void) {} | 68 | static inline void vga_switcheroo_unregister_handler(void) {} |
64 | static inline int vga_switcheroo_process_delayed_switch(void) { return 0; } | 69 | static inline int vga_switcheroo_process_delayed_switch(void) { return 0; } |
70 | static inline int vga_switcheroo_get_client_state(struct pci_dev *dev) { return VGA_SWITCHEROO_CLIENT_ON; } | ||
71 | |||
65 | 72 | ||
66 | #endif | 73 | #endif |