WIP FPC-III support
[linux/fpc-iii.git] / drivers / gpu / drm / i915 / display / intel_opregion.h
blob4aa68ffbd30eba9d895517b1cbe0c2c48c825578
1 /*
2 * Copyright © 2008-2017 Intel Corporation
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:
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.
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.
25 #ifndef _INTEL_OPREGION_H_
26 #define _INTEL_OPREGION_H_
28 #include <linux/workqueue.h>
29 #include <linux/pci.h>
31 struct drm_i915_private;
32 struct intel_encoder;
34 struct opregion_header;
35 struct opregion_acpi;
36 struct opregion_swsci;
37 struct opregion_asle;
39 struct 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;
55 #define OPREGION_SIZE (8 * 1024)
57 #ifdef CONFIG_ACPI
59 int intel_opregion_setup(struct drm_i915_private *dev_priv);
61 void intel_opregion_register(struct drm_i915_private *dev_priv);
62 void intel_opregion_unregister(struct drm_i915_private *dev_priv);
64 void intel_opregion_resume(struct drm_i915_private *dev_priv);
65 void intel_opregion_suspend(struct drm_i915_private *dev_priv,
66 pci_power_t state);
68 void intel_opregion_asle_intr(struct drm_i915_private *dev_priv);
69 int intel_opregion_notify_encoder(struct intel_encoder *intel_encoder,
70 bool enable);
71 int intel_opregion_notify_adapter(struct drm_i915_private *dev_priv,
72 pci_power_t state);
73 int intel_opregion_get_panel_type(struct drm_i915_private *dev_priv);
75 #else /* CONFIG_ACPI*/
77 static inline int intel_opregion_setup(struct drm_i915_private *dev_priv)
79 return 0;
82 static inline void intel_opregion_register(struct drm_i915_private *dev_priv)
86 static inline void intel_opregion_unregister(struct drm_i915_private *dev_priv)
90 static inline void intel_opregion_resume(struct drm_i915_private *dev_priv)
94 static inline void intel_opregion_suspend(struct drm_i915_private *dev_priv,
95 pci_power_t state)
99 static inline void intel_opregion_asle_intr(struct drm_i915_private *dev_priv)
103 static inline int
104 intel_opregion_notify_encoder(struct intel_encoder *intel_encoder, bool enable)
106 return 0;
109 static inline int
110 intel_opregion_notify_adapter(struct drm_i915_private *dev, pci_power_t state)
112 return 0;
115 static inline int intel_opregion_get_panel_type(struct drm_i915_private *dev)
117 return -ENODEV;
120 #endif /* CONFIG_ACPI */
122 #endif