• Home
  • Raw
  • Download

Lines Matching refs:cif

419 	struct cmdif *cif;  member
484 static int sendcmd(struct cmdif *cif, u32 flags, u32 cmd, u32 parm,
486 static int getsourcesink(struct cmdif *cif, unsigned char source,
490 static int riptide_reset(struct cmdif *cif, struct snd_riptide *chip);
668 static int senddata(struct cmdif *cif, const unsigned char *in, u32 offset) in senddata() argument
677 if (SEND_SMEM(cif, 0, addr) != 0) in senddata()
682 if (SEND_WMEM(cif, 2, in senddata()
692 static int loadfirmware(struct cmdif *cif, const unsigned char *img, in loadfirmware() argument
706 err = senddata(cif, in, laddr + saddr); in loadfirmware()
716 if (SEND_GOTO(cif, val) != 0) in loadfirmware()
737 alloclbuspath(struct cmdif *cif, unsigned char source, in alloclbuspath() argument
746 SEND_PSEL(cif, source, sink); in alloclbuspath()
770 alloclbuspath(cif, source + 1, ++npath, mixer, s); in alloclbuspath()
776 freelbuspath(struct cmdif *cif, unsigned char source, const unsigned char *path) in freelbuspath() argument
784 SEND_PCLR(cif, source, sink); in freelbuspath()
792 freelbuspath(cif, source + 1, ++npath); in freelbuspath()
797 static int writearm(struct cmdif *cif, u32 addr, u32 data, u32 mask) in writearm() argument
803 SEND_RMEM(cif, 0x02, addr, &rptr); in writearm()
807 SEND_SMEM(cif, 0x01, addr); in writearm()
808 SEND_WMEM(cif, 0x02, (rptr.retlongs[0] | data)); in writearm()
809 SEND_RMEM(cif, 0x02, addr, &rptr); in writearm()
821 static int sendcmd(struct cmdif *cif, u32 flags, u32 cmd, u32 parm, in sendcmd() argument
831 if (snd_BUG_ON(!cif)) in sendcmd()
834 hwport = cif->hwport; in sendcmd()
835 if (cif->errcnt > MAX_ERROR_COUNT) { in sendcmd()
836 if (cif->is_reset) { in sendcmd()
839 if (riptide_reset(cif, NULL) == 0) { in sendcmd()
840 cif->errcnt = 0; in sendcmd()
852 spin_lock_irqsave(&cif->lock, irqflags); in sendcmd()
853 while (i++ < CMDIF_TIMEOUT && !IS_READY(cif->hwport)) in sendcmd()
895 spin_unlock_irqrestore(&cif->lock, irqflags); in sendcmd()
897 cif->cmdcnt++; /* update command statistics */ in sendcmd()
898 cif->cmdtime += time; in sendcmd()
899 if (time > cif->cmdtimemax) in sendcmd()
900 cif->cmdtimemax = time; in sendcmd()
901 if (time < cif->cmdtimemin) in sendcmd()
902 cif->cmdtimemin = time; in sendcmd()
903 if ((cif->cmdcnt) % 1000 == 0) in sendcmd()
906 cif->cmdcnt, cif->cmdtime, cif->cmdtimemin, in sendcmd()
907 cif->cmdtimemax, cif->errcnt); in sendcmd()
911 cif->errcnt++; in sendcmd()
912 spin_unlock_irqrestore(&cif->lock, irqflags); in sendcmd()
915 cif->cmdcnt, (int)((void *)&(cmdport->stat) - (void *)hwport), in sendcmd()
923 setmixer(struct cmdif *cif, short num, unsigned short rval, unsigned short lval) in setmixer() argument
930 SEND_SDGV(cif, num, num, rval, lval); in setmixer()
931 SEND_RDGV(cif, num, num, &rptr); in setmixer()
939 static int getpaths(struct cmdif *cif, unsigned char *o) in getpaths() argument
946 getsourcesink(cif, i, i, &src[i], &sink[i]); in getpaths()
956 getsourcesink(struct cmdif *cif, unsigned char source, unsigned char sink, in getsourcesink() argument
961 if (SEND_RSSV(cif, source, sink, &rptr) && in getsourcesink()
962 SEND_RSSV(cif, source, sink, &rptr)) in getsourcesink()
971 getsamplerate(struct cmdif *cif, unsigned char *intdec, unsigned int *rate) in getsamplerate() argument
981 if (SEND_RSRC(cif, *s, &rptr) && in getsamplerate()
982 SEND_RSRC(cif, *s, &rptr)) in getsamplerate()
1002 setsampleformat(struct cmdif *cif, in setsampleformat() argument
1016 if (SEND_SETF(cif, mixer, w, ch, order, sig, id) && in setsampleformat()
1017 SEND_SETF(cif, mixer, w, ch, order, sig, id)) { in setsampleformat()
1025 setsamplerate(struct cmdif *cif, unsigned char *intdec, unsigned int rate) in setsamplerate() argument
1040 SEND_SSRC(cif, *intdec, D, M, N); in setsamplerate()
1041 SEND_RSRC(cif, *intdec, &rptr); in setsamplerate()
1058 getmixer(struct cmdif *cif, short num, unsigned short *rval, in getmixer() argument
1063 if (SEND_RDGV(cif, num, num, &rptr) && SEND_RDGV(cif, num, num, &rptr)) in getmixer()
1074 struct cmdif *cif = chip->cif; in riptide_handleirq() local
1083 if (!cif) in riptide_handleirq()
1126 READ_AUDIO_STATUS(cif->hwport), in riptide_handleirq()
1175 static int try_to_load_firmware(struct cmdif *cif, struct snd_riptide *chip) in try_to_load_firmware() argument
1181 WRITE_PORT_ULONG(cif->hwport->port[i].data1, 0); in try_to_load_firmware()
1182 WRITE_PORT_ULONG(cif->hwport->port[i].data2, 0); in try_to_load_firmware()
1184 SET_GRESET(cif->hwport); in try_to_load_firmware()
1186 UNSET_GRESET(cif->hwport); in try_to_load_firmware()
1190 if (IS_READY(cif->hwport) && !IS_GERR(cif->hwport)) in try_to_load_firmware()
1197 READ_AUDIO_STATUS(cif->hwport), in try_to_load_firmware()
1198 IS_READY(cif->hwport), IS_GERR(cif->hwport)); in try_to_load_firmware()
1203 READ_AUDIO_STATUS(cif->hwport), in try_to_load_firmware()
1204 IS_READY(cif->hwport), IS_GERR(cif->hwport)); in try_to_load_firmware()
1207 SEND_GETV(cif, &firmware.ret); in try_to_load_firmware()
1231 err = loadfirmware(cif, chip->fw_entry->data, chip->fw_entry->size); in try_to_load_firmware()
1243 static int riptide_reset(struct cmdif *cif, struct snd_riptide *chip) in riptide_reset() argument
1248 if (!cif) in riptide_reset()
1251 cif->cmdcnt = 0; in riptide_reset()
1252 cif->cmdtime = 0; in riptide_reset()
1253 cif->cmdtimemax = 0; in riptide_reset()
1254 cif->cmdtimemin = 0xffffffff; in riptide_reset()
1255 cif->errcnt = 0; in riptide_reset()
1256 cif->is_reset = 0; in riptide_reset()
1260 err = try_to_load_firmware(cif, chip); in riptide_reset()
1265 SEND_SACR(cif, 0, AC97_RESET); in riptide_reset()
1266 SEND_RACR(cif, AC97_RESET, &rptr); in riptide_reset()
1269 SEND_PLST(cif, 0); in riptide_reset()
1270 SEND_SLST(cif, 0); in riptide_reset()
1271 SEND_DLST(cif, 0); in riptide_reset()
1272 SEND_ALST(cif, 0); in riptide_reset()
1273 SEND_KDMA(cif); in riptide_reset()
1275 writearm(cif, 0x301F8, 1, 1); in riptide_reset()
1276 writearm(cif, 0x301F4, 1, 1); in riptide_reset()
1278 SEND_LSEL(cif, MODEM_CMD, 0, 0, MODEM_INTDEC, MODEM_MERGER, in riptide_reset()
1280 setmixer(cif, MODEM_MIXER, 0x7fff, 0x7fff); in riptide_reset()
1281 alloclbuspath(cif, ARM2LBUS_FIFO13, lbus_play_modem, NULL, NULL); in riptide_reset()
1283 SEND_LSEL(cif, FM_CMD, 0, 0, FM_INTDEC, FM_MERGER, FM_SPLITTER, in riptide_reset()
1285 setmixer(cif, FM_MIXER, 0x7fff, 0x7fff); in riptide_reset()
1286 writearm(cif, 0x30648 + FM_MIXER * 4, 0x01, 0x00000005); in riptide_reset()
1287 writearm(cif, 0x301A8, 0x02, 0x00000002); in riptide_reset()
1288 writearm(cif, 0x30264, 0x08, 0xffffffff); in riptide_reset()
1289 alloclbuspath(cif, OPL3_SAMPLE, lbus_play_opl3, NULL, NULL); in riptide_reset()
1291 SEND_SSRC(cif, I2S_INTDEC, 48000, in riptide_reset()
1294 SEND_LSEL(cif, I2S_CMD0, 0, 0, I2S_INTDEC, I2S_MERGER, I2S_SPLITTER, in riptide_reset()
1296 SEND_SI2S(cif, 1); in riptide_reset()
1297 alloclbuspath(cif, ARM2LBUS_FIFO0, lbus_play_i2s, NULL, NULL); in riptide_reset()
1298 alloclbuspath(cif, DIGITAL_MIXER_OUT0, lbus_play_out, NULL, NULL); in riptide_reset()
1299 alloclbuspath(cif, DIGITAL_MIXER_OUT0, lbus_play_outhp, NULL, NULL); in riptide_reset()
1301 SET_AIACK(cif->hwport); in riptide_reset()
1302 SET_AIE(cif->hwport); in riptide_reset()
1303 SET_AIACK(cif->hwport); in riptide_reset()
1304 cif->is_reset = 1; in riptide_reset()
1354 struct cmdif *cif = chip->cif; in snd_riptide_pointer() local
1358 SEND_GPOS(cif, 0, data->id, &rptr); in snd_riptide_pointer()
1387 struct cmdif *cif = chip->cif; in snd_riptide_trigger() local
1395 SEND_SSTR(cif, data->id, data->sgdlist.addr); in snd_riptide_trigger()
1396 SET_AIE(cif->hwport); in snd_riptide_trigger()
1399 setmixer(cif, data->mixer, 0x7fff, 0x7fff); in snd_riptide_trigger()
1408 setmixer(cif, data->mixer, 0, 0); in snd_riptide_trigger()
1409 setmixer(cif, data->mixer, 0, 0); in snd_riptide_trigger()
1410 SEND_KSTR(cif, data->id); in snd_riptide_trigger()
1416 SEND_GPOS(cif, 0, data->id, &rptr); in snd_riptide_trigger()
1424 SEND_PSTR(cif, data->id); in snd_riptide_trigger()
1431 SEND_SSTR(cif, data->id, data->sgdlist.addr); in snd_riptide_trigger()
1449 struct cmdif *cif = chip->cif; in snd_riptide_prepare() local
1455 if (snd_BUG_ON(!cif || !data)) in snd_riptide_prepare()
1524 freelbuspath(cif, data->source, data->lbuspath); in snd_riptide_prepare()
1525 alloclbuspath(cif, data->source, lbuspath, in snd_riptide_prepare()
1536 (cif, data->mixer, data->id, channels, format) in snd_riptide_prepare()
1537 || setsamplerate(cif, data->intdec, rate)) in snd_riptide_prepare()
1574 struct cmdif *cif = chip->cif; in snd_riptide_hw_free() local
1576 if (cif && data) { in snd_riptide_hw_free()
1578 freelbuspath(cif, data->source, data->lbuspath); in snd_riptide_hw_free()
1707 struct cmdif *cif = chip->cif; in snd_riptide_interrupt() local
1710 if (cif) { in snd_riptide_interrupt()
1712 if (IS_EOBIRQ(cif->hwport) || IS_EOSIRQ(cif->hwport) || in snd_riptide_interrupt()
1713 IS_EOCIRQ(cif->hwport)) { in snd_riptide_interrupt()
1717 if (chip->rmidi && IS_MPUIRQ(cif->hwport)) { in snd_riptide_interrupt()
1722 SET_AIACK(cif->hwport); in snd_riptide_interrupt()
1732 struct cmdif *cif = chip->cif; in snd_riptide_codec_write() local
1736 if (snd_BUG_ON(!cif)) in snd_riptide_codec_write()
1741 SEND_SACR(cif, val, reg); in snd_riptide_codec_write()
1742 SEND_RACR(cif, reg, &rptr); in snd_riptide_codec_write()
1752 struct cmdif *cif = chip->cif; in snd_riptide_codec_read() local
1755 if (snd_BUG_ON(!cif)) in snd_riptide_codec_read()
1758 if (SEND_RACR(cif, reg, &rptr) != 0) in snd_riptide_codec_read()
1759 SEND_RACR(cif, reg, &rptr); in snd_riptide_codec_read()
1766 struct cmdif *cif; in snd_riptide_initialize() local
1773 cif = chip->cif; in snd_riptide_initialize()
1774 if (!cif) { in snd_riptide_initialize()
1775 cif = kzalloc(sizeof(struct cmdif), GFP_KERNEL); in snd_riptide_initialize()
1776 if (!cif) in snd_riptide_initialize()
1778 cif->hwport = (struct riptideport *)chip->port; in snd_riptide_initialize()
1779 spin_lock_init(&cif->lock); in snd_riptide_initialize()
1780 chip->cif = cif; in snd_riptide_initialize()
1782 cif->is_reset = 0; in snd_riptide_initialize()
1783 err = riptide_reset(cif, chip); in snd_riptide_initialize()
1792 SEND_SETDPLL(cif); in snd_riptide_initialize()
1797 SET_EMPUIRQ(cif->hwport); in snd_riptide_initialize()
1804 struct cmdif *cif; in snd_riptide_free() local
1806 cif = chip->cif; in snd_riptide_free()
1807 if (cif) { in snd_riptide_free()
1808 SET_GRESET(cif->hwport); in snd_riptide_free()
1810 UNSET_GRESET(cif->hwport); in snd_riptide_free()
1811 kfree(chip->cif); in snd_riptide_free()
1835 chip->cif = NULL; in snd_riptide_create()
1870 struct cmdif *cif = NULL; in snd_riptide_proc_read() local
1884 cif = chip->cif; in snd_riptide_proc_read()
1885 if (cif) { in snd_riptide_proc_read()
1894 getmixer(cif, i, &rval, &lval); in snd_riptide_proc_read()
1899 cif->cmdcnt, cif->errcnt, in snd_riptide_proc_read()
1900 cif->cmdtime, cif->cmdtimemax, cif->cmdtimemin); in snd_riptide_proc_read()
1913 if (!(getsamplerate(cif, data->intdec, &rate))) in snd_riptide_proc_read()
1924 if (!(getsamplerate(cif, data->intdec, &rate))) in snd_riptide_proc_read()
1929 i = getpaths(cif, p); in snd_riptide_proc_read()