blob: 2aeb3e25579cdb91340594811d1d040743d7db25 [file] [log] [blame]
David Herrmanne3263ab2013-08-02 14:05:22 +02001#ifndef _ARCH_X86_KERNEL_SYSFB_H
2#define _ARCH_X86_KERNEL_SYSFB_H
3
4/*
5 * Generic System Framebuffers on x86
6 * Copyright (c) 2012-2013 David Herrmann <dh.herrmann@gmail.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the Free
10 * Software Foundation; either version 2 of the License, or (at your option)
11 * any later version.
12 */
13
14#include <linux/kernel.h>
15#include <linux/platform_data/simplefb.h>
16#include <linux/screen_info.h>
17
David Herrmann2995e502013-08-02 14:05:23 +020018enum {
19 M_I17, /* 17-Inch iMac */
20 M_I20, /* 20-Inch iMac */
21 M_I20_SR, /* 20-Inch iMac (Santa Rosa) */
22 M_I24, /* 24-Inch iMac */
23 M_I24_8_1, /* 24-Inch iMac, 8,1th gen */
24 M_I24_10_1, /* 24-Inch iMac, 10,1th gen */
25 M_I27_11_1, /* 27-Inch iMac, 11,1th gen */
26 M_MINI, /* Mac Mini */
27 M_MINI_3_1, /* Mac Mini, 3,1th gen */
28 M_MINI_4_1, /* Mac Mini, 4,1th gen */
29 M_MB, /* MacBook */
30 M_MB_2, /* MacBook, 2nd rev. */
31 M_MB_3, /* MacBook, 3rd rev. */
32 M_MB_5_1, /* MacBook, 5th rev. */
33 M_MB_6_1, /* MacBook, 6th rev. */
34 M_MB_7_1, /* MacBook, 7th rev. */
35 M_MB_SR, /* MacBook, 2nd gen, (Santa Rosa) */
36 M_MBA, /* MacBook Air */
37 M_MBA_3, /* Macbook Air, 3rd rev */
38 M_MBP, /* MacBook Pro */
39 M_MBP_2, /* MacBook Pro 2nd gen */
40 M_MBP_2_2, /* MacBook Pro 2,2nd gen */
41 M_MBP_SR, /* MacBook Pro (Santa Rosa) */
42 M_MBP_4, /* MacBook Pro, 4th gen */
43 M_MBP_5_1, /* MacBook Pro, 5,1th gen */
44 M_MBP_5_2, /* MacBook Pro, 5,2th gen */
45 M_MBP_5_3, /* MacBook Pro, 5,3rd gen */
46 M_MBP_6_1, /* MacBook Pro, 6,1th gen */
47 M_MBP_6_2, /* MacBook Pro, 6,2th gen */
48 M_MBP_7_1, /* MacBook Pro, 7,1th gen */
49 M_MBP_8_2, /* MacBook Pro, 8,2nd gen */
50 M_UNKNOWN /* placeholder */
51};
52
53struct efifb_dmi_info {
54 char *optname;
55 unsigned long base;
56 int stride;
57 int width;
58 int height;
59 int flags;
60};
61
62#ifdef CONFIG_EFI
63
64extern struct efifb_dmi_info efifb_dmi_list[];
65void sysfb_apply_efi_quirks(void);
66
67#else /* CONFIG_EFI */
68
69static inline void sysfb_apply_efi_quirks(void)
70{
71}
72
73#endif /* CONFIG_EFI */
74
David Herrmanne3263ab2013-08-02 14:05:22 +020075#ifdef CONFIG_X86_SYSFB
76
77bool parse_mode(const struct screen_info *si,
78 struct simplefb_platform_data *mode);
79int create_simplefb(const struct screen_info *si,
80 const struct simplefb_platform_data *mode);
81
82#else /* CONFIG_X86_SYSFB */
83
84static inline bool parse_mode(const struct screen_info *si,
85 struct simplefb_platform_data *mode)
86{
87 return false;
88}
89
90static inline int create_simplefb(const struct screen_info *si,
91 const struct simplefb_platform_data *mode)
92{
93 return -EINVAL;
94}
95
96#endif /* CONFIG_X86_SYSFB */
97
98#endif /* _ARCH_X86_KERNEL_SYSFB_H */