146 lines · c
1/*2 * Copyright © 2008-2017 Intel Corporation3 *4 * Permission is hereby granted, free of charge, to any person obtaining a5 * copy of this software and associated documentation files (the "Software"),6 * to deal in the Software without restriction, including without limitation7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,8 * and/or sell copies of the Software, and to permit persons to whom the9 * Software is furnished to do so, subject to the following conditions:10 *11 * The above copyright notice and this permission notice (including the next12 * paragraph) shall be included in all copies or substantial portions of the13 * Software.14 *15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS21 * IN THE SOFTWARE.22 *23 */24 25#ifndef _INTEL_OPREGION_H_26#define _INTEL_OPREGION_H_27 28#include <linux/pci.h>29#include <linux/types.h>30 31struct intel_connector;32struct intel_display;33struct intel_encoder;34 35#ifdef CONFIG_ACPI36 37int intel_opregion_setup(struct intel_display *display);38void intel_opregion_cleanup(struct intel_display *display);39 40void intel_opregion_register(struct intel_display *display);41void intel_opregion_unregister(struct intel_display *display);42 43void intel_opregion_resume(struct intel_display *display);44void intel_opregion_suspend(struct intel_display *display,45 pci_power_t state);46 47bool intel_opregion_asle_present(struct intel_display *display);48void intel_opregion_asle_intr(struct intel_display *display);49int intel_opregion_notify_encoder(struct intel_encoder *encoder,50 bool enable);51int intel_opregion_notify_adapter(struct intel_display *display,52 pci_power_t state);53int intel_opregion_get_panel_type(struct intel_display *display);54const struct drm_edid *intel_opregion_get_edid(struct intel_connector *connector);55 56bool intel_opregion_vbt_present(struct intel_display *display);57const void *intel_opregion_get_vbt(struct intel_display *display, size_t *size);58 59bool intel_opregion_headless_sku(struct intel_display *display);60 61void intel_opregion_debugfs_register(struct intel_display *display);62 63#else /* CONFIG_ACPI*/64 65static inline int intel_opregion_setup(struct intel_display *display)66{67 return 0;68}69 70static inline void intel_opregion_cleanup(struct intel_display *display)71{72}73 74static inline void intel_opregion_register(struct intel_display *display)75{76}77 78static inline void intel_opregion_unregister(struct intel_display *display)79{80}81 82static inline void intel_opregion_resume(struct intel_display *display)83{84}85 86static inline void intel_opregion_suspend(struct intel_display *display,87 pci_power_t state)88{89}90 91static inline bool intel_opregion_asle_present(struct intel_display *display)92{93 return false;94}95 96static inline void intel_opregion_asle_intr(struct intel_display *display)97{98}99 100static inline int101intel_opregion_notify_encoder(struct intel_encoder *encoder, bool enable)102{103 return 0;104}105 106static inline int107intel_opregion_notify_adapter(struct intel_display *display, pci_power_t state)108{109 return 0;110}111 112static inline int intel_opregion_get_panel_type(struct intel_display *display)113{114 return -ENODEV;115}116 117static inline const struct drm_edid *118intel_opregion_get_edid(struct intel_connector *connector)119{120 return NULL;121}122 123static inline bool intel_opregion_vbt_present(struct intel_display *display)124{125 return false;126}127 128static inline const void *129intel_opregion_get_vbt(struct intel_display *display, size_t *size)130{131 return NULL;132}133 134static inline bool intel_opregion_headless_sku(struct intel_display *display)135{136 return false;137}138 139static inline void intel_opregion_debugfs_register(struct intel_display *display)140{141}142 143#endif /* CONFIG_ACPI */144 145#endif146