From: Ondrej Zary <linux@rainbow-software.org>
To: alsa-devel@alsa-project.org
Subject: [RFC] cmi8330: Add basic CMI8329 support
Date: Sat, 27 Jun 2009 17:07:31 +0200 [thread overview]
Message-ID: <200906271707.32687.linux@rainbow-software.org> (raw)
Add basic support for CMI8329 cards. It seems to be very similar to CMI8330,
but the PnP devices are different:
- AD1848 (WSS) and SB16 device IDs are swapped
- the OPL3 port is contained in SB16 device, not AD1848 (WSS)
- there is A@@0001 device (looks like some control interface - it has only
one 8-bit I/O address)
Is my detection code correct, shouldn't the struct pnp_dev returned
pnp_request_card_device() be released somehow?
Also the mixer seems to be a bit different - master volume does not work
currently.
My card includes wavetable MIDI - it works in Windows when MPU-401 is
selected. It does not work with this driver - pmidi plays but no sound
comes out. OPL3 works.
My card has also an IDE interface but it's not visible as PnP device and
it does not work even in Windows (and I'm unable to find any driver for it
for any OS).
Here's a scan of the card: http://www.rainbow-software.org/images/hardware/cmi8329a_.jpg
The main chip is labelled AD Chips CMI8329A.
--- linux-test/sound/isa/cmi8330.c 2009-06-27 16:32:13.000000000 +0200
+++ linux-2.6.30-pentium/sound/isa/cmi8330.c 2009-06-27 16:33:25.000000000 +0200
@@ -156,6 +156,11 @@
typedef int (*snd_pcm_open_callback_t)(struct snd_pcm_substream *);
+enum card_type {
+ CMI8329,
+ CMI8330
+};
+
struct snd_cmi8330 {
#ifdef CONFIG_PNP
struct pnp_dev *cap;
@@ -172,6 +177,8 @@
snd_pcm_open_callback_t open;
void *private_data; /* sb or wss */
} streams[2];
+
+ enum card_type type;
};
#ifdef CONFIG_PNP
@@ -328,12 +335,26 @@
{
struct pnp_dev *pdev;
int err;
+ const char *sb16_id, *wss_id;
+
+ /* CMI8329 has a device with ID A@@0001, CMI8330 does not */
+ pdev = pnp_request_card_device(card, "A@@0001", NULL);
+ if (pdev) {
+ acard->type = CMI8329;
+ pnp_release_card_device(pdev);
+ sb16_id = id->devs[0].id;
+ wss_id = id->devs[1].id;
+ } else {
+ acard->type = CMI8330;
+ sb16_id = id->devs[1].id;
+ wss_id = id->devs[0].id;
+ }
- acard->cap = pnp_request_card_device(card, id->devs[0].id, NULL);
+ acard->cap = pnp_request_card_device(card, wss_id, NULL);
if (acard->cap == NULL)
return -EBUSY;
- acard->play = pnp_request_card_device(card, id->devs[1].id, NULL);
+ acard->play = pnp_request_card_device(card, sb16_id, NULL);
if (acard->play == NULL)
return -EBUSY;
@@ -351,7 +372,8 @@
wssport[dev] = pnp_port_start(pdev, 0);
wssdma[dev] = pnp_dma(pdev, 0);
wssirq[dev] = pnp_irq(pdev, 0);
- fmport[dev] = pnp_port_start(pdev, 1);
+ if (acard->type == CMI8330)
+ fmport[dev] = pnp_port_start(pdev, 1);
/* allocate SB16 resources */
pdev = acard->play;
@@ -365,6 +387,8 @@
sbdma8[dev] = pnp_dma(pdev, 0);
sbdma16[dev] = pnp_dma(pdev, 1);
sbirq[dev] = pnp_irq(pdev, 0);
+ if (acard->type == CMI8329)
+ fmport[dev] = pnp_port_start(pdev, 1);
/* allocate MPU-401 resources */
pdev = acard->mpu;
--
Ondrej Zary
next reply other threads:[~2009-06-27 15:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-27 15:07 Ondrej Zary [this message]
2009-06-29 6:25 ` [RFC] cmi8330: Add basic CMI8329 support Takashi Iwai
2009-07-04 20:25 ` Ondrej Zary
2009-07-05 9:51 ` Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200906271707.32687.linux@rainbow-software.org \
--to=linux@rainbow-software.org \
--cc=alsa-devel@alsa-project.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.