Lines Matching refs:aci

114 	struct snd_miro_aci *aci;  member
145 static int aci_busy_wait(struct snd_miro_aci *aci) in aci_busy_wait() argument
151 byte = inb(aci->aci_port + ACI_REG_BUSY); in aci_busy_wait()
181 static inline int aci_write(struct snd_miro_aci *aci, unsigned char byte) in aci_write() argument
183 if (aci_busy_wait(aci) >= 0) { in aci_write()
184 outb(byte, aci->aci_port + ACI_REG_COMMAND); in aci_write()
192 static inline int aci_read(struct snd_miro_aci *aci) in aci_read() argument
196 if (aci_busy_wait(aci) >= 0) { in aci_read()
197 byte = inb(aci->aci_port + ACI_REG_STATUS); in aci_read()
205 int snd_aci_cmd(struct snd_miro_aci *aci, int write1, int write2, int write3) in snd_aci_cmd() argument
210 if (mutex_lock_interruptible(&aci->aci_mutex)) in snd_aci_cmd()
217 value = aci_write(aci, write[i]); in snd_aci_cmd()
223 value = aci_read(aci); in snd_aci_cmd()
225 out: mutex_unlock(&aci->aci_mutex); in snd_aci_cmd()
230 static int aci_getvalue(struct snd_miro_aci *aci, unsigned char index) in aci_getvalue() argument
232 return snd_aci_cmd(aci, ACI_STATUS, index, -1); in aci_getvalue()
235 static int aci_setvalue(struct snd_miro_aci *aci, unsigned char index, in aci_setvalue() argument
238 return snd_aci_cmd(aci, index, value, -1); in aci_setvalue()
261 value = aci_getvalue(miro->aci, ACI_S_GENERAL); in snd_miro_get_capture()
281 error = aci_setvalue(miro->aci, ACI_SET_SOLOMODE, value); in snd_miro_put_capture()
288 change = (value != miro->aci->aci_solomode); in snd_miro_put_capture()
289 miro->aci->aci_solomode = value; in snd_miro_put_capture()
311 if (miro->aci->aci_version <= 176) { in snd_miro_get_preamp()
319 ucontrol->value.integer.value[0] = miro->aci->aci_preamp; in snd_miro_get_preamp()
323 value = aci_getvalue(miro->aci, ACI_GET_PREAMP); in snd_miro_get_preamp()
343 error = aci_setvalue(miro->aci, ACI_SET_PREAMP, value); in snd_miro_put_preamp()
350 change = (value != miro->aci->aci_preamp); in snd_miro_put_preamp()
351 miro->aci->aci_preamp = value; in snd_miro_put_preamp()
362 ucontrol->value.integer.value[0] = miro->aci->aci_amp; in snd_miro_get_amp()
375 error = aci_setvalue(miro->aci, ACI_SET_POWERAMP, value); in snd_miro_put_amp()
381 change = (value != miro->aci->aci_amp); in snd_miro_put_amp()
382 miro->aci->aci_amp = value; in snd_miro_put_amp()
431 right_val = aci_getvalue(miro->aci, right_reg); in snd_miro_get_double()
437 left_val = aci_getvalue(miro->aci, left_reg); in snd_miro_get_double()
474 struct snd_miro_aci *aci = miro->aci; in snd_miro_put_double() local
490 left_old = aci_getvalue(aci, getreg_left); in snd_miro_put_double()
496 right_old = aci_getvalue(aci, getreg_right); in snd_miro_put_double()
516 error = aci_setvalue(aci, setreg_left, left); in snd_miro_put_double()
523 error = aci_setvalue(aci, setreg_left, 0x80 - left); in snd_miro_put_double()
532 error = aci_setvalue(aci, setreg_right, right); in snd_miro_put_double()
539 error = aci_setvalue(aci, setreg_right, 0x80 - right); in snd_miro_put_double()
558 error = aci_setvalue(aci, setreg_left, 0x20 - left); in snd_miro_put_double()
564 error = aci_setvalue(aci, setreg_right, 0x20 - right); in snd_miro_put_double()
663 struct snd_miro_aci *aci = miro->aci; in snd_set_aci_init_values() local
667 if ((aci->aci_product == 'A') && wss) { in snd_set_aci_init_values()
668 error = aci_setvalue(aci, ACI_SET_WSS, wss); in snd_set_aci_init_values()
678 error = aci_setvalue(aci, ACI_SET_IDE, ide); in snd_set_aci_init_values()
688 error = aci_setvalue(aci, aci_init_values[idx][0], in snd_set_aci_init_values()
696 aci->aci_amp = 0; in snd_set_aci_init_values()
697 aci->aci_preamp = 0; in snd_set_aci_init_values()
698 aci->aci_solomode = 1; in snd_set_aci_init_values()
730 if ((miro->aci->aci_product == 'A') || in snd_miro_mixer()
731 (miro->aci->aci_product == 'B')) { in snd_miro_mixer()
741 if ((miro->aci->aci_product == 'B') || in snd_miro_mixer()
742 (miro->aci->aci_product == 'C')) { in snd_miro_mixer()
747 if (miro->aci->aci_version >= 176) { in snd_miro_mixer()
754 if (miro->aci->aci_product == 'C') { in snd_miro_mixer()
891 struct snd_miro_aci *aci = miro->aci; in snd_miro_proc_read() local
897 (aci->aci_vendor == 'm') && in snd_miro_proc_read()
898 (aci->aci_product == 'A')) { in snd_miro_proc_read()
899 switch (aci->aci_version) { in snd_miro_proc_read()
912 (aci->aci_vendor == 'm') && in snd_miro_proc_read()
913 (aci->aci_product == 'B')) { in snd_miro_proc_read()
914 switch (aci->aci_version) { in snd_miro_proc_read()
930 (aci->aci_vendor == 'm') && in snd_miro_proc_read()
931 (aci->aci_product == 'C')) { in snd_miro_proc_read()
932 switch (aci->aci_version) { in snd_miro_proc_read()
956 switch (aci->aci_vendor) { in snd_miro_proc_read()
961 snd_iprintf(buffer, "unknown (0x%x)\n", aci->aci_vendor); in snd_miro_proc_read()
966 switch (aci->aci_product) { in snd_miro_proc_read()
977 snd_iprintf(buffer, "unknown (0x%x)\n", aci->aci_product); in snd_miro_proc_read()
982 aci->aci_version, aci->aci_version); in snd_miro_proc_read()
984 aci->aci_port, aci->aci_port+2); in snd_miro_proc_read()
987 snd_iprintf(buffer, " solomode: 0x%x\n", aci->aci_solomode); in snd_miro_proc_read()
988 snd_iprintf(buffer, " amp : 0x%x\n", aci->aci_amp); in snd_miro_proc_read()
989 snd_iprintf(buffer, " preamp : 0x%x\n", aci->aci_preamp); in snd_miro_proc_read()
1207 struct snd_miro_aci *aci = &aci_device; in snd_card_miro_aci_detect() local
1209 miro->aci = aci; in snd_card_miro_aci_detect()
1211 mutex_init(&aci->aci_mutex); in snd_card_miro_aci_detect()
1216 aci->aci_port = (regval & 0x10) ? 0x344 : 0x354; in snd_card_miro_aci_detect()
1219 devm_request_region(card->dev, aci->aci_port, 3, "miro aci"); in snd_card_miro_aci_detect()
1222 aci->aci_port, aci->aci_port+2); in snd_card_miro_aci_detect()
1228 if (snd_aci_cmd(aci, ACI_ERROR_OP, -1, -1) < 0) { in snd_card_miro_aci_detect()
1233 aci->aci_vendor = snd_aci_cmd(aci, ACI_READ_IDCODE, -1, -1); in snd_card_miro_aci_detect()
1234 aci->aci_product = snd_aci_cmd(aci, ACI_READ_IDCODE, -1, -1); in snd_card_miro_aci_detect()
1235 if (aci->aci_vendor < 0 || aci->aci_product < 0) { in snd_card_miro_aci_detect()
1237 aci->aci_port); in snd_card_miro_aci_detect()
1241 aci->aci_version = snd_aci_cmd(aci, ACI_READ_VERSION, -1, -1); in snd_card_miro_aci_detect()
1242 if (aci->aci_version < 0) { in snd_card_miro_aci_detect()
1244 aci->aci_port); in snd_card_miro_aci_detect()
1248 if (snd_aci_cmd(aci, ACI_INIT, -1, -1) < 0 || in snd_card_miro_aci_detect()
1249 snd_aci_cmd(aci, ACI_ERROR_OP, ACI_ERROR_OP, ACI_ERROR_OP) < 0 || in snd_card_miro_aci_detect()
1250 snd_aci_cmd(aci, ACI_ERROR_OP, ACI_ERROR_OP, ACI_ERROR_OP) < 0) { in snd_card_miro_aci_detect()
1320 if (miro->aci->aci_vendor == 'm') { in snd_miro_probe()
1322 switch (miro->aci->aci_product) { in snd_miro_probe()