Lines Matching refs:bits
24 SND_CS8403_DECL void SND_CS8403_DECODE(struct snd_aes_iec958 *diga, unsigned char bits) in SND_CS8403_DECODE() argument
26 if (bits & 0x01) { /* consumer */ in SND_CS8403_DECODE()
27 if (!(bits & 0x02)) in SND_CS8403_DECODE()
29 if (!(bits & 0x08)) in SND_CS8403_DECODE()
31 switch (bits & 0x10) { in SND_CS8403_DECODE()
35 if (!(bits & 0x80)) in SND_CS8403_DECODE()
37 switch (bits & 0x60) { in SND_CS8403_DECODE()
43 switch (bits & 0x06) { in SND_CS8403_DECODE()
50 switch (bits & 0x18) { in SND_CS8403_DECODE()
56 switch (bits & 0x60) { in SND_CS8403_DECODE()
62 if (bits & 0x80) in SND_CS8403_DECODE()
69 unsigned char bits; in SND_CS8403_ENCODE() local
72 bits = 0x01; /* consumer mode */ in SND_CS8403_ENCODE()
74 bits &= ~0x02; in SND_CS8403_ENCODE()
76 bits |= 0x02; in SND_CS8403_ENCODE()
78 bits &= ~0x08; in SND_CS8403_ENCODE()
80 bits |= 0x08; in SND_CS8403_ENCODE()
83 case IEC958_AES0_CON_EMPHASIS_NONE: bits |= 0x10; break; in SND_CS8403_ENCODE()
84 case IEC958_AES0_CON_EMPHASIS_5015: bits |= 0x00; break; in SND_CS8403_ENCODE()
87 bits &= ~0x80; in SND_CS8403_ENCODE()
89 bits |= 0x80; in SND_CS8403_ENCODE()
91 bits |= 0x60; in SND_CS8403_ENCODE()
95 bits |= 0x00; break; in SND_CS8403_ENCODE()
97 bits |= 0x20; break; in SND_CS8403_ENCODE()
100 bits |= 0x40; break; in SND_CS8403_ENCODE()
105 case IEC958_AES3_CON_FS_44100: bits |= 0x00; break; in SND_CS8403_ENCODE()
106 case IEC958_AES3_CON_FS_48000: bits |= 0x02; break; in SND_CS8403_ENCODE()
107 case IEC958_AES3_CON_FS_32000: bits |= 0x04; break; in SND_CS8403_ENCODE()
110 bits = 0x00; /* professional mode */ in SND_CS8403_ENCODE()
112 bits &= ~0x02; in SND_CS8403_ENCODE()
114 bits |= 0x02; in SND_CS8403_ENCODE()
117 case IEC958_AES0_PRO_FS_32000: bits |= 0x00; break; in SND_CS8403_ENCODE()
118 case IEC958_AES0_PRO_FS_44100: bits |= 0x10; break; /* 44.1kHz */ in SND_CS8403_ENCODE()
119 case IEC958_AES0_PRO_FS_48000: bits |= 0x08; break; /* 48kHz */ in SND_CS8403_ENCODE()
121 case IEC958_AES0_PRO_FS_NOTID: bits |= 0x18; break; in SND_CS8403_ENCODE()
124 case IEC958_AES0_PRO_EMPHASIS_NONE: bits |= 0x20; break; in SND_CS8403_ENCODE()
125 case IEC958_AES0_PRO_EMPHASIS_5015: bits |= 0x40; break; in SND_CS8403_ENCODE()
126 case IEC958_AES0_PRO_EMPHASIS_CCITT: bits |= 0x00; break; in SND_CS8403_ENCODE()
128 case IEC958_AES0_PRO_EMPHASIS_NOTID: bits |= 0x60; break; in SND_CS8403_ENCODE()
132 case IEC958_AES1_PRO_MODE_STEREOPHONIC: bits |= 0x00; break; in SND_CS8403_ENCODE()
133 default: bits |= 0x80; break; in SND_CS8403_ENCODE()
136 return bits; in SND_CS8403_ENCODE()
154 SND_CS8404_DECL void SND_CS8404_DECODE(struct snd_aes_iec958 *diga, unsigned char bits) in SND_CS8404_DECODE() argument
156 if (bits & 0x10) { /* consumer */ in SND_CS8404_DECODE()
157 if (!(bits & 0x20)) in SND_CS8404_DECODE()
159 if (!(bits & 0x40)) in SND_CS8404_DECODE()
161 if (!(bits & 0x80)) in SND_CS8404_DECODE()
163 switch (bits & 0x03) { in SND_CS8404_DECODE()
167 switch (bits & 0x06) { in SND_CS8404_DECODE()
174 if (!(bits & 0x04)) in SND_CS8404_DECODE()
176 switch (bits & 0x60) { in SND_CS8404_DECODE()
182 switch (bits & 0x03) { in SND_CS8404_DECODE()
188 if (!(bits & 0x80)) in SND_CS8404_DECODE()
195 unsigned char bits; in SND_CS8404_ENCODE() local
198 bits = 0x10; /* consumer mode */ in SND_CS8404_ENCODE()
200 bits |= 0x20; in SND_CS8404_ENCODE()
202 bits |= 0x40; in SND_CS8404_ENCODE()
204 bits |= 0x80; in SND_CS8404_ENCODE()
206 bits |= 0x03; in SND_CS8404_ENCODE()
209 case IEC958_AES3_CON_FS_44100: bits |= 0x06; break; in SND_CS8404_ENCODE()
210 case IEC958_AES3_CON_FS_48000: bits |= 0x04; break; in SND_CS8404_ENCODE()
211 case IEC958_AES3_CON_FS_32000: bits |= 0x02; break; in SND_CS8404_ENCODE()
214 bits = 0x00; /* professional mode */ in SND_CS8404_ENCODE()
216 bits |= 0x04; in SND_CS8404_ENCODE()
218 case IEC958_AES0_PRO_FS_32000: bits |= 0x00; break; in SND_CS8404_ENCODE()
219 case IEC958_AES0_PRO_FS_44100: bits |= 0x40; break; /* 44.1kHz */ in SND_CS8404_ENCODE()
220 case IEC958_AES0_PRO_FS_48000: bits |= 0x20; break; /* 48kHz */ in SND_CS8404_ENCODE()
222 case IEC958_AES0_PRO_FS_NOTID: bits |= 0x00; break; in SND_CS8404_ENCODE()
225 case IEC958_AES0_PRO_EMPHASIS_NONE: bits |= 0x02; break; in SND_CS8404_ENCODE()
226 case IEC958_AES0_PRO_EMPHASIS_5015: bits |= 0x01; break; in SND_CS8404_ENCODE()
227 case IEC958_AES0_PRO_EMPHASIS_CCITT: bits |= 0x00; break; in SND_CS8404_ENCODE()
229 case IEC958_AES0_PRO_EMPHASIS_NOTID: bits |= 0x03; break; in SND_CS8404_ENCODE()
233 case IEC958_AES1_PRO_MODE_STEREOPHONIC: bits |= 0x00; break; in SND_CS8404_ENCODE()
234 default: bits |= 0x80; break; in SND_CS8404_ENCODE()
237 return bits; in SND_CS8404_ENCODE()