170412cfaSRafael Antognolli /*
270412cfaSRafael Antognolli * Copyright © 2015 Intel Corporation
370412cfaSRafael Antognolli *
470412cfaSRafael Antognolli * Permission is hereby granted, free of charge, to any person obtaining a
570412cfaSRafael Antognolli * copy of this software and associated documentation files (the "Software"),
670412cfaSRafael Antognolli * to deal in the Software without restriction, including without limitation
770412cfaSRafael Antognolli * the rights to use, copy, modify, merge, publish, distribute, sublicense,
870412cfaSRafael Antognolli * and/or sell copies of the Software, and to permit persons to whom the
970412cfaSRafael Antognolli * Software is furnished to do so, subject to the following conditions:
1070412cfaSRafael Antognolli *
1170412cfaSRafael Antognolli * The above copyright notice and this permission notice (including the next
1270412cfaSRafael Antognolli * paragraph) shall be included in all copies or substantial portions of the
1370412cfaSRafael Antognolli * Software.
1470412cfaSRafael Antognolli *
1570412cfaSRafael Antognolli * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1670412cfaSRafael Antognolli * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1770412cfaSRafael Antognolli * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1870412cfaSRafael Antognolli * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1970412cfaSRafael Antognolli * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2070412cfaSRafael Antognolli * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2170412cfaSRafael Antognolli * IN THE SOFTWARE.
2270412cfaSRafael Antognolli *
2370412cfaSRafael Antognolli * Authors:
2470412cfaSRafael Antognolli * Rafael Antognolli <rafael.antognolli@intel.com>
2570412cfaSRafael Antognolli *
2670412cfaSRafael Antognolli */
2770412cfaSRafael Antognolli
28b0b7d372SDaniel Vetter #include <linux/module.h>
290500c04eSSam Ravnborg
30*255490f9SVille Syrjälä #include <drm/drm_edid.h>
310500c04eSSam Ravnborg #include <drm/drm_print.h>
32e15c8f4bSDaniel Vetter
33e15c8f4bSDaniel Vetter #include "drm_crtc_helper_internal.h"
3470412cfaSRafael Antognolli
3570412cfaSRafael Antognolli MODULE_AUTHOR("David Airlie, Jesse Barnes");
3670412cfaSRafael Antognolli MODULE_DESCRIPTION("DRM KMS helper");
3770412cfaSRafael Antognolli MODULE_LICENSE("GPL and additional rights");
3870412cfaSRafael Antognolli
39ac6c35a4SJani Nikula #if IS_ENABLED(CONFIG_DRM_LOAD_EDID_FIRMWARE)
40ac6c35a4SJani Nikula
41ac6c35a4SJani Nikula /* Backward compatibility for drm_kms_helper.edid_firmware */
edid_firmware_set(const char * val,const struct kernel_param * kp)42ac6c35a4SJani Nikula static int edid_firmware_set(const char *val, const struct kernel_param *kp)
43ac6c35a4SJani Nikula {
44ade92599SJani Nikula DRM_NOTE("drm_kms_helper.edid_firmware is deprecated, please use drm.edid_firmware instead.\n");
45ac6c35a4SJani Nikula
46ac6c35a4SJani Nikula return __drm_set_edid_firmware_path(val);
47ac6c35a4SJani Nikula }
48ac6c35a4SJani Nikula
edid_firmware_get(char * buffer,const struct kernel_param * kp)49ac6c35a4SJani Nikula static int edid_firmware_get(char *buffer, const struct kernel_param *kp)
50ac6c35a4SJani Nikula {
51ac6c35a4SJani Nikula return __drm_get_edid_firmware_path(buffer, PAGE_SIZE);
52ac6c35a4SJani Nikula }
53ac6c35a4SJani Nikula
54ac6c35a4SJani Nikula static const struct kernel_param_ops edid_firmware_ops = {
55ac6c35a4SJani Nikula .set = edid_firmware_set,
56ac6c35a4SJani Nikula .get = edid_firmware_get,
57ac6c35a4SJani Nikula };
58ac6c35a4SJani Nikula
59ac6c35a4SJani Nikula module_param_cb(edid_firmware, &edid_firmware_ops, NULL, 0644);
60ac6c35a4SJani Nikula __MODULE_PARM_TYPE(edid_firmware, "charp");
61ac6c35a4SJani Nikula MODULE_PARM_DESC(edid_firmware,
62ac6c35a4SJani Nikula "DEPRECATED. Use drm.edid_firmware module parameter instead.");
63ac6c35a4SJani Nikula
64ac6c35a4SJani Nikula #endif
65