Thomas Gleixner | 2874c5f | 2019-05-27 08:55:01 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 2 | /* |
| 3 | * linux/arch/arm/mach-omap2/devices.c |
| 4 | * |
| 5 | * OMAP2 platform device setup/initialization |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 6 | */ |
Suman Anna | 1ff4cb6 | 2018-02-12 19:32:43 -0600 | [diff] [blame] | 7 | |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 8 | #include <linux/kernel.h> |
| 9 | #include <linux/init.h> |
| 10 | #include <linux/platform_device.h> |
Russell King | fced80c | 2008-09-06 12:10:45 +0100 | [diff] [blame] | 11 | #include <linux/io.h> |
Kevin Hilman | 917fa28 | 2008-12-10 17:37:17 -0800 | [diff] [blame] | 12 | #include <linux/clk.h> |
Hans Verkuil | 0bf63e2 | 2019-07-30 03:17:59 -0300 | [diff] [blame] | 13 | #include <linux/dma-mapping.h> |
Varadarajan, Charulatha | f2ce623 | 2010-09-23 20:02:42 +0530 | [diff] [blame] | 14 | #include <linux/err.h> |
Charulatha V | 1a5d819 | 2011-02-02 17:52:14 +0530 | [diff] [blame] | 15 | #include <linux/slab.h> |
Benoit Cousson | ad8dfac | 2011-08-12 13:48:47 +0200 | [diff] [blame] | 16 | #include <linux/of.h> |
Matt Porter | 484202f | 2012-09-17 16:26:11 -0700 | [diff] [blame] | 17 | #include <linux/pinctrl/machine.h> |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 18 | |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 19 | #include <asm/mach-types.h> |
| 20 | #include <asm/mach/map.h> |
| 21 | |
Tony Lindgren | 45c3eb7 | 2012-11-30 08:41:50 -0800 | [diff] [blame] | 22 | #include <linux/omap-dma.h> |
Tony Lindgren | 2a296c8 | 2012-10-02 17:41:35 -0700 | [diff] [blame] | 23 | |
Tony Lindgren | ee0839c | 2012-02-24 10:34:35 -0800 | [diff] [blame] | 24 | #include "iomap.h" |
Tony Lindgren | 2a296c8 | 2012-10-02 17:41:35 -0700 | [diff] [blame] | 25 | #include "omap_hwmod.h" |
Tony Lindgren | 25c7d49 | 2012-10-02 17:25:48 -0700 | [diff] [blame] | 26 | #include "omap_device.h" |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 27 | |
Tony Lindgren | 7d7e1eb | 2012-08-27 17:43:01 -0700 | [diff] [blame] | 28 | #include "soc.h" |
| 29 | #include "common.h" |
Paul Walmsley | 4814ced | 2010-10-08 11:40:20 -0600 | [diff] [blame] | 30 | #include "control.h" |
Archit Taneja | 576e5bd | 2013-09-16 12:48:31 +0530 | [diff] [blame] | 31 | #include "display.h" |
Tony Lindgren | 4896e39 | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 32 | |
sricharan | 0abcf61 | 2011-02-08 14:10:45 +0530 | [diff] [blame] | 33 | #define L3_MODULES_MAX_LEN 12 |
sricharan | a4dc616 | 2011-03-09 16:00:29 +0530 | [diff] [blame] | 34 | #define L3_MODULES 3 |
sricharan | 0abcf61 | 2011-02-08 14:10:45 +0530 | [diff] [blame] | 35 | |
Tony Lindgren | d887466 | 2008-12-10 17:37:16 -0800 | [diff] [blame] | 36 | /*-------------------------------------------------------------------------*/ |
| 37 | |
Javier Martinez Canillas | 502ad2a | 2016-08-11 15:29:45 -0400 | [diff] [blame] | 38 | #if IS_ENABLED(CONFIG_VIDEO_OMAP2_VOUT) |
| 39 | #if IS_ENABLED(CONFIG_FB_OMAP2) |
Vaibhav Hiremath | b227358 | 2010-05-10 14:29:14 -0700 | [diff] [blame] | 40 | static struct resource omap_vout_resource[3 - CONFIG_FB_OMAP2_NUM_FBS] = { |
| 41 | }; |
| 42 | #else |
| 43 | static struct resource omap_vout_resource[2] = { |
| 44 | }; |
| 45 | #endif |
| 46 | |
Hans Verkuil | 0bf63e2 | 2019-07-30 03:17:59 -0300 | [diff] [blame] | 47 | static u64 omap_vout_dma_mask = DMA_BIT_MASK(32); |
| 48 | |
Vaibhav Hiremath | b227358 | 2010-05-10 14:29:14 -0700 | [diff] [blame] | 49 | static 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 Verkuil | 0bf63e2 | 2019-07-30 03:17:59 -0300 | [diff] [blame] | 54 | .dev = { |
| 55 | .dma_mask = &omap_vout_dma_mask, |
| 56 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 57 | }, |
Vaibhav Hiremath | b227358 | 2010-05-10 14:29:14 -0700 | [diff] [blame] | 58 | }; |
Archit Taneja | 576e5bd | 2013-09-16 12:48:31 +0530 | [diff] [blame] | 59 | |
| 60 | int __init omap_init_vout(void) |
Vaibhav Hiremath | b227358 | 2010-05-10 14:29:14 -0700 | [diff] [blame] | 61 | { |
Archit Taneja | 576e5bd | 2013-09-16 12:48:31 +0530 | [diff] [blame] | 62 | return platform_device_register(&omap_vout_device); |
Vaibhav Hiremath | b227358 | 2010-05-10 14:29:14 -0700 | [diff] [blame] | 63 | } |
| 64 | #else |
Archit Taneja | 576e5bd | 2013-09-16 12:48:31 +0530 | [diff] [blame] | 65 | int __init omap_init_vout(void) { return 0; } |
Vaibhav Hiremath | b227358 | 2010-05-10 14:29:14 -0700 | [diff] [blame] | 66 | #endif |