Commit | Line | Data |
---|---|---|
ec4d02d9 SB |
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*/ |