aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-msm/smd_private.h
diff options
context:
space:
mode:
authorBrian Swetland <swetland@google.com>2009-07-01 20:58:37 -0400
committerDaniel Walker <dwalker@codeaurora.org>2010-05-12 12:15:09 -0400
commit03e00cd350c6636b5f2a9854609fea93a5c7b677 (patch)
tree82c9fa41f1b21c1450500cb92577b17ed4ae8b45 /arch/arm/mach-msm/smd_private.h
parentec9d3d14ffa9454e6d51e5dd1889d6e9e0be5198 (diff)
[ARM] msm: cleanup smd, separate debugfs support
- pull debug code into smd_debug.c - move necessary structures and defines into smd_private.h - fix some comment formatting, etc Signed-off-by: Brian Swetland <swetland@google.com> Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
Diffstat (limited to 'arch/arm/mach-msm/smd_private.h')
-rw-r--r--arch/arm/mach-msm/smd_private.h101
1 files changed, 101 insertions, 0 deletions
diff --git a/arch/arm/mach-msm/smd_private.h b/arch/arm/mach-msm/smd_private.h
index 71f9612d5f50..13d7c9d31a9a 100644
--- a/arch/arm/mach-msm/smd_private.h
+++ b/arch/arm/mach-msm/smd_private.h
@@ -16,6 +16,10 @@
16#ifndef _ARCH_ARM_MACH_MSM_MSM_SMD_PRIVATE_H_ 16#ifndef _ARCH_ARM_MACH_MSM_MSM_SMD_PRIVATE_H_
17#define _ARCH_ARM_MACH_MSM_MSM_SMD_PRIVATE_H_ 17#define _ARCH_ARM_MACH_MSM_MSM_SMD_PRIVATE_H_
18 18
19#include <linux/platform_device.h>
20#include <linux/spinlock.h>
21#include <linux/list.h>
22
19struct smem_heap_info 23struct smem_heap_info
20{ 24{
21 unsigned initialized; 25 unsigned initialized;
@@ -232,4 +236,101 @@ typedef enum
232 SMEM_NUM_ITEMS, 236 SMEM_NUM_ITEMS,
233} smem_mem_type; 237} smem_mem_type;
234 238
239
240#define SMD_SS_CLOSED 0x00000000
241#define SMD_SS_OPENING 0x00000001
242#define SMD_SS_OPENED 0x00000002
243#define SMD_SS_FLUSHING 0x00000003
244#define SMD_SS_CLOSING 0x00000004
245#define SMD_SS_RESET 0x00000005
246#define SMD_SS_RESET_OPENING 0x00000006
247
248#define SMD_BUF_SIZE 8192
249#define SMD_CHANNELS 64
250
251#define SMD_HEADER_SIZE 20
252
253struct smd_alloc_elm {
254 char name[20];
255 uint32_t cid;
256 uint32_t ctype;
257 uint32_t ref_count;
258};
259
260struct smd_half_channel {
261 unsigned state;
262 unsigned char fDSR;
263 unsigned char fCTS;
264 unsigned char fCD;
265 unsigned char fRI;
266 unsigned char fHEAD;
267 unsigned char fTAIL;
268 unsigned char fSTATE;
269 unsigned char fUNUSED;
270 unsigned tail;
271 unsigned head;
272} __attribute__((packed));
273
274struct smd_shared_v1 {
275 struct smd_half_channel ch0;
276 unsigned char data0[SMD_BUF_SIZE];
277 struct smd_half_channel ch1;
278 unsigned char data1[SMD_BUF_SIZE];
279};
280
281struct smd_shared_v2 {
282 struct smd_half_channel ch0;
283 struct smd_half_channel ch1;
284};
285
286struct smd_channel {
287 volatile struct smd_half_channel *send;
288 volatile struct smd_half_channel *recv;
289 unsigned char *send_data;
290 unsigned char *recv_data;
291
292 unsigned fifo_mask;
293 unsigned fifo_size;
294 unsigned current_packet;
295 unsigned n;
296
297 struct list_head ch_list;
298
299 void *priv;
300 void (*notify)(void *priv, unsigned flags);
301
302 int (*read)(struct smd_channel *ch, void *data, int len);
303 int (*write)(struct smd_channel *ch, const void *data, int len);
304 int (*read_avail)(struct smd_channel *ch);
305 int (*write_avail)(struct smd_channel *ch);
306
307 void (*update_state)(struct smd_channel *ch);
308 unsigned last_state;
309 void (*notify_other_cpu)(void);
310 unsigned type;
311
312 char name[32];
313 struct platform_device pdev;
314};
315
316#define SMD_TYPE_MASK 0x0FF
317#define SMD_TYPE_APPS_MODEM 0x000
318#define SMD_TYPE_APPS_DSP 0x001
319#define SMD_TYPE_MODEM_DSP 0x002
320
321#define SMD_KIND_MASK 0xF00
322#define SMD_KIND_UNKNOWN 0x000
323#define SMD_KIND_STREAM 0x100
324#define SMD_KIND_PACKET 0x200
325
326extern struct list_head smd_ch_closed_list;
327extern struct list_head smd_ch_list;
328
329extern spinlock_t smd_lock;
330extern spinlock_t smem_lock;
331
332void *smem_find(unsigned id, unsigned size);
333void *smem_item(unsigned id, unsigned *size);
334uint32_t raw_smsm_get_state(enum smsm_state_item item);
335
235#endif 336#endif