11 #include <linux/module.h>
12 #include <linux/kernel.h>
34 #if defined(CONFIG_PCI) && defined(CONFIG_SPARC64)
36 #include <linux/pci.h>
51 MODULE_AUTHOR(
"Jaroslav Kysela, Derrick J. Brashear and David S. Miller");
57 struct sbus_dma_info {
76 struct sbus_dma_info sbus_info;
88 #define CS4231_FLAG_EBUS 0x00000001
89 #define CS4231_FLAG_PLAYBACK 0x00000002
90 #define CS4231_FLAG_CAPTURE 0x00000004
101 #define CS4231_MODE_NONE 0x0000
102 #define CS4231_MODE_PLAY 0x0001
103 #define CS4231_MODE_RECORD 0x0002
104 #define CS4231_MODE_TIMER 0x0004
105 #define CS4231_MODE_OPEN (CS4231_MODE_PLAY | CS4231_MODE_RECORD | \
128 #define CS4231U(chip, x) ((chip)->port + ((c_d_c_CS4231##x) << 2))
132 #define APCCSR 0x10UL
133 #define APCCVA 0x20UL
135 #define APCCNVA 0x28UL
136 #define APCCNC 0x2cUL
137 #define APCPVA 0x30UL
139 #define APCPNVA 0x38UL
140 #define APCPNC 0x3cUL
148 #define APC_PLAY 0x30UL
149 #define APC_RECORD 0x20UL
153 #define APC_INT_PENDING 0x800000
154 #define APC_PLAY_INT 0x400000
155 #define APC_CAPT_INT 0x200000
156 #define APC_GENL_INT 0x100000
157 #define APC_XINT_ENA 0x80000
158 #define APC_XINT_PLAY 0x40000
159 #define APC_XINT_CAPT 0x20000
160 #define APC_XINT_GENL 0x10000
161 #define APC_XINT_EMPT 0x8000
162 #define APC_XINT_PEMP 0x4000
163 #define APC_XINT_PNVA 0x2000
164 #define APC_XINT_PENA 0x1000
165 #define APC_XINT_COVF 0x800
166 #define APC_XINT_CNVA 0x400
167 #define APC_XINT_CEMP 0x200
168 #define APC_XINT_CENA 0x100
169 #define APC_PPAUSE 0x80
170 #define APC_CPAUSE 0x40
171 #define APC_CDC_RESET 0x20
172 #define APC_PDMA_READY 0x08
173 #define APC_CDMA_READY 0x04
174 #define APC_CHIP_RESET 0x01
178 #define EBDMA_CSR 0x00UL
179 #define EBDMA_ADDR 0x04UL
180 #define EBDMA_COUNT 0x08UL
186 static unsigned char freq_bits[14] = {
203 static unsigned int rates[14] = {
204 5510, 6620, 8000, 9600, 11025, 16000, 18900, 22050,
205 27042, 32000, 33075, 37800, 44100, 48000
217 &hw_constraints_rates);
220 static unsigned char snd_cs4231_original_image[32] =
259 return readb(reg_addr);
268 return writeb(val, reg_addr);
281 for (timeout = 250; timeout > 0; timeout--) {
282 int val = __cs4231_readb(chip,
CS4231U(chip, REGSEL));
289 static void snd_cs4231_dout(
struct snd_cs4231 *chip,
unsigned char reg,
292 snd_cs4231_ready(chip);
293 #ifdef CONFIG_SND_DEBUG
295 snd_printdd(
"out: auto calibration time out - reg = 0x%x, "
299 __cs4231_writeb(chip, chip->
mce_bit | reg,
CS4231U(chip, REGSEL));
301 __cs4231_writeb(chip, value,
CS4231U(chip,
REG));
305 static inline void snd_cs4231_outm(
struct snd_cs4231 *chip,
unsigned char reg,
306 unsigned char mask,
unsigned char value)
312 snd_cs4231_dout(chip, reg, tmp);
315 static void snd_cs4231_out(
struct snd_cs4231 *chip,
unsigned char reg,
318 snd_cs4231_dout(chip, reg, value);
323 static unsigned char snd_cs4231_in(
struct snd_cs4231 *chip,
unsigned char reg)
325 snd_cs4231_ready(chip);
326 #ifdef CONFIG_SND_DEBUG
327 if (__cs4231_readb(chip,
CS4231U(chip, REGSEL)) & CS4231_INIT)
328 snd_printdd(
"in: auto calibration time out - reg = 0x%x\n",
331 __cs4231_writeb(chip, chip->
mce_bit | reg,
CS4231U(chip, REGSEL));
333 return __cs4231_readb(chip,
CS4231U(chip,
REG));
340 static void snd_cs4231_busy_wait(
struct snd_cs4231 *chip)
345 for (timeout = 5; timeout > 0; timeout--)
346 __cs4231_readb(chip,
CS4231U(chip, REGSEL));
349 for (timeout = 500; timeout > 0; timeout--) {
350 int val = __cs4231_readb(chip,
CS4231U(chip, REGSEL));
351 if ((val & CS4231_INIT) == 0)
357 static void snd_cs4231_mce_up(
struct snd_cs4231 *chip)
363 snd_cs4231_ready(chip);
364 #ifdef CONFIG_SND_DEBUG
365 if (__cs4231_readb(chip,
CS4231U(chip, REGSEL)) & CS4231_INIT)
366 snd_printdd(
"mce_up - auto calibration time out (0)\n");
369 timeout = __cs4231_readb(chip,
CS4231U(chip, REGSEL));
372 "codec still busy\n",
375 __cs4231_writeb(chip, chip->
mce_bit | (timeout & 0x1f),
377 spin_unlock_irqrestore(&chip->
lock, flags);
380 static void snd_cs4231_mce_down(
struct snd_cs4231 *chip)
382 unsigned long flags, timeout;
385 snd_cs4231_busy_wait(chip);
387 #ifdef CONFIG_SND_DEBUG
388 if (__cs4231_readb(chip,
CS4231U(chip, REGSEL)) & CS4231_INIT)
389 snd_printdd(
"mce_down [%p] - auto calibration time out (0)\n",
393 reg = __cs4231_readb(chip,
CS4231U(chip, REGSEL));
394 __cs4231_writeb(chip, chip->
mce_bit | (reg & 0x1f),
398 "- codec still busy\n", chip->
port);
399 if ((reg & CS4231_MCE) == 0) {
400 spin_unlock_irqrestore(&chip->
lock, flags);
409 spin_unlock_irqrestore(&chip->
lock, flags);
415 spin_unlock_irqrestore(&chip->
lock, flags);
419 "mce_down - auto calibration time out (2)\n");
424 unsigned int *periods_sent)
429 unsigned int period_size = snd_pcm_lib_period_bytes(substream);
430 unsigned int offset = period_size * (*periods_sent);
432 BUG_ON(period_size >= (1 << 24));
434 if (dma_cont->
request(dma_cont,
435 runtime->
dma_addr + offset, period_size))
437 (*periods_sent) = ((*periods_sent) + 1) % runtime->
periods;
442 unsigned int what,
int on)
448 dma_cont = &chip->
p_dma;
450 dma_cont->
prepare(dma_cont, 0);
451 dma_cont->
enable(dma_cont, 1);
452 snd_cs4231_advance_dma(dma_cont,
456 dma_cont->
enable(dma_cont, 0);
460 dma_cont = &chip->
c_dma;
462 dma_cont->
prepare(dma_cont, 1);
463 dma_cont->
enable(dma_cont, 1);
464 snd_cs4231_advance_dma(dma_cont,
468 dma_cont->
enable(dma_cont, 0);
482 unsigned int what = 0;
489 snd_pcm_trigger_done(s, substream);
492 snd_pcm_trigger_done(s, substream);
498 cs4231_dma_trigger(substream, what, 1);
501 cs4231_dma_trigger(substream, what, 0);
506 spin_unlock_irqrestore(&chip->
lock, flags);
521 static unsigned char snd_cs4231_get_rate(
unsigned int rate)
525 for (i = 0; i < 14; i++)
526 if (rate == rates[i])
529 return freq_bits[13];
532 static unsigned char snd_cs4231_get_format(
struct snd_cs4231 *chip,
int format,
535 unsigned char rformat;
560 static void snd_cs4231_calibrate_mute(
struct snd_cs4231 *chip,
int mute)
567 spin_unlock_irqrestore(&chip->
lock, flags);
597 spin_unlock_irqrestore(&chip->
lock, flags);
600 static void snd_cs4231_playback_format(
struct snd_cs4231 *chip,
607 snd_cs4231_calibrate_mute(chip, 1);
609 snd_cs4231_mce_up(chip);
616 spin_unlock_irqrestore(&chip->
lock, flags);
618 snd_cs4231_mce_down(chip);
620 snd_cs4231_calibrate_mute(chip, 0);
624 static void snd_cs4231_capture_format(
struct snd_cs4231 *chip,
631 snd_cs4231_calibrate_mute(chip, 1);
633 snd_cs4231_mce_up(chip);
640 spin_unlock_irqrestore(&chip->
lock, flags);
641 snd_cs4231_mce_down(chip);
642 snd_cs4231_mce_up(chip);
646 spin_unlock_irqrestore(&chip->
lock, flags);
648 snd_cs4231_mce_down(chip);
650 snd_cs4231_calibrate_mute(chip, 0);
658 static unsigned long snd_cs4231_timer_resolution(
struct snd_timer *
timer)
678 (
unsigned char) (ticks >> 8));
681 (
unsigned char) ticks);
684 CS4231_TIMER_ENABLE);
686 spin_unlock_irqrestore(&chip->
lock, flags);
691 static int snd_cs4231_timer_stop(
struct snd_timer *timer)
700 spin_unlock_irqrestore(&chip->
lock, flags);
709 snd_cs4231_mce_down(chip);
711 #ifdef SNDRV_DEBUG_MCE
714 snd_cs4231_mce_up(chip);
718 CS4231_RECORD_ENABLE |
723 spin_unlock_irqrestore(&chip->
lock, flags);
724 snd_cs4231_mce_down(chip);
726 #ifdef SNDRV_DEBUG_MCE
730 snd_cs4231_mce_up(chip);
734 spin_unlock_irqrestore(&chip->
lock, flags);
735 snd_cs4231_mce_down(chip);
737 #ifdef SNDRV_DEBUG_MCE
745 spin_unlock_irqrestore(&chip->
lock, flags);
747 snd_cs4231_mce_up(chip);
751 spin_unlock_irqrestore(&chip->
lock, flags);
752 snd_cs4231_mce_down(chip);
754 #ifdef SNDRV_DEBUG_MCE
758 snd_cs4231_mce_up(chip);
761 spin_unlock_irqrestore(&chip->
lock, flags);
762 snd_cs4231_mce_down(chip);
764 #ifdef SNDRV_DEBUG_MCE
769 static int snd_cs4231_open(
struct snd_cs4231 *chip,
unsigned int mode)
774 if ((chip->
mode & mode)) {
797 spin_unlock_irqrestore(&chip->
lock, flags);
804 static void snd_cs4231_close(
struct snd_cs4231 *chip,
unsigned int mode)
814 snd_cs4231_calibrate_mute(chip, 1);
827 spin_unlock_irqrestore(&chip->
lock, flags);
828 snd_cs4231_mce_up(chip);
835 spin_unlock_irqrestore(&chip->
lock, flags);
836 snd_cs4231_mce_down(chip);
844 spin_unlock_irqrestore(&chip->
lock, flags);
846 snd_cs4231_calibrate_mute(chip, 0);
856 static int snd_cs4231_timer_open(
struct snd_timer *timer)
863 static int snd_cs4231_timer_close(
struct snd_timer *timer)
874 .open = snd_cs4231_timer_open,
875 .close = snd_cs4231_timer_close,
876 .c_resolution = snd_cs4231_timer_resolution,
877 .start = snd_cs4231_timer_start,
878 .stop = snd_cs4231_timer_stop,
889 unsigned char new_pdfr;
896 new_pdfr = snd_cs4231_get_format(chip,
params_format(hw_params),
899 snd_cs4231_playback_format(chip, hw_params, new_pdfr);
918 spin_unlock_irqrestore(&chip->
lock, flags);
927 unsigned char new_cdfr;
934 new_cdfr = snd_cs4231_get_format(chip,
params_format(hw_params),
937 snd_cs4231_capture_format(chip, hw_params, new_cdfr);
953 spin_unlock_irqrestore(&chip->
lock, flags);
958 static void snd_cs4231_overrange(
struct snd_cs4231 *chip)
965 spin_unlock_irqrestore(&chip->
lock, flags);
968 if (res & (0x08 | 0x02))
972 static void snd_cs4231_play_callback(
struct snd_cs4231 *chip)
981 static void snd_cs4231_capture_callback(
struct snd_cs4231 *chip)
999 ptr = dma_cont->
address(dma_cont);
1001 ptr -= substream->
runtime->dma_addr;
1003 return bytes_to_frames(substream->
runtime, ptr);
1015 ptr = dma_cont->
address(dma_cont);
1017 ptr -= substream->
runtime->dma_addr;
1019 return bytes_to_frames(substream->
runtime, ptr);
1024 unsigned long flags;
1030 for (i = 0; i < 50; i++) {
1032 if (__cs4231_readb(chip,
CS4231U(chip, REGSEL)) & CS4231_INIT)
1039 spin_unlock_irqrestore(&chip->
lock, flags);
1055 spin_unlock_irqrestore(&chip->
lock, flags);
1065 ptr = (
unsigned char *) &chip->
image;
1067 snd_cs4231_mce_down(chip);
1071 for (i = 0; i < 32; i++)
1072 snd_cs4231_out(chip, i, *ptr++);
1074 spin_unlock_irqrestore(&chip->
lock, flags);
1076 snd_cs4231_mce_up(chip);
1078 snd_cs4231_mce_down(chip);
1102 .buffer_bytes_max = 32 * 1024,
1103 .period_bytes_min = 64,
1104 .period_bytes_max = 32 * 1024,
1106 .periods_max = 1024,
1126 .buffer_bytes_max = 32 * 1024,
1127 .period_bytes_min = 64,
1128 .period_bytes_max = 32 * 1024,
1130 .periods_max = 1024,
1139 runtime->
hw = snd_cs4231_playback;
1149 snd_cs4231_xrate(runtime);
1160 runtime->
hw = snd_cs4231_capture;
1170 snd_cs4231_xrate(runtime);
1199 static struct snd_pcm_ops snd_cs4231_playback_ops = {
1200 .open = snd_cs4231_playback_open,
1201 .close = snd_cs4231_playback_close,
1203 .hw_params = snd_cs4231_playback_hw_params,
1205 .prepare = snd_cs4231_playback_prepare,
1206 .trigger = snd_cs4231_trigger,
1207 .pointer = snd_cs4231_playback_pointer,
1210 static struct snd_pcm_ops snd_cs4231_capture_ops = {
1211 .open = snd_cs4231_capture_open,
1212 .close = snd_cs4231_capture_close,
1214 .hw_params = snd_cs4231_capture_hw_params,
1216 .prepare = snd_cs4231_capture_prepare,
1217 .trigger = snd_cs4231_trigger,
1218 .pointer = snd_cs4231_capture_pointer,
1232 &snd_cs4231_playback_ops);
1234 &snd_cs4231_capture_ops);
1243 64 * 1024, 128 * 1024);
1268 timer->
hw = snd_cs4231_timer_table;
1278 static int snd_cs4231_info_mux(
struct snd_kcontrol *kcontrol,
1281 static char *texts[4] = {
1282 "Line",
"CD",
"Mic",
"Mix"
1296 static int snd_cs4231_get_mux(
struct snd_kcontrol *kcontrol,
1300 unsigned long flags;
1303 ucontrol->
value.enumerated.item[0] =
1305 ucontrol->
value.enumerated.item[1] =
1307 spin_unlock_irqrestore(&chip->
lock, flags);
1312 static int snd_cs4231_put_mux(
struct snd_kcontrol *kcontrol,
1316 unsigned long flags;
1320 if (ucontrol->
value.enumerated.item[0] > 3 ||
1321 ucontrol->
value.enumerated.item[1] > 3)
1323 left = ucontrol->
value.enumerated.item[0] << 6;
1324 right = ucontrol->
value.enumerated.item[1] << 6;
1335 spin_unlock_irqrestore(&chip->
lock, flags);
1340 static int snd_cs4231_info_single(
struct snd_kcontrol *kcontrol,
1345 uinfo->
type = (mask == 1) ?
1354 static int snd_cs4231_get_single(
struct snd_kcontrol *kcontrol,
1358 unsigned long flags;
1366 ucontrol->
value.integer.value[0] = (chip->
image[
reg] >> shift) & mask;
1368 spin_unlock_irqrestore(&chip->
lock, flags);
1371 ucontrol->
value.integer.value[0] =
1372 (mask - ucontrol->
value.integer.value[0]);
1377 static int snd_cs4231_put_single(
struct snd_kcontrol *kcontrol,
1381 unsigned long flags;
1389 val = (ucontrol->
value.integer.value[0] &
mask);
1396 val = (chip->
image[
reg] & ~(mask << shift)) |
val;
1398 snd_cs4231_out(chip, reg, val);
1400 spin_unlock_irqrestore(&chip->
lock, flags);
1405 static int snd_cs4231_info_double(
struct snd_kcontrol *kcontrol,
1410 uinfo->
type = mask == 1 ?
1419 static int snd_cs4231_get_double(
struct snd_kcontrol *kcontrol,
1423 unsigned long flags;
1433 ucontrol->
value.integer.value[0] =
1434 (chip->
image[left_reg] >> shift_left) & mask;
1435 ucontrol->
value.integer.value[1] =
1438 spin_unlock_irqrestore(&chip->
lock, flags);
1441 ucontrol->
value.integer.value[0] =
1442 (mask - ucontrol->
value.integer.value[0]);
1443 ucontrol->
value.integer.value[1] =
1444 (mask - ucontrol->
value.integer.value[1]);
1450 static int snd_cs4231_put_double(
struct snd_kcontrol *kcontrol,
1454 unsigned long flags;
1462 unsigned short val1, val2;
1464 val1 = ucontrol->
value.integer.value[0] &
mask;
1465 val2 = ucontrol->
value.integer.value[1] &
mask;
1470 val1 <<= shift_left;
1475 val1 = (chip->
image[left_reg] & ~(mask << shift_left)) | val1;
1477 change = val1 != chip->
image[left_reg];
1478 change |= val2 != chip->
image[right_reg];
1479 snd_cs4231_out(chip, left_reg, val1);
1480 snd_cs4231_out(chip, right_reg, val2);
1482 spin_unlock_irqrestore(&chip->
lock, flags);
1487 #define CS4231_SINGLE(xname, xindex, reg, shift, mask, invert) \
1488 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), .index = (xindex), \
1489 .info = snd_cs4231_info_single, \
1490 .get = snd_cs4231_get_single, .put = snd_cs4231_put_single, \
1491 .private_value = (reg) | ((shift) << 8) | ((mask) << 16) | ((invert) << 24) }
1493 #define CS4231_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, \
1494 shift_right, mask, invert) \
1495 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), .index = (xindex), \
1496 .info = snd_cs4231_info_double, \
1497 .get = snd_cs4231_get_double, .put = snd_cs4231_put_double, \
1498 .private_value = (left_reg) | ((right_reg) << 8) | ((shift_left) << 16) | \
1499 ((shift_right) << 19) | ((mask) << 24) | ((invert) << 22) }
1526 .name =
"Capture Source",
1527 .info = snd_cs4231_info_mux,
1528 .get = snd_cs4231_get_mux,
1529 .put = snd_cs4231_put_mux,
1550 for (idx = 0; idx <
ARRAY_SIZE(snd_cs4231_controls); idx++) {
1597 err = snd_cs4231_pcm(card);
1601 err = snd_cs4231_mixer(card);
1605 err = snd_cs4231_timer(card);
1627 unsigned long flags;
1645 snd_cs4231_play_callback(chip);
1650 !(csr & APC_XINT_EMPT))
1651 snd_cs4231_capture_callback(chip);
1661 snd_cs4231_overrange(chip);
1666 spin_unlock_irqrestore(&chip->
lock, flags);
1678 unsigned long flags;
1681 struct sbus_dma_info *
base = &dma_cont->sbus_info;
1683 if (len >= (1 << 24))
1703 spin_unlock_irqrestore(&base->lock, flags);
1709 unsigned long flags;
1711 struct sbus_dma_info *base = &dma_cont->sbus_info;
1723 spin_unlock_irqrestore(&base->lock, flags);
1728 unsigned long flags;
1730 struct sbus_dma_info *base = &dma_cont->sbus_info;
1753 csr |= (APC_CDMA_READY << shift);
1755 csr &= ~(APC_CDMA_READY << shift);
1758 spin_unlock_irqrestore(&base->lock, flags);
1763 struct sbus_dma_info *base = &dma_cont->sbus_info;
1772 static int snd_cs4231_sbus_free(
struct snd_cs4231 *chip)
1789 return snd_cs4231_sbus_free(cp);
1793 .
dev_free = snd_cs4231_sbus_dev_free,
1811 sizeof(snd_cs4231_original_image));
1816 snd_printdd(
"cs4231-%d: Unable to map chip registers.\n", dev);
1820 chip->
c_dma.sbus_info.regs = chip->
port;
1821 chip->
p_dma.sbus_info.regs = chip->
port;
1825 chip->
p_dma.prepare = sbus_dma_prepare;
1826 chip->
p_dma.enable = sbus_dma_enable;
1827 chip->
p_dma.request = sbus_dma_request;
1828 chip->
p_dma.address = sbus_dma_addr;
1830 chip->
c_dma.prepare = sbus_dma_prepare;
1831 chip->
c_dma.enable = sbus_dma_enable;
1832 chip->
c_dma.request = sbus_dma_request;
1833 chip->
c_dma.address = sbus_dma_addr;
1837 snd_printdd(
"cs4231-%d: Unable to grab SBUS IRQ %d\n",
1839 snd_cs4231_sbus_free(chip);
1844 if (snd_cs4231_probe(chip) < 0) {
1845 snd_cs4231_sbus_free(chip);
1848 snd_cs4231_init(chip);
1851 chip, &snd_cs4231_sbus_dev_ops)) < 0) {
1852 snd_cs4231_sbus_free(chip);
1865 err = cs4231_attach_begin(&card);
1872 (
unsigned long long)rp->
start,
1875 err = snd_cs4231_sbus_create(card, op, dev);
1881 return cs4231_attach_finish(card);
1892 snd_cs4231_play_callback(chip);
1895 static void snd_cs4231_ebus_capture_callback(
struct ebus_dma_info *
p,
1900 snd_cs4231_capture_callback(chip);
1932 static int snd_cs4231_ebus_free(
struct snd_cs4231 *chip)
1936 if (chip->
c_dma.ebus_info.regs) {
1940 if (chip->
p_dma.ebus_info.regs) {
1955 return snd_cs4231_ebus_free(cp);
1959 .
dev_free = snd_cs4231_ebus_dev_free,
1977 sizeof(snd_cs4231_original_image));
1978 strcpy(chip->
c_dma.ebus_info.name,
"cs4231(capture)");
1980 chip->
c_dma.ebus_info.callback = snd_cs4231_ebus_capture_callback;
1981 chip->
c_dma.ebus_info.client_cookie =
chip;
1983 strcpy(chip->
p_dma.ebus_info.name,
"cs4231(play)");
1985 chip->
p_dma.ebus_info.callback = snd_cs4231_ebus_play_callback;
1986 chip->
p_dma.ebus_info.client_cookie =
chip;
1989 chip->
p_dma.prepare = _ebus_dma_prepare;
1990 chip->
p_dma.enable = _ebus_dma_enable;
1991 chip->
p_dma.request = _ebus_dma_request;
1992 chip->
p_dma.address = _ebus_dma_addr;
1994 chip->
c_dma.prepare = _ebus_dma_prepare;
1995 chip->
c_dma.enable = _ebus_dma_enable;
1996 chip->
c_dma.request = _ebus_dma_request;
1997 chip->
c_dma.address = _ebus_dma_addr;
2000 chip->
p_dma.ebus_info.regs =
2002 chip->
c_dma.ebus_info.regs =
2004 if (!chip->
port || !chip->
p_dma.ebus_info.regs ||
2005 !chip->
c_dma.ebus_info.regs) {
2006 snd_cs4231_ebus_free(chip);
2007 snd_printdd(
"cs4231-%d: Unable to map chip registers.\n", dev);
2012 snd_cs4231_ebus_free(chip);
2013 snd_printdd(
"cs4231-%d: Unable to register EBUS capture DMA\n",
2018 snd_cs4231_ebus_free(chip);
2019 snd_printdd(
"cs4231-%d: Unable to enable EBUS capture IRQ\n",
2025 snd_cs4231_ebus_free(chip);
2026 snd_printdd(
"cs4231-%d: Unable to register EBUS play DMA\n",
2031 snd_cs4231_ebus_free(chip);
2032 snd_printdd(
"cs4231-%d: Unable to enable EBUS play IRQ\n", dev);
2036 if (snd_cs4231_probe(chip) < 0) {
2037 snd_cs4231_ebus_free(chip);
2040 snd_cs4231_init(chip);
2043 chip, &snd_cs4231_ebus_dev_ops)) < 0) {
2044 snd_cs4231_ebus_free(chip);
2056 err = cs4231_attach_begin(&card);
2065 err = snd_cs4231_ebus_create(card, op, dev);
2071 return cs4231_attach_finish(card);
2078 if (!
strcmp(op->
dev.of_node->parent->name,
"ebus"))
2079 return cs4231_ebus_probe(op);
2082 if (!
strcmp(op->
dev.of_node->parent->name,
"sbus") ||
2083 !
strcmp(op->
dev.of_node->parent->name,
"sbi"))
2084 return cs4231_sbus_probe(op);
2100 .name =
"SUNW,CS4231",
2104 .compatible =
"SUNW,CS4231",
2115 .of_match_table = cs4231_match,
2117 .probe = cs4231_probe,