Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Stephen Warren <SWarren@nvidia.com>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: Proposed changes to azx/patch_realtek.c
Date: Wed, 15 Dec 2004 18:31:54 +0100	[thread overview]
Message-ID: <s5hfz27qxh1.wl@alsa2.suse.de> (raw)
In-Reply-To: <DBFABB80F7FD3143A911F9E6CFD477B0033AE3D9@hqemmail02.nvidia.com>

At Wed, 15 Dec 2004 09:21:25 -0800,
Stephen Warren wrote:
> 
> Hello.
> 
> I'm working on updating the Azalia audio driver (ALC880 codec) to
> support a new PCB with different routing of codec pins to connectors.
> 
> As part of this, I took a look at patch_realtek.c and have a few
> suggestions on how to simplify things.
> 
> As an example of this, I've attached a patch. This isolates and
> knowledge of the "board type" to the patch_alc880 function. All
> decisions based on the board type are made here, and written into
> configuration variables in the spec structure. Then, all other functions
> simply pull values out of the spec structure and use them, so they don't
> have to have a bunch of code that's conditional on board type, which
> could grow unmanageably.
> 
> See the attached patch for this change.

Sorry, your patch can't be applied.  I rewrote the azx and hda_codec
codes largely again, committed to CVS shortly before.  The new code is
a bit better than the older one in this regard.

> Going forward, I'd like to make the following changes:
> 
> 1)
> 
> patch_alc880 fills in the spec structure at run-time. Instead, I'd like
> a set of pre-filled-in structures to be part of the driver, and
> patch_alc880 just initializes codec->spec to point at one (just like it
> currently initializes spec->init_seq to point at a specific list of
> initialization instructions with my patch).
> 
> Benefit: Can support new boards simply by defining a new pre-defined
> data structure and ALC880_xxx enumeration value - no need to actually
> edit code in patch_alc880 for this.

This sounds reasonable.

> 2)
> 
> Unify 880 and 260 support.
> 
> Much of the code for 880 and 260 is very similar - for example,
> alc880_build_controls and alc260_build_controls are the same function,
> except that (if we use just the 880 code) we would hard-code
> spec->build_side_mixer=0 and spec->digital=0, and have to parameterize
> the function by putting a pointer to either alc880_base_mixer or
> alc260_base_mixer into the spec structure.
> 
> Benefit: Identical code for 880 and 260 reduces duplication. Can
> configure differences between codecs/boards just by editing the
> pre-initialized spec structure values.
> 
> I expect to have to define my own xxx_base_mixer function for the PCB
> I'm supporting.

Yes, I thought of that, too.  That's why struct alc_spec is shared
between these codecs.  I left it as it is simply because I have no
test board for ALC260.

Go ahead, clean up as you like ;)


Takashi


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/

  reply	other threads:[~2004-12-15 17:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-15 17:21 Proposed changes to azx/patch_realtek.c Stephen Warren
2004-12-15 17:31 ` Takashi Iwai [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-12-15 17:45 Stephen Warren
2004-12-15 18:06 ` 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=s5hfz27qxh1.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=SWarren@nvidia.com \
    --cc=alsa-devel@lists.sourceforge.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox