]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blob - arch/arm/mach-shmobile/board-lager-reference.c
ACPI / Fan: Use bus id as the name for non PNP0C0B (Fan) devices
[mirror_ubuntu-focal-kernel.git] / arch / arm / mach-shmobile / board-lager-reference.c
1 /*
2 * Lager board support - Reference DT implementation
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Copyright (C) 2013 Simon Horman
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include <linux/dma-mapping.h>
22 #include <linux/init.h>
23 #include <linux/of_platform.h>
24 #include <linux/platform_data/rcar-du.h>
25
26 #include <asm/mach/arch.h>
27
28 #include "clock.h"
29 #include "common.h"
30 #include "irqs.h"
31 #include "r8a7790.h"
32 #include "rcar-gen2.h"
33
34 /* DU */
35 static struct rcar_du_encoder_data lager_du_encoders[] = {
36 {
37 .type = RCAR_DU_ENCODER_VGA,
38 .output = RCAR_DU_OUTPUT_DPAD0,
39 }, {
40 .type = RCAR_DU_ENCODER_NONE,
41 .output = RCAR_DU_OUTPUT_LVDS1,
42 .connector.lvds.panel = {
43 .width_mm = 210,
44 .height_mm = 158,
45 .mode = {
46 .pixelclock = 65000000,
47 .hactive = 1024,
48 .hfront_porch = 20,
49 .hback_porch = 160,
50 .hsync_len = 136,
51 .vactive = 768,
52 .vfront_porch = 3,
53 .vback_porch = 29,
54 .vsync_len = 6,
55 },
56 },
57 },
58 };
59
60 static struct rcar_du_platform_data lager_du_pdata = {
61 .encoders = lager_du_encoders,
62 .num_encoders = ARRAY_SIZE(lager_du_encoders),
63 };
64
65 static const struct resource du_resources[] __initconst = {
66 DEFINE_RES_MEM(0xfeb00000, 0x70000),
67 DEFINE_RES_MEM_NAMED(0xfeb90000, 0x1c, "lvds.0"),
68 DEFINE_RES_MEM_NAMED(0xfeb94000, 0x1c, "lvds.1"),
69 DEFINE_RES_IRQ(gic_spi(256)),
70 DEFINE_RES_IRQ(gic_spi(268)),
71 DEFINE_RES_IRQ(gic_spi(269)),
72 };
73
74 static void __init lager_add_du_device(void)
75 {
76 struct platform_device_info info = {
77 .name = "rcar-du-r8a7790",
78 .id = -1,
79 .res = du_resources,
80 .num_res = ARRAY_SIZE(du_resources),
81 .data = &lager_du_pdata,
82 .size_data = sizeof(lager_du_pdata),
83 .dma_mask = DMA_BIT_MASK(32),
84 };
85
86 platform_device_register_full(&info);
87 }
88
89 /*
90 * This is a really crude hack to provide clkdev support to platform
91 * devices until they get moved to DT.
92 */
93 static const struct clk_name clk_names[] __initconst = {
94 { "du0", "du.0", "rcar-du-r8a7790" },
95 { "du1", "du.1", "rcar-du-r8a7790" },
96 { "du2", "du.2", "rcar-du-r8a7790" },
97 { "lvds0", "lvds.0", "rcar-du-r8a7790" },
98 { "lvds1", "lvds.1", "rcar-du-r8a7790" },
99 };
100
101 static void __init lager_add_standard_devices(void)
102 {
103 shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false);
104 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
105
106 lager_add_du_device();
107 }
108
109 static const char *lager_boards_compat_dt[] __initdata = {
110 "renesas,lager",
111 "renesas,lager-reference",
112 NULL,
113 };
114
115 DT_MACHINE_START(LAGER_DT, "lager")
116 .smp = smp_ops(r8a7790_smp_ops),
117 .init_early = shmobile_init_delay,
118 .init_time = rcar_gen2_timer_init,
119 .init_machine = lager_add_standard_devices,
120 .init_late = shmobile_init_late,
121 .reserve = rcar_gen2_reserve,
122 .dt_compat = lager_boards_compat_dt,
123 MACHINE_END