Lines Matching +full:cs +full:- +full:0

1 // SPDX-License-Identifier: GPL-2.0-only
13 * snd_pcm_create_iec958_consumer_default - create default consumer format IEC958 channel status
14 * @cs: channel status buffer, at least four bytes
17 * Create the consumer format channel status data in @cs of maximum size
18 * @len. When relevant, the configuration-dependant bits will be set as
29 int snd_pcm_create_iec958_consumer_default(u8 *cs, size_t len) in snd_pcm_create_iec958_consumer_default() argument
32 return -EINVAL; in snd_pcm_create_iec958_consumer_default()
34 memset(cs, 0, len); in snd_pcm_create_iec958_consumer_default()
36 cs[0] = IEC958_AES0_CON_NOT_COPYRIGHT | IEC958_AES0_CON_EMPHASIS_NONE; in snd_pcm_create_iec958_consumer_default()
37 cs[1] = IEC958_AES1_CON_GENERAL; in snd_pcm_create_iec958_consumer_default()
38 cs[2] = IEC958_AES2_CON_SOURCE_UNSPEC | IEC958_AES2_CON_CHANNEL_UNSPEC; in snd_pcm_create_iec958_consumer_default()
39 cs[3] = IEC958_AES3_CON_CLOCK_1000PPM | IEC958_AES3_CON_FS_NOTID; in snd_pcm_create_iec958_consumer_default()
42 cs[4] = IEC958_AES4_CON_WORDLEN_NOTID; in snd_pcm_create_iec958_consumer_default()
49 u8 *cs, size_t len) in fill_iec958_consumer() argument
52 return -EINVAL; in fill_iec958_consumer()
54 if ((cs[3] & IEC958_AES3_CON_FS) == IEC958_AES3_CON_FS_NOTID) { in fill_iec958_consumer()
80 return -EINVAL; in fill_iec958_consumer()
83 cs[3] &= ~IEC958_AES3_CON_FS; in fill_iec958_consumer()
84 cs[3] |= fs; in fill_iec958_consumer()
88 (cs[4] & IEC958_AES4_CON_WORDLEN) == IEC958_AES4_CON_WORDLEN_NOTID) { in fill_iec958_consumer()
103 case 32: /* Assume 24-bit width for 32-bit samples. */ in fill_iec958_consumer()
109 return -EINVAL; in fill_iec958_consumer()
112 cs[4] &= ~IEC958_AES4_CON_WORDLEN; in fill_iec958_consumer()
113 cs[4] |= ws; in fill_iec958_consumer()
120 * snd_pcm_fill_iec958_consumer - Fill consumer format IEC958 channel status
121 * @runtime: pcm runtime structure with ->rate filled in
122 * @cs: channel status buffer, at least four bytes
134 u8 *cs, size_t len) in snd_pcm_fill_iec958_consumer() argument
136 return fill_iec958_consumer(runtime->rate, in snd_pcm_fill_iec958_consumer()
137 snd_pcm_format_width(runtime->format), in snd_pcm_fill_iec958_consumer()
138 cs, len); in snd_pcm_fill_iec958_consumer()
143 * snd_pcm_fill_iec958_consumer_hw_params - Fill consumer format IEC958 channel status
145 * @cs: channel status buffer, at least four bytes
157 u8 *cs, size_t len) in snd_pcm_fill_iec958_consumer_hw_params() argument
159 return fill_iec958_consumer(params_rate(params), params_width(params), cs, len); in snd_pcm_fill_iec958_consumer_hw_params()
164 * snd_pcm_create_iec958_consumer - create consumer format IEC958 channel status
165 * @runtime: pcm runtime structure with ->rate filled in
166 * @cs: channel status buffer, at least four bytes
169 * Create the consumer format channel status data in @cs of maximum size
176 int snd_pcm_create_iec958_consumer(struct snd_pcm_runtime *runtime, u8 *cs, in snd_pcm_create_iec958_consumer() argument
181 ret = snd_pcm_create_iec958_consumer_default(cs, len); in snd_pcm_create_iec958_consumer()
182 if (ret < 0) in snd_pcm_create_iec958_consumer()
185 return snd_pcm_fill_iec958_consumer(runtime, cs, len); in snd_pcm_create_iec958_consumer()
190 * snd_pcm_create_iec958_consumer_hw_params - create IEC958 channel status
192 * @cs: channel status buffer, at least four bytes
195 * Create the consumer format channel status data in @cs of maximum size
203 u8 *cs, size_t len) in snd_pcm_create_iec958_consumer_hw_params() argument
207 ret = snd_pcm_create_iec958_consumer_default(cs, len); in snd_pcm_create_iec958_consumer_hw_params()
208 if (ret < 0) in snd_pcm_create_iec958_consumer_hw_params()
211 return fill_iec958_consumer(params_rate(params), params_width(params), cs, len); in snd_pcm_create_iec958_consumer_hw_params()