• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/src/linux/linux-2.6/sound/pci/riptide/

Lines Matching refs:cif

433 	struct cmdif *cif;
499 static int sendcmd(struct cmdif *cif, u32 flags, u32 cmd, u32 parm,
501 static int getsourcesink(struct cmdif *cif, unsigned char source,
505 static int riptide_reset(struct cmdif *cif, struct snd_riptide *chip);
706 static int senddata(struct cmdif *cif, unsigned char *in, u32 offset)
715 if (SEND_SMEM(cif, 0, addr) != 0)
720 if (SEND_WMEM(cif, 2,
730 static int loadfirmware(struct cmdif *cif, unsigned char *img,
744 err = senddata(cif, in, laddr + saddr);
754 if (SEND_GOTO(cif, val) != 0)
775 alloclbuspath(struct cmdif *cif, unsigned char source,
784 SEND_PSEL(cif, source, sink);
808 alloclbuspath(cif, source + 1, ++npath, mixer, s);
814 freelbuspath(struct cmdif *cif, unsigned char source, unsigned char *path)
822 SEND_PCLR(cif, source, sink);
830 freelbuspath(cif, source + 1, ++npath);
835 static int writearm(struct cmdif *cif, u32 addr, u32 data, u32 mask)
841 SEND_RMEM(cif, 0x02, addr, &rptr);
845 SEND_SMEM(cif, 0x01, addr);
846 SEND_WMEM(cif, 0x02, (rptr.retlongs[0] | data));
847 SEND_RMEM(cif, 0x02, addr, &rptr);
859 static int sendcmd(struct cmdif *cif, u32 flags, u32 cmd, u32 parm,
869 snd_assert(cif, return -EINVAL);
871 hwport = cif->hwport;
872 if (cif->errcnt > MAX_ERROR_COUNT) {
873 if (cif->is_reset) {
876 if (riptide_reset(cif, NULL) == 0) {
877 cif->errcnt = 0;
889 spin_lock_irqsave(&cif->lock, irqflags);
890 while (i++ < CMDIF_TIMEOUT && !IS_READY(cif->hwport))
930 spin_unlock_irqrestore(&cif->lock, irqflags);
932 cif->cmdcnt++; /* update command statistics */
933 cif->cmdtime += time;
934 if (time > cif->cmdtimemax)
935 cif->cmdtimemax = time;
936 if (time < cif->cmdtimemin)
937 cif->cmdtimemin = time;
938 if ((cif->cmdcnt) % 1000 == 0)
941 cif->cmdcnt, cif->cmdtime, cif->cmdtimemin,
942 cif->cmdtimemax, cif->errcnt);
946 cif->errcnt++;
947 spin_unlock_irqrestore(&cif->lock, irqflags);
950 cif->cmdcnt, (int)((void *)&(cmdport->stat) - (void *)hwport),
958 setmixer(struct cmdif *cif, short num, unsigned short rval, unsigned short lval)
965 SEND_SDGV(cif, num, num, rval, lval);
966 SEND_RDGV(cif, num, num, &rptr);
974 static int getpaths(struct cmdif *cif, unsigned char *o)
981 getsourcesink(cif, i, i, &src[i], &sink[i]);
991 getsourcesink(struct cmdif *cif, unsigned char source, unsigned char sink,
996 if (SEND_RSSV(cif, source, sink, &rptr) &&
997 SEND_RSSV(cif, source, sink, &rptr))
1006 getsamplerate(struct cmdif *cif, unsigned char *intdec, unsigned int *rate)
1016 if (SEND_RSRC(cif, *s, &rptr) &&
1017 SEND_RSRC(cif, *s, &rptr))
1037 setsampleformat(struct cmdif *cif,
1051 if (SEND_SETF(cif, mixer, w, ch, order, sig, id) &&
1052 SEND_SETF(cif, mixer, w, ch, order, sig, id)) {
1060 setsamplerate(struct cmdif *cif, unsigned char *intdec, unsigned int rate)
1075 SEND_SSRC(cif, *intdec, D, M, N);
1076 SEND_RSRC(cif, *intdec, &rptr);
1093 getmixer(struct cmdif *cif, short num, unsigned short *rval,
1098 if (SEND_RDGV(cif, num, num, &rptr) && SEND_RDGV(cif, num, num, &rptr))
1109 struct cmdif *cif = chip->cif;
1118 if (!cif)
1155 READ_AUDIO_STATUS(cif->hwport),
1210 static int riptide_reset(struct cmdif *cif, struct snd_riptide *chip)
1217 if (!cif)
1220 cif->cmdcnt = 0;
1221 cif->cmdtime = 0;
1222 cif->cmdtimemax = 0;
1223 cif->cmdtimemin = 0xffffffff;
1224 cif->errcnt = 0;
1225 cif->is_reset = 0;
1231 WRITE_PORT_ULONG(cif->hwport->port[i].data1, 0);
1232 WRITE_PORT_ULONG(cif->hwport->port[i].data2, 0);
1234 SET_GRESET(cif->hwport);
1236 UNSET_GRESET(cif->hwport);
1240 if (IS_READY(cif->hwport) && !IS_GERR(cif->hwport))
1246 READ_AUDIO_STATUS(cif->hwport),
1247 IS_READY(cif->hwport), IS_GERR(cif->hwport));
1252 READ_AUDIO_STATUS(cif->hwport),
1253 IS_READY(cif->hwport), IS_GERR(cif->hwport));
1256 SEND_GETV(cif, &rptr);
1289 err = loadfirmware(cif, chip->fw_entry->data,
1298 SEND_SACR(cif, 0, AC97_RESET);
1299 SEND_RACR(cif, AC97_RESET, &rptr);
1302 SEND_PLST(cif, 0);
1303 SEND_SLST(cif, 0);
1304 SEND_DLST(cif, 0);
1305 SEND_ALST(cif, 0);
1306 SEND_KDMA(cif);
1308 writearm(cif, 0x301F8, 1, 1);
1309 writearm(cif, 0x301F4, 1, 1);
1311 SEND_LSEL(cif, MODEM_CMD, 0, 0, MODEM_INTDEC, MODEM_MERGER,
1313 setmixer(cif, MODEM_MIXER, 0x7fff, 0x7fff);
1314 alloclbuspath(cif, ARM2LBUS_FIFO13, lbus_play_modem, NULL, NULL);
1316 SEND_LSEL(cif, FM_CMD, 0, 0, FM_INTDEC, FM_MERGER, FM_SPLITTER,
1318 setmixer(cif, FM_MIXER, 0x7fff, 0x7fff);
1319 writearm(cif, 0x30648 + FM_MIXER * 4, 0x01, 0x00000005);
1320 writearm(cif, 0x301A8, 0x02, 0x00000002);
1321 writearm(cif, 0x30264, 0x08, 0xffffffff);
1322 alloclbuspath(cif, OPL3_SAMPLE, lbus_play_opl3, NULL, NULL);
1324 SEND_SSRC(cif, I2S_INTDEC, 48000,
1327 SEND_LSEL(cif, I2S_CMD0, 0, 0, I2S_INTDEC, I2S_MERGER, I2S_SPLITTER,
1329 SEND_SI2S(cif, 1);
1330 alloclbuspath(cif, ARM2LBUS_FIFO0, lbus_play_i2s, NULL, NULL);
1331 alloclbuspath(cif, DIGITAL_MIXER_OUT0, lbus_play_out, NULL, NULL);
1332 alloclbuspath(cif, DIGITAL_MIXER_OUT0, lbus_play_outhp, NULL, NULL);
1334 SET_AIACK(cif->hwport);
1335 SET_AIE(cif->hwport);
1336 SET_AIACK(cif->hwport);
1337 cif->is_reset = 1;
1392 struct cmdif *cif = chip->cif;
1396 SEND_GPOS(cif, 0, data->id, &rptr);
1425 struct cmdif *cif = chip->cif;
1433 SEND_SSTR(cif, data->id, data->sgdlist.addr);
1434 SET_AIE(cif->hwport);
1437 setmixer(cif, data->mixer, 0x7fff, 0x7fff);
1446 setmixer(cif, data->mixer, 0, 0);
1447 setmixer(cif, data->mixer, 0, 0);
1448 SEND_KSTR(cif, data->id);
1454 SEND_GPOS(cif, 0, data->id, &rptr);
1462 SEND_PSTR(cif, data->id);
1469 SEND_SSTR(cif, data->id, data->sgdlist.addr);
1488 struct cmdif *cif = chip->cif;
1494 snd_assert(cif && data, return -EINVAL);
1560 freelbuspath(cif, data->source, data->lbuspath);
1561 alloclbuspath(cif, data->source, lbuspath,
1572 (cif, data->mixer, data->id, channels, format)
1573 || setsamplerate(cif, data->intdec, rate))
1611 struct cmdif *cif = chip->cif;
1613 if (cif && data) {
1615 freelbuspath(cif, data->source, data->lbuspath);
1748 struct cmdif *cif = chip->cif;
1750 if (cif) {
1752 if (IS_EOBIRQ(cif->hwport) || IS_EOSIRQ(cif->hwport) ||
1753 IS_EOCIRQ(cif->hwport)) {
1757 if (chip->rmidi && IS_MPUIRQ(cif->hwport)) {
1762 SET_AIACK(cif->hwport);
1772 struct cmdif *cif = chip->cif;
1776 snd_assert(cif, return);
1780 SEND_SACR(cif, val, reg);
1781 SEND_RACR(cif, reg, &rptr);
1791 struct cmdif *cif = chip->cif;
1794 snd_assert(cif, return 0);
1796 if (SEND_RACR(cif, reg, &rptr) != 0)
1797 SEND_RACR(cif, reg, &rptr);
1804 struct cmdif *cif;
1810 cif = chip->cif;
1811 if (!cif) {
1812 if ((cif = kzalloc(sizeof(struct cmdif), GFP_KERNEL)) == NULL)
1814 cif->hwport = (struct riptideport *)chip->port;
1815 spin_lock_init(&cif->lock);
1816 chip->cif = cif;
1818 cif->is_reset = 0;
1819 if ((err = riptide_reset(cif, chip)) != 0)
1827 SEND_SETDPLL(cif);
1832 SET_EMPUIRQ(cif->hwport);
1838 struct cmdif *cif;
1842 if ((cif = chip->cif)) {
1843 SET_GRESET(cif->hwport);
1845 UNSET_GRESET(cif->hwport);
1846 kfree(chip->cif);
1889 chip->cif = NULL;
1936 struct cmdif *cif = NULL;
1950 if ((cif = chip->cif)) {
1959 getmixer(cif, i, &rval, &lval);
1964 cif->cmdcnt, cif->errcnt,
1965 cif->cmdtime, cif->cmdtimemax, cif->cmdtimemin);
1977 if (!(getsamplerate(cif, data->intdec, &rate)))
1988 if (!(getsamplerate(cif, data->intdec, &rate)))
1992 i = getpaths(cif, p);