diff options
author | Arnd Bergmann <arnd@arndb.de> | 2013-06-20 15:41:06 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2013-06-20 15:41:06 -0400 |
commit | f9f697a77d23dfbd00bd75b27b67fea1fd7a1767 (patch) | |
tree | 350d9a39fe56c145e36d703074c2892bc7fbeadb /include | |
parent | 8fe14e5a74d3f45589c83c06ed63b5c8a376a824 (diff) | |
parent | d2e993289cc5f1780ce74188e3a8d2b404748397 (diff) |
Merge tag 'omap-for-v3.11/mailbox-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/drivers
From Tony Lindgren:
Move OMAP Mailbox framework to drivers via Suman Anna <s-anna@ti.com>
The OMAP Mailbox driver framework is moved out of arch/arm folder
into drivers/mailbox folder, to re-enable building it and also serve
as a baseline for adapting to the new mailbox driver framework. The
changes mainly contain:
- a minor bug fix and cleanup of mach-specific mailbox code
- remove any header dependencies from plat-omap for multi-platform
support
- represent mailbox device data through platform data/hwmod attrs
- move the omap mailbox code out of plat-omap/mach-omapX to
drivers/mailbox folder
* tag 'omap-for-v3.11/mailbox-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
mailbox/omap: move the OMAP mailbox framework to drivers
ARM: OMAP2+: add user and fifo info to mailbox platform data
ARM: OMAP2+: mbox: remove dependencies with soc.h
omap: mailbox: correct the argument type for irq ops
omap: mailbox: call request_irq after mbox queues are allocated
omap: mailbox: check iomem resource before dereferencing it
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/omap-mailbox.h | 29 | ||||
-rw-r--r-- | include/linux/platform_data/mailbox-omap.h | 58 |
2 files changed, 87 insertions, 0 deletions
diff --git a/include/linux/omap-mailbox.h b/include/linux/omap-mailbox.h new file mode 100644 index 000000000000..f8322d9cd235 --- /dev/null +++ b/include/linux/omap-mailbox.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * omap-mailbox: interprocessor communication module for OMAP | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #ifndef OMAP_MAILBOX_H | ||
10 | #define OMAP_MAILBOX_H | ||
11 | |||
12 | typedef u32 mbox_msg_t; | ||
13 | struct omap_mbox; | ||
14 | |||
15 | typedef int __bitwise omap_mbox_irq_t; | ||
16 | #define IRQ_TX ((__force omap_mbox_irq_t) 1) | ||
17 | #define IRQ_RX ((__force omap_mbox_irq_t) 2) | ||
18 | |||
19 | int omap_mbox_msg_send(struct omap_mbox *, mbox_msg_t msg); | ||
20 | |||
21 | struct omap_mbox *omap_mbox_get(const char *, struct notifier_block *nb); | ||
22 | void omap_mbox_put(struct omap_mbox *mbox, struct notifier_block *nb); | ||
23 | |||
24 | void omap_mbox_save_ctx(struct omap_mbox *mbox); | ||
25 | void omap_mbox_restore_ctx(struct omap_mbox *mbox); | ||
26 | void omap_mbox_enable_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq); | ||
27 | void omap_mbox_disable_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq); | ||
28 | |||
29 | #endif /* OMAP_MAILBOX_H */ | ||
diff --git a/include/linux/platform_data/mailbox-omap.h b/include/linux/platform_data/mailbox-omap.h new file mode 100644 index 000000000000..4631dbb4255e --- /dev/null +++ b/include/linux/platform_data/mailbox-omap.h | |||
@@ -0,0 +1,58 @@ | |||
1 | /* | ||
2 | * mailbox-omap.h | ||
3 | * | ||
4 | * Copyright (C) 2013 Texas Instruments, Inc. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * version 2 as published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | */ | ||
15 | |||
16 | #ifndef _PLAT_MAILBOX_H | ||
17 | #define _PLAT_MAILBOX_H | ||
18 | |||
19 | /* Interrupt register configuration types */ | ||
20 | #define MBOX_INTR_CFG_TYPE1 (0) | ||
21 | #define MBOX_INTR_CFG_TYPE2 (1) | ||
22 | |||
23 | /** | ||
24 | * struct omap_mbox_dev_info - OMAP mailbox device attribute info | ||
25 | * @name: name of the mailbox device | ||
26 | * @tx_id: mailbox queue id used for transmitting messages | ||
27 | * @rx_id: mailbox queue id on which messages are received | ||
28 | * @irq_id: irq identifier number to use from the hwmod data | ||
29 | * @usr_id: mailbox user id for identifying the interrupt into | ||
30 | * the MPU interrupt controller. | ||
31 | */ | ||
32 | struct omap_mbox_dev_info { | ||
33 | const char *name; | ||
34 | u32 tx_id; | ||
35 | u32 rx_id; | ||
36 | u32 irq_id; | ||
37 | u32 usr_id; | ||
38 | }; | ||
39 | |||
40 | /** | ||
41 | * struct omap_mbox_pdata - OMAP mailbox platform data | ||
42 | * @intr_type: type of interrupt configuration registers used | ||
43 | while programming mailbox queue interrupts | ||
44 | * @num_users: number of users (processor devices) that the mailbox | ||
45 | * h/w block can interrupt | ||
46 | * @num_fifos: number of h/w fifos within the mailbox h/w block | ||
47 | * @info_cnt: number of mailbox devices for the platform | ||
48 | * @info: array of mailbox device attributes | ||
49 | */ | ||
50 | struct omap_mbox_pdata { | ||
51 | u32 intr_type; | ||
52 | u32 num_users; | ||
53 | u32 num_fifos; | ||
54 | u32 info_cnt; | ||
55 | struct omap_mbox_dev_info *info; | ||
56 | }; | ||
57 | |||
58 | #endif /* _PLAT_MAILBOX_H */ | ||