Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 11 | |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 12 | #include <linux/kernel.h> |
| 13 | #include <linux/init.h> |
| 14 | #include <linux/platform_device.h> |
Russell King | fced80c | 2008-09-06 12:10:45 +0100 | [diff] [blame] | 15 | #include <linux/io.h> |
Kevin Hilman | 917fa28 | 2008-12-10 17:37:17 -0800 | [diff] [blame] | 16 | #include <linux/clk.h> |
Varadarajan, Charulatha | f2ce623 | 2010-09-23 20:02:42 +0530 | [diff] [blame] | 17 | #include <linux/err.h> |
Charulatha V | 1a5d819 | 2011-02-02 17:52:14 +0530 | [diff] [blame] | 18 | #include <linux/slab.h> |
Benoit Cousson | ad8dfac | 2011-08-12 13:48:47 +0200 | [diff] [blame^] | 19 | #include <linux/of.h> |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 20 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 21 | #include <mach/hardware.h> |
Will Deacon | 8834133 | 2010-04-09 13:54:43 +0100 | [diff] [blame] | 22 | #include <mach/irqs.h> |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 23 | #include <asm/mach-types.h> |
| 24 | #include <asm/mach/map.h> |
Will Deacon | 8834133 | 2010-04-09 13:54:43 +0100 | [diff] [blame] | 25 | #include <asm/pmu.h> |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 26 | |
Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 27 | #include <plat/tc.h> |
| 28 | #include <plat/board.h> |
Jarkko Nikula | a09f73f | 2010-10-04 15:04:53 +0300 | [diff] [blame] | 29 | #include <plat/mcbsp.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 30 | #include <mach/gpio.h> |
Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 31 | #include <plat/mmc.h> |
Dmitry Kasatkin | ee5500c | 2010-05-03 11:10:03 +0800 | [diff] [blame] | 32 | #include <plat/dma.h> |
Varadarajan, Charulatha | f2ce623 | 2010-09-23 20:02:42 +0530 | [diff] [blame] | 33 | #include <plat/omap_hwmod.h> |
| 34 | #include <plat/omap_device.h> |
Syed Rafiuddin | 5955676 | 2010-12-27 05:51:45 +0000 | [diff] [blame] | 35 | #include <plat/omap4-keypad.h> |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 36 | |
Tony Lindgren | 4896e39 | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 37 | #include "mux.h" |
Paul Walmsley | 4814ced | 2010-10-08 11:40:20 -0600 | [diff] [blame] | 38 | #include "control.h" |
Laurent Pinchart | a11f670 | 2009-12-14 08:09:07 -0300 | [diff] [blame] | 39 | #include "devices.h" |
Tony Lindgren | 4896e39 | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 40 | |
sricharan | 0abcf61 | 2011-02-08 14:10:45 +0530 | [diff] [blame] | 41 | #define L3_MODULES_MAX_LEN 12 |
sricharan | a4dc616 | 2011-03-09 16:00:29 +0530 | [diff] [blame] | 42 | #define L3_MODULES 3 |
sricharan | 0abcf61 | 2011-02-08 14:10:45 +0530 | [diff] [blame] | 43 | |
| 44 | static int __init omap3_l3_init(void) |
| 45 | { |
| 46 | int l; |
| 47 | struct omap_hwmod *oh; |
Kevin Hilman | 3528c58 | 2011-07-21 13:48:45 -0700 | [diff] [blame] | 48 | struct platform_device *pdev; |
sricharan | 0abcf61 | 2011-02-08 14:10:45 +0530 | [diff] [blame] | 49 | char oh_name[L3_MODULES_MAX_LEN]; |
| 50 | |
| 51 | /* |
| 52 | * To avoid code running on other OMAPs in |
| 53 | * multi-omap builds |
| 54 | */ |
| 55 | if (!(cpu_is_omap34xx())) |
| 56 | return -ENODEV; |
| 57 | |
| 58 | l = snprintf(oh_name, L3_MODULES_MAX_LEN, "l3_main"); |
| 59 | |
| 60 | oh = omap_hwmod_lookup(oh_name); |
| 61 | |
| 62 | if (!oh) |
| 63 | pr_err("could not look up %s\n", oh_name); |
| 64 | |
Kevin Hilman | 3528c58 | 2011-07-21 13:48:45 -0700 | [diff] [blame] | 65 | pdev = omap_device_build("omap_l3_smx", 0, oh, NULL, 0, |
sricharan | 0abcf61 | 2011-02-08 14:10:45 +0530 | [diff] [blame] | 66 | NULL, 0, 0); |
| 67 | |
Kevin Hilman | 3528c58 | 2011-07-21 13:48:45 -0700 | [diff] [blame] | 68 | WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name); |
sricharan | 0abcf61 | 2011-02-08 14:10:45 +0530 | [diff] [blame] | 69 | |
Kevin Hilman | 3528c58 | 2011-07-21 13:48:45 -0700 | [diff] [blame] | 70 | return IS_ERR(pdev) ? PTR_ERR(pdev) : 0; |
sricharan | 0abcf61 | 2011-02-08 14:10:45 +0530 | [diff] [blame] | 71 | } |
| 72 | postcore_initcall(omap3_l3_init); |
| 73 | |
sricharan | a4dc616 | 2011-03-09 16:00:29 +0530 | [diff] [blame] | 74 | static int __init omap4_l3_init(void) |
| 75 | { |
| 76 | int l, i; |
| 77 | struct omap_hwmod *oh[3]; |
Kevin Hilman | 3528c58 | 2011-07-21 13:48:45 -0700 | [diff] [blame] | 78 | struct platform_device *pdev; |
sricharan | a4dc616 | 2011-03-09 16:00:29 +0530 | [diff] [blame] | 79 | char oh_name[L3_MODULES_MAX_LEN]; |
| 80 | |
Benoit Cousson | ad8dfac | 2011-08-12 13:48:47 +0200 | [diff] [blame^] | 81 | /* If dtb is there, the devices will be created dynamically */ |
| 82 | if (of_have_populated_dt()) |
| 83 | return -ENODEV; |
| 84 | |
sricharan | a4dc616 | 2011-03-09 16:00:29 +0530 | [diff] [blame] | 85 | /* |
| 86 | * To avoid code running on other OMAPs in |
| 87 | * multi-omap builds |
| 88 | */ |
| 89 | if (!(cpu_is_omap44xx())) |
| 90 | return -ENODEV; |
| 91 | |
| 92 | for (i = 0; i < L3_MODULES; i++) { |
| 93 | l = snprintf(oh_name, L3_MODULES_MAX_LEN, "l3_main_%d", i+1); |
| 94 | |
| 95 | oh[i] = omap_hwmod_lookup(oh_name); |
| 96 | if (!(oh[i])) |
| 97 | pr_err("could not look up %s\n", oh_name); |
| 98 | } |
| 99 | |
Kevin Hilman | 3528c58 | 2011-07-21 13:48:45 -0700 | [diff] [blame] | 100 | pdev = omap_device_build_ss("omap_l3_noc", 0, oh, 3, NULL, |
sricharan | a4dc616 | 2011-03-09 16:00:29 +0530 | [diff] [blame] | 101 | 0, NULL, 0, 0); |
| 102 | |
Kevin Hilman | 3528c58 | 2011-07-21 13:48:45 -0700 | [diff] [blame] | 103 | WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name); |
sricharan | a4dc616 | 2011-03-09 16:00:29 +0530 | [diff] [blame] | 104 | |
Kevin Hilman | 3528c58 | 2011-07-21 13:48:45 -0700 | [diff] [blame] | 105 | return IS_ERR(pdev) ? PTR_ERR(pdev) : 0; |
sricharan | a4dc616 | 2011-03-09 16:00:29 +0530 | [diff] [blame] | 106 | } |
| 107 | postcore_initcall(omap4_l3_init); |
| 108 | |
Tony Lindgren | 828c707 | 2009-03-23 18:23:49 -0700 | [diff] [blame] | 109 | #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 110 | |
Sergio Aguirre | cfe2cde | 2010-11-15 11:29:54 -0300 | [diff] [blame] | 111 | static struct resource omap2cam_resources[] = { |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 112 | { |
Tony Lindgren | 828c707 | 2009-03-23 18:23:49 -0700 | [diff] [blame] | 113 | .start = OMAP24XX_CAMERA_BASE, |
| 114 | .end = OMAP24XX_CAMERA_BASE + 0xfff, |
| 115 | .flags = IORESOURCE_MEM, |
| 116 | }, |
| 117 | { |
| 118 | .start = INT_24XX_CAM_IRQ, |
| 119 | .flags = IORESOURCE_IRQ, |
| 120 | } |
| 121 | }; |
| 122 | |
Sergio Aguirre | cfe2cde | 2010-11-15 11:29:54 -0300 | [diff] [blame] | 123 | static struct platform_device omap2cam_device = { |
Tony Lindgren | 828c707 | 2009-03-23 18:23:49 -0700 | [diff] [blame] | 124 | .name = "omap24xxcam", |
| 125 | .id = -1, |
Sergio Aguirre | cfe2cde | 2010-11-15 11:29:54 -0300 | [diff] [blame] | 126 | .num_resources = ARRAY_SIZE(omap2cam_resources), |
| 127 | .resource = omap2cam_resources, |
Tony Lindgren | 828c707 | 2009-03-23 18:23:49 -0700 | [diff] [blame] | 128 | }; |
Laurent Pinchart | a11f670 | 2009-12-14 08:09:07 -0300 | [diff] [blame] | 129 | #endif |
Tony Lindgren | 828c707 | 2009-03-23 18:23:49 -0700 | [diff] [blame] | 130 | |
| 131 | static struct resource omap3isp_resources[] = { |
| 132 | { |
| 133 | .start = OMAP3430_ISP_BASE, |
| 134 | .end = OMAP3430_ISP_END, |
| 135 | .flags = IORESOURCE_MEM, |
| 136 | }, |
| 137 | { |
Tony Lindgren | 828c707 | 2009-03-23 18:23:49 -0700 | [diff] [blame] | 138 | .start = OMAP3430_ISP_CCP2_BASE, |
| 139 | .end = OMAP3430_ISP_CCP2_END, |
| 140 | .flags = IORESOURCE_MEM, |
| 141 | }, |
| 142 | { |
| 143 | .start = OMAP3430_ISP_CCDC_BASE, |
| 144 | .end = OMAP3430_ISP_CCDC_END, |
| 145 | .flags = IORESOURCE_MEM, |
| 146 | }, |
| 147 | { |
| 148 | .start = OMAP3430_ISP_HIST_BASE, |
| 149 | .end = OMAP3430_ISP_HIST_END, |
| 150 | .flags = IORESOURCE_MEM, |
| 151 | }, |
| 152 | { |
| 153 | .start = OMAP3430_ISP_H3A_BASE, |
| 154 | .end = OMAP3430_ISP_H3A_END, |
| 155 | .flags = IORESOURCE_MEM, |
| 156 | }, |
| 157 | { |
| 158 | .start = OMAP3430_ISP_PREV_BASE, |
| 159 | .end = OMAP3430_ISP_PREV_END, |
| 160 | .flags = IORESOURCE_MEM, |
| 161 | }, |
| 162 | { |
| 163 | .start = OMAP3430_ISP_RESZ_BASE, |
| 164 | .end = OMAP3430_ISP_RESZ_END, |
| 165 | .flags = IORESOURCE_MEM, |
| 166 | }, |
| 167 | { |
| 168 | .start = OMAP3430_ISP_SBL_BASE, |
| 169 | .end = OMAP3430_ISP_SBL_END, |
| 170 | .flags = IORESOURCE_MEM, |
| 171 | }, |
| 172 | { |
Tuukka Toivonen | 6817a69 | 2010-02-02 11:17:33 -0300 | [diff] [blame] | 173 | .start = OMAP3430_ISP_CSI2A_REGS1_BASE, |
| 174 | .end = OMAP3430_ISP_CSI2A_REGS1_END, |
Tony Lindgren | 828c707 | 2009-03-23 18:23:49 -0700 | [diff] [blame] | 175 | .flags = IORESOURCE_MEM, |
| 176 | }, |
| 177 | { |
Tuukka Toivonen | 6817a69 | 2010-02-02 11:17:33 -0300 | [diff] [blame] | 178 | .start = OMAP3430_ISP_CSIPHY2_BASE, |
| 179 | .end = OMAP3430_ISP_CSIPHY2_END, |
| 180 | .flags = IORESOURCE_MEM, |
| 181 | }, |
| 182 | { |
| 183 | .start = OMAP3630_ISP_CSI2A_REGS2_BASE, |
| 184 | .end = OMAP3630_ISP_CSI2A_REGS2_END, |
| 185 | .flags = IORESOURCE_MEM, |
| 186 | }, |
| 187 | { |
| 188 | .start = OMAP3630_ISP_CSI2C_REGS1_BASE, |
| 189 | .end = OMAP3630_ISP_CSI2C_REGS1_END, |
| 190 | .flags = IORESOURCE_MEM, |
| 191 | }, |
| 192 | { |
| 193 | .start = OMAP3630_ISP_CSIPHY1_BASE, |
| 194 | .end = OMAP3630_ISP_CSIPHY1_END, |
| 195 | .flags = IORESOURCE_MEM, |
| 196 | }, |
| 197 | { |
| 198 | .start = OMAP3630_ISP_CSI2C_REGS2_BASE, |
| 199 | .end = OMAP3630_ISP_CSI2C_REGS2_END, |
Tony Lindgren | 828c707 | 2009-03-23 18:23:49 -0700 | [diff] [blame] | 200 | .flags = IORESOURCE_MEM, |
| 201 | }, |
| 202 | { |
| 203 | .start = INT_34XX_CAM_IRQ, |
| 204 | .flags = IORESOURCE_IRQ, |
| 205 | } |
| 206 | }; |
| 207 | |
| 208 | static struct platform_device omap3isp_device = { |
| 209 | .name = "omap3isp", |
| 210 | .id = -1, |
| 211 | .num_resources = ARRAY_SIZE(omap3isp_resources), |
| 212 | .resource = omap3isp_resources, |
| 213 | }; |
| 214 | |
Laurent Pinchart | a11f670 | 2009-12-14 08:09:07 -0300 | [diff] [blame] | 215 | int omap3_init_camera(struct isp_platform_data *pdata) |
Tony Lindgren | 828c707 | 2009-03-23 18:23:49 -0700 | [diff] [blame] | 216 | { |
Laurent Pinchart | a11f670 | 2009-12-14 08:09:07 -0300 | [diff] [blame] | 217 | omap3isp_device.dev.platform_data = pdata; |
| 218 | return platform_device_register(&omap3isp_device); |
Tony Lindgren | 828c707 | 2009-03-23 18:23:49 -0700 | [diff] [blame] | 219 | } |
Tony Lindgren | 828c707 | 2009-03-23 18:23:49 -0700 | [diff] [blame] | 220 | |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 221 | static inline void omap_init_camera(void) |
| 222 | { |
Sergio Aguirre | cfe2cde | 2010-11-15 11:29:54 -0300 | [diff] [blame] | 223 | #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) |
| 224 | if (cpu_is_omap24xx()) |
| 225 | platform_device_register(&omap2cam_device); |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 226 | #endif |
Sergio Aguirre | cfe2cde | 2010-11-15 11:29:54 -0300 | [diff] [blame] | 227 | } |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 228 | |
Syed Rafiuddin | 5955676 | 2010-12-27 05:51:45 +0000 | [diff] [blame] | 229 | int __init omap4_keyboard_init(struct omap4_keypad_platform_data |
Shubhrajyoti Datta | f67df6c | 2011-07-05 03:38:24 -0700 | [diff] [blame] | 230 | *sdp4430_keypad_data, struct omap_board_data *bdata) |
Syed Rafiuddin | 5955676 | 2010-12-27 05:51:45 +0000 | [diff] [blame] | 231 | { |
Kevin Hilman | 3528c58 | 2011-07-21 13:48:45 -0700 | [diff] [blame] | 232 | struct platform_device *pdev; |
Syed Rafiuddin | 5955676 | 2010-12-27 05:51:45 +0000 | [diff] [blame] | 233 | struct omap_hwmod *oh; |
| 234 | struct omap4_keypad_platform_data *keypad_data; |
| 235 | unsigned int id = -1; |
| 236 | char *oh_name = "kbd"; |
| 237 | char *name = "omap4-keypad"; |
| 238 | |
| 239 | oh = omap_hwmod_lookup(oh_name); |
| 240 | if (!oh) { |
| 241 | pr_err("Could not look up %s\n", oh_name); |
| 242 | return -ENODEV; |
| 243 | } |
| 244 | |
| 245 | keypad_data = sdp4430_keypad_data; |
| 246 | |
Kevin Hilman | 3528c58 | 2011-07-21 13:48:45 -0700 | [diff] [blame] | 247 | pdev = omap_device_build(name, id, oh, keypad_data, |
Benoit Cousson | f718e2c | 2011-08-10 15:30:09 +0200 | [diff] [blame] | 248 | sizeof(struct omap4_keypad_platform_data), NULL, 0, 0); |
Syed Rafiuddin | 5955676 | 2010-12-27 05:51:45 +0000 | [diff] [blame] | 249 | |
Kevin Hilman | 3528c58 | 2011-07-21 13:48:45 -0700 | [diff] [blame] | 250 | if (IS_ERR(pdev)) { |
Lucas De Marchi | 25985ed | 2011-03-30 22:57:33 -0300 | [diff] [blame] | 251 | WARN(1, "Can't build omap_device for %s:%s.\n", |
Syed Rafiuddin | 5955676 | 2010-12-27 05:51:45 +0000 | [diff] [blame] | 252 | name, oh->name); |
Kevin Hilman | 3528c58 | 2011-07-21 13:48:45 -0700 | [diff] [blame] | 253 | return PTR_ERR(pdev); |
Syed Rafiuddin | 5955676 | 2010-12-27 05:51:45 +0000 | [diff] [blame] | 254 | } |
Shubhrajyoti Datta | f67df6c | 2011-07-05 03:38:24 -0700 | [diff] [blame] | 255 | oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt); |
Syed Rafiuddin | 5955676 | 2010-12-27 05:51:45 +0000 | [diff] [blame] | 256 | |
| 257 | return 0; |
| 258 | } |
| 259 | |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 260 | #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 261 | static inline void omap_init_mbox(void) |
| 262 | { |
Felipe Contreras | 69dbf85 | 2011-02-24 12:51:33 -0800 | [diff] [blame] | 263 | struct omap_hwmod *oh; |
Kevin Hilman | 3528c58 | 2011-07-21 13:48:45 -0700 | [diff] [blame] | 264 | struct platform_device *pdev; |
Felipe Contreras | 69dbf85 | 2011-02-24 12:51:33 -0800 | [diff] [blame] | 265 | |
| 266 | oh = omap_hwmod_lookup("mailbox"); |
| 267 | if (!oh) { |
| 268 | pr_err("%s: unable to find hwmod\n", __func__); |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 269 | return; |
| 270 | } |
Felipe Contreras | 69dbf85 | 2011-02-24 12:51:33 -0800 | [diff] [blame] | 271 | |
Benoit Cousson | f718e2c | 2011-08-10 15:30:09 +0200 | [diff] [blame] | 272 | pdev = omap_device_build("omap-mailbox", -1, oh, NULL, 0, NULL, 0, 0); |
Kevin Hilman | 3528c58 | 2011-07-21 13:48:45 -0700 | [diff] [blame] | 273 | WARN(IS_ERR(pdev), "%s: could not build device, err %ld\n", |
| 274 | __func__, PTR_ERR(pdev)); |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 275 | } |
| 276 | #else |
| 277 | static inline void omap_init_mbox(void) { } |
Hiroshi DOYU | 6c20a68 | 2009-03-23 18:07:23 -0700 | [diff] [blame] | 278 | #endif /* CONFIG_OMAP_MBOX_FWK */ |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 279 | |
Tony Lindgren | 9b6553c | 2006-04-02 17:46:30 +0100 | [diff] [blame] | 280 | static inline void omap_init_sti(void) {} |
Tony Lindgren | 9b6553c | 2006-04-02 17:46:30 +0100 | [diff] [blame] | 281 | |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 282 | #if defined(CONFIG_SND_SOC) || defined(CONFIG_SND_SOC_MODULE) |
| 283 | |
| 284 | static struct platform_device omap_pcm = { |
| 285 | .name = "omap-pcm-audio", |
| 286 | .id = -1, |
| 287 | }; |
| 288 | |
| 289 | /* |
| 290 | * OMAP2420 has 2 McBSP ports |
| 291 | * OMAP2430 has 5 McBSP ports |
| 292 | * OMAP3 has 5 McBSP ports |
| 293 | * OMAP4 has 4 McBSP ports |
| 294 | */ |
| 295 | OMAP_MCBSP_PLATFORM_DEVICE(1); |
| 296 | OMAP_MCBSP_PLATFORM_DEVICE(2); |
| 297 | OMAP_MCBSP_PLATFORM_DEVICE(3); |
| 298 | OMAP_MCBSP_PLATFORM_DEVICE(4); |
| 299 | OMAP_MCBSP_PLATFORM_DEVICE(5); |
| 300 | |
| 301 | static void omap_init_audio(void) |
| 302 | { |
| 303 | platform_device_register(&omap_mcbsp1); |
| 304 | platform_device_register(&omap_mcbsp2); |
| 305 | if (cpu_is_omap243x() || cpu_is_omap34xx() || cpu_is_omap44xx()) { |
| 306 | platform_device_register(&omap_mcbsp3); |
| 307 | platform_device_register(&omap_mcbsp4); |
| 308 | } |
| 309 | if (cpu_is_omap243x() || cpu_is_omap34xx()) |
| 310 | platform_device_register(&omap_mcbsp5); |
| 311 | |
| 312 | platform_device_register(&omap_pcm); |
| 313 | } |
| 314 | |
| 315 | #else |
| 316 | static inline void omap_init_audio(void) {} |
| 317 | #endif |
| 318 | |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame] | 319 | #if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE) |
Juha Yrjola | ed7eb9d | 2006-06-26 16:16:10 -0700 | [diff] [blame] | 320 | |
Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 321 | #include <plat/mcspi.h> |
Juha Yrjola | ed7eb9d | 2006-06-26 16:16:10 -0700 | [diff] [blame] | 322 | |
Charulatha V | 1a5d819 | 2011-02-02 17:52:14 +0530 | [diff] [blame] | 323 | static int omap_mcspi_init(struct omap_hwmod *oh, void *unused) |
Juha Yrjola | ed7eb9d | 2006-06-26 16:16:10 -0700 | [diff] [blame] | 324 | { |
Kevin Hilman | 3528c58 | 2011-07-21 13:48:45 -0700 | [diff] [blame] | 325 | struct platform_device *pdev; |
Charulatha V | 1a5d819 | 2011-02-02 17:52:14 +0530 | [diff] [blame] | 326 | char *name = "omap2_mcspi"; |
| 327 | struct omap2_mcspi_platform_config *pdata; |
| 328 | static int spi_num; |
| 329 | struct omap2_mcspi_dev_attr *mcspi_attrib = oh->dev_attr; |
Tony Lindgren | af41a12 | 2009-09-24 16:23:05 -0700 | [diff] [blame] | 330 | |
Charulatha V | 1a5d819 | 2011-02-02 17:52:14 +0530 | [diff] [blame] | 331 | pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); |
| 332 | if (!pdata) { |
| 333 | pr_err("Memory allocation for McSPI device failed\n"); |
| 334 | return -ENOMEM; |
| 335 | } |
Tony Lindgren | af41a12 | 2009-09-24 16:23:05 -0700 | [diff] [blame] | 336 | |
Charulatha V | 1a5d819 | 2011-02-02 17:52:14 +0530 | [diff] [blame] | 337 | pdata->num_cs = mcspi_attrib->num_chipselect; |
| 338 | switch (oh->class->rev) { |
| 339 | case OMAP2_MCSPI_REV: |
| 340 | case OMAP3_MCSPI_REV: |
| 341 | pdata->regs_offset = 0; |
| 342 | break; |
| 343 | case OMAP4_MCSPI_REV: |
| 344 | pdata->regs_offset = OMAP4_MCSPI_REG_OFFSET; |
| 345 | break; |
| 346 | default: |
| 347 | pr_err("Invalid McSPI Revision value\n"); |
| 348 | return -EINVAL; |
| 349 | } |
| 350 | |
| 351 | spi_num++; |
Kevin Hilman | 3528c58 | 2011-07-21 13:48:45 -0700 | [diff] [blame] | 352 | pdev = omap_device_build(name, spi_num, oh, pdata, |
Benoit Cousson | f718e2c | 2011-08-10 15:30:09 +0200 | [diff] [blame] | 353 | sizeof(*pdata), NULL, 0, 0); |
Kevin Hilman | 3528c58 | 2011-07-21 13:48:45 -0700 | [diff] [blame] | 354 | WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s\n", |
Charulatha V | 1a5d819 | 2011-02-02 17:52:14 +0530 | [diff] [blame] | 355 | name, oh->name); |
| 356 | kfree(pdata); |
| 357 | return 0; |
Tony Lindgren | af41a12 | 2009-09-24 16:23:05 -0700 | [diff] [blame] | 358 | } |
Tony Lindgren | af41a12 | 2009-09-24 16:23:05 -0700 | [diff] [blame] | 359 | |
| 360 | static void omap_init_mcspi(void) |
| 361 | { |
Charulatha V | 1a5d819 | 2011-02-02 17:52:14 +0530 | [diff] [blame] | 362 | omap_hwmod_for_each_by_class("mcspi", omap_mcspi_init, NULL); |
Juha Yrjola | ed7eb9d | 2006-06-26 16:16:10 -0700 | [diff] [blame] | 363 | } |
| 364 | |
| 365 | #else |
| 366 | static inline void omap_init_mcspi(void) {} |
| 367 | #endif |
| 368 | |
Will Deacon | 8834133 | 2010-04-09 13:54:43 +0100 | [diff] [blame] | 369 | static struct resource omap2_pmu_resource = { |
| 370 | .start = 3, |
| 371 | .end = 3, |
| 372 | .flags = IORESOURCE_IRQ, |
| 373 | }; |
| 374 | |
| 375 | static struct resource omap3_pmu_resource = { |
| 376 | .start = INT_34XX_BENCH_MPU_EMUL, |
| 377 | .end = INT_34XX_BENCH_MPU_EMUL, |
| 378 | .flags = IORESOURCE_IRQ, |
| 379 | }; |
| 380 | |
| 381 | static struct platform_device omap_pmu_device = { |
| 382 | .name = "arm-pmu", |
| 383 | .id = ARM_PMU_DEVICE_CPU, |
| 384 | .num_resources = 1, |
| 385 | }; |
| 386 | |
| 387 | static void omap_init_pmu(void) |
| 388 | { |
| 389 | if (cpu_is_omap24xx()) |
| 390 | omap_pmu_device.resource = &omap2_pmu_resource; |
| 391 | else if (cpu_is_omap34xx()) |
| 392 | omap_pmu_device.resource = &omap3_pmu_resource; |
| 393 | else |
| 394 | return; |
| 395 | |
| 396 | platform_device_register(&omap_pmu_device); |
| 397 | } |
| 398 | |
| 399 | |
Dmitry Kasatkin | ee5500c | 2010-05-03 11:10:03 +0800 | [diff] [blame] | 400 | #if defined(CONFIG_CRYPTO_DEV_OMAP_SHAM) || defined(CONFIG_CRYPTO_DEV_OMAP_SHAM_MODULE) |
| 401 | |
Dmitry Kasatkin | edc774e | 2010-05-14 14:45:08 +1000 | [diff] [blame] | 402 | #ifdef CONFIG_ARCH_OMAP2 |
Dmitry Kasatkin | ee5500c | 2010-05-03 11:10:03 +0800 | [diff] [blame] | 403 | static struct resource omap2_sham_resources[] = { |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame] | 404 | { |
| 405 | .start = OMAP24XX_SEC_SHA1MD5_BASE, |
| 406 | .end = OMAP24XX_SEC_SHA1MD5_BASE + 0x64, |
| 407 | .flags = IORESOURCE_MEM, |
| 408 | }, |
| 409 | { |
| 410 | .start = INT_24XX_SHA1MD5, |
| 411 | .flags = IORESOURCE_IRQ, |
| 412 | } |
| 413 | }; |
Dmitry Kasatkin | ee5500c | 2010-05-03 11:10:03 +0800 | [diff] [blame] | 414 | static int omap2_sham_resources_sz = ARRAY_SIZE(omap2_sham_resources); |
| 415 | #else |
| 416 | #define omap2_sham_resources NULL |
| 417 | #define omap2_sham_resources_sz 0 |
| 418 | #endif |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame] | 419 | |
Dmitry Kasatkin | edc774e | 2010-05-14 14:45:08 +1000 | [diff] [blame] | 420 | #ifdef CONFIG_ARCH_OMAP3 |
Dmitry Kasatkin | ee5500c | 2010-05-03 11:10:03 +0800 | [diff] [blame] | 421 | static struct resource omap3_sham_resources[] = { |
| 422 | { |
| 423 | .start = OMAP34XX_SEC_SHA1MD5_BASE, |
| 424 | .end = OMAP34XX_SEC_SHA1MD5_BASE + 0x64, |
| 425 | .flags = IORESOURCE_MEM, |
| 426 | }, |
| 427 | { |
| 428 | .start = INT_34XX_SHA1MD52_IRQ, |
| 429 | .flags = IORESOURCE_IRQ, |
| 430 | }, |
| 431 | { |
| 432 | .start = OMAP34XX_DMA_SHA1MD5_RX, |
| 433 | .flags = IORESOURCE_DMA, |
| 434 | } |
| 435 | }; |
| 436 | static int omap3_sham_resources_sz = ARRAY_SIZE(omap3_sham_resources); |
| 437 | #else |
| 438 | #define omap3_sham_resources NULL |
| 439 | #define omap3_sham_resources_sz 0 |
| 440 | #endif |
| 441 | |
| 442 | static struct platform_device sham_device = { |
| 443 | .name = "omap-sham", |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame] | 444 | .id = -1, |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame] | 445 | }; |
| 446 | |
Dmitry Kasatkin | ee5500c | 2010-05-03 11:10:03 +0800 | [diff] [blame] | 447 | static void omap_init_sham(void) |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame] | 448 | { |
Dmitry Kasatkin | ee5500c | 2010-05-03 11:10:03 +0800 | [diff] [blame] | 449 | if (cpu_is_omap24xx()) { |
| 450 | sham_device.resource = omap2_sham_resources; |
| 451 | sham_device.num_resources = omap2_sham_resources_sz; |
| 452 | } else if (cpu_is_omap34xx()) { |
| 453 | sham_device.resource = omap3_sham_resources; |
| 454 | sham_device.num_resources = omap3_sham_resources_sz; |
| 455 | } else { |
| 456 | pr_err("%s: platform not supported\n", __func__); |
| 457 | return; |
| 458 | } |
| 459 | platform_device_register(&sham_device); |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame] | 460 | } |
| 461 | #else |
Dmitry Kasatkin | ee5500c | 2010-05-03 11:10:03 +0800 | [diff] [blame] | 462 | static inline void omap_init_sham(void) { } |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame] | 463 | #endif |
| 464 | |
Dmitry Kasatkin | b744c67 | 2010-09-03 19:13:55 +0800 | [diff] [blame] | 465 | #if defined(CONFIG_CRYPTO_DEV_OMAP_AES) || defined(CONFIG_CRYPTO_DEV_OMAP_AES_MODULE) |
| 466 | |
Dmitry Kasatkin | 82a0c14 | 2010-08-20 13:44:46 +0000 | [diff] [blame] | 467 | #ifdef CONFIG_ARCH_OMAP2 |
Dmitry Kasatkin | b744c67 | 2010-09-03 19:13:55 +0800 | [diff] [blame] | 468 | static struct resource omap2_aes_resources[] = { |
| 469 | { |
| 470 | .start = OMAP24XX_SEC_AES_BASE, |
| 471 | .end = OMAP24XX_SEC_AES_BASE + 0x4C, |
| 472 | .flags = IORESOURCE_MEM, |
| 473 | }, |
| 474 | { |
| 475 | .start = OMAP24XX_DMA_AES_TX, |
| 476 | .flags = IORESOURCE_DMA, |
| 477 | }, |
| 478 | { |
| 479 | .start = OMAP24XX_DMA_AES_RX, |
| 480 | .flags = IORESOURCE_DMA, |
| 481 | } |
| 482 | }; |
| 483 | static int omap2_aes_resources_sz = ARRAY_SIZE(omap2_aes_resources); |
| 484 | #else |
| 485 | #define omap2_aes_resources NULL |
| 486 | #define omap2_aes_resources_sz 0 |
| 487 | #endif |
| 488 | |
Dmitry Kasatkin | 82a0c14 | 2010-08-20 13:44:46 +0000 | [diff] [blame] | 489 | #ifdef CONFIG_ARCH_OMAP3 |
Dmitry Kasatkin | b744c67 | 2010-09-03 19:13:55 +0800 | [diff] [blame] | 490 | static struct resource omap3_aes_resources[] = { |
| 491 | { |
| 492 | .start = OMAP34XX_SEC_AES_BASE, |
| 493 | .end = OMAP34XX_SEC_AES_BASE + 0x4C, |
| 494 | .flags = IORESOURCE_MEM, |
| 495 | }, |
| 496 | { |
| 497 | .start = OMAP34XX_DMA_AES2_TX, |
| 498 | .flags = IORESOURCE_DMA, |
| 499 | }, |
| 500 | { |
| 501 | .start = OMAP34XX_DMA_AES2_RX, |
| 502 | .flags = IORESOURCE_DMA, |
| 503 | } |
| 504 | }; |
| 505 | static int omap3_aes_resources_sz = ARRAY_SIZE(omap3_aes_resources); |
| 506 | #else |
| 507 | #define omap3_aes_resources NULL |
| 508 | #define omap3_aes_resources_sz 0 |
| 509 | #endif |
| 510 | |
| 511 | static struct platform_device aes_device = { |
| 512 | .name = "omap-aes", |
| 513 | .id = -1, |
| 514 | }; |
| 515 | |
| 516 | static void omap_init_aes(void) |
| 517 | { |
| 518 | if (cpu_is_omap24xx()) { |
| 519 | aes_device.resource = omap2_aes_resources; |
| 520 | aes_device.num_resources = omap2_aes_resources_sz; |
| 521 | } else if (cpu_is_omap34xx()) { |
| 522 | aes_device.resource = omap3_aes_resources; |
| 523 | aes_device.num_resources = omap3_aes_resources_sz; |
| 524 | } else { |
| 525 | pr_err("%s: platform not supported\n", __func__); |
| 526 | return; |
| 527 | } |
| 528 | platform_device_register(&aes_device); |
| 529 | } |
| 530 | |
| 531 | #else |
| 532 | static inline void omap_init_aes(void) { } |
| 533 | #endif |
| 534 | |
Tony Lindgren | d887466 | 2008-12-10 17:37:16 -0800 | [diff] [blame] | 535 | /*-------------------------------------------------------------------------*/ |
| 536 | |
Anand Gadiyar | e08016d | 2011-03-01 13:12:55 -0800 | [diff] [blame] | 537 | #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) |
Kevin Hilman | 917fa28 | 2008-12-10 17:37:17 -0800 | [diff] [blame] | 538 | |
Anand Gadiyar | e08016d | 2011-03-01 13:12:55 -0800 | [diff] [blame] | 539 | static inline void omap242x_mmc_mux(struct omap_mmc_platform_data |
| 540 | *mmc_controller) |
Tony Lindgren | d887466 | 2008-12-10 17:37:16 -0800 | [diff] [blame] | 541 | { |
stanley.miao | ed8303fc | 2010-05-13 12:39:30 +0000 | [diff] [blame] | 542 | if ((mmc_controller->slots[0].switch_pin > 0) && \ |
| 543 | (mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES)) |
| 544 | omap_mux_init_gpio(mmc_controller->slots[0].switch_pin, |
| 545 | OMAP_PIN_INPUT_PULLUP); |
| 546 | if ((mmc_controller->slots[0].gpio_wp > 0) && \ |
| 547 | (mmc_controller->slots[0].gpio_wp < OMAP_MAX_GPIO_LINES)) |
| 548 | omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp, |
| 549 | OMAP_PIN_INPUT_PULLUP); |
| 550 | |
Anand Gadiyar | e08016d | 2011-03-01 13:12:55 -0800 | [diff] [blame] | 551 | omap_mux_init_signal("sdmmc_cmd", 0); |
| 552 | omap_mux_init_signal("sdmmc_clki", 0); |
| 553 | omap_mux_init_signal("sdmmc_clko", 0); |
| 554 | omap_mux_init_signal("sdmmc_dat0", 0); |
| 555 | omap_mux_init_signal("sdmmc_dat_dir0", 0); |
| 556 | omap_mux_init_signal("sdmmc_cmd_dir", 0); |
| 557 | if (mmc_controller->slots[0].caps & MMC_CAP_4_BIT_DATA) { |
| 558 | omap_mux_init_signal("sdmmc_dat1", 0); |
| 559 | omap_mux_init_signal("sdmmc_dat2", 0); |
| 560 | omap_mux_init_signal("sdmmc_dat3", 0); |
| 561 | omap_mux_init_signal("sdmmc_dat_dir1", 0); |
| 562 | omap_mux_init_signal("sdmmc_dat_dir2", 0); |
| 563 | omap_mux_init_signal("sdmmc_dat_dir3", 0); |
Tony Lindgren | d887466 | 2008-12-10 17:37:16 -0800 | [diff] [blame] | 564 | } |
Vikram Pandita | 57b9daa | 2009-08-28 11:24:11 -0700 | [diff] [blame] | 565 | |
Anand Gadiyar | e08016d | 2011-03-01 13:12:55 -0800 | [diff] [blame] | 566 | /* |
| 567 | * Use internal loop-back in MMC/SDIO Module Input Clock |
| 568 | * selection |
| 569 | */ |
| 570 | if (mmc_controller->slots[0].internal_clock) { |
| 571 | u32 v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0); |
| 572 | v |= (1 << 24); |
| 573 | omap_ctrl_writel(v, OMAP2_CONTROL_DEVCONF0); |
Vikram Pandita | 57b9daa | 2009-08-28 11:24:11 -0700 | [diff] [blame] | 574 | } |
Tony Lindgren | d887466 | 2008-12-10 17:37:16 -0800 | [diff] [blame] | 575 | } |
| 576 | |
Anand Gadiyar | e08016d | 2011-03-01 13:12:55 -0800 | [diff] [blame] | 577 | void __init omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data) |
Tony Lindgren | d887466 | 2008-12-10 17:37:16 -0800 | [diff] [blame] | 578 | { |
Anand Gadiyar | e08016d | 2011-03-01 13:12:55 -0800 | [diff] [blame] | 579 | char *name = "mmci-omap"; |
Tony Lindgren | d887466 | 2008-12-10 17:37:16 -0800 | [diff] [blame] | 580 | |
Anand Gadiyar | e08016d | 2011-03-01 13:12:55 -0800 | [diff] [blame] | 581 | if (!mmc_data[0]) { |
| 582 | pr_err("%s fails: Incomplete platform data\n", __func__); |
| 583 | return; |
| 584 | } |
Tony Lindgren | d887466 | 2008-12-10 17:37:16 -0800 | [diff] [blame] | 585 | |
Anand Gadiyar | e08016d | 2011-03-01 13:12:55 -0800 | [diff] [blame] | 586 | omap242x_mmc_mux(mmc_data[0]); |
| 587 | omap_mmc_add(name, 0, OMAP2_MMC1_BASE, OMAP2420_MMC_SIZE, |
| 588 | INT_24XX_MMC_IRQ, mmc_data[0]); |
Tony Lindgren | d887466 | 2008-12-10 17:37:16 -0800 | [diff] [blame] | 589 | } |
| 590 | |
| 591 | #endif |
| 592 | |
| 593 | /*-------------------------------------------------------------------------*/ |
| 594 | |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame] | 595 | #if defined(CONFIG_HDQ_MASTER_OMAP) || defined(CONFIG_HDQ_MASTER_OMAP_MODULE) |
Tony Lindgren | 59b479e | 2011-01-27 16:39:40 -0800 | [diff] [blame] | 596 | #if defined(CONFIG_SOC_OMAP2430) || defined(CONFIG_SOC_OMAP3430) |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame] | 597 | #define OMAP_HDQ_BASE 0x480B2000 |
| 598 | #endif |
| 599 | static struct resource omap_hdq_resources[] = { |
| 600 | { |
| 601 | .start = OMAP_HDQ_BASE, |
| 602 | .end = OMAP_HDQ_BASE + 0x1C, |
| 603 | .flags = IORESOURCE_MEM, |
| 604 | }, |
| 605 | { |
| 606 | .start = INT_24XX_HDQ_IRQ, |
| 607 | .flags = IORESOURCE_IRQ, |
| 608 | }, |
| 609 | }; |
| 610 | static struct platform_device omap_hdq_dev = { |
| 611 | .name = "omap_hdq", |
| 612 | .id = 0, |
| 613 | .dev = { |
| 614 | .platform_data = NULL, |
| 615 | }, |
| 616 | .num_resources = ARRAY_SIZE(omap_hdq_resources), |
| 617 | .resource = omap_hdq_resources, |
| 618 | }; |
| 619 | static inline void omap_hdq_init(void) |
| 620 | { |
| 621 | (void) platform_device_register(&omap_hdq_dev); |
| 622 | } |
| 623 | #else |
| 624 | static inline void omap_hdq_init(void) {} |
| 625 | #endif |
| 626 | |
Vaibhav Hiremath | b227358 | 2010-05-10 14:29:14 -0700 | [diff] [blame] | 627 | /*---------------------------------------------------------------------------*/ |
| 628 | |
| 629 | #if defined(CONFIG_VIDEO_OMAP2_VOUT) || \ |
| 630 | defined(CONFIG_VIDEO_OMAP2_VOUT_MODULE) |
| 631 | #if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) |
| 632 | static struct resource omap_vout_resource[3 - CONFIG_FB_OMAP2_NUM_FBS] = { |
| 633 | }; |
| 634 | #else |
| 635 | static struct resource omap_vout_resource[2] = { |
| 636 | }; |
| 637 | #endif |
| 638 | |
| 639 | static struct platform_device omap_vout_device = { |
| 640 | .name = "omap_vout", |
| 641 | .num_resources = ARRAY_SIZE(omap_vout_resource), |
| 642 | .resource = &omap_vout_resource[0], |
| 643 | .id = -1, |
| 644 | }; |
| 645 | static void omap_init_vout(void) |
| 646 | { |
| 647 | if (platform_device_register(&omap_vout_device) < 0) |
| 648 | printk(KERN_ERR "Unable to register OMAP-VOUT device\n"); |
| 649 | } |
| 650 | #else |
| 651 | static inline void omap_init_vout(void) {} |
| 652 | #endif |
| 653 | |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 654 | /*-------------------------------------------------------------------------*/ |
| 655 | |
| 656 | static int __init omap2_init_devices(void) |
| 657 | { |
Paul Walmsley | 81fbc5ef | 2010-12-21 19:56:17 -0700 | [diff] [blame] | 658 | /* |
| 659 | * please keep these calls, and their implementations above, |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 660 | * in alphabetical order so they're easier to sort through. |
| 661 | */ |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 662 | omap_init_audio(); |
Tony Lindgren | 828c707 | 2009-03-23 18:23:49 -0700 | [diff] [blame] | 663 | omap_init_camera(); |
Tony Lindgren | c40fae95 | 2006-12-07 13:58:10 -0800 | [diff] [blame] | 664 | omap_init_mbox(); |
Juha Yrjola | ed7eb9d | 2006-06-26 16:16:10 -0700 | [diff] [blame] | 665 | omap_init_mcspi(); |
Will Deacon | 8834133 | 2010-04-09 13:54:43 +0100 | [diff] [blame] | 666 | omap_init_pmu(); |
Tony Lindgren | 646e3ed | 2008-10-06 15:49:36 +0300 | [diff] [blame] | 667 | omap_hdq_init(); |
Tony Lindgren | 9b6553c | 2006-04-02 17:46:30 +0100 | [diff] [blame] | 668 | omap_init_sti(); |
Dmitry Kasatkin | ee5500c | 2010-05-03 11:10:03 +0800 | [diff] [blame] | 669 | omap_init_sham(); |
Dmitry Kasatkin | b744c67 | 2010-09-03 19:13:55 +0800 | [diff] [blame] | 670 | omap_init_aes(); |
Vaibhav Hiremath | b227358 | 2010-05-10 14:29:14 -0700 | [diff] [blame] | 671 | omap_init_vout(); |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 672 | |
| 673 | return 0; |
| 674 | } |
| 675 | arch_initcall(omap2_init_devices); |
Varadarajan, Charulatha | f2ce623 | 2010-09-23 20:02:42 +0530 | [diff] [blame] | 676 | |
| 677 | #if defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE) |
Varadarajan, Charulatha | f2ce623 | 2010-09-23 20:02:42 +0530 | [diff] [blame] | 678 | static int __init omap_init_wdt(void) |
| 679 | { |
| 680 | int id = -1; |
Kevin Hilman | 3528c58 | 2011-07-21 13:48:45 -0700 | [diff] [blame] | 681 | struct platform_device *pdev; |
Varadarajan, Charulatha | f2ce623 | 2010-09-23 20:02:42 +0530 | [diff] [blame] | 682 | struct omap_hwmod *oh; |
| 683 | char *oh_name = "wd_timer2"; |
| 684 | char *dev_name = "omap_wdt"; |
| 685 | |
| 686 | if (!cpu_class_is_omap2()) |
| 687 | return 0; |
| 688 | |
| 689 | oh = omap_hwmod_lookup(oh_name); |
| 690 | if (!oh) { |
| 691 | pr_err("Could not look up wd_timer%d hwmod\n", id); |
| 692 | return -EINVAL; |
| 693 | } |
| 694 | |
Benoit Cousson | f718e2c | 2011-08-10 15:30:09 +0200 | [diff] [blame] | 695 | pdev = omap_device_build(dev_name, id, oh, NULL, 0, NULL, 0, 0); |
Kevin Hilman | 3528c58 | 2011-07-21 13:48:45 -0700 | [diff] [blame] | 696 | WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s.\n", |
Varadarajan, Charulatha | f2ce623 | 2010-09-23 20:02:42 +0530 | [diff] [blame] | 697 | dev_name, oh->name); |
| 698 | return 0; |
| 699 | } |
| 700 | subsys_initcall(omap_init_wdt); |
| 701 | #endif |