blob: c757eec5cc3edefa69c178a6ea12182505331f03 [file] [log] [blame]
Eric Holmberg6275b602012-11-19 13:05:04 -07001/* arch/arm/mach-msm/smp2p_private_api.h
2 *
3 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 and
7 * only version 2 as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14#ifndef _ARCH_ARM_MACH_MSM_SMP2P_PRIVATE_API_H_
15#define _ARCH_ARM_MACH_MSM_SMP2P_PRIVATE_API_H_
16
17#include <linux/notifier.h>
18
19struct msm_smp2p_out;
20
21/* Maximum size of the entry name and trailing null. */
22#define SMP2P_MAX_ENTRY_NAME 16
23
24/* Bits per entry */
25#define SMP2P_BITS_PER_ENTRY 32
26
27/* Processor ID's */
28enum {
29 SMP2P_APPS_PROC = 0,
30 SMP2P_MODEM_PROC = 1,
31 SMP2P_AUDIO_PROC = 2,
32 SMP2P_RESERVED_PROC_1 = 3,
33 SMP2P_WIRELESS_PROC = 4,
34 SMP2P_RESERVED_PROC_2 = 5,
35 SMP2P_POWER_PROC = 6,
36 /* add new processors here */
37
38 SMP2P_REMOTE_MOCK_PROC,
39 SMP2P_NUM_PROCS,
40};
41
42/**
43 * Notification events that are passed to notifier for incoming and outgoing
44 * entries.
45 *
46 * If the @metadata argument in the notifier is non-null, then it will
47 * point to the associated struct smux_meta_* structure.
48 */
49enum msm_smp2p_events {
50 SMP2P_OPEN, /* data is NULL */
51 SMP2P_ENTRY_UPDATE, /* data => struct msm_smp2p_update_notif */
52};
53
54/**
55 * Passed in response to a SMP2P_ENTRY_UPDATE event.
56 *
57 * @prev_value: previous value of entry
58 * @current_value: latest value of entry
59 */
60struct msm_smp2p_update_notif {
61 uint32_t previous_value;
62 uint32_t current_value;
63};
64
65int msm_smp2p_out_open(int remote_pid, const char *entry,
66 struct notifier_block *open_notifier,
67 struct msm_smp2p_out **handle);
68int msm_smp2p_out_close(struct msm_smp2p_out **handle);
69int msm_smp2p_out_read(struct msm_smp2p_out *handle, uint32_t *data);
70int msm_smp2p_out_write(struct msm_smp2p_out *handle, uint32_t data);
71int msm_smp2p_out_modify(struct msm_smp2p_out *handle, uint32_t set_mask,
72 uint32_t clear_mask);
73int msm_smp2p_in_read(int remote_pid, const char *entry, uint32_t *data);
74int msm_smp2p_in_register(int remote_pid, const char *entry,
75 struct notifier_block *in_notifier);
76int msm_smp2p_in_unregister(int remote_pid, const char *entry,
77 struct notifier_block *in_notifier);
78
79#endif /* _ARCH_ARM_MACH_MSM_SMP2P_PRIVATE_API_H_ */