All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Sasha Khapyorsky <sashak@smlink.com>
Cc: unixtricks@btinternet.com, alsa-devel@lists.sourceforge.net,
	Antonis Tsolomitis <atsol@aegean.gr>,
	Jacques Goldberg <Jacques.Goldberg@cern.ch>
Subject: Re: ATI IXP Modem driver
Date: Thu, 29 Jul 2004 17:43:09 +0200	[thread overview]
Message-ID: <s5hhdrqq0oi.wl@alsa2.suse.de> (raw)
In-Reply-To: <20040729183716.5e9f7229@sashak.lan>

At Thu, 29 Jul 2004 18:37:16 +0300,
Sasha Khapyorsky wrote:
> 
> On Wed, 28 Jul 2004 18:26:25 +0200
> Takashi Iwai <tiwai@suse.de> wrote:
> 
> > 
> > Well, this will be still a problem when the audio driver is loaded
> > after the modem driver.  We'll need a way to avoid the double reset on
> > codecs.
> > 
> > How about adding a new flag to ac97 struct to indicate the shared chip
> > type? 
> 
> Basically ac97 (or even ac97_bus) 'sharing' is good idea - it better
> represents the real configuration.

I thought of sharing ac97_bus instance between two drivers but it
can't because bus includes the card pointer.  But the idea is somewhat
similar.

> > ac97_codec.c holds a static array, such as
> > 
> > 	static ac97_t *ac97_shared_codec[AC97_NUM_SHARED_CHIPS][4];
> > 
> > and when ac97->shared is non-zero, check the existence of the
> > already-initialized codec first,
> > 	if (ac97->shared && ac97_shared_codec[ac97->shared][ac97->num])
> > 	{
> > 		if (modem_only)
> > 			...
> > 		if (audio_only)
> > 			...
> > 	}
> > 
> > and set it when ready
> > 	if (ac97->shared)
> > 		ac97_shared_codec[ac97->shared][ac97->num] = ac97;
> > 
> > release it in snd_ac97_free(),
> > 	if (ac97->shared)
> > 		ac97_shared_codec[ac97->shared][ac97->num] = NULL;
> > 
> > Most likely we'll need to protect the above with mutex.
> 
> But one question about such implementation. What non-zero
> 'ac97-shared' should mean as index: How many shared chips will be
> possible?

I think you'll understand more when you read my last patch :)

Anyway, so far, only two are defined, ICH and ATIIXP.
More come, more will be added.

>  If more that one (AC97_NUM_SHARED_CHIPS > 1), which initial
> value should be used by driver? I mean how driver will know how much
> 'shared' buses are already in use?

The shared audio/modem drivers set their unique shared type.
If the driver isn't shared, simply leave it zero.  In theory, multiple
chips from the single ich/ati driver could be assigned, but it's not
supposed in the real world.

If the shared_type is non-zero (i.e. a shareable driver), the driver
should also set SKIP_MODEM/AUDIO scaps field bit, too, so that the
only audio/modem codecs are assigned.  ac97 core skips the audio/modem
codec in the probe routine when the codec was already assigned and the
codec type is what you want to skip.  Maybe we can get rid of these
checks. It's just to be sure.


Takashi


-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com

  reply	other threads:[~2004-07-29 15:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1083465072.1639.8.camel@server.gowanlea.net>
     [not found] ` <20040503163657.668357a9@sashak.lan>
     [not found]   ` <1087962001.4844.0.camel@server.gowanlea.net>
     [not found]     ` <20040711191833.462a0b4b@sashak.lan>
     [not found]       ` <s5hr7rhcztt.wl@alsa2.suse.de>
     [not found]         ` <20040712162839.2c58e1c3@sashak.lan>
     [not found]           ` <s5hd631cq5v.wl@alsa2.suse.de>
2004-07-12 16:54             ` ATI IXP Modem driver Sasha Khapyorsky
2004-07-12 16:57               ` Takashi Iwai
2004-07-25 15:21                 ` Sasha Khapyorsky
2004-07-28 16:26                   ` Takashi Iwai
2004-07-29 15:11                     ` Takashi Iwai
2004-07-29 16:27                       ` Sasha Khapyorsky
2004-07-29 17:03                         ` Takashi Iwai
2004-07-29 15:37                     ` Sasha Khapyorsky
2004-07-29 15:43                       ` Takashi Iwai [this message]
2004-07-29 16:15                         ` Sasha Khapyorsky

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=s5hhdrqq0oi.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=Jacques.Goldberg@cern.ch \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=atsol@aegean.gr \
    --cc=sashak@smlink.com \
    --cc=unixtricks@btinternet.com \
    /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.