All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Manuel Jander <mjander@embedded.cl>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: Aureal VOrtex update and MPU401 survey
Date: Thu, 13 Mar 2003 10:10:12 +0100	[thread overview]
Message-ID: <s5hbs0fws23.wl@alsa2.suse.de> (raw)
In-Reply-To: <3E7008F7.1090207@embedded.cl>

Hi,

At Thu, 13 Mar 2003 00:28:39 -0400,
Manuel Jander wrote:
> 
> MPU401 survey:
> I though about a modification for the mpu401_uart driver, to allow
> a more versatil handling of different IO types. I observed that
> at least the SBLive, appart from the Vortex have a standart MPU401 port, 
> but the hardware IO is slighdely different enough to prevent the usage 
> of the existing MPU401 driver. That means the driver is copy pasted and 
> only the Register access (inb and outb) calls are modified.
> 
> Know there are too options: allow replacement functions for inb and 
> outb, or to use wrappers that accept the mpu type as parameter so that a 
> more sophisticated IO handling can be done. THat means:
> 
> case 1
> 
> typedef mpu401_t {
>    ....
>    void (*write) (u8 data, u32 addr);
>    u8 (*write) (u32 addr);
>    ....
> }
> .....
> 
> mpu->write = outb;
> mpu->read = inb;
> 
> 
> ----------- < OR >-------------------
> case 2
> 
> typedef mpu401_t {
>    ....
>    void (*write) (mpu401_t *mpu, u8 data, u32 addr);
>    u8 (*write) (mpu401_t *mpu, u32 addr);
>    ....
> }
> 
> ...
> 
> mpu->write = mpu_write;
> mpu->read = mpu_read;
> 
> 
> ... and implemented in the specific card driver:
> 
> void mpu_write(mpu401_t *mpu, u8 data, u32 addr) {
>      some_iohardware_write(mpu->private_data, data, addr);
> }
> 
> void mpu_write(mpu401_t *mpu, u8 data, u32 addr) {
>      return some_iohardware_read(mpu->private_data, addr);
> }

(i suppose the second one corresponds to read :)

i like the idea.  not only emu10k1 but some also other drivers use a
copy of mpu401_uart.c code.  for compatibility, we can keep the old
snd_mpu_uart401_new() function which works like it has been, and add a
new function with the driver-specific callbacks.

from the suggestions, i would choose the last one.  the callback
likely needs a private data to access the hardware properly.
also, for the callback argument, we don't need to pass the exact
address but only a enum CMD and DATA.


> The question is: Can anyone take advantage of having the "mpu" object 
> avaiable inside a IO wrapper ? The SBLive should, but are the 
> maintainers of the SBLive in the mood to actually make use of that ?

no problem, but unfortunately i (and perhaps Jaroslav, too) have no
time in this week to attend the LAD meeting at Karlsruhe.
so, the work will be done in the next week.


the only remaining problem is the interrupt handler.
in the case of mpu401_uart.c, there is only one interrupt handler
which handles both receive and transmit.  but some hardwares have
different rx and tx interrupts, so we need to separate them.


anyway, please feel free to submit the patch.


ciao,

Takashi


-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en

      reply	other threads:[~2003-03-13  9:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-13  4:28 Aureal VOrtex update and MPU401 survey Manuel Jander
2003-03-13  9:10 ` Takashi Iwai [this message]

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=s5hbs0fws23.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=mjander@embedded.cl \
    /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.