4
* Author: Liam Girdwood <lrg@slimlogic.co.uk>
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.
11
#ifndef __LINUX_SND_SOC_OMAP_PORT_MGR_H
12
#define __LINUX_SND_SOC_OMAP_PORT_MGR_H
14
#include <linux/debugfs.h>
17
* TODO: These structures, enums and port ID macros should be moved to the
18
* new public ABE API header.
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
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
43
#define OMAP_ABE_MAX_PORT_ID OMAP_ABE_FE_PORT_TONES
45
/* ports can either be enabled or disabled */
51
/* structure used for client port info */
52
struct omap_abe_port {
54
/* logical and physical port IDs that correspond this port */
59
/* enabled or disabled */
60
enum port_state state;
62
/* logical port ref count */
65
struct list_head list;
68
#ifdef CONFIG_DEBUG_FS
69
struct dentry *debugfs_lstate;
70
struct dentry *debugfs_lphy;
71
struct dentry *debugfs_lusers;
75
/* main ABE structure */
78
/* List of open ABE logical ports */
79
struct list_head ports;
85
#ifdef CONFIG_DEBUG_FS
86
struct dentry *debugfs_root;
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);
98
#endif /* __LINUX_SND_SOC_OMAP_PORT_MGR_H */