~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to sound/soc/omap/abe/port_mgr.h

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * ABE Port manager
 
3
 *
 
4
 * Author:              Liam Girdwood <lrg@slimlogic.co.uk>
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License version 2 as
 
8
 * published by the Free Software Foundation.
 
9
 */
 
10
 
 
11
#ifndef __LINUX_SND_SOC_OMAP_PORT_MGR_H
 
12
#define __LINUX_SND_SOC_OMAP_PORT_MGR_H
 
13
 
 
14
#include <linux/debugfs.h>
 
15
 
 
16
/*
 
17
 * TODO: These structures, enums and port ID macros should be moved to the
 
18
 * new public ABE API header.
 
19
 */
 
20
 
 
21
/* Logical PORT IDs - Backend */
 
22
#define OMAP_ABE_BE_PORT_DMIC0                  0
 
23
#define OMAP_ABE_BE_PORT_DMIC1                  1
 
24
#define OMAP_ABE_BE_PORT_DMIC2                  2
 
25
#define OMAP_ABE_BE_PORT_PDM_DL1                3
 
26
#define OMAP_ABE_BE_PORT_PDM_DL2                4
 
27
#define OMAP_ABE_BE_PORT_PDM_VIB                5
 
28
#define OMAP_ABE_BE_PORT_PDM_UL1                6
 
29
#define OMAP_ABE_BE_PORT_BT_VX_DL               7
 
30
#define OMAP_ABE_BE_PORT_BT_VX_UL               8
 
31
#define OMAP_ABE_BE_PORT_MM_EXT_UL              9
 
32
#define OMAP_ABE_BE_PORT_MM_EXT_DL              10
 
33
 
 
34
/* Logical PORT IDs - Frontend */
 
35
#define OMAP_ABE_FE_PORT_MM_DL1         11
 
36
#define OMAP_ABE_FE_PORT_MM_UL1         12
 
37
#define OMAP_ABE_FE_PORT_MM_UL2         13
 
38
#define OMAP_ABE_FE_PORT_VX_DL          14
 
39
#define OMAP_ABE_FE_PORT_VX_UL          15
 
40
#define OMAP_ABE_FE_PORT_VIB            16
 
41
#define OMAP_ABE_FE_PORT_TONES          17
 
42
 
 
43
#define OMAP_ABE_MAX_PORT_ID    OMAP_ABE_FE_PORT_TONES
 
44
 
 
45
/* ports can either be enabled or disabled */
 
46
enum port_state {
 
47
        PORT_DISABLED = 0,
 
48
        PORT_ENABLED,
 
49
};
 
50
 
 
51
/* structure used for client port info */
 
52
struct omap_abe_port {
 
53
 
 
54
        /* logical and physical port IDs that correspond this port */
 
55
        int logical_id;
 
56
        int physical_id;
 
57
        int physical_users;
 
58
 
 
59
        /* enabled or disabled */
 
60
        enum port_state state;
 
61
 
 
62
        /* logical port ref count */
 
63
        int users;
 
64
 
 
65
        struct list_head list;
 
66
        struct abe *abe;
 
67
 
 
68
#ifdef CONFIG_DEBUG_FS
 
69
        struct dentry *debugfs_lstate;
 
70
        struct dentry *debugfs_lphy;
 
71
        struct dentry *debugfs_lusers;
 
72
#endif
 
73
};
 
74
 
 
75
/* main ABE structure */
 
76
struct abe {
 
77
 
 
78
        /* List of open ABE logical ports */
 
79
        struct list_head ports;
 
80
 
 
81
        /* spinlock */
 
82
        spinlock_t lock;
 
83
 
 
84
 
 
85
#ifdef CONFIG_DEBUG_FS
 
86
        struct dentry *debugfs_root;
 
87
#endif
 
88
};
 
89
 
 
90
struct omap_abe_port *omap_abe_port_open(struct abe *abe, int logical_id);
 
91
void omap_abe_port_close(struct abe *abe, struct omap_abe_port *port);
 
92
int omap_abe_port_enable(struct abe *abe, struct omap_abe_port *port);
 
93
int omap_abe_port_disable(struct abe *abe, struct omap_abe_port *port);
 
94
int omap_abe_port_is_enabled(struct abe *abe, struct omap_abe_port *port);
 
95
struct abe *omap_abe_port_mgr_get(void);
 
96
void omap_abe_port_mgr_put(struct abe *abe);
 
97
 
 
98
#endif /* __LINUX_SND_SOC_OMAP_PORT_MGR_H */