blob: 324f02bf8a51da6b3d3395d30c309447a8f7c793 [file] [log] [blame]
Tony Lindgren1dbae812005-11-10 14:26:51 +00001/*
2 * linux/arch/arm/mach-omap2/devices.c
3 *
4 * OMAP2 platform device setup/initialization
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 as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
Russell King2f8163b2011-07-26 10:53:52 +010011#include <linux/gpio.h>
Tony Lindgren1dbae812005-11-10 14:26:51 +000012#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/platform_device.h>
Russell Kingfced80c2008-09-06 12:10:45 +010015#include <linux/io.h>
Kevin Hilman917fa282008-12-10 17:37:17 -080016#include <linux/clk.h>
Varadarajan, Charulathaf2ce6232010-09-23 20:02:42 +053017#include <linux/err.h>
Charulatha V1a5d8192011-02-02 17:52:14 +053018#include <linux/slab.h>
Benoit Coussonad8dfac2011-08-12 13:48:47 +020019#include <linux/of.h>
Matt Porter484202f2012-09-17 16:26:11 -070020#include <linux/pinctrl/machine.h>
Suman Annab8a7cf82013-01-28 17:21:58 -060021#include <linux/platform_data/mailbox-omap.h>
Tony Lindgren1dbae812005-11-10 14:26:51 +000022
Tony Lindgren1dbae812005-11-10 14:26:51 +000023#include <asm/mach-types.h>
24#include <asm/mach/map.h>
25
Tony Lindgren45c3eb72012-11-30 08:41:50 -080026#include <linux/omap-dma.h>
Tony Lindgren2a296c82012-10-02 17:41:35 -070027
Tony Lindgrenee0839c2012-02-24 10:34:35 -080028#include "iomap.h"
Tony Lindgren2a296c82012-10-02 17:41:35 -070029#include "omap_hwmod.h"
Tony Lindgren25c7d492012-10-02 17:25:48 -070030#include "omap_device.h"
Tony Lindgren1dbae812005-11-10 14:26:51 +000031
Tony Lindgren7d7e1eb2012-08-27 17:43:01 -070032#include "soc.h"
33#include "common.h"
Tony Lindgren4896e392009-12-11 16:16:32 -080034#include "mux.h"
Paul Walmsley4814ced2010-10-08 11:40:20 -060035#include "control.h"
Laurent Pincharta11f6702009-12-14 08:09:07 -030036#include "devices.h"
Archit Taneja576e5bd2013-09-16 12:48:31 +053037#include "display.h"
Tony Lindgren4896e392009-12-11 16:16:32 -080038
sricharan0abcf612011-02-08 14:10:45 +053039#define L3_MODULES_MAX_LEN 12
sricharana4dc6162011-03-09 16:00:29 +053040#define L3_MODULES 3
sricharan0abcf612011-02-08 14:10:45 +053041
42static int __init omap3_l3_init(void)
43{
sricharan0abcf612011-02-08 14:10:45 +053044 struct omap_hwmod *oh;
Kevin Hilman3528c582011-07-21 13:48:45 -070045 struct platform_device *pdev;
sricharan0abcf612011-02-08 14:10:45 +053046 char oh_name[L3_MODULES_MAX_LEN];
47
48 /*
49 * To avoid code running on other OMAPs in
50 * multi-omap builds
51 */
52 if (!(cpu_is_omap34xx()))
53 return -ENODEV;
54
Paul Walmsleyeeb37112012-04-13 06:34:32 -060055 snprintf(oh_name, L3_MODULES_MAX_LEN, "l3_main");
sricharan0abcf612011-02-08 14:10:45 +053056
57 oh = omap_hwmod_lookup(oh_name);
58
59 if (!oh)
60 pr_err("could not look up %s\n", oh_name);
61
Paul Walmsleyc1d1cd52013-01-26 00:48:53 -070062 pdev = omap_device_build("omap_l3_smx", 0, oh, NULL, 0);
sricharan0abcf612011-02-08 14:10:45 +053063
Kevin Hilman3528c582011-07-21 13:48:45 -070064 WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);
sricharan0abcf612011-02-08 14:10:45 +053065
Thomas Meyer12616742013-06-01 11:44:44 +020066 return PTR_RET(pdev);
sricharan0abcf612011-02-08 14:10:45 +053067}
Tony Lindgrenb76c8b12013-01-11 11:24:18 -080068omap_postcore_initcall(omap3_l3_init);
sricharan0abcf612011-02-08 14:10:45 +053069
sricharana4dc6162011-03-09 16:00:29 +053070static int __init omap4_l3_init(void)
71{
Paul Walmsleyeeb37112012-04-13 06:34:32 -060072 int i;
sricharana4dc6162011-03-09 16:00:29 +053073 struct omap_hwmod *oh[3];
Kevin Hilman3528c582011-07-21 13:48:45 -070074 struct platform_device *pdev;
sricharana4dc6162011-03-09 16:00:29 +053075 char oh_name[L3_MODULES_MAX_LEN];
76
Benoit Coussonad8dfac2011-08-12 13:48:47 +020077 /* If dtb is there, the devices will be created dynamically */
78 if (of_have_populated_dt())
79 return -ENODEV;
80
sricharana4dc6162011-03-09 16:00:29 +053081 /*
82 * To avoid code running on other OMAPs in
83 * multi-omap builds
84 */
R Sricharane17933c2011-11-04 15:52:59 +053085 if (!cpu_is_omap44xx() && !soc_is_omap54xx())
sricharana4dc6162011-03-09 16:00:29 +053086 return -ENODEV;
87
88 for (i = 0; i < L3_MODULES; i++) {
Paul Walmsleyeeb37112012-04-13 06:34:32 -060089 snprintf(oh_name, L3_MODULES_MAX_LEN, "l3_main_%d", i+1);
sricharana4dc6162011-03-09 16:00:29 +053090
91 oh[i] = omap_hwmod_lookup(oh_name);
92 if (!(oh[i]))
93 pr_err("could not look up %s\n", oh_name);
94 }
95
Paul Walmsleyc1d1cd52013-01-26 00:48:53 -070096 pdev = omap_device_build_ss("omap_l3_noc", 0, oh, 3, NULL, 0);
sricharana4dc6162011-03-09 16:00:29 +053097
Kevin Hilman3528c582011-07-21 13:48:45 -070098 WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);
sricharana4dc6162011-03-09 16:00:29 +053099
Thomas Meyer12616742013-06-01 11:44:44 +0200100 return PTR_RET(pdev);
sricharana4dc6162011-03-09 16:00:29 +0530101}
Tony Lindgrenb76c8b12013-01-11 11:24:18 -0800102omap_postcore_initcall(omap4_l3_init);
sricharana4dc6162011-03-09 16:00:29 +0530103
Tony Lindgren828c7072009-03-23 18:23:49 -0700104#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
Tony Lindgrenc40fae952006-12-07 13:58:10 -0800105
Sergio Aguirrecfe2cde2010-11-15 11:29:54 -0300106static struct resource omap2cam_resources[] = {
Tony Lindgrenc40fae952006-12-07 13:58:10 -0800107 {
Tony Lindgren828c7072009-03-23 18:23:49 -0700108 .start = OMAP24XX_CAMERA_BASE,
109 .end = OMAP24XX_CAMERA_BASE + 0xfff,
110 .flags = IORESOURCE_MEM,
111 },
112 {
Tony Lindgren7d7e1eb2012-08-27 17:43:01 -0700113 .start = 24 + OMAP_INTC_START,
Tony Lindgren828c7072009-03-23 18:23:49 -0700114 .flags = IORESOURCE_IRQ,
115 }
116};
117
Sergio Aguirrecfe2cde2010-11-15 11:29:54 -0300118static struct platform_device omap2cam_device = {
Tony Lindgren828c7072009-03-23 18:23:49 -0700119 .name = "omap24xxcam",
120 .id = -1,
Sergio Aguirrecfe2cde2010-11-15 11:29:54 -0300121 .num_resources = ARRAY_SIZE(omap2cam_resources),
122 .resource = omap2cam_resources,
Tony Lindgren828c7072009-03-23 18:23:49 -0700123};
Laurent Pincharta11f6702009-12-14 08:09:07 -0300124#endif
Tony Lindgren828c7072009-03-23 18:23:49 -0700125
Ohad Ben-Cohen1a51a0c2012-01-11 15:28:11 +0200126#if defined(CONFIG_IOMMU_API)
127
Tony Lindgren2ab7c842012-11-02 12:24:14 -0700128#include <linux/platform_data/iommu-omap.h>
Ohad Ben-Cohen1a51a0c2012-01-11 15:28:11 +0200129
Tony Lindgren828c7072009-03-23 18:23:49 -0700130static struct resource omap3isp_resources[] = {
131 {
132 .start = OMAP3430_ISP_BASE,
133 .end = OMAP3430_ISP_END,
134 .flags = IORESOURCE_MEM,
135 },
136 {
Tony Lindgren828c7072009-03-23 18:23:49 -0700137 .start = OMAP3430_ISP_CCP2_BASE,
138 .end = OMAP3430_ISP_CCP2_END,
139 .flags = IORESOURCE_MEM,
140 },
141 {
142 .start = OMAP3430_ISP_CCDC_BASE,
143 .end = OMAP3430_ISP_CCDC_END,
144 .flags = IORESOURCE_MEM,
145 },
146 {
147 .start = OMAP3430_ISP_HIST_BASE,
148 .end = OMAP3430_ISP_HIST_END,
149 .flags = IORESOURCE_MEM,
150 },
151 {
152 .start = OMAP3430_ISP_H3A_BASE,
153 .end = OMAP3430_ISP_H3A_END,
154 .flags = IORESOURCE_MEM,
155 },
156 {
157 .start = OMAP3430_ISP_PREV_BASE,
158 .end = OMAP3430_ISP_PREV_END,
159 .flags = IORESOURCE_MEM,
160 },
161 {
162 .start = OMAP3430_ISP_RESZ_BASE,
163 .end = OMAP3430_ISP_RESZ_END,
164 .flags = IORESOURCE_MEM,
165 },
166 {
167 .start = OMAP3430_ISP_SBL_BASE,
168 .end = OMAP3430_ISP_SBL_END,
169 .flags = IORESOURCE_MEM,
170 },
171 {
Tuukka Toivonen6817a692010-02-02 11:17:33 -0300172 .start = OMAP3430_ISP_CSI2A_REGS1_BASE,
173 .end = OMAP3430_ISP_CSI2A_REGS1_END,
Tony Lindgren828c7072009-03-23 18:23:49 -0700174 .flags = IORESOURCE_MEM,
175 },
176 {
Tuukka Toivonen6817a692010-02-02 11:17:33 -0300177 .start = OMAP3430_ISP_CSIPHY2_BASE,
178 .end = OMAP3430_ISP_CSIPHY2_END,
179 .flags = IORESOURCE_MEM,
180 },
181 {
182 .start = OMAP3630_ISP_CSI2A_REGS2_BASE,
183 .end = OMAP3630_ISP_CSI2A_REGS2_END,
184 .flags = IORESOURCE_MEM,
185 },
186 {
187 .start = OMAP3630_ISP_CSI2C_REGS1_BASE,
188 .end = OMAP3630_ISP_CSI2C_REGS1_END,
189 .flags = IORESOURCE_MEM,
190 },
191 {
192 .start = OMAP3630_ISP_CSIPHY1_BASE,
193 .end = OMAP3630_ISP_CSIPHY1_END,
194 .flags = IORESOURCE_MEM,
195 },
196 {
197 .start = OMAP3630_ISP_CSI2C_REGS2_BASE,
198 .end = OMAP3630_ISP_CSI2C_REGS2_END,
Tony Lindgren828c7072009-03-23 18:23:49 -0700199 .flags = IORESOURCE_MEM,
200 },
201 {
Sakari Ailusc19d19e2012-10-14 07:31:48 -0300202 .start = OMAP343X_CTRL_BASE + OMAP343X_CONTROL_CSIRXFE,
203 .end = OMAP343X_CTRL_BASE + OMAP343X_CONTROL_CSIRXFE + 3,
204 .flags = IORESOURCE_MEM,
205 },
206 {
207 .start = OMAP343X_CTRL_BASE + OMAP3630_CONTROL_CAMERA_PHY_CTRL,
208 .end = OMAP343X_CTRL_BASE + OMAP3630_CONTROL_CAMERA_PHY_CTRL + 3,
209 .flags = IORESOURCE_MEM,
210 },
211 {
Tony Lindgren7d7e1eb2012-08-27 17:43:01 -0700212 .start = 24 + OMAP_INTC_START,
Tony Lindgren828c7072009-03-23 18:23:49 -0700213 .flags = IORESOURCE_IRQ,
214 }
215};
216
217static struct platform_device omap3isp_device = {
218 .name = "omap3isp",
219 .id = -1,
220 .num_resources = ARRAY_SIZE(omap3isp_resources),
221 .resource = omap3isp_resources,
222};
223
Ohad Ben-Cohenc8eaab32011-09-23 16:44:57 +0300224static struct omap_iommu_arch_data omap3_isp_iommu = {
Omar Ramirez Luna72b15b62012-11-19 19:05:50 -0600225 .name = "mmu_isp",
Ohad Ben-Cohenc8eaab32011-09-23 16:44:57 +0300226};
227
Laurent Pincharta11f6702009-12-14 08:09:07 -0300228int omap3_init_camera(struct isp_platform_data *pdata)
Tony Lindgren828c7072009-03-23 18:23:49 -0700229{
Suman Anna0ac4f032014-03-05 18:24:12 -0600230 if (of_have_populated_dt())
231 omap3_isp_iommu.name = "480bd400.mmu";
232
Laurent Pincharta11f6702009-12-14 08:09:07 -0300233 omap3isp_device.dev.platform_data = pdata;
Ohad Ben-Cohenc8eaab32011-09-23 16:44:57 +0300234 omap3isp_device.dev.archdata.iommu = &omap3_isp_iommu;
235
Laurent Pincharta11f6702009-12-14 08:09:07 -0300236 return platform_device_register(&omap3isp_device);
Tony Lindgren828c7072009-03-23 18:23:49 -0700237}
Tony Lindgren828c7072009-03-23 18:23:49 -0700238
Ohad Ben-Cohen1a51a0c2012-01-11 15:28:11 +0200239#else /* !CONFIG_IOMMU_API */
240
241int omap3_init_camera(struct isp_platform_data *pdata)
242{
243 return 0;
244}
245
246#endif
247
Tony Lindgren1dbae812005-11-10 14:26:51 +0000248static inline void omap_init_camera(void)
249{
Sergio Aguirrecfe2cde2010-11-15 11:29:54 -0300250#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
251 if (cpu_is_omap24xx())
252 platform_device_register(&omap2cam_device);
Tony Lindgren1dbae812005-11-10 14:26:51 +0000253#endif
Sergio Aguirrecfe2cde2010-11-15 11:29:54 -0300254}
Tony Lindgren1dbae812005-11-10 14:26:51 +0000255
Suman Annac869c752013-03-12 17:55:29 -0500256#if defined(CONFIG_OMAP2PLUS_MBOX) || defined(CONFIG_OMAP2PLUS_MBOX_MODULE)
Kevin Hilman9cf793f2012-02-20 09:43:30 -0800257static inline void __init omap_init_mbox(void)
Tony Lindgrenc40fae952006-12-07 13:58:10 -0800258{
Felipe Contreras69dbf852011-02-24 12:51:33 -0800259 struct omap_hwmod *oh;
Kevin Hilman3528c582011-07-21 13:48:45 -0700260 struct platform_device *pdev;
Suman Annab8a7cf82013-01-28 17:21:58 -0600261 struct omap_mbox_pdata *pdata;
Felipe Contreras69dbf852011-02-24 12:51:33 -0800262
263 oh = omap_hwmod_lookup("mailbox");
264 if (!oh) {
265 pr_err("%s: unable to find hwmod\n", __func__);
Hiroshi DOYU6c20a682009-03-23 18:07:23 -0700266 return;
267 }
Suman Annab8a7cf82013-01-28 17:21:58 -0600268 if (!oh->dev_attr) {
269 pr_err("%s: hwmod doesn't have valid attrs\n", __func__);
270 return;
271 }
Felipe Contreras69dbf852011-02-24 12:51:33 -0800272
Suman Annab8a7cf82013-01-28 17:21:58 -0600273 pdata = (struct omap_mbox_pdata *)oh->dev_attr;
274 pdev = omap_device_build("omap-mailbox", -1, oh, pdata, sizeof(*pdata));
Kevin Hilman3528c582011-07-21 13:48:45 -0700275 WARN(IS_ERR(pdev), "%s: could not build device, err %ld\n",
276 __func__, PTR_ERR(pdev));
Tony Lindgrenc40fae952006-12-07 13:58:10 -0800277}
278#else
279static inline void omap_init_mbox(void) { }
Suman Annac869c752013-03-12 17:55:29 -0500280#endif /* CONFIG_OMAP2PLUS_MBOX */
Tony Lindgrenc40fae952006-12-07 13:58:10 -0800281
Tony Lindgren9b6553c2006-04-02 17:46:30 +0100282static inline void omap_init_sti(void) {}
Tony Lindgren9b6553c2006-04-02 17:46:30 +0100283
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000284#if defined(CONFIG_SND_SOC) || defined(CONFIG_SND_SOC_MODULE)
285
286static struct platform_device omap_pcm = {
287 .name = "omap-pcm-audio",
288 .id = -1,
289};
290
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000291static void omap_init_audio(void)
292{
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000293 platform_device_register(&omap_pcm);
294}
295
296#else
297static inline void omap_init_audio(void) {}
298#endif
299
Tony Lindgren646e3ed2008-10-06 15:49:36 +0300300#if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE)
Juha Yrjolaed7eb9d2006-06-26 16:16:10 -0700301
Arnd Bergmann22037472012-08-24 15:21:06 +0200302#include <linux/platform_data/spi-omap2-mcspi.h>
Juha Yrjolaed7eb9d2006-06-26 16:16:10 -0700303
Kevin Hilman9cf793f2012-02-20 09:43:30 -0800304static int __init omap_mcspi_init(struct omap_hwmod *oh, void *unused)
Juha Yrjolaed7eb9d2006-06-26 16:16:10 -0700305{
Kevin Hilman3528c582011-07-21 13:48:45 -0700306 struct platform_device *pdev;
Charulatha V1a5d8192011-02-02 17:52:14 +0530307 char *name = "omap2_mcspi";
308 struct omap2_mcspi_platform_config *pdata;
309 static int spi_num;
310 struct omap2_mcspi_dev_attr *mcspi_attrib = oh->dev_attr;
Tony Lindgrenaf41a122009-09-24 16:23:05 -0700311
Charulatha V1a5d8192011-02-02 17:52:14 +0530312 pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
313 if (!pdata) {
314 pr_err("Memory allocation for McSPI device failed\n");
315 return -ENOMEM;
316 }
Tony Lindgrenaf41a122009-09-24 16:23:05 -0700317
Charulatha V1a5d8192011-02-02 17:52:14 +0530318 pdata->num_cs = mcspi_attrib->num_chipselect;
319 switch (oh->class->rev) {
320 case OMAP2_MCSPI_REV:
321 case OMAP3_MCSPI_REV:
322 pdata->regs_offset = 0;
323 break;
324 case OMAP4_MCSPI_REV:
325 pdata->regs_offset = OMAP4_MCSPI_REG_OFFSET;
326 break;
327 default:
328 pr_err("Invalid McSPI Revision value\n");
Julia Lawalle0feca892011-12-23 18:39:31 +0100329 kfree(pdata);
Charulatha V1a5d8192011-02-02 17:52:14 +0530330 return -EINVAL;
331 }
332
333 spi_num++;
Paul Walmsleyc1d1cd52013-01-26 00:48:53 -0700334 pdev = omap_device_build(name, spi_num, oh, pdata, sizeof(*pdata));
Kevin Hilman3528c582011-07-21 13:48:45 -0700335 WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s\n",
Charulatha V1a5d8192011-02-02 17:52:14 +0530336 name, oh->name);
337 kfree(pdata);
338 return 0;
Tony Lindgrenaf41a122009-09-24 16:23:05 -0700339}
Tony Lindgrenaf41a122009-09-24 16:23:05 -0700340
341static void omap_init_mcspi(void)
342{
Charulatha V1a5d8192011-02-02 17:52:14 +0530343 omap_hwmod_for_each_by_class("mcspi", omap_mcspi_init, NULL);
Juha Yrjolaed7eb9d2006-06-26 16:16:10 -0700344}
345
346#else
347static inline void omap_init_mcspi(void) {}
348#endif
349
Paul Walmsley4848d462012-09-23 17:28:27 -0600350/**
351 * omap_init_rng - bind the RNG hwmod to the RNG omap_device
352 *
353 * Bind the RNG hwmod to the RNG omap_device. No return value.
354 */
355static void omap_init_rng(void)
356{
357 struct omap_hwmod *oh;
358 struct platform_device *pdev;
359
360 oh = omap_hwmod_lookup("rng");
361 if (!oh)
362 return;
363
Paul Walmsleyc1d1cd52013-01-26 00:48:53 -0700364 pdev = omap_device_build("omap_rng", -1, oh, NULL, 0);
Paul Walmsley4848d462012-09-23 17:28:27 -0600365 WARN(IS_ERR(pdev), "Can't build omap_device for omap_rng\n");
366}
Will Deacon88341332010-04-09 13:54:43 +0100367
Mark A. Greer26f88e62013-03-18 10:06:32 -0600368static void __init omap_init_sham(void)
Tony Lindgren646e3ed2008-10-06 15:49:36 +0300369{
Mark A. Greer8c7bb572013-03-18 10:06:33 -0600370 struct omap_hwmod *oh;
371 struct platform_device *pdev;
Mark A. Greere569e992013-03-30 15:49:19 -0600372
Mark A. Greer8c7bb572013-03-18 10:06:33 -0600373 oh = omap_hwmod_lookup("sham");
374 if (!oh)
375 return;
Mark A. Greere569e992013-03-30 15:49:19 -0600376
Mark A. Greer8c7bb572013-03-18 10:06:33 -0600377 pdev = omap_device_build("omap-sham", -1, oh, NULL, 0);
378 WARN(IS_ERR(pdev), "Can't build omap_device for omap-sham\n");
Tony Lindgren646e3ed2008-10-06 15:49:36 +0300379}
Tony Lindgren646e3ed2008-10-06 15:49:36 +0300380
Mark A. Greer14ae5562012-12-21 09:28:10 -0700381static void __init omap_init_aes(void)
Dmitry Kasatkinb744c672010-09-03 19:13:55 +0800382{
Mark A. Greer77e2fd82012-12-21 09:28:11 -0700383 struct omap_hwmod *oh;
384 struct platform_device *pdev;
Mark A. Greer660ffd62012-12-21 09:28:09 -0700385
Mark A. Greer77e2fd82012-12-21 09:28:11 -0700386 oh = omap_hwmod_lookup("aes");
387 if (!oh)
388 return;
Mark A. Greer660ffd62012-12-21 09:28:09 -0700389
Mark A. Greer77e2fd82012-12-21 09:28:11 -0700390 pdev = omap_device_build("omap-aes", -1, oh, NULL, 0);
391 WARN(IS_ERR(pdev), "Can't build omap_device for omap-aes\n");
Dmitry Kasatkinb744c672010-09-03 19:13:55 +0800392}
393
Tony Lindgrend8874662008-12-10 17:37:16 -0800394/*-------------------------------------------------------------------------*/
395
Vaibhav Hiremathb2273582010-05-10 14:29:14 -0700396#if defined(CONFIG_VIDEO_OMAP2_VOUT) || \
397 defined(CONFIG_VIDEO_OMAP2_VOUT_MODULE)
398#if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
399static struct resource omap_vout_resource[3 - CONFIG_FB_OMAP2_NUM_FBS] = {
400};
401#else
402static struct resource omap_vout_resource[2] = {
403};
404#endif
405
406static struct platform_device omap_vout_device = {
407 .name = "omap_vout",
408 .num_resources = ARRAY_SIZE(omap_vout_resource),
409 .resource = &omap_vout_resource[0],
410 .id = -1,
411};
Archit Taneja576e5bd2013-09-16 12:48:31 +0530412
413int __init omap_init_vout(void)
Vaibhav Hiremathb2273582010-05-10 14:29:14 -0700414{
Archit Taneja576e5bd2013-09-16 12:48:31 +0530415 return platform_device_register(&omap_vout_device);
Vaibhav Hiremathb2273582010-05-10 14:29:14 -0700416}
417#else
Archit Taneja576e5bd2013-09-16 12:48:31 +0530418int __init omap_init_vout(void) { return 0; }
Vaibhav Hiremathb2273582010-05-10 14:29:14 -0700419#endif
420
Tony Lindgren1dbae812005-11-10 14:26:51 +0000421/*-------------------------------------------------------------------------*/
422
423static int __init omap2_init_devices(void)
424{
Matt Porter484202f2012-09-17 16:26:11 -0700425 /* Enable dummy states for those platforms without pinctrl support */
426 if (!of_have_populated_dt())
427 pinctrl_provide_dummies();
428
Paul Walmsley81fbc5ef2010-12-21 19:56:17 -0700429 /*
430 * please keep these calls, and their implementations above,
Tony Lindgren1dbae812005-11-10 14:26:51 +0000431 * in alphabetical order so they're easier to sort through.
432 */
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000433 omap_init_audio();
Tony Lindgren828c7072009-03-23 18:23:49 -0700434 omap_init_camera();
Benoit Coussonefcf1e52012-01-20 14:15:58 +0100435 /* If dtb is there, the devices will be created dynamically */
Peter Ujfalusi259bd6c2012-05-02 15:23:18 +0300436 if (!of_have_populated_dt()) {
Suman Annadbd5f462014-07-11 16:44:40 -0500437 omap_init_mbox();
Benoit Coussonefcf1e52012-01-20 14:15:58 +0100438 omap_init_mcspi();
Mark A. Greer114d7a82013-03-18 10:06:33 -0600439 omap_init_sham();
Mark A. Greer53335ac2012-12-21 09:28:12 -0700440 omap_init_aes();
Lokesh Vutla674ee082013-08-05 20:17:22 +0530441 omap_init_rng();
Peter Ujfalusi259bd6c2012-05-02 15:23:18 +0300442 }
Tony Lindgren9b6553c2006-04-02 17:46:30 +0100443 omap_init_sti();
Tony Lindgren1dbae812005-11-10 14:26:51 +0000444
445 return 0;
446}
Tony Lindgrenb76c8b12013-01-11 11:24:18 -0800447omap_arch_initcall(omap2_init_devices);