devices.c (05668381140309088443bf5dc53add4104610fbb) | devices.c (c40fae9525e6c29c87a4f4361ff0a8d67a36e448) |
---|---|
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 --- 52 unchanged lines hidden (view full) --- 61} 62 63#else 64 65static void omap_init_i2c(void) {} 66 67#endif 68 | 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 --- 52 unchanged lines hidden (view full) --- 61} 62 63#else 64 65static void omap_init_i2c(void) {} 66 67#endif 68 |
69#if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE) 70#define OMAP2_MBOX_BASE IO_ADDRESS(OMAP24XX_MAILBOX_BASE) 71 72static struct resource mbox_resources[] = { 73 { 74 .start = OMAP2_MBOX_BASE, 75 .end = OMAP2_MBOX_BASE + 0x11f, 76 .flags = IORESOURCE_MEM, 77 }, 78 { 79 .start = INT_24XX_MAIL_U0_MPU, 80 .flags = IORESOURCE_IRQ, 81 }, 82 { 83 .start = INT_24XX_MAIL_U3_MPU, 84 .flags = IORESOURCE_IRQ, 85 }, 86}; 87 88static struct platform_device mbox_device = { 89 .name = "mailbox", 90 .id = -1, 91 .num_resources = ARRAY_SIZE(mbox_resources), 92 .resource = mbox_resources, 93}; 94 95static inline void omap_init_mbox(void) 96{ 97 platform_device_register(&mbox_device); 98} 99#else 100static inline void omap_init_mbox(void) { } 101#endif 102 |
|
69#if defined(CONFIG_OMAP_STI) 70 71#define OMAP2_STI_BASE IO_ADDRESS(0x48068000) 72#define OMAP2_STI_CHANNEL_BASE 0x54000000 73#define OMAP2_STI_IRQ 4 74 75static struct resource sti_resources[] = { 76 { --- 29 unchanged lines hidden (view full) --- 106 107#if defined(CONFIG_SPI_OMAP24XX) 108 109#include <asm/arch/mcspi.h> 110 111#define OMAP2_MCSPI1_BASE 0x48098000 112#define OMAP2_MCSPI2_BASE 0x4809a000 113 | 103#if defined(CONFIG_OMAP_STI) 104 105#define OMAP2_STI_BASE IO_ADDRESS(0x48068000) 106#define OMAP2_STI_CHANNEL_BASE 0x54000000 107#define OMAP2_STI_IRQ 4 108 109static struct resource sti_resources[] = { 110 { --- 29 unchanged lines hidden (view full) --- 140 141#if defined(CONFIG_SPI_OMAP24XX) 142 143#include <asm/arch/mcspi.h> 144 145#define OMAP2_MCSPI1_BASE 0x48098000 146#define OMAP2_MCSPI2_BASE 0x4809a000 147 |
114/* FIXME: use resources instead */ 115 | |
116static struct omap2_mcspi_platform_config omap2_mcspi1_config = { | 148static struct omap2_mcspi_platform_config omap2_mcspi1_config = { |
117 .base = io_p2v(OMAP2_MCSPI1_BASE), | |
118 .num_cs = 4, 119}; 120 | 149 .num_cs = 4, 150}; 151 |
152static struct resource omap2_mcspi1_resources[] = { 153 { 154 .start = OMAP2_MCSPI1_BASE, 155 .end = OMAP2_MCSPI1_BASE + 0xff, 156 .flags = IORESOURCE_MEM, 157 }, 158}; 159 |
|
121struct platform_device omap2_mcspi1 = { 122 .name = "omap2_mcspi", 123 .id = 1, | 160struct platform_device omap2_mcspi1 = { 161 .name = "omap2_mcspi", 162 .id = 1, |
163 .num_resources = ARRAY_SIZE(omap2_mcspi1_resources), 164 .resource = omap2_mcspi1_resources, |
|
124 .dev = { 125 .platform_data = &omap2_mcspi1_config, 126 }, 127}; 128 129static struct omap2_mcspi_platform_config omap2_mcspi2_config = { | 165 .dev = { 166 .platform_data = &omap2_mcspi1_config, 167 }, 168}; 169 170static struct omap2_mcspi_platform_config omap2_mcspi2_config = { |
130 .base = io_p2v(OMAP2_MCSPI2_BASE), | |
131 .num_cs = 2, 132}; 133 | 171 .num_cs = 2, 172}; 173 |
174static struct resource omap2_mcspi2_resources[] = { 175 { 176 .start = OMAP2_MCSPI2_BASE, 177 .end = OMAP2_MCSPI2_BASE + 0xff, 178 .flags = IORESOURCE_MEM, 179 }, 180}; 181 |
|
134struct platform_device omap2_mcspi2 = { 135 .name = "omap2_mcspi", 136 .id = 2, | 182struct platform_device omap2_mcspi2 = { 183 .name = "omap2_mcspi", 184 .id = 2, |
185 .num_resources = ARRAY_SIZE(omap2_mcspi2_resources), 186 .resource = omap2_mcspi2_resources, |
|
137 .dev = { 138 .platform_data = &omap2_mcspi2_config, 139 }, 140}; 141 142static void omap_init_mcspi(void) 143{ 144 platform_device_register(&omap2_mcspi1); --- 7 unchanged lines hidden (view full) --- 152/*-------------------------------------------------------------------------*/ 153 154static int __init omap2_init_devices(void) 155{ 156 /* please keep these calls, and their implementations above, 157 * in alphabetical order so they're easier to sort through. 158 */ 159 omap_init_i2c(); | 187 .dev = { 188 .platform_data = &omap2_mcspi2_config, 189 }, 190}; 191 192static void omap_init_mcspi(void) 193{ 194 platform_device_register(&omap2_mcspi1); --- 7 unchanged lines hidden (view full) --- 202/*-------------------------------------------------------------------------*/ 203 204static int __init omap2_init_devices(void) 205{ 206 /* please keep these calls, and their implementations above, 207 * in alphabetical order so they're easier to sort through. 208 */ 209 omap_init_i2c(); |
210 omap_init_mbox(); |
|
160 omap_init_mcspi(); 161 omap_init_sti(); 162 163 return 0; 164} 165arch_initcall(omap2_init_devices); | 211 omap_init_mcspi(); 212 omap_init_sti(); 213 214 return 0; 215} 216arch_initcall(omap2_init_devices); |
166 | |