blob: 5a2e198e7db103843b3fc159f14f7a1b160b587d [file] [log] [blame]
Thomas Gleixner2874c5f2019-05-27 08:55:01 +02001// SPDX-License-Identifier: GPL-2.0-or-later
Tony Lindgren1dbae812005-11-10 14:26:51 +00002/*
3 * linux/arch/arm/mach-omap2/devices.c
4 *
5 * OMAP2 platform device setup/initialization
Tony Lindgren1dbae812005-11-10 14:26:51 +00006 */
Suman Anna1ff4cb62018-02-12 19:32:43 -06007
Tony Lindgren1dbae812005-11-10 14:26:51 +00008#include <linux/kernel.h>
9#include <linux/init.h>
10#include <linux/platform_device.h>
Russell Kingfced80c2008-09-06 12:10:45 +010011#include <linux/io.h>
Kevin Hilman917fa282008-12-10 17:37:17 -080012#include <linux/clk.h>
Hans Verkuil0bf63e22019-07-30 03:17:59 -030013#include <linux/dma-mapping.h>
Varadarajan, Charulathaf2ce6232010-09-23 20:02:42 +053014#include <linux/err.h>
Charulatha V1a5d8192011-02-02 17:52:14 +053015#include <linux/slab.h>
Benoit Coussonad8dfac2011-08-12 13:48:47 +020016#include <linux/of.h>
Matt Porter484202f2012-09-17 16:26:11 -070017#include <linux/pinctrl/machine.h>
Tony Lindgren1dbae812005-11-10 14:26:51 +000018
Tony Lindgren1dbae812005-11-10 14:26:51 +000019#include <asm/mach-types.h>
20#include <asm/mach/map.h>
21
Tony Lindgren45c3eb72012-11-30 08:41:50 -080022#include <linux/omap-dma.h>
Tony Lindgren2a296c82012-10-02 17:41:35 -070023
Tony Lindgrenee0839c2012-02-24 10:34:35 -080024#include "iomap.h"
Tony Lindgren2a296c82012-10-02 17:41:35 -070025#include "omap_hwmod.h"
Tony Lindgren25c7d492012-10-02 17:25:48 -070026#include "omap_device.h"
Tony Lindgren1dbae812005-11-10 14:26:51 +000027
Tony Lindgren7d7e1eb2012-08-27 17:43:01 -070028#include "soc.h"
29#include "common.h"
Paul Walmsley4814ced2010-10-08 11:40:20 -060030#include "control.h"
Archit Taneja576e5bd2013-09-16 12:48:31 +053031#include "display.h"
Tony Lindgren4896e392009-12-11 16:16:32 -080032
sricharan0abcf612011-02-08 14:10:45 +053033#define L3_MODULES_MAX_LEN 12
sricharana4dc6162011-03-09 16:00:29 +053034#define L3_MODULES 3
sricharan0abcf612011-02-08 14:10:45 +053035
Tony Lindgrend8874662008-12-10 17:37:16 -080036/*-------------------------------------------------------------------------*/
37
Javier Martinez Canillas502ad2a2016-08-11 15:29:45 -040038#if IS_ENABLED(CONFIG_VIDEO_OMAP2_VOUT)
39#if IS_ENABLED(CONFIG_FB_OMAP2)
Vaibhav Hiremathb2273582010-05-10 14:29:14 -070040static struct resource omap_vout_resource[3 - CONFIG_FB_OMAP2_NUM_FBS] = {
41};
42#else
43static struct resource omap_vout_resource[2] = {
44};
45#endif
46
Hans Verkuil0bf63e22019-07-30 03:17:59 -030047static u64 omap_vout_dma_mask = DMA_BIT_MASK(32);
48
Vaibhav Hiremathb2273582010-05-10 14:29:14 -070049static struct platform_device omap_vout_device = {
50 .name = "omap_vout",
51 .num_resources = ARRAY_SIZE(omap_vout_resource),
52 .resource = &omap_vout_resource[0],
53 .id = -1,
Hans Verkuil0bf63e22019-07-30 03:17:59 -030054 .dev = {
55 .dma_mask = &omap_vout_dma_mask,
56 .coherent_dma_mask = DMA_BIT_MASK(32),
57 },
Vaibhav Hiremathb2273582010-05-10 14:29:14 -070058};
Archit Taneja576e5bd2013-09-16 12:48:31 +053059
60int __init omap_init_vout(void)
Vaibhav Hiremathb2273582010-05-10 14:29:14 -070061{
Archit Taneja576e5bd2013-09-16 12:48:31 +053062 return platform_device_register(&omap_vout_device);
Vaibhav Hiremathb2273582010-05-10 14:29:14 -070063}
64#else
Archit Taneja576e5bd2013-09-16 12:48:31 +053065int __init omap_init_vout(void) { return 0; }
Vaibhav Hiremathb2273582010-05-10 14:29:14 -070066#endif