diff options
| author | David Herrmann <dh.herrmann@gmail.com> | 2013-08-02 08:05:20 -0400 |
|---|---|---|
| committer | H. Peter Anvin <hpa@linux.intel.com> | 2013-08-02 19:17:44 -0400 |
| commit | 5ef76da644bf346d29200007d8d3779e7009dabb (patch) | |
| tree | e9e248f6a7f06211d03a8d89cf5466d5adcb885d /include/linux/platform_data | |
| parent | 5ae90d8e467e625e447000cb4335c4db973b1095 (diff) | |
fbdev: simplefb: add init through platform_data
If we create proper platform-devices in x86 boot-code, we can use simplefb
for VBE or EFI framebuffers, too. However, there is normally no OF support
so we introduce a platform_data object so x86 boot-code can pass the
parameters via plain old platform-data.
This also removes the OF dependency as it is not needed. The headers
provide proper dummies for the case OF is disabled.
Furthermore, we move the FORMAT-definitions to the common platform header
so initialization code can use it to transform "struct screen_info" to
the right format-name.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Link: http://lkml.kernel.org/r/1375445127-15480-2-git-send-email-dh.herrmann@gmail.com
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'include/linux/platform_data')
| -rw-r--r-- | include/linux/platform_data/simplefb.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/include/linux/platform_data/simplefb.h b/include/linux/platform_data/simplefb.h new file mode 100644 index 000000000000..5fa2c5e02ab8 --- /dev/null +++ b/include/linux/platform_data/simplefb.h | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | /* | ||
| 2 | * simplefb.h - Simple Framebuffer Device | ||
| 3 | * | ||
| 4 | * Copyright (C) 2013 David Herrmann <dh.herrmann@gmail.com> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2 of the License, or | ||
| 9 | * (at your option) any later version. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef __PLATFORM_DATA_SIMPLEFB_H__ | ||
| 13 | #define __PLATFORM_DATA_SIMPLEFB_H__ | ||
| 14 | |||
| 15 | #include <drm/drm_fourcc.h> | ||
| 16 | #include <linux/fb.h> | ||
| 17 | #include <linux/kernel.h> | ||
| 18 | |||
| 19 | /* format array, use it to initialize a "struct simplefb_format" array */ | ||
| 20 | #define SIMPLEFB_FORMATS \ | ||
| 21 | { \ | ||
| 22 | { "r5g6b5", 16, {11, 5}, {5, 6}, {0, 5}, {0, 0}, DRM_FORMAT_RGB565 }, \ | ||
| 23 | } | ||
| 24 | |||
| 25 | /* | ||
| 26 | * Data-Format for Simple-Framebuffers | ||
| 27 | * @name: unique 0-terminated name that can be used to identify the mode | ||
| 28 | * @red,green,blue: Offsets and sizes of the single RGB parts | ||
| 29 | * @transp: Offset and size of the alpha bits. length=0 means no alpha | ||
| 30 | * @fourcc: 32bit DRM four-CC code (see drm_fourcc.h) | ||
| 31 | */ | ||
| 32 | struct simplefb_format { | ||
| 33 | const char *name; | ||
| 34 | u32 bits_per_pixel; | ||
| 35 | struct fb_bitfield red; | ||
| 36 | struct fb_bitfield green; | ||
| 37 | struct fb_bitfield blue; | ||
| 38 | struct fb_bitfield transp; | ||
| 39 | u32 fourcc; | ||
| 40 | }; | ||
| 41 | |||
| 42 | /* | ||
| 43 | * Simple-Framebuffer description | ||
| 44 | * If the arch-boot code creates simple-framebuffers without DT support, it | ||
| 45 | * can pass the width, height, stride and format via this platform-data object. | ||
| 46 | * The framebuffer location must be given as IORESOURCE_MEM resource. | ||
| 47 | * @format must be a format as described in "struct simplefb_format" above. | ||
| 48 | */ | ||
| 49 | struct simplefb_platform_data { | ||
| 50 | u32 width; | ||
| 51 | u32 height; | ||
| 52 | u32 stride; | ||
| 53 | const char *format; | ||
| 54 | }; | ||
| 55 | |||
| 56 | #endif /* __PLATFORM_DATA_SIMPLEFB_H__ */ | ||
