2 * OMAP hardware spinlock device initialization
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com
6 * Contact: Simon Que <sque@ti.com>
7 * Hari Kanigeri <h-kanigeri2@ti.com>
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
19 #include <linux/kernel.h>
20 #include <linux/init.h>
21 #include <linux/err.h>
22 #include <linux/hwspinlock.h>
24 #include <plat/omap_hwmod.h>
25 #include <plat/omap_device.h>
27 static struct hwspinlock_pdata omap_hwspinlock_pdata __initdata
= {
31 int __init
hwspinlocks_init(void)
34 struct omap_hwmod
*oh
;
35 struct platform_device
*pdev
;
36 const char *oh_name
= "spinlock";
37 const char *dev_name
= "omap_hwspinlock";
40 * Hwmod lookup will fail in case our platform doesn't support the
41 * hardware spinlock module, so it is safe to run this initcall
44 oh
= omap_hwmod_lookup(oh_name
);
48 pdev
= omap_device_build(dev_name
, 0, oh
, &omap_hwspinlock_pdata
,
49 sizeof(struct hwspinlock_pdata
),
52 pr_err("Can't build omap_device for %s:%s\n", dev_name
,
54 retval
= PTR_ERR(pdev
);
59 /* early board code might need to reserve specific hwspinlock instances */
60 postcore_initcall(hwspinlocks_init
);