aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-netx
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-netx')
-rw-r--r--arch/arm/mach-netx/fb.c114
-rw-r--r--arch/arm/mach-netx/fb.h24
2 files changed, 138 insertions, 0 deletions
diff --git a/arch/arm/mach-netx/fb.c b/arch/arm/mach-netx/fb.c
new file mode 100644
index 000000000000..e169b683e4de
--- /dev/null
+++ b/arch/arm/mach-netx/fb.c
@@ -0,0 +1,114 @@
1/*
2 * arch/arm/mach-netx/fb.c
3 *
4 * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
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 version 2
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#include <linux/device.h>
21#include <linux/init.h>
22#include <linux/dma-mapping.h>
23#include <linux/amba/bus.h>
24#include <linux/amba/clcd.h>
25
26#include <asm/arch/netx-regs.h>
27#include <asm/arch/hardware.h>
28
29struct clk {};
30
31static struct clk fb_clk;
32
33static struct clcd_panel *netx_panel;
34
35void netx_clcd_enable(struct clcd_fb *fb)
36{
37}
38
39int netx_clcd_setup(struct clcd_fb *fb)
40{
41 dma_addr_t dma;
42
43 fb->panel = netx_panel;
44
45 fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, 1024*1024,
46 &dma, GFP_KERNEL);
47 if (!fb->fb.screen_base) {
48 printk(KERN_ERR "CLCD: unable to map framebuffer\n");
49 return -ENOMEM;
50 }
51
52 fb->fb.fix.smem_start = dma;
53 fb->fb.fix.smem_len = 1024*1024;
54
55 return 0;
56}
57
58int netx_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma)
59{
60 return dma_mmap_writecombine(&fb->dev->dev, vma,
61 fb->fb.screen_base,
62 fb->fb.fix.smem_start,
63 fb->fb.fix.smem_len);
64}
65
66void netx_clcd_remove(struct clcd_fb *fb)
67{
68 dma_free_writecombine(&fb->dev->dev, fb->fb.fix.smem_len,
69 fb->fb.screen_base, fb->fb.fix.smem_start);
70}
71
72void clk_disable(struct clk *clk)
73{
74}
75
76int clk_set_rate(struct clk *clk, unsigned long rate)
77{
78 return 0;
79}
80
81int clk_enable(struct clk *clk)
82{
83 return 0;
84}
85
86struct clk *clk_get(struct device *dev, const char *id)
87{
88 return &fb_clk;
89}
90
91void clk_put(struct clk *clk)
92{
93}
94
95static struct amba_device fb_device = {
96 .dev = {
97 .bus_id = "fb",
98 .coherent_dma_mask = ~0,
99 },
100 .res = {
101 .start = 0x00104000,
102 .end = 0x00104fff,
103 .flags = IORESOURCE_MEM,
104 },
105 .irq = { NETX_IRQ_LCD, NO_IRQ },
106 .periphid = 0x10112400,
107};
108
109int netx_fb_init(struct clcd_board *board, struct clcd_panel *panel)
110{
111 netx_panel = panel;
112 fb_device.dev.platform_data = board;
113 return amba_device_register(&fb_device, &iomem_resource);
114}
diff --git a/arch/arm/mach-netx/fb.h b/arch/arm/mach-netx/fb.h
new file mode 100644
index 000000000000..4919cf33a5f3
--- /dev/null
+++ b/arch/arm/mach-netx/fb.h
@@ -0,0 +1,24 @@
1/*
2 * arch/arm/mach-netx/fb.h
3 *
4 * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
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 version 2
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20void netx_clcd_enable(struct clcd_fb *fb);
21int netx_clcd_setup(struct clcd_fb *fb);
22int netx_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma);
23void netx_clcd_remove(struct clcd_fb *fb);
24int netx_fb_init(struct clcd_board *board, struct clcd_panel *panel);