These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / staging / board / armadillo800eva.c
1 /*
2  * Staging board support for Armadillo 800 eva.
3  * Enable not-yet-DT-capable devices here.
4  *
5  * Based on board-armadillo800eva.c
6  *
7  * Copyright (C) 2012 Renesas Solutions Corp.
8  * Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; version 2 of the License.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  */
19
20 #include <linux/dma-mapping.h>
21 #include <linux/fb.h>
22 #include <linux/kernel.h>
23 #include <linux/platform_device.h>
24 #include <linux/videodev2.h>
25
26 #include <video/sh_mobile_lcdc.h>
27
28 #include "board.h"
29
30
31 static struct fb_videomode lcdc0_mode = {
32         .name           = "AMPIER/AM-800480",
33         .xres           = 800,
34         .yres           = 480,
35         .left_margin    = 88,
36         .right_margin   = 40,
37         .hsync_len      = 128,
38         .upper_margin   = 20,
39         .lower_margin   = 5,
40         .vsync_len      = 5,
41         .sync           = 0,
42 };
43
44 static struct sh_mobile_lcdc_info lcdc0_info = {
45         .clock_source   = LCDC_CLK_BUS,
46         .ch[0] = {
47                 .chan           = LCDC_CHAN_MAINLCD,
48                 .fourcc         = V4L2_PIX_FMT_RGB565,
49                 .interface_type = RGB24,
50                 .clock_divider  = 5,
51                 .flags          = 0,
52                 .lcd_modes      = &lcdc0_mode,
53                 .num_modes      = 1,
54                 .panel_cfg = {
55                         .width  = 111,
56                         .height = 68,
57                 },
58         },
59 };
60
61 static struct resource lcdc0_resources[] = {
62         [0] = {
63                 .name   = "LCD0",
64                 .start  = 0xfe940000,
65                 .end    = 0xfe943fff,
66                 .flags  = IORESOURCE_MEM,
67         },
68         [1] = {
69                 .start  = 177 + 32,
70                 .flags  = IORESOURCE_IRQ,
71         },
72 };
73
74 static struct platform_device lcdc0_device = {
75         .name           = "sh_mobile_lcdc_fb",
76         .num_resources  = ARRAY_SIZE(lcdc0_resources),
77         .resource       = lcdc0_resources,
78         .id             = 0,
79         .dev    = {
80                 .platform_data  = &lcdc0_info,
81                 .coherent_dma_mask = DMA_BIT_MASK(32),
82         },
83 };
84
85 static const struct board_staging_clk lcdc0_clocks[] __initconst = {
86         { "lcdc0", NULL, "sh_mobile_lcdc_fb.0" },
87 };
88
89 static const struct board_staging_dev armadillo800eva_devices[] __initconst = {
90         {
91                 .pdev           = &lcdc0_device,
92                 .clocks         = lcdc0_clocks,
93                 .nclocks        = ARRAY_SIZE(lcdc0_clocks),
94                 .domain         = "/system-controller@e6180000/pm-domains/c5/a4lc@1"
95         },
96 };
97
98 static void __init armadillo800eva_init(void)
99 {
100         board_staging_gic_setup_xlate("arm,cortex-a9-gic", 32);
101         board_staging_register_devices(armadillo800eva_devices,
102                                        ARRAY_SIZE(armadillo800eva_devices));
103 }
104
105 board_staging("renesas,armadillo800eva", armadillo800eva_init);