Loading...
1/*
2 * Copyright © 2008-2017 Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
22 *
23 */
24
25#ifndef _INTEL_OPREGION_H_
26#define _INTEL_OPREGION_H_
27
28#include <linux/workqueue.h>
29#include <linux/pci.h>
30
31struct drm_i915_private;
32struct intel_encoder;
33
34struct opregion_header;
35struct opregion_acpi;
36struct opregion_swsci;
37struct opregion_asle;
38
39struct intel_opregion {
40 struct opregion_header *header;
41 struct opregion_acpi *acpi;
42 struct opregion_swsci *swsci;
43 u32 swsci_gbda_sub_functions;
44 u32 swsci_sbcb_sub_functions;
45 struct opregion_asle *asle;
46 void *rvda;
47 void *vbt_firmware;
48 const void *vbt;
49 u32 vbt_size;
50 u32 *lid_state;
51 struct work_struct asle_work;
52 struct notifier_block acpi_notifier;
53};
54
55#define OPREGION_SIZE (8 * 1024)
56
57#ifdef CONFIG_ACPI
58
59int intel_opregion_setup(struct drm_i915_private *dev_priv);
60
61void intel_opregion_register(struct drm_i915_private *dev_priv);
62void intel_opregion_unregister(struct drm_i915_private *dev_priv);
63
64void intel_opregion_resume(struct drm_i915_private *dev_priv);
65void intel_opregion_suspend(struct drm_i915_private *dev_priv,
66 pci_power_t state);
67
68void intel_opregion_asle_intr(struct drm_i915_private *dev_priv);
69int intel_opregion_notify_encoder(struct intel_encoder *intel_encoder,
70 bool enable);
71int intel_opregion_notify_adapter(struct drm_i915_private *dev_priv,
72 pci_power_t state);
73int intel_opregion_get_panel_type(struct drm_i915_private *dev_priv);
74
75#else /* CONFIG_ACPI*/
76
77static inline int intel_opregion_setup(struct drm_i915_private *dev_priv)
78{
79 return 0;
80}
81
82static inline void intel_opregion_register(struct drm_i915_private *dev_priv)
83{
84}
85
86static inline void intel_opregion_unregister(struct drm_i915_private *dev_priv)
87{
88}
89
90static inline void intel_opregion_resume(struct drm_i915_private *dev_priv)
91{
92}
93
94static inline void intel_opregion_suspend(struct drm_i915_private *dev_priv,
95 pci_power_t state)
96{
97}
98
99static inline void intel_opregion_asle_intr(struct drm_i915_private *dev_priv)
100{
101}
102
103static inline int
104intel_opregion_notify_encoder(struct intel_encoder *intel_encoder, bool enable)
105{
106 return 0;
107}
108
109static inline int
110intel_opregion_notify_adapter(struct drm_i915_private *dev, pci_power_t state)
111{
112 return 0;
113}
114
115static inline int intel_opregion_get_panel_type(struct drm_i915_private *dev)
116{
117 return -ENODEV;
118}
119
120#endif /* CONFIG_ACPI */
121
122#endif
1/*
2 * Copyright © 2008-2017 Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
22 *
23 */
24
25#ifndef _INTEL_OPREGION_H_
26#define _INTEL_OPREGION_H_
27
28#include <linux/workqueue.h>
29#include <linux/pci.h>
30
31struct drm_i915_private;
32struct intel_connector;
33struct intel_encoder;
34
35struct opregion_header;
36struct opregion_acpi;
37struct opregion_swsci;
38struct opregion_asle;
39struct opregion_asle_ext;
40
41struct intel_opregion {
42 struct opregion_header *header;
43 struct opregion_acpi *acpi;
44 struct opregion_swsci *swsci;
45 u32 swsci_gbda_sub_functions;
46 u32 swsci_sbcb_sub_functions;
47 struct opregion_asle *asle;
48 struct opregion_asle_ext *asle_ext;
49 void *rvda;
50 void *vbt_firmware;
51 const void *vbt;
52 u32 vbt_size;
53 u32 *lid_state;
54 struct work_struct asle_work;
55 struct notifier_block acpi_notifier;
56};
57
58#define OPREGION_SIZE (8 * 1024)
59
60#ifdef CONFIG_ACPI
61
62int intel_opregion_setup(struct drm_i915_private *dev_priv);
63
64void intel_opregion_register(struct drm_i915_private *dev_priv);
65void intel_opregion_unregister(struct drm_i915_private *dev_priv);
66
67void intel_opregion_resume(struct drm_i915_private *dev_priv);
68void intel_opregion_suspend(struct drm_i915_private *dev_priv,
69 pci_power_t state);
70
71void intel_opregion_asle_intr(struct drm_i915_private *dev_priv);
72int intel_opregion_notify_encoder(struct intel_encoder *intel_encoder,
73 bool enable);
74int intel_opregion_notify_adapter(struct drm_i915_private *dev_priv,
75 pci_power_t state);
76int intel_opregion_get_panel_type(struct drm_i915_private *dev_priv);
77struct edid *intel_opregion_get_edid(struct intel_connector *connector);
78
79bool intel_opregion_headless_sku(struct drm_i915_private *i915);
80
81#else /* CONFIG_ACPI*/
82
83static inline int intel_opregion_setup(struct drm_i915_private *dev_priv)
84{
85 return 0;
86}
87
88static inline void intel_opregion_register(struct drm_i915_private *dev_priv)
89{
90}
91
92static inline void intel_opregion_unregister(struct drm_i915_private *dev_priv)
93{
94}
95
96static inline void intel_opregion_resume(struct drm_i915_private *dev_priv)
97{
98}
99
100static inline void intel_opregion_suspend(struct drm_i915_private *dev_priv,
101 pci_power_t state)
102{
103}
104
105static inline void intel_opregion_asle_intr(struct drm_i915_private *dev_priv)
106{
107}
108
109static inline int
110intel_opregion_notify_encoder(struct intel_encoder *intel_encoder, bool enable)
111{
112 return 0;
113}
114
115static inline int
116intel_opregion_notify_adapter(struct drm_i915_private *dev, pci_power_t state)
117{
118 return 0;
119}
120
121static inline int intel_opregion_get_panel_type(struct drm_i915_private *dev)
122{
123 return -ENODEV;
124}
125
126static inline struct edid *
127intel_opregion_get_edid(struct intel_connector *connector)
128{
129 return NULL;
130}
131
132static inline bool intel_opregion_headless_sku(struct drm_i915_private *i915)
133{
134 return false;
135}
136
137#endif /* CONFIG_ACPI */
138
139#endif