Lines Matching +full:mux +full:- +full:ctrl +full:- +full:list
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
12 * notice, this list of conditions and the following disclaimer.
14 * notice, this list of conditions and the following disclaimer in the
43 spicds_ctrl ctrl;
49 unsigned int dvc; /* De-emphasis and Volume Control */
59 if (codec->cif)
67 codec->ctrl(codec->devinfo, cs, 0, cdti);
69 codec->ctrl(codec->devinfo, cs, 1, cdti);
81 device_printf(codec->dev, "spicds_wrcd(codec, 0x%02x, 0x%02x)\n", reg, val);
84 if (codec->cif)
85 codec->ctrl(codec->devinfo, 1, 1, 0);
87 codec->ctrl(codec->devinfo, 0, 1, 0);
89 if (codec->type != SPICDS_TYPE_WM8770) {
90 if (codec->type == SPICDS_TYPE_AK4381) {
95 else if (codec->type == SPICDS_TYPE_AK4396)
127 if (codec->cif) {
128 codec->ctrl(codec->devinfo, 0, 1, 0);
130 codec->ctrl(codec->devinfo, 1, 1, 0);
133 codec->ctrl(codec->devinfo, 1, 1, 0);
140 spicds_create(device_t dev, void *devinfo, int num, spicds_ctrl ctrl)
145 device_printf(dev, "spicds_create(dev, devinfo, %d, ctrl)\n", num);
151 snprintf(codec->name, SPICDS_NAMELEN, "%s:spicds%d", device_get_nameunit(dev), num);
152 codec->lock = snd_mtxcreate(codec->name, codec->name);
153 codec->dev = dev;
154 codec->ctrl = ctrl;
155 codec->devinfo = devinfo;
156 codec->num = num;
157 codec->type = SPICDS_TYPE_AK4524;
158 codec->cif = 0;
159 codec->format = AK452X_FORMAT_I2S | AK452X_FORMAT_256FSN | AK452X_FORMAT_1X;
160 codec->dvc = AK452X_DVC_DEMOFF | AK452X_DVC_ZTM1024 | AK452X_DVC_ZCE;
168 snd_mtxfree(codec->lock);
175 snd_mtxlock(codec->lock);
176 codec->type = type;
177 snd_mtxunlock(codec->lock);
183 snd_mtxlock(codec->lock);
184 codec->cif = cif;
185 snd_mtxunlock(codec->lock);
191 snd_mtxlock(codec->lock);
192 codec->format = format;
193 snd_mtxunlock(codec->lock);
199 snd_mtxlock(codec->lock);
200 codec->dvc = dvc;
201 snd_mtxunlock(codec->lock);
208 device_printf(codec->dev, "spicds_init(codec)\n");
210 snd_mtxlock(codec->lock);
211 if (codec->type == SPICDS_TYPE_AK4524 ||\
212 codec->type == SPICDS_TYPE_AK4528) {
216 spicds_wrcd(codec, AK4524_FORMAT, codec->format);
217 spicds_wrcd(codec, AK4524_DVC, codec->dvc);
225 if (codec->type == SPICDS_TYPE_WM8770) {
229 spicds_wrcd(codec, 0x1b, 0x044); /* ADC Mux (AC'97 source) */
233 spicds_wrcd(codec, 0x18, 0x000); /* All power-up */
238 spicds_wrcd(codec, 0x19, 0x000); /* -12dB ADC/L */
239 spicds_wrcd(codec, 0x1a, 0x000); /* -12dB ADC/R */
241 if (codec->type == SPICDS_TYPE_AK4358)
242 spicds_wrcd(codec, 0x00, 0x07); /* I2S, 24bit, power-up */
243 if (codec->type == SPICDS_TYPE_AK4381)
244 spicds_wrcd(codec, 0x00, 0x8f); /* I2S, 24bit, power-up */
245 if (codec->type == SPICDS_TYPE_AK4396)
246 spicds_wrcd(codec, 0x00, 0x07); /* I2S, 24bit, power-up */
247 snd_mtxunlock(codec->lock);
253 snd_mtxlock(codec->lock);
254 if (codec->type != SPICDS_TYPE_WM8770) {
258 spicds_wrcd(codec, AK4524_FORMAT, codec->format);
259 spicds_wrcd(codec, AK4524_DVC, codec->dvc);
268 snd_mtxunlock(codec->lock);
275 device_printf(codec->dev, "spicds_set(codec, %d, %d, %d)\n", dir, left, right);
277 snd_mtxlock(codec->lock);
279 if ((codec->type == SPICDS_TYPE_AK4381) || \
280 (codec->type == SPICDS_TYPE_AK4396))
285 switch (codec->type) {
297 if ((codec->type == SPICDS_TYPE_AK4381) || \
298 (codec->type == SPICDS_TYPE_AK4396))
303 switch (codec->type) {
314 if (dir == PCMDIR_REC && codec->type == SPICDS_TYPE_AK4524) {
316 device_printf(codec->dev, "spicds_set(): AK4524(REC) %d/%d\n", left, right);
321 if (dir == PCMDIR_PLAY && codec->type == SPICDS_TYPE_AK4524) {
323 device_printf(codec->dev, "spicds_set(): AK4524(PLAY) %d/%d\n", left, right);
328 if (dir == PCMDIR_PLAY && codec->type == SPICDS_TYPE_AK4528) {
330 device_printf(codec->dev, "spicds_set(): AK4528(PLAY) %d/%d\n", left, right);
335 if (dir == PCMDIR_PLAY && codec->type == SPICDS_TYPE_WM8770) {
337 device_printf(codec->dev, "spicds_set(): WM8770(PLAY) %d/%d\n", left, right);
342 if (dir == PCMDIR_PLAY && codec->type == SPICDS_TYPE_AK4358) {
344 device_printf(codec->dev, "spicds_set(): AK4358(PLAY) %d/%d\n", left, right);
349 if (dir == PCMDIR_PLAY && codec->type == SPICDS_TYPE_AK4381) {
351 device_printf(codec->dev, "spicds_set(): AK4381(PLAY) %d/%d\n", left, right);
357 if (dir == PCMDIR_PLAY && codec->type == SPICDS_TYPE_AK4396) {
359 device_printf(codec->dev, "spicds_set(): AK4396(PLAY) %d/%d\n", left, right);
365 snd_mtxunlock(codec->lock);