sound/pci/rme32.c
1000
memset(&rme32->capture_pcm, 0, sizeof(rme32->capture_pcm));
sound/pci/rme32.c
1001
rme32->capture_pcm.hw_buffer_size = RME32_BUFFER_SIZE;
sound/pci/rme32.c
1002
rme32->capture_pcm.hw_queue_size = RME32_BUFFER_SIZE / 2;
sound/pci/rme32.c
1003
rme32->capture_pcm.sw_buffer_size = snd_pcm_lib_buffer_bytes(substream);
sound/pci/rme32.c
1005
writel(0, rme32->iobase + RME32_IO_RESET_POS);
sound/pci/rme32.c
1013
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
sound/pci/rme32.c
1016
guard(spinlock)(&rme32->lock);
sound/pci/rme32.c
1018
if (s != rme32->playback_substream &&
sound/pci/rme32.c
1019
s != rme32->capture_substream)
sound/pci/rme32.c
1023
rme32->running |= (1 << s->stream);
sound/pci/rme32.c
1024
if (rme32->fullduplex_mode) {
sound/pci/rme32.c
1026
if (s == rme32->playback_substream) {
sound/pci/rme32.c
1027
rme32->playback_pcm.hw_io =
sound/pci/rme32.c
1028
rme32->playback_pcm.hw_data = snd_rme32_pcm_byteptr(rme32);
sound/pci/rme32.c
1030
rme32->capture_pcm.hw_io =
sound/pci/rme32.c
1031
rme32->capture_pcm.hw_data = snd_rme32_pcm_byteptr(rme32);
sound/pci/rme32.c
1036
rme32->running &= ~(1 << s->stream);
sound/pci/rme32.c
1044
if (rme32->running && ! RME32_ISWORKING(rme32))
sound/pci/rme32.c
1045
snd_rme32_pcm_start(rme32, 0);
sound/pci/rme32.c
1048
if (! rme32->running && RME32_ISWORKING(rme32))
sound/pci/rme32.c
1049
snd_rme32_pcm_stop(rme32, 0);
sound/pci/rme32.c
1052
if (rme32->running && RME32_ISWORKING(rme32))
sound/pci/rme32.c
1053
snd_rme32_pcm_stop(rme32, 1);
sound/pci/rme32.c
1056
if (rme32->running && ! RME32_ISWORKING(rme32))
sound/pci/rme32.c
1057
snd_rme32_pcm_start(rme32, 1);
sound/pci/rme32.c
1067
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
sound/pci/rme32.c
1068
return snd_rme32_pcm_byteptr(rme32) >> rme32->playback_frlog;
sound/pci/rme32.c
1074
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
sound/pci/rme32.c
1075
return snd_rme32_pcm_byteptr(rme32) >> rme32->capture_frlog;
sound/pci/rme32.c
1083
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
sound/pci/rme32.c
1084
memcpy_toio(rme32->iobase + RME32_IO_DATA_BUFFER + rec->hw_data,
sound/pci/rme32.c
1090
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
sound/pci/rme32.c
1093
rec = &rme32->playback_pcm;
sound/pci/rme32.c
1094
cprec = &rme32->capture_pcm;
sound/pci/rme32.c
1095
scoped_guard(spinlock, &rme32->lock) {
sound/pci/rme32.c
1097
if (rme32->running & (1 << SNDRV_PCM_STREAM_CAPTURE))
sound/pci/rme32.c
1107
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
sound/pci/rme32.c
1109
rme32->iobase + RME32_IO_DATA_BUFFER + rec->hw_data,
sound/pci/rme32.c
1115
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
sound/pci/rme32.c
1116
return snd_pcm_indirect_capture_transfer(substream, &rme32->capture_pcm,
sound/pci/rme32.c
1123
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
sound/pci/rme32.c
1124
return snd_pcm_indirect_playback_pointer(substream, &rme32->playback_pcm,
sound/pci/rme32.c
1125
snd_rme32_pcm_byteptr(rme32));
sound/pci/rme32.c
1131
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
sound/pci/rme32.c
1132
return snd_pcm_indirect_capture_pointer(substream, &rme32->capture_pcm,
sound/pci/rme32.c
1133
snd_rme32_pcm_byteptr(rme32));
sound/pci/rme32.c
1224
static void snd_rme32_free(struct rme32 *rme32)
sound/pci/rme32.c
1226
if (rme32->irq >= 0)
sound/pci/rme32.c
1227
snd_rme32_pcm_stop(rme32, 0);
sound/pci/rme32.c
1232
struct rme32 *rme32 = (struct rme32 *) pcm->private_data;
sound/pci/rme32.c
1233
rme32->spdif_pcm = NULL;
sound/pci/rme32.c
1239
struct rme32 *rme32 = (struct rme32 *) pcm->private_data;
sound/pci/rme32.c
1240
rme32->adat_pcm = NULL;
sound/pci/rme32.c
1243
static int snd_rme32_create(struct rme32 *rme32)
sound/pci/rme32.c
1245
struct pci_dev *pci = rme32->pci;
sound/pci/rme32.c
1248
rme32->irq = -1;
sound/pci/rme32.c
1249
spin_lock_init(&rme32->lock);
sound/pci/rme32.c
1258
rme32->port = pci_resource_start(rme32->pci, 0);
sound/pci/rme32.c
1260
rme32->iobase = devm_ioremap(&pci->dev, rme32->port, RME32_IO_SIZE);
sound/pci/rme32.c
1261
if (!rme32->iobase) {
sound/pci/rme32.c
1262
dev_err(rme32->card->dev,
sound/pci/rme32.c
1264
rme32->port, rme32->port + RME32_IO_SIZE - 1);
sound/pci/rme32.c
1269
IRQF_SHARED, KBUILD_MODNAME, rme32)) {
sound/pci/rme32.c
1270
dev_err(rme32->card->dev, "unable to grab IRQ %d\n", pci->irq);
sound/pci/rme32.c
1273
rme32->irq = pci->irq;
sound/pci/rme32.c
1274
rme32->card->sync_irq = rme32->irq;
sound/pci/rme32.c
1277
pci_read_config_byte(pci, 8, &rme32->rev);
sound/pci/rme32.c
1280
err = snd_pcm_new(rme32->card, "Digi32 IEC958", 0, 1, 1, &rme32->spdif_pcm);
sound/pci/rme32.c
1283
rme32->spdif_pcm->private_data = rme32;
sound/pci/rme32.c
1284
rme32->spdif_pcm->private_free = snd_rme32_free_spdif_pcm;
sound/pci/rme32.c
1285
strscpy(rme32->spdif_pcm->name, "Digi32 IEC958");
sound/pci/rme32.c
1286
if (rme32->fullduplex_mode) {
sound/pci/rme32.c
1287
snd_pcm_set_ops(rme32->spdif_pcm, SNDRV_PCM_STREAM_PLAYBACK,
sound/pci/rme32.c
1289
snd_pcm_set_ops(rme32->spdif_pcm, SNDRV_PCM_STREAM_CAPTURE,
sound/pci/rme32.c
1291
snd_pcm_set_managed_buffer_all(rme32->spdif_pcm, SNDRV_DMA_TYPE_CONTINUOUS,
sound/pci/rme32.c
1293
rme32->spdif_pcm->info_flags = SNDRV_PCM_INFO_JOINT_DUPLEX;
sound/pci/rme32.c
1295
snd_pcm_set_ops(rme32->spdif_pcm, SNDRV_PCM_STREAM_PLAYBACK,
sound/pci/rme32.c
1297
snd_pcm_set_ops(rme32->spdif_pcm, SNDRV_PCM_STREAM_CAPTURE,
sound/pci/rme32.c
1299
rme32->spdif_pcm->info_flags = SNDRV_PCM_INFO_HALF_DUPLEX;
sound/pci/rme32.c
1306
rme32->adat_pcm = NULL;
sound/pci/rme32.c
1309
err = snd_pcm_new(rme32->card, "Digi32 ADAT", 1,
sound/pci/rme32.c
1310
1, 1, &rme32->adat_pcm);
sound/pci/rme32.c
1313
rme32->adat_pcm->private_data = rme32;
sound/pci/rme32.c
1314
rme32->adat_pcm->private_free = snd_rme32_free_adat_pcm;
sound/pci/rme32.c
1315
strscpy(rme32->adat_pcm->name, "Digi32 ADAT");
sound/pci/rme32.c
1316
if (rme32->fullduplex_mode) {
sound/pci/rme32.c
1317
snd_pcm_set_ops(rme32->adat_pcm, SNDRV_PCM_STREAM_PLAYBACK,
sound/pci/rme32.c
1319
snd_pcm_set_ops(rme32->adat_pcm, SNDRV_PCM_STREAM_CAPTURE,
sound/pci/rme32.c
1321
snd_pcm_set_managed_buffer_all(rme32->adat_pcm, SNDRV_DMA_TYPE_CONTINUOUS,
sound/pci/rme32.c
1324
rme32->adat_pcm->info_flags = SNDRV_PCM_INFO_JOINT_DUPLEX;
sound/pci/rme32.c
1326
snd_pcm_set_ops(rme32->adat_pcm, SNDRV_PCM_STREAM_PLAYBACK,
sound/pci/rme32.c
1328
snd_pcm_set_ops(rme32->adat_pcm, SNDRV_PCM_STREAM_CAPTURE,
sound/pci/rme32.c
1330
rme32->adat_pcm->info_flags = SNDRV_PCM_INFO_HALF_DUPLEX;
sound/pci/rme32.c
1335
rme32->playback_periodsize = 0;
sound/pci/rme32.c
1336
rme32->capture_periodsize = 0;
sound/pci/rme32.c
1339
snd_rme32_pcm_stop(rme32, 0);
sound/pci/rme32.c
1342
snd_rme32_reset_dac(rme32);
sound/pci/rme32.c
1345
writel(0, rme32->iobase + RME32_IO_RESET_POS);
sound/pci/rme32.c
1348
rme32->wcreg = RME32_WCR_SEL | /* normal playback */
sound/pci/rme32.c
1351
writel(rme32->wcreg, rme32->iobase + RME32_IO_CONTROL_REGISTER);
sound/pci/rme32.c
1355
err = snd_rme32_create_switches(rme32->card, rme32);
sound/pci/rme32.c
1360
snd_rme32_proc_init(rme32);
sound/pci/rme32.c
1362
rme32->capture_substream = NULL;
sound/pci/rme32.c
1363
rme32->playback_substream = NULL;
sound/pci/rme32.c
1376
struct rme32 *rme32 = (struct rme32 *) entry->private_data;
sound/pci/rme32.c
1378
rme32->rcreg = readl(rme32->iobase + RME32_IO_CONTROL_REGISTER);
sound/pci/rme32.c
1380
snd_iprintf(buffer, rme32->card->longname);
sound/pci/rme32.c
1381
snd_iprintf(buffer, " (index #%d)\n", rme32->card->number + 1);
sound/pci/rme32.c
1384
if (rme32->fullduplex_mode)
sound/pci/rme32.c
1388
if (RME32_PRO_WITH_8414(rme32)) {
sound/pci/rme32.c
1393
if (rme32->wcreg & RME32_WCR_MODE24) {
sound/pci/rme32.c
1398
if (rme32->wcreg & RME32_WCR_MONO) {
sound/pci/rme32.c
1405
switch (snd_rme32_getinputtype(rme32)) {
sound/pci/rme32.c
1419
if (snd_rme32_capture_getrate(rme32, &n) < 0) {
sound/pci/rme32.c
1428
snd_rme32_capture_getrate(rme32, &n));
sound/pci/rme32.c
1432
if (rme32->wcreg & RME32_WCR_SEL) {
sound/pci/rme32.c
1437
if (rme32->wcreg & RME32_WCR_MUTE) {
sound/pci/rme32.c
1445
((!(rme32->wcreg & RME32_WCR_FREQ_0))
sound/pci/rme32.c
1446
&& (!(rme32->wcreg & RME32_WCR_FREQ_1)))) {
sound/pci/rme32.c
1448
snd_rme32_playback_getrate(rme32));
sound/pci/rme32.c
1450
if (rme32->rcreg & RME32_RCR_KMODE) {
sound/pci/rme32.c
1455
if (rme32->wcreg & RME32_WCR_PRO) {
sound/pci/rme32.c
1460
if (rme32->wcreg & RME32_WCR_EMP) {
sound/pci/rme32.c
1467
static void snd_rme32_proc_init(struct rme32 *rme32)
sound/pci/rme32.c
1469
snd_card_ro_proc_new(rme32->card, "rme32", rme32, snd_rme32_proc_read);
sound/pci/rme32.c
1482
struct rme32 *rme32 = snd_kcontrol_chip(kcontrol);
sound/pci/rme32.c
1484
guard(spinlock_irq)(&rme32->lock);
sound/pci/rme32.c
1486
rme32->wcreg & RME32_WCR_SEL ? 0 : 1;
sound/pci/rme32.c
1493
struct rme32 *rme32 = snd_kcontrol_chip(kcontrol);
sound/pci/rme32.c
1498
guard(spinlock_irq)(&rme32->lock);
sound/pci/rme32.c
1499
val = (rme32->wcreg & ~RME32_WCR_SEL) | val;
sound/pci/rme32.c
1500
change = val != rme32->wcreg;
sound/pci/rme32.c
1505
rme32->wcreg = val;
sound/pci/rme32.c
1506
writel(val, rme32->iobase + RME32_IO_CONTROL_REGISTER);
sound/pci/rme32.c
1514
struct rme32 *rme32 = snd_kcontrol_chip(kcontrol);
sound/pci/rme32.c
1520
switch (rme32->pci->device) {
sound/pci/rme32.c
1538
struct rme32 *rme32 = snd_kcontrol_chip(kcontrol);
sound/pci/rme32.c
1541
guard(spinlock_irq)(&rme32->lock);
sound/pci/rme32.c
1542
ucontrol->value.enumerated.item[0] = snd_rme32_getinputtype(rme32);
sound/pci/rme32.c
1544
switch (rme32->pci->device) {
sound/pci/rme32.c
1566
struct rme32 *rme32 = snd_kcontrol_chip(kcontrol);
sound/pci/rme32.c
1570
switch (rme32->pci->device) {
sound/pci/rme32.c
1584
guard(spinlock_irq)(&rme32->lock);
sound/pci/rme32.c
1585
change = val != (unsigned int)snd_rme32_getinputtype(rme32);
sound/pci/rme32.c
1586
snd_rme32_setinputtype(rme32, val);
sound/pci/rme32.c
1605
struct rme32 *rme32 = snd_kcontrol_chip(kcontrol);
sound/pci/rme32.c
1607
guard(spinlock_irq)(&rme32->lock);
sound/pci/rme32.c
1608
ucontrol->value.enumerated.item[0] = snd_rme32_getclockmode(rme32);
sound/pci/rme32.c
1615
struct rme32 *rme32 = snd_kcontrol_chip(kcontrol);
sound/pci/rme32.c
1620
guard(spinlock_irq)(&rme32->lock);
sound/pci/rme32.c
1621
change = val != (unsigned int)snd_rme32_getclockmode(rme32);
sound/pci/rme32.c
1622
snd_rme32_setclockmode(rme32, val);
sound/pci/rme32.c
1657
struct rme32 *rme32 = snd_kcontrol_chip(kcontrol);
sound/pci/rme32.c
1660
rme32->wcreg_spdif);
sound/pci/rme32.c
1667
struct rme32 *rme32 = snd_kcontrol_chip(kcontrol);
sound/pci/rme32.c
1672
guard(spinlock_irq)(&rme32->lock);
sound/pci/rme32.c
1673
change = val != rme32->wcreg_spdif;
sound/pci/rme32.c
1674
rme32->wcreg_spdif = val;
sound/pci/rme32.c
1690
struct rme32 *rme32 = snd_kcontrol_chip(kcontrol);
sound/pci/rme32.c
1693
rme32->wcreg_spdif_stream);
sound/pci/rme32.c
1701
struct rme32 *rme32 = snd_kcontrol_chip(kcontrol);
sound/pci/rme32.c
1706
guard(spinlock_irq)(&rme32->lock);
sound/pci/rme32.c
1707
change = val != rme32->wcreg_spdif_stream;
sound/pci/rme32.c
1708
rme32->wcreg_spdif_stream = val;
sound/pci/rme32.c
1709
rme32->wcreg &= ~(RME32_WCR_PRO | RME32_WCR_EMP);
sound/pci/rme32.c
1710
rme32->wcreg |= val;
sound/pci/rme32.c
1711
writel(rme32->wcreg, rme32->iobase + RME32_IO_CONTROL_REGISTER);
sound/pci/rme32.c
1786
static int snd_rme32_create_switches(struct snd_card *card, struct rme32 * rme32)
sound/pci/rme32.c
1792
kctl = snd_ctl_new1(&snd_rme32_controls[idx], rme32);
sound/pci/rme32.c
1797
rme32->spdif_ctl = kctl;
sound/pci/rme32.c
1816
struct rme32 *rme32;
sound/pci/rme32.c
1829
sizeof(*rme32), &card);
sound/pci/rme32.c
1833
rme32 = (struct rme32 *) card->private_data;
sound/pci/rme32.c
1834
rme32->card = card;
sound/pci/rme32.c
1835
rme32->pci = pci;
sound/pci/rme32.c
1837
rme32->fullduplex_mode = 1;
sound/pci/rme32.c
1838
err = snd_rme32_create(rme32);
sound/pci/rme32.c
1843
switch (rme32->pci->device) {
sound/pci/rme32.c
1855
card->shortname, rme32->rev, rme32->port, rme32->irq);
sound/pci/rme32.c
222
#define RME32_ISWORKING(rme32) ((rme32)->wcreg & RME32_WCR_START)
sound/pci/rme32.c
223
#define RME32_PRO_WITH_8414(rme32) ((rme32)->pci->device == PCI_DEVICE_ID_RME_DIGI32_PRO && (rme32)->rev == RME32_PRO_REVISION_WITH_8414)
sound/pci/rme32.c
231
static void snd_rme32_proc_init(struct rme32 * rme32);
sound/pci/rme32.c
233
static int snd_rme32_create_switches(struct snd_card *card, struct rme32 * rme32);
sound/pci/rme32.c
235
static inline unsigned int snd_rme32_pcm_byteptr(struct rme32 * rme32)
sound/pci/rme32.c
237
return (readl(rme32->iobase + RME32_IO_GET_POS)
sound/pci/rme32.c
246
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
sound/pci/rme32.c
248
memset_io(rme32->iobase + RME32_IO_DATA_BUFFER + pos, 0, count);
sound/pci/rme32.c
257
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
sound/pci/rme32.c
259
if (copy_from_iter_toio(rme32->iobase + RME32_IO_DATA_BUFFER + pos,
sound/pci/rme32.c
270
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
sound/pci/rme32.c
272
if (copy_to_iter_fromio(rme32->iobase + RME32_IO_DATA_BUFFER + pos,
sound/pci/rme32.c
384
static void snd_rme32_reset_dac(struct rme32 *rme32)
sound/pci/rme32.c
386
writel(rme32->wcreg | RME32_WCR_PD,
sound/pci/rme32.c
387
rme32->iobase + RME32_IO_CONTROL_REGISTER);
sound/pci/rme32.c
388
writel(rme32->wcreg, rme32->iobase + RME32_IO_CONTROL_REGISTER);
sound/pci/rme32.c
391
static int snd_rme32_playback_getrate(struct rme32 * rme32)
sound/pci/rme32.c
395
rate = ((rme32->wcreg >> RME32_WCR_BITPOS_FREQ_0) & 1) +
sound/pci/rme32.c
396
(((rme32->wcreg >> RME32_WCR_BITPOS_FREQ_1) & 1) << 1);
sound/pci/rme32.c
410
return (rme32->wcreg & RME32_WCR_DS_BM) ? rate << 1 : rate;
sound/pci/rme32.c
413
static int snd_rme32_capture_getrate(struct rme32 * rme32, int *is_adat)
sound/pci/rme32.c
418
if (rme32->rcreg & RME32_RCR_LOCK) {
sound/pci/rme32.c
422
if (rme32->rcreg & RME32_RCR_ERF) {
sound/pci/rme32.c
427
n = ((rme32->rcreg >> RME32_RCR_BITPOS_F0) & 1) +
sound/pci/rme32.c
428
(((rme32->rcreg >> RME32_RCR_BITPOS_F1) & 1) << 1) +
sound/pci/rme32.c
429
(((rme32->rcreg >> RME32_RCR_BITPOS_F2) & 1) << 2);
sound/pci/rme32.c
431
if (RME32_PRO_WITH_8414(rme32))
sound/pci/rme32.c
474
static int snd_rme32_playback_setrate(struct rme32 * rme32, int rate)
sound/pci/rme32.c
478
ds = rme32->wcreg & RME32_WCR_DS_BM;
sound/pci/rme32.c
481
rme32->wcreg &= ~RME32_WCR_DS_BM;
sound/pci/rme32.c
482
rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) &
sound/pci/rme32.c
486
rme32->wcreg &= ~RME32_WCR_DS_BM;
sound/pci/rme32.c
487
rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_1) &
sound/pci/rme32.c
491
rme32->wcreg &= ~RME32_WCR_DS_BM;
sound/pci/rme32.c
492
rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) |
sound/pci/rme32.c
496
if (rme32->pci->device != PCI_DEVICE_ID_RME_DIGI32_PRO)
sound/pci/rme32.c
498
rme32->wcreg |= RME32_WCR_DS_BM;
sound/pci/rme32.c
499
rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) &
sound/pci/rme32.c
503
if (rme32->pci->device != PCI_DEVICE_ID_RME_DIGI32_PRO)
sound/pci/rme32.c
505
rme32->wcreg |= RME32_WCR_DS_BM;
sound/pci/rme32.c
506
rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_1) &
sound/pci/rme32.c
510
if (rme32->pci->device != PCI_DEVICE_ID_RME_DIGI32_PRO)
sound/pci/rme32.c
512
rme32->wcreg |= RME32_WCR_DS_BM;
sound/pci/rme32.c
513
rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) |
sound/pci/rme32.c
519
if ((!ds && rme32->wcreg & RME32_WCR_DS_BM) ||
sound/pci/rme32.c
520
(ds && !(rme32->wcreg & RME32_WCR_DS_BM)))
sound/pci/rme32.c
523
snd_rme32_reset_dac(rme32);
sound/pci/rme32.c
525
writel(rme32->wcreg, rme32->iobase + RME32_IO_CONTROL_REGISTER);
sound/pci/rme32.c
530
static int snd_rme32_setclockmode(struct rme32 * rme32, int mode)
sound/pci/rme32.c
535
rme32->wcreg = (rme32->wcreg & ~RME32_WCR_FREQ_0) &
sound/pci/rme32.c
540
rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) &
sound/pci/rme32.c
545
rme32->wcreg = (rme32->wcreg & ~RME32_WCR_FREQ_0) |
sound/pci/rme32.c
550
rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) |
sound/pci/rme32.c
556
writel(rme32->wcreg, rme32->iobase + RME32_IO_CONTROL_REGISTER);
sound/pci/rme32.c
560
static int snd_rme32_getclockmode(struct rme32 * rme32)
sound/pci/rme32.c
562
return ((rme32->wcreg >> RME32_WCR_BITPOS_FREQ_0) & 1) +
sound/pci/rme32.c
563
(((rme32->wcreg >> RME32_WCR_BITPOS_FREQ_1) & 1) << 1);
sound/pci/rme32.c
566
static int snd_rme32_setinputtype(struct rme32 * rme32, int type)
sound/pci/rme32.c
570
rme32->wcreg = (rme32->wcreg & ~RME32_WCR_INP_0) &
sound/pci/rme32.c
574
rme32->wcreg = (rme32->wcreg | RME32_WCR_INP_0) &
sound/pci/rme32.c
578
rme32->wcreg = (rme32->wcreg & ~RME32_WCR_INP_0) |
sound/pci/rme32.c
582
rme32->wcreg = (rme32->wcreg | RME32_WCR_INP_0) |
sound/pci/rme32.c
588
writel(rme32->wcreg, rme32->iobase + RME32_IO_CONTROL_REGISTER);
sound/pci/rme32.c
592
static int snd_rme32_getinputtype(struct rme32 * rme32)
sound/pci/rme32.c
594
return ((rme32->wcreg >> RME32_WCR_BITPOS_INP_0) & 1) +
sound/pci/rme32.c
595
(((rme32->wcreg >> RME32_WCR_BITPOS_INP_1) & 1) << 1);
sound/pci/rme32.c
599
snd_rme32_setframelog(struct rme32 * rme32, int n_channels, int is_playback)
sound/pci/rme32.c
610
frlog += (rme32->wcreg & RME32_WCR_MODE24) ? 2 : 1;
sound/pci/rme32.c
611
rme32->playback_frlog = frlog;
sound/pci/rme32.c
613
frlog += (rme32->wcreg & RME32_WCR_MODE24) ? 2 : 1;
sound/pci/rme32.c
614
rme32->capture_frlog = frlog;
sound/pci/rme32.c
618
static int snd_rme32_setformat(struct rme32 *rme32, snd_pcm_format_t format)
sound/pci/rme32.c
622
rme32->wcreg &= ~RME32_WCR_MODE24;
sound/pci/rme32.c
625
rme32->wcreg |= RME32_WCR_MODE24;
sound/pci/rme32.c
630
writel(rme32->wcreg, rme32->iobase + RME32_IO_CONTROL_REGISTER);
sound/pci/rme32.c
639
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
sound/pci/rme32.c
642
if (!rme32->fullduplex_mode) {
sound/pci/rme32.c
643
runtime->dma_area = (void __force *)(rme32->iobase +
sound/pci/rme32.c
645
runtime->dma_addr = rme32->port + RME32_IO_DATA_BUFFER;
sound/pci/rme32.c
649
guard(spinlock_irq)(&rme32->lock);
sound/pci/rme32.c
651
if (rme32->rcreg & RME32_RCR_KMODE)
sound/pci/rme32.c
652
rate = snd_rme32_capture_getrate(rme32, &dummy);
sound/pci/rme32.c
658
err = snd_rme32_playback_setrate(rme32, params_rate(params));
sound/pci/rme32.c
662
err = snd_rme32_setformat(rme32, params_format(params));
sound/pci/rme32.c
666
snd_rme32_setframelog(rme32, params_channels(params), 1);
sound/pci/rme32.c
667
if (rme32->capture_periodsize != 0) {
sound/pci/rme32.c
668
if (params_period_size(params) << rme32->playback_frlog != rme32->capture_periodsize)
sound/pci/rme32.c
671
rme32->playback_periodsize = params_period_size(params) << rme32->playback_frlog;
sound/pci/rme32.c
673
if ((rme32->wcreg & RME32_WCR_ADAT) == 0) {
sound/pci/rme32.c
674
rme32->wcreg &= ~(RME32_WCR_PRO | RME32_WCR_EMP);
sound/pci/rme32.c
675
rme32->wcreg |= rme32->wcreg_spdif_stream;
sound/pci/rme32.c
676
writel(rme32->wcreg, rme32->iobase + RME32_IO_CONTROL_REGISTER);
sound/pci/rme32.c
687
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
sound/pci/rme32.c
690
if (!rme32->fullduplex_mode) {
sound/pci/rme32.c
691
runtime->dma_area = (void __force *)rme32->iobase +
sound/pci/rme32.c
693
runtime->dma_addr = rme32->port + RME32_IO_DATA_BUFFER;
sound/pci/rme32.c
697
guard(spinlock_irq)(&rme32->lock);
sound/pci/rme32.c
699
rme32->wcreg |= RME32_WCR_AUTOSYNC;
sound/pci/rme32.c
700
writel(rme32->wcreg, rme32->iobase + RME32_IO_CONTROL_REGISTER);
sound/pci/rme32.c
702
err = snd_rme32_setformat(rme32, params_format(params));
sound/pci/rme32.c
705
err = snd_rme32_playback_setrate(rme32, params_rate(params));
sound/pci/rme32.c
708
rate = snd_rme32_capture_getrate(rme32, &isadat);
sound/pci/rme32.c
717
rme32->wcreg &= ~RME32_WCR_AUTOSYNC;
sound/pci/rme32.c
718
writel(rme32->wcreg, rme32->iobase + RME32_IO_CONTROL_REGISTER);
sound/pci/rme32.c
720
snd_rme32_setframelog(rme32, params_channels(params), 0);
sound/pci/rme32.c
721
if (rme32->playback_periodsize != 0) {
sound/pci/rme32.c
722
if (params_period_size(params) << rme32->capture_frlog !=
sound/pci/rme32.c
723
rme32->playback_periodsize)
sound/pci/rme32.c
726
rme32->capture_periodsize =
sound/pci/rme32.c
727
params_period_size(params) << rme32->capture_frlog;
sound/pci/rme32.c
732
static void snd_rme32_pcm_start(struct rme32 * rme32, int from_pause)
sound/pci/rme32.c
735
writel(0, rme32->iobase + RME32_IO_RESET_POS);
sound/pci/rme32.c
738
rme32->wcreg |= RME32_WCR_START;
sound/pci/rme32.c
739
writel(rme32->wcreg, rme32->iobase + RME32_IO_CONTROL_REGISTER);
sound/pci/rme32.c
742
static void snd_rme32_pcm_stop(struct rme32 * rme32, int to_pause)
sound/pci/rme32.c
748
rme32->rcreg = readl(rme32->iobase + RME32_IO_CONTROL_REGISTER);
sound/pci/rme32.c
749
if (rme32->rcreg & RME32_RCR_IRQ) {
sound/pci/rme32.c
750
writel(0, rme32->iobase + RME32_IO_CONFIRM_ACTION_IRQ);
sound/pci/rme32.c
752
rme32->wcreg &= ~RME32_WCR_START;
sound/pci/rme32.c
753
if (rme32->wcreg & RME32_WCR_SEL)
sound/pci/rme32.c
754
rme32->wcreg |= RME32_WCR_MUTE;
sound/pci/rme32.c
755
writel(rme32->wcreg, rme32->iobase + RME32_IO_CONTROL_REGISTER);
sound/pci/rme32.c
757
writel(0, rme32->iobase + RME32_IO_RESET_POS);
sound/pci/rme32.c
762
struct rme32 *rme32 = (struct rme32 *) dev_id;
sound/pci/rme32.c
764
rme32->rcreg = readl(rme32->iobase + RME32_IO_CONTROL_REGISTER);
sound/pci/rme32.c
765
if (!(rme32->rcreg & RME32_RCR_IRQ)) {
sound/pci/rme32.c
768
if (rme32->capture_substream) {
sound/pci/rme32.c
769
snd_pcm_period_elapsed(rme32->capture_substream);
sound/pci/rme32.c
771
if (rme32->playback_substream) {
sound/pci/rme32.c
772
snd_pcm_period_elapsed(rme32->playback_substream);
sound/pci/rme32.c
774
writel(0, rme32->iobase + RME32_IO_CONFIRM_ACTION_IRQ);
sound/pci/rme32.c
787
static void snd_rme32_set_buffer_constraint(struct rme32 *rme32, struct snd_pcm_runtime *runtime)
sound/pci/rme32.c
789
if (! rme32->fullduplex_mode) {
sound/pci/rme32.c
802
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
sound/pci/rme32.c
807
scoped_guard(spinlock_irq, &rme32->lock) {
sound/pci/rme32.c
808
if (rme32->playback_substream != NULL)
sound/pci/rme32.c
810
rme32->wcreg &= ~RME32_WCR_ADAT;
sound/pci/rme32.c
811
writel(rme32->wcreg, rme32->iobase + RME32_IO_CONTROL_REGISTER);
sound/pci/rme32.c
812
rme32->playback_substream = substream;
sound/pci/rme32.c
815
if (rme32->fullduplex_mode)
sound/pci/rme32.c
819
if (rme32->pci->device == PCI_DEVICE_ID_RME_DIGI32_PRO) {
sound/pci/rme32.c
824
if (rme32->rcreg & RME32_RCR_KMODE)
sound/pci/rme32.c
825
rate = snd_rme32_capture_getrate(rme32, &dummy);
sound/pci/rme32.c
833
snd_rme32_set_buffer_constraint(rme32, runtime);
sound/pci/rme32.c
835
rme32->wcreg_spdif_stream = rme32->wcreg_spdif;
sound/pci/rme32.c
836
rme32->spdif_ctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE;
sound/pci/rme32.c
837
snd_ctl_notify(rme32->card, SNDRV_CTL_EVENT_MASK_VALUE |
sound/pci/rme32.c
838
SNDRV_CTL_EVENT_MASK_INFO, &rme32->spdif_ctl->id);
sound/pci/rme32.c
845
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
sound/pci/rme32.c
850
scoped_guard(spinlock_irq, &rme32->lock) {
sound/pci/rme32.c
851
if (rme32->capture_substream != NULL)
sound/pci/rme32.c
853
rme32->capture_substream = substream;
sound/pci/rme32.c
856
if (rme32->fullduplex_mode)
sound/pci/rme32.c
860
if (RME32_PRO_WITH_8414(rme32)) {
sound/pci/rme32.c
864
rate = snd_rme32_capture_getrate(rme32, &isadat);
sound/pci/rme32.c
874
snd_rme32_set_buffer_constraint(rme32, runtime);
sound/pci/rme32.c
883
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
sound/pci/rme32.c
888
scoped_guard(spinlock_irq, &rme32->lock) {
sound/pci/rme32.c
889
if (rme32->playback_substream != NULL)
sound/pci/rme32.c
891
rme32->wcreg |= RME32_WCR_ADAT;
sound/pci/rme32.c
892
writel(rme32->wcreg, rme32->iobase + RME32_IO_CONTROL_REGISTER);
sound/pci/rme32.c
893
rme32->playback_substream = substream;
sound/pci/rme32.c
896
if (rme32->fullduplex_mode)
sound/pci/rme32.c
901
if (rme32->rcreg & RME32_RCR_KMODE)
sound/pci/rme32.c
902
rate = snd_rme32_capture_getrate(rme32, &dummy);
sound/pci/rme32.c
910
snd_rme32_set_buffer_constraint(rme32, runtime);
sound/pci/rme32.c
918
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
sound/pci/rme32.c
921
if (rme32->fullduplex_mode)
sound/pci/rme32.c
925
rate = snd_rme32_capture_getrate(rme32, &isadat);
sound/pci/rme32.c
937
scoped_guard(spinlock_irq, &rme32->lock) {
sound/pci/rme32.c
938
if (rme32->capture_substream != NULL)
sound/pci/rme32.c
940
rme32->capture_substream = substream;
sound/pci/rme32.c
943
snd_rme32_set_buffer_constraint(rme32, runtime);
sound/pci/rme32.c
949
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
sound/pci/rme32.c
952
scoped_guard(spinlock_irq, &rme32->lock) {
sound/pci/rme32.c
953
rme32->playback_substream = NULL;
sound/pci/rme32.c
954
rme32->playback_periodsize = 0;
sound/pci/rme32.c
955
spdif = (rme32->wcreg & RME32_WCR_ADAT) == 0;
sound/pci/rme32.c
958
rme32->spdif_ctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_INACTIVE;
sound/pci/rme32.c
959
snd_ctl_notify(rme32->card, SNDRV_CTL_EVENT_MASK_VALUE |
sound/pci/rme32.c
961
&rme32->spdif_ctl->id);
sound/pci/rme32.c
968
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
sound/pci/rme32.c
970
guard(spinlock_irq)(&rme32->lock);
sound/pci/rme32.c
971
rme32->capture_substream = NULL;
sound/pci/rme32.c
972
rme32->capture_periodsize = 0;
sound/pci/rme32.c
978
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
sound/pci/rme32.c
980
guard(spinlock_irq)(&rme32->lock);
sound/pci/rme32.c
981
if (rme32->fullduplex_mode) {
sound/pci/rme32.c
982
memset(&rme32->playback_pcm, 0, sizeof(rme32->playback_pcm));
sound/pci/rme32.c
983
rme32->playback_pcm.hw_buffer_size = RME32_BUFFER_SIZE;
sound/pci/rme32.c
984
rme32->playback_pcm.sw_buffer_size = snd_pcm_lib_buffer_bytes(substream);
sound/pci/rme32.c
986
writel(0, rme32->iobase + RME32_IO_RESET_POS);
sound/pci/rme32.c
988
if (rme32->wcreg & RME32_WCR_SEL)
sound/pci/rme32.c
989
rme32->wcreg &= ~RME32_WCR_MUTE;
sound/pci/rme32.c
990
writel(rme32->wcreg, rme32->iobase + RME32_IO_CONTROL_REGISTER);
sound/pci/rme32.c
996
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
sound/pci/rme32.c
998
guard(spinlock_irq)(&rme32->lock);
sound/pci/rme32.c
999
if (rme32->fullduplex_mode) {