Lines Matching refs:bits

39 SND_CS8403_DECL void SND_CS8403_DECODE(struct snd_aes_iec958 *diga, unsigned char bits)  in SND_CS8403_DECODE()  argument
41 if (bits & 0x01) { /* consumer */ in SND_CS8403_DECODE()
42 if (!(bits & 0x02)) in SND_CS8403_DECODE()
44 if (!(bits & 0x08)) in SND_CS8403_DECODE()
46 switch (bits & 0x10) { in SND_CS8403_DECODE()
50 if (!(bits & 0x80)) in SND_CS8403_DECODE()
52 switch (bits & 0x60) { in SND_CS8403_DECODE()
58 switch (bits & 0x06) { in SND_CS8403_DECODE()
65 switch (bits & 0x18) { in SND_CS8403_DECODE()
71 switch (bits & 0x60) { in SND_CS8403_DECODE()
77 if (bits & 0x80) in SND_CS8403_DECODE()
84 unsigned char bits; in SND_CS8403_ENCODE() local
87 bits = 0x01; /* consumer mode */ in SND_CS8403_ENCODE()
89 bits &= ~0x02; in SND_CS8403_ENCODE()
91 bits |= 0x02; in SND_CS8403_ENCODE()
93 bits &= ~0x08; in SND_CS8403_ENCODE()
95 bits |= 0x08; in SND_CS8403_ENCODE()
98 case IEC958_AES0_CON_EMPHASIS_NONE: bits |= 0x10; break; in SND_CS8403_ENCODE()
99 case IEC958_AES0_CON_EMPHASIS_5015: bits |= 0x00; break; in SND_CS8403_ENCODE()
102 bits &= ~0x80; in SND_CS8403_ENCODE()
104 bits |= 0x80; in SND_CS8403_ENCODE()
106 bits |= 0x60; in SND_CS8403_ENCODE()
110 bits |= 0x00; break; in SND_CS8403_ENCODE()
112 bits |= 0x20; break; in SND_CS8403_ENCODE()
115 bits |= 0x40; break; in SND_CS8403_ENCODE()
120 case IEC958_AES3_CON_FS_44100: bits |= 0x00; break; in SND_CS8403_ENCODE()
121 case IEC958_AES3_CON_FS_48000: bits |= 0x02; break; in SND_CS8403_ENCODE()
122 case IEC958_AES3_CON_FS_32000: bits |= 0x04; break; in SND_CS8403_ENCODE()
125 bits = 0x00; /* professional mode */ in SND_CS8403_ENCODE()
127 bits &= ~0x02; in SND_CS8403_ENCODE()
129 bits |= 0x02; in SND_CS8403_ENCODE()
132 case IEC958_AES0_PRO_FS_32000: bits |= 0x00; break; in SND_CS8403_ENCODE()
133 case IEC958_AES0_PRO_FS_44100: bits |= 0x10; break; /* 44.1kHz */ in SND_CS8403_ENCODE()
134 case IEC958_AES0_PRO_FS_48000: bits |= 0x08; break; /* 48kHz */ in SND_CS8403_ENCODE()
136 case IEC958_AES0_PRO_FS_NOTID: bits |= 0x18; break; in SND_CS8403_ENCODE()
139 case IEC958_AES0_PRO_EMPHASIS_NONE: bits |= 0x20; break; in SND_CS8403_ENCODE()
140 case IEC958_AES0_PRO_EMPHASIS_5015: bits |= 0x40; break; in SND_CS8403_ENCODE()
141 case IEC958_AES0_PRO_EMPHASIS_CCITT: bits |= 0x00; break; in SND_CS8403_ENCODE()
143 case IEC958_AES0_PRO_EMPHASIS_NOTID: bits |= 0x60; break; in SND_CS8403_ENCODE()
147 case IEC958_AES1_PRO_MODE_STEREOPHONIC: bits |= 0x00; break; in SND_CS8403_ENCODE()
148 default: bits |= 0x80; break; in SND_CS8403_ENCODE()
151 return bits; in SND_CS8403_ENCODE()
169 SND_CS8404_DECL void SND_CS8404_DECODE(struct snd_aes_iec958 *diga, unsigned char bits) in SND_CS8404_DECODE() argument
171 if (bits & 0x10) { /* consumer */ in SND_CS8404_DECODE()
172 if (!(bits & 0x20)) in SND_CS8404_DECODE()
174 if (!(bits & 0x40)) in SND_CS8404_DECODE()
176 if (!(bits & 0x80)) in SND_CS8404_DECODE()
178 switch (bits & 0x03) { in SND_CS8404_DECODE()
182 switch (bits & 0x06) { in SND_CS8404_DECODE()
189 if (!(bits & 0x04)) in SND_CS8404_DECODE()
191 switch (bits & 0x60) { in SND_CS8404_DECODE()
197 switch (bits & 0x03) { in SND_CS8404_DECODE()
203 if (!(bits & 0x80)) in SND_CS8404_DECODE()
210 unsigned char bits; in SND_CS8404_ENCODE() local
213 bits = 0x10; /* consumer mode */ in SND_CS8404_ENCODE()
215 bits |= 0x20; in SND_CS8404_ENCODE()
217 bits |= 0x40; in SND_CS8404_ENCODE()
219 bits |= 0x80; in SND_CS8404_ENCODE()
221 bits |= 0x03; in SND_CS8404_ENCODE()
224 case IEC958_AES3_CON_FS_44100: bits |= 0x06; break; in SND_CS8404_ENCODE()
225 case IEC958_AES3_CON_FS_48000: bits |= 0x04; break; in SND_CS8404_ENCODE()
226 case IEC958_AES3_CON_FS_32000: bits |= 0x02; break; in SND_CS8404_ENCODE()
229 bits = 0x00; /* professional mode */ in SND_CS8404_ENCODE()
231 bits |= 0x04; in SND_CS8404_ENCODE()
233 case IEC958_AES0_PRO_FS_32000: bits |= 0x00; break; in SND_CS8404_ENCODE()
234 case IEC958_AES0_PRO_FS_44100: bits |= 0x40; break; /* 44.1kHz */ in SND_CS8404_ENCODE()
235 case IEC958_AES0_PRO_FS_48000: bits |= 0x20; break; /* 48kHz */ in SND_CS8404_ENCODE()
237 case IEC958_AES0_PRO_FS_NOTID: bits |= 0x00; break; in SND_CS8404_ENCODE()
240 case IEC958_AES0_PRO_EMPHASIS_NONE: bits |= 0x02; break; in SND_CS8404_ENCODE()
241 case IEC958_AES0_PRO_EMPHASIS_5015: bits |= 0x01; break; in SND_CS8404_ENCODE()
242 case IEC958_AES0_PRO_EMPHASIS_CCITT: bits |= 0x00; break; in SND_CS8404_ENCODE()
244 case IEC958_AES0_PRO_EMPHASIS_NOTID: bits |= 0x03; break; in SND_CS8404_ENCODE()
248 case IEC958_AES1_PRO_MODE_STEREOPHONIC: bits |= 0x00; break; in SND_CS8404_ENCODE()
249 default: bits |= 0x80; break; in SND_CS8404_ENCODE()
252 return bits; in SND_CS8404_ENCODE()