Lines Matching refs:aci
115 struct snd_miro_aci *aci; member
146 static int aci_busy_wait(struct snd_miro_aci *aci) in aci_busy_wait() argument
152 byte = inb(aci->aci_port + ACI_REG_BUSY); in aci_busy_wait()
155 dev_dbg(aci->card->dev, in aci_busy_wait()
179 dev_err(aci->card->dev, "%s() time out\n", __func__); in aci_busy_wait()
183 static inline int aci_write(struct snd_miro_aci *aci, unsigned char byte) in aci_write() argument
185 if (aci_busy_wait(aci) >= 0) { in aci_write()
186 outb(byte, aci->aci_port + ACI_REG_COMMAND); in aci_write()
189 dev_err(aci->card->dev, "aci busy, %s(0x%x) stopped.\n", __func__, byte); in aci_write()
194 static inline int aci_read(struct snd_miro_aci *aci) in aci_read() argument
198 if (aci_busy_wait(aci) >= 0) { in aci_read()
199 byte = inb(aci->aci_port + ACI_REG_STATUS); in aci_read()
202 dev_err(aci->card->dev, "aci busy, %s() stopped.\n", __func__); in aci_read()
207 int snd_aci_cmd(struct snd_miro_aci *aci, int write1, int write2, int write3) in snd_aci_cmd() argument
212 if (mutex_lock_interruptible(&aci->aci_mutex)) in snd_aci_cmd()
219 value = aci_write(aci, write[i]); in snd_aci_cmd()
225 value = aci_read(aci); in snd_aci_cmd()
227 out: mutex_unlock(&aci->aci_mutex); in snd_aci_cmd()
232 static int aci_getvalue(struct snd_miro_aci *aci, unsigned char index) in aci_getvalue() argument
234 return snd_aci_cmd(aci, ACI_STATUS, index, -1); in aci_getvalue()
237 static int aci_setvalue(struct snd_miro_aci *aci, unsigned char index, in aci_setvalue() argument
240 return snd_aci_cmd(aci, index, value, -1); in aci_setvalue()
263 value = aci_getvalue(miro->aci, ACI_S_GENERAL); in snd_miro_get_capture()
283 error = aci_setvalue(miro->aci, ACI_SET_SOLOMODE, value); in snd_miro_put_capture()
290 change = (value != miro->aci->aci_solomode); in snd_miro_put_capture()
291 miro->aci->aci_solomode = value; in snd_miro_put_capture()
313 if (miro->aci->aci_version <= 176) { in snd_miro_get_preamp()
321 ucontrol->value.integer.value[0] = miro->aci->aci_preamp; in snd_miro_get_preamp()
325 value = aci_getvalue(miro->aci, ACI_GET_PREAMP); in snd_miro_get_preamp()
345 error = aci_setvalue(miro->aci, ACI_SET_PREAMP, value); in snd_miro_put_preamp()
352 change = (value != miro->aci->aci_preamp); in snd_miro_put_preamp()
353 miro->aci->aci_preamp = value; in snd_miro_put_preamp()
364 ucontrol->value.integer.value[0] = miro->aci->aci_amp; in snd_miro_get_amp()
377 error = aci_setvalue(miro->aci, ACI_SET_POWERAMP, value); in snd_miro_put_amp()
384 change = (value != miro->aci->aci_amp); in snd_miro_put_amp()
385 miro->aci->aci_amp = value; in snd_miro_put_amp()
434 right_val = aci_getvalue(miro->aci, right_reg); in snd_miro_get_double()
441 left_val = aci_getvalue(miro->aci, left_reg); in snd_miro_get_double()
479 struct snd_miro_aci *aci = miro->aci; in snd_miro_put_double() local
495 left_old = aci_getvalue(aci, getreg_left); in snd_miro_put_double()
502 right_old = aci_getvalue(aci, getreg_right); in snd_miro_put_double()
523 error = aci_setvalue(aci, setreg_left, left); in snd_miro_put_double()
530 error = aci_setvalue(aci, setreg_left, 0x80 - left); in snd_miro_put_double()
539 error = aci_setvalue(aci, setreg_right, right); in snd_miro_put_double()
546 error = aci_setvalue(aci, setreg_right, 0x80 - right); in snd_miro_put_double()
565 error = aci_setvalue(aci, setreg_left, 0x20 - left); in snd_miro_put_double()
571 error = aci_setvalue(aci, setreg_right, 0x20 - right); in snd_miro_put_double()
670 struct snd_miro_aci *aci = miro->aci; in snd_set_aci_init_values() local
674 if ((aci->aci_product == 'A') && wss) { in snd_set_aci_init_values()
675 error = aci_setvalue(aci, ACI_SET_WSS, wss); in snd_set_aci_init_values()
685 error = aci_setvalue(aci, ACI_SET_IDE, ide); in snd_set_aci_init_values()
695 error = aci_setvalue(aci, aci_init_values[idx][0], in snd_set_aci_init_values()
703 aci->aci_amp = 0; in snd_set_aci_init_values()
704 aci->aci_preamp = 0; in snd_set_aci_init_values()
705 aci->aci_solomode = 1; in snd_set_aci_init_values()
737 if ((miro->aci->aci_product == 'A') || in snd_miro_mixer()
738 (miro->aci->aci_product == 'B')) { in snd_miro_mixer()
748 if ((miro->aci->aci_product == 'B') || in snd_miro_mixer()
749 (miro->aci->aci_product == 'C')) { in snd_miro_mixer()
754 if (miro->aci->aci_version >= 176) { in snd_miro_mixer()
761 if (miro->aci->aci_product == 'C') { in snd_miro_mixer()
898 struct snd_miro_aci *aci = miro->aci; in snd_miro_proc_read() local
904 (aci->aci_vendor == 'm') && in snd_miro_proc_read()
905 (aci->aci_product == 'A')) { in snd_miro_proc_read()
906 switch (aci->aci_version) { in snd_miro_proc_read()
919 (aci->aci_vendor == 'm') && in snd_miro_proc_read()
920 (aci->aci_product == 'B')) { in snd_miro_proc_read()
921 switch (aci->aci_version) { in snd_miro_proc_read()
937 (aci->aci_vendor == 'm') && in snd_miro_proc_read()
938 (aci->aci_product == 'C')) { in snd_miro_proc_read()
939 switch (aci->aci_version) { in snd_miro_proc_read()
963 switch (aci->aci_vendor) { in snd_miro_proc_read()
968 snd_iprintf(buffer, "unknown (0x%x)\n", aci->aci_vendor); in snd_miro_proc_read()
973 switch (aci->aci_product) { in snd_miro_proc_read()
984 snd_iprintf(buffer, "unknown (0x%x)\n", aci->aci_product); in snd_miro_proc_read()
989 aci->aci_version, aci->aci_version); in snd_miro_proc_read()
991 aci->aci_port, aci->aci_port+2); in snd_miro_proc_read()
994 snd_iprintf(buffer, " solomode: 0x%x\n", aci->aci_solomode); in snd_miro_proc_read()
995 snd_iprintf(buffer, " amp : 0x%x\n", aci->aci_amp); in snd_miro_proc_read()
996 snd_iprintf(buffer, " preamp : 0x%x\n", aci->aci_preamp); in snd_miro_proc_read()
1214 struct snd_miro_aci *aci = &aci_device; in snd_card_miro_aci_detect() local
1216 miro->aci = aci; in snd_card_miro_aci_detect()
1218 aci->card = card; in snd_card_miro_aci_detect()
1219 mutex_init(&aci->aci_mutex); in snd_card_miro_aci_detect()
1224 aci->aci_port = (regval & 0x10) ? 0x344 : 0x354; in snd_card_miro_aci_detect()
1227 devm_request_region(card->dev, aci->aci_port, 3, "miro aci"); in snd_card_miro_aci_detect()
1230 aci->aci_port, aci->aci_port+2); in snd_card_miro_aci_detect()
1236 if (snd_aci_cmd(aci, ACI_ERROR_OP, -1, -1) < 0) { in snd_card_miro_aci_detect()
1241 aci->aci_vendor = snd_aci_cmd(aci, ACI_READ_IDCODE, -1, -1); in snd_card_miro_aci_detect()
1242 aci->aci_product = snd_aci_cmd(aci, ACI_READ_IDCODE, -1, -1); in snd_card_miro_aci_detect()
1243 if (aci->aci_vendor < 0 || aci->aci_product < 0) { in snd_card_miro_aci_detect()
1245 aci->aci_port); in snd_card_miro_aci_detect()
1249 aci->aci_version = snd_aci_cmd(aci, ACI_READ_VERSION, -1, -1); in snd_card_miro_aci_detect()
1250 if (aci->aci_version < 0) { in snd_card_miro_aci_detect()
1252 aci->aci_port); in snd_card_miro_aci_detect()
1256 if (snd_aci_cmd(aci, ACI_INIT, -1, -1) < 0 || in snd_card_miro_aci_detect()
1257 snd_aci_cmd(aci, ACI_ERROR_OP, ACI_ERROR_OP, ACI_ERROR_OP) < 0 || in snd_card_miro_aci_detect()
1258 snd_aci_cmd(aci, ACI_ERROR_OP, ACI_ERROR_OP, ACI_ERROR_OP) < 0) { in snd_card_miro_aci_detect()
1328 if (miro->aci->aci_vendor == 'm') { in snd_miro_probe()
1330 switch (miro->aci->aci_product) { in snd_miro_probe()