blob: 002a15f313f30bb7e1e798d78b60a287578b574e [file] [log] [blame]
Ben Dooks58435f72008-11-19 15:41:31 +00001/* linux/arch/arm/plat-s3c/dev-fb.c
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for framebuffer device
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/kernel.h>
15#include <linux/string.h>
16#include <linux/platform_device.h>
17#include <linux/fb.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090018#include <linux/gfp.h>
Ben Dooks58435f72008-11-19 15:41:31 +000019
Russell King80b02c12009-01-08 10:01:47 +000020#include <mach/irqs.h>
Ben Dooks58435f72008-11-19 15:41:31 +000021#include <mach/map.h>
22#include <mach/regs-fb.h>
23
24#include <plat/fb.h>
25#include <plat/devs.h>
26#include <plat/cpu.h>
27
28static struct resource s3c_fb_resource[] = {
29 [0] = {
30 .start = S3C_PA_FB,
31 .end = S3C_PA_FB + SZ_16K - 1,
32 .flags = IORESOURCE_MEM,
33 },
34 [1] = {
35 .start = IRQ_LCD_VSYNC,
36 .end = IRQ_LCD_VSYNC,
37 .flags = IORESOURCE_IRQ,
38 },
39 [2] = {
40 .start = IRQ_LCD_FIFO,
41 .end = IRQ_LCD_FIFO,
42 .flags = IORESOURCE_IRQ,
43 },
44 [3] = {
45 .start = IRQ_LCD_SYSTEM,
46 .end = IRQ_LCD_SYSTEM,
47 .flags = IORESOURCE_IRQ,
48 },
49};
50
51struct platform_device s3c_device_fb = {
52 .name = "s3c-fb",
53 .id = -1,
54 .num_resources = ARRAY_SIZE(s3c_fb_resource),
55 .resource = s3c_fb_resource,
56 .dev.dma_mask = &s3c_device_fb.dev.coherent_dma_mask,
57 .dev.coherent_dma_mask = 0xffffffffUL,
58};
59
60void __init s3c_fb_set_platdata(struct s3c_fb_platdata *pd)
61{
62 struct s3c_fb_platdata *npd;
63
64 if (!pd) {
65 printk(KERN_ERR "%s: no platform data\n", __func__);
66 return;
67 }
68
69 npd = kmemdup(pd, sizeof(struct s3c_fb_platdata), GFP_KERNEL);
70 if (!npd)
71 printk(KERN_ERR "%s: no memory for platform data\n", __func__);
72
73 s3c_device_fb.dev.platform_data = npd;
74}