1
0

fb: Generalize framebuffer device initialization

This commit is contained in:
2012-10-07 23:25:11 -04:00
parent 0b7e14c69b
commit c64bfea238
7 changed files with 137 additions and 17 deletions

View File

@ -18,10 +18,13 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <types.h>
#include <framebuffer.h>
#include <mm.h>
#include <init.h>
#include <math.h>
#include <mm.h>
#include <types.h>
#include <drivers/fb.h>
#define PL111_CR_EN 0x001
#define PL111_CR_PWR 0x800
@ -40,7 +43,7 @@ struct pl111_control {
struct fbdev pl111_fb_device;
int pl111_init(struct fb *f, unsigned int color_depth) {
int pl111_init_dev(struct fb *f, unsigned int color_depth) {
unsigned int width, height;
unsigned int fb_size, power;
struct pl111_control *plio = (struct pl111_control*)PL111_IOBASE;
@ -87,3 +90,13 @@ int pl111_init(struct fb *f, unsigned int color_depth) {
return 0;
}
struct fb_dev pl111_dev = {
.init = &pl111_init_dev
};
void pl111_init() {
fb_register_device(&pl111_dev);
}
device_initcall(pl111_init);