diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /include/sound/sh_fsi.h | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'include/sound/sh_fsi.h')
-rw-r--r-- | include/sound/sh_fsi.h | 83 |
1 files changed, 22 insertions, 61 deletions
diff --git a/include/sound/sh_fsi.h b/include/sound/sh_fsi.h index 9d51d6f35893..9a155f9d0a12 100644 --- a/include/sound/sh_fsi.h +++ b/include/sound/sh_fsi.h | |||
@@ -15,67 +15,29 @@ | |||
15 | #define FSI_PORT_A 0 | 15 | #define FSI_PORT_A 0 |
16 | #define FSI_PORT_B 1 | 16 | #define FSI_PORT_B 1 |
17 | 17 | ||
18 | /* flags format | ||
19 | |||
20 | * 0xABCDEEFF | ||
21 | * | ||
22 | * A: channel size for TDM (input) | ||
23 | * B: channel size for TDM (ooutput) | ||
24 | * C: inversion | ||
25 | * D: mode | ||
26 | * E: input format | ||
27 | * F: output format | ||
28 | */ | ||
29 | |||
30 | #include <linux/clk.h> | 18 | #include <linux/clk.h> |
31 | #include <sound/soc.h> | 19 | #include <sound/soc.h> |
32 | 20 | ||
33 | /* TDM channel */ | 21 | /* |
34 | #define SH_FSI_SET_CH_I(x) ((x & 0xF) << 28) | 22 | * flags format |
35 | #define SH_FSI_SET_CH_O(x) ((x & 0xF) << 24) | 23 | * |
36 | 24 | * 0x000000BA | |
37 | #define SH_FSI_CH_IMASK 0xF0000000 | 25 | * |
38 | #define SH_FSI_CH_OMASK 0x0F000000 | 26 | * A: inversion |
39 | #define SH_FSI_GET_CH_I(x) ((x & SH_FSI_CH_IMASK) >> 28) | 27 | * B: format mode |
40 | #define SH_FSI_GET_CH_O(x) ((x & SH_FSI_CH_OMASK) >> 24) | 28 | */ |
41 | |||
42 | /* clock inversion */ | ||
43 | #define SH_FSI_INVERSION_MASK 0x00F00000 | ||
44 | #define SH_FSI_LRM_INV (1 << 20) | ||
45 | #define SH_FSI_BRM_INV (1 << 21) | ||
46 | #define SH_FSI_LRS_INV (1 << 22) | ||
47 | #define SH_FSI_BRS_INV (1 << 23) | ||
48 | |||
49 | /* mode */ | ||
50 | #define SH_FSI_MODE_MASK 0x000F0000 | ||
51 | #define SH_FSI_IN_SLAVE_MODE (1 << 16) /* default master mode */ | ||
52 | #define SH_FSI_OUT_SLAVE_MODE (1 << 17) /* default master mode */ | ||
53 | |||
54 | /* DI format */ | ||
55 | #define SH_FSI_FMT_MASK 0x000000FF | ||
56 | #define SH_FSI_IFMT(x) (((SH_FSI_FMT_ ## x) & SH_FSI_FMT_MASK) << 8) | ||
57 | #define SH_FSI_OFMT(x) (((SH_FSI_FMT_ ## x) & SH_FSI_FMT_MASK) << 0) | ||
58 | #define SH_FSI_GET_IFMT(x) ((x >> 8) & SH_FSI_FMT_MASK) | ||
59 | #define SH_FSI_GET_OFMT(x) ((x >> 0) & SH_FSI_FMT_MASK) | ||
60 | |||
61 | #define SH_FSI_FMT_MONO 0 | ||
62 | #define SH_FSI_FMT_MONO_DELAY 1 | ||
63 | #define SH_FSI_FMT_PCM 2 | ||
64 | #define SH_FSI_FMT_I2S 3 | ||
65 | #define SH_FSI_FMT_TDM 4 | ||
66 | #define SH_FSI_FMT_TDM_DELAY 5 | ||
67 | #define SH_FSI_FMT_SPDIF 6 | ||
68 | |||
69 | 29 | ||
70 | #define SH_FSI_IFMT_TDM_CH(x) \ | 30 | /* A: clock inversion */ |
71 | (SH_FSI_IFMT(TDM) | SH_FSI_SET_CH_I(x)) | 31 | #define SH_FSI_INVERSION_MASK 0x0000000F |
72 | #define SH_FSI_IFMT_TDM_DELAY_CH(x) \ | 32 | #define SH_FSI_LRM_INV (1 << 0) |
73 | (SH_FSI_IFMT(TDM_DELAY) | SH_FSI_SET_CH_I(x)) | 33 | #define SH_FSI_BRM_INV (1 << 1) |
34 | #define SH_FSI_LRS_INV (1 << 2) | ||
35 | #define SH_FSI_BRS_INV (1 << 3) | ||
74 | 36 | ||
75 | #define SH_FSI_OFMT_TDM_CH(x) \ | 37 | /* B: format mode */ |
76 | (SH_FSI_OFMT(TDM) | SH_FSI_SET_CH_O(x)) | 38 | #define SH_FSI_FMT_MASK 0x000000F0 |
77 | #define SH_FSI_OFMT_TDM_DELAY_CH(x) \ | 39 | #define SH_FSI_FMT_DAI (0 << 4) |
78 | (SH_FSI_OFMT(TDM_DELAY) | SH_FSI_SET_CH_O(x)) | 40 | #define SH_FSI_FMT_SPDIF (1 << 4) |
79 | 41 | ||
80 | 42 | ||
81 | /* | 43 | /* |
@@ -85,7 +47,9 @@ | |||
85 | * ACK_MD (FSI2) | 47 | * ACK_MD (FSI2) |
86 | * CKG1 (FSI) | 48 | * CKG1 (FSI) |
87 | * | 49 | * |
88 | * err: return value < 0 | 50 | * err : return value < 0 |
51 | * no change : return value == 0 | ||
52 | * change xMD : return value > 0 | ||
89 | * | 53 | * |
90 | * 0x-00000AB | 54 | * 0x-00000AB |
91 | * | 55 | * |
@@ -111,10 +75,7 @@ | |||
111 | struct sh_fsi_platform_info { | 75 | struct sh_fsi_platform_info { |
112 | unsigned long porta_flags; | 76 | unsigned long porta_flags; |
113 | unsigned long portb_flags; | 77 | unsigned long portb_flags; |
114 | int (*set_rate)(int is_porta, int rate); /* for master mode */ | 78 | int (*set_rate)(struct device *dev, int is_porta, int rate, int enable); |
115 | }; | 79 | }; |
116 | 80 | ||
117 | extern struct snd_soc_dai fsi_soc_dai[2]; | ||
118 | extern struct snd_soc_platform fsi_soc_platform; | ||
119 | |||
120 | #endif /* __SOUND_FSI_H */ | 81 | #endif /* __SOUND_FSI_H */ |