aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/devices.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-11-01 23:58:25 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-01 23:58:25 -0400
commit81a3c10ce8a7fd5bf9a06bfc38bd417512911831 (patch)
tree12ceac10fae8c4b2dc17b362672a5db305a8d960 /arch/arm/mach-omap2/devices.c
parent6585dea1f99cc2265582ff2e4cc1727062136e92 (diff)
parentdf80442d1ee2902c2e39f90f18160f2e08d14c06 (diff)
Merge branch 'next/cleanup2' of git://git.linaro.org/people/arnd/arm-soc
* 'next/cleanup2' of git://git.linaro.org/people/arnd/arm-soc: (31 commits) ARM: OMAP: Warn if omap_ioremap is called before SoC detection ARM: OMAP: Move set_globals initialization to happen in init_early ARM: OMAP: Map SRAM later on with ioremap_exec() ARM: OMAP: Remove calls to SRAM allocations for framebuffer ARM: OMAP: Avoid cpu_is_omapxxxx usage until map_io is done ARM: OMAP1: Use generic map_io, init_early and init_irq arm/dts: OMAP3+: Add mpu, dsp and iva nodes arm/dts: OMAP4: Add a main ocp entry bound to l3-noc driver ARM: OMAP2+: l3-noc: Add support for device-tree ARM: OMAP2+: board-generic: Add i2c static init ARM: OMAP2+: board-generic: Add DT support to generic board arm/dts: Add support for OMAP3 Beagle board arm/dts: Add initial device tree support for OMAP3 SoC arm/dts: Add support for OMAP4 SDP board arm/dts: Add support for OMAP4 PandaBoard arm/dts: Add initial device tree support for OMAP4 SoC ARM: OMAP: omap_device: Add a method to build an omap_device from a DT node ARM: OMAP: omap_device: Add omap_device_[alloc|delete] for DT integration of: Add helpers to get one string in multiple strings property ARM: OMAP2+: devices: Remove all omap_device_pm_latency structures ... Fix up trivial header file conflicts in arch/arm/mach-omap2/board-generic.c
Diffstat (limited to 'arch/arm/mach-omap2/devices.c')
-rw-r--r--arch/arm/mach-omap2/devices.c51
1 files changed, 9 insertions, 42 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 406b56cfedbc..68ec03152d5f 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -16,6 +16,7 @@
16#include <linux/clk.h> 16#include <linux/clk.h>
17#include <linux/err.h> 17#include <linux/err.h>
18#include <linux/slab.h> 18#include <linux/slab.h>
19#include <linux/of.h>
19 20
20#include <mach/hardware.h> 21#include <mach/hardware.h>
21#include <mach/irqs.h> 22#include <mach/irqs.h>
@@ -76,6 +77,10 @@ static int __init omap4_l3_init(void)
76 struct platform_device *pdev; 77 struct platform_device *pdev;
77 char oh_name[L3_MODULES_MAX_LEN]; 78 char oh_name[L3_MODULES_MAX_LEN];
78 79
80 /* If dtb is there, the devices will be created dynamically */
81 if (of_have_populated_dt())
82 return -ENODEV;
83
79 /* 84 /*
80 * To avoid code running on other OMAPs in 85 * To avoid code running on other OMAPs in
81 * multi-omap builds 86 * multi-omap builds
@@ -220,14 +225,6 @@ static inline void omap_init_camera(void)
220#endif 225#endif
221} 226}
222 227
223struct omap_device_pm_latency omap_keyboard_latency[] = {
224 {
225 .deactivate_func = omap_device_idle_hwmods,
226 .activate_func = omap_device_enable_hwmods,
227 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
228 },
229};
230
231int __init omap4_keyboard_init(struct omap4_keypad_platform_data 228int __init omap4_keyboard_init(struct omap4_keypad_platform_data
232 *sdp4430_keypad_data, struct omap_board_data *bdata) 229 *sdp4430_keypad_data, struct omap_board_data *bdata)
233{ 230{
@@ -247,9 +244,7 @@ int __init omap4_keyboard_init(struct omap4_keypad_platform_data
247 keypad_data = sdp4430_keypad_data; 244 keypad_data = sdp4430_keypad_data;
248 245
249 pdev = omap_device_build(name, id, oh, keypad_data, 246 pdev = omap_device_build(name, id, oh, keypad_data,
250 sizeof(struct omap4_keypad_platform_data), 247 sizeof(struct omap4_keypad_platform_data), NULL, 0, 0);
251 omap_keyboard_latency,
252 ARRAY_SIZE(omap_keyboard_latency), 0);
253 248
254 if (IS_ERR(pdev)) { 249 if (IS_ERR(pdev)) {
255 WARN(1, "Can't build omap_device for %s:%s.\n", 250 WARN(1, "Can't build omap_device for %s:%s.\n",
@@ -262,14 +257,6 @@ int __init omap4_keyboard_init(struct omap4_keypad_platform_data
262} 257}
263 258
264#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) 259#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
265static struct omap_device_pm_latency mbox_latencies[] = {
266 [0] = {
267 .activate_func = omap_device_enable_hwmods,
268 .deactivate_func = omap_device_idle_hwmods,
269 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
270 },
271};
272
273static inline void omap_init_mbox(void) 260static inline void omap_init_mbox(void)
274{ 261{
275 struct omap_hwmod *oh; 262 struct omap_hwmod *oh;
@@ -281,8 +268,7 @@ static inline void omap_init_mbox(void)
281 return; 268 return;
282 } 269 }
283 270
284 pdev = omap_device_build("omap-mailbox", -1, oh, NULL, 0, 271 pdev = omap_device_build("omap-mailbox", -1, oh, NULL, 0, NULL, 0, 0);
285 mbox_latencies, ARRAY_SIZE(mbox_latencies), 0);
286 WARN(IS_ERR(pdev), "%s: could not build device, err %ld\n", 272 WARN(IS_ERR(pdev), "%s: could not build device, err %ld\n",
287 __func__, PTR_ERR(pdev)); 273 __func__, PTR_ERR(pdev));
288} 274}
@@ -365,14 +351,6 @@ static inline void omap_init_mcpdm(void) {}
365 351
366#include <plat/mcspi.h> 352#include <plat/mcspi.h>
367 353
368struct omap_device_pm_latency omap_mcspi_latency[] = {
369 [0] = {
370 .deactivate_func = omap_device_idle_hwmods,
371 .activate_func = omap_device_enable_hwmods,
372 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
373 },
374};
375
376static int omap_mcspi_init(struct omap_hwmod *oh, void *unused) 354static int omap_mcspi_init(struct omap_hwmod *oh, void *unused)
377{ 355{
378 struct platform_device *pdev; 356 struct platform_device *pdev;
@@ -403,8 +381,7 @@ static int omap_mcspi_init(struct omap_hwmod *oh, void *unused)
403 381
404 spi_num++; 382 spi_num++;
405 pdev = omap_device_build(name, spi_num, oh, pdata, 383 pdev = omap_device_build(name, spi_num, oh, pdata,
406 sizeof(*pdata), omap_mcspi_latency, 384 sizeof(*pdata), NULL, 0, 0);
407 ARRAY_SIZE(omap_mcspi_latency), 0);
408 WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s\n", 385 WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s\n",
409 name, oh->name); 386 name, oh->name);
410 kfree(pdata); 387 kfree(pdata);
@@ -730,14 +707,6 @@ static int __init omap2_init_devices(void)
730arch_initcall(omap2_init_devices); 707arch_initcall(omap2_init_devices);
731 708
732#if defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE) 709#if defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE)
733static struct omap_device_pm_latency omap_wdt_latency[] = {
734 [0] = {
735 .deactivate_func = omap_device_idle_hwmods,
736 .activate_func = omap_device_enable_hwmods,
737 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
738 },
739};
740
741static int __init omap_init_wdt(void) 710static int __init omap_init_wdt(void)
742{ 711{
743 int id = -1; 712 int id = -1;
@@ -755,9 +724,7 @@ static int __init omap_init_wdt(void)
755 return -EINVAL; 724 return -EINVAL;
756 } 725 }
757 726
758 pdev = omap_device_build(dev_name, id, oh, NULL, 0, 727 pdev = omap_device_build(dev_name, id, oh, NULL, 0, NULL, 0, 0);
759 omap_wdt_latency,
760 ARRAY_SIZE(omap_wdt_latency), 0);
761 WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s.\n", 728 WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s.\n",
762 dev_name, oh->name); 729 dev_name, oh->name);
763 return 0; 730 return 0;