diff options
author | Sjur Brændeland <sjur.brandeland@stericsson.com> | 2012-09-20 12:32:56 -0400 |
---|---|---|
committer | Ohad Ben-Cohen <ohad@wizery.com> | 2012-09-22 09:35:13 -0400 |
commit | ec4d02d9180f407c41f8310a13b34e473c671fbb (patch) | |
tree | 2b8afeaa25f2948920cd3b50de83f55cefbd6614 /include/linux/ste_modem_shm.h | |
parent | 099a3f33c82b5153a4422eb92c648098b3f7c086 (diff) |
remoteproc: Add STE modem driver
Add support for the STE modem shared memory driver.
This driver hooks into the remoteproc framework
in order to manage configuration and the virtio
devices.
This driver adds custom firmware handlers, because
STE modem uses a custom firmware layout.
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
cc: Linus Walleij <linus.walleij@linaro.org>
cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
[ohad: validate mdev->ops, move setup() to probe/remove, trivial style changes]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Diffstat (limited to 'include/linux/ste_modem_shm.h')
-rw-r--r-- | include/linux/ste_modem_shm.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/include/linux/ste_modem_shm.h b/include/linux/ste_modem_shm.h new file mode 100644 index 000000000000..8444a4eff1bb --- /dev/null +++ b/include/linux/ste_modem_shm.h | |||
@@ -0,0 +1,56 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson AB 2012 | ||
3 | * Author: Sjur Brendeland / sjur.brandeland@stericsson.com | ||
4 | * | ||
5 | * License terms: GNU General Public License (GPL) version 2 | ||
6 | */ | ||
7 | |||
8 | #ifndef __INC_MODEM_DEV_H | ||
9 | #define __INC_MODEM_DEV_H | ||
10 | #include <linux/types.h> | ||
11 | #include <linux/platform_device.h> | ||
12 | |||
13 | struct ste_modem_device; | ||
14 | |||
15 | /** | ||
16 | * struct ste_modem_dev_cb - Callbacks for modem initiated events. | ||
17 | * @kick: Called when the modem kicks the host. | ||
18 | * | ||
19 | * This structure contains callbacks for actions triggered by the modem. | ||
20 | */ | ||
21 | struct ste_modem_dev_cb { | ||
22 | void (*kick)(struct ste_modem_device *mdev, int notify_id); | ||
23 | }; | ||
24 | |||
25 | /** | ||
26 | * struct ste_modem_dev_ops - Functions to control modem and modem interface. | ||
27 | * | ||
28 | * @power: Main power switch, used for cold-start or complete power off. | ||
29 | * @kick: Kick the modem. | ||
30 | * @kick_subscribe: Subscribe for notifications from the modem. | ||
31 | * @setup: Provide callback functions to modem device. | ||
32 | * | ||
33 | * This structure contains functions used by the ste remoteproc driver | ||
34 | * to manage the modem. | ||
35 | */ | ||
36 | struct ste_modem_dev_ops { | ||
37 | int (*power)(struct ste_modem_device *mdev, bool on); | ||
38 | int (*kick)(struct ste_modem_device *mdev, int notify_id); | ||
39 | int (*kick_subscribe)(struct ste_modem_device *mdev, int notify_id); | ||
40 | int (*setup)(struct ste_modem_device *mdev, | ||
41 | struct ste_modem_dev_cb *cfg); | ||
42 | }; | ||
43 | |||
44 | /** | ||
45 | * struct ste_modem_device - represent the STE modem device | ||
46 | * @pdev: Reference to platform device | ||
47 | * @ops: Operations used to manage the modem. | ||
48 | * @drv_data: Driver private data. | ||
49 | */ | ||
50 | struct ste_modem_device { | ||
51 | struct platform_device pdev; | ||
52 | struct ste_modem_dev_ops ops; | ||
53 | void *drv_data; | ||
54 | }; | ||
55 | |||
56 | #endif /*INC_MODEM_DEV_H*/ | ||