From: Rene Herman <rene.herman@keyaccess.nl>
To: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: Takashi Iwai <tiwai@suse.de>, Alsa-devel <alsa-devel@alsa-project.org>
Subject: Re: [PATCH 10/10] wss_lib: use wss detection code instead of ad1848 one
Date: Wed, 23 Jul 2008 23:28:47 +0200 [thread overview]
Message-ID: <4887A28F.90506@keyaccess.nl> (raw)
In-Reply-To: <4883632A.8090106@keyaccess.nl>
On 20-07-08 18:09, Rene Herman wrote:
> For anyone interested, I have placed the complete series as I have it
> here at:
>
> http://members.home.nl/rene.herman/wss/
>
> It's against current ALSA. I'll give this a proper review early this
> coming week. Takashi was away for the week so that should get things
> looked at before he returns.
*** 0001-wss_lib-move-cs4231_lib-into-wss_lib.patch
Acked-by: Rene Herman <rene.herman@gmail.com>
*** 0002-wss_lib-rename-cs4231.h-into-wss.h.patch
Acked-by: Rene Herman <rene.herman@gmail.com>
*** 0003-wss-rename-cs4321_foo-to-wss_foo.patch
> -#define CS4231_HW_DETECT 0x0000 /* let CS4231 driver detect chip */
[ ... ]
> +#define WSS_HW_DETECT 0x0000 /* let CS4231 driver detect chip */
The comment likes to be "let WSS driver [ ... ]". But please don't even
think of actually changing that. Only pointed out to dazzle you with my
unrelenting eye for detail.
> diff --git a/sound/isa/ad1848/ad1848.c b/sound/isa/ad1848/ad1848.c
> index 5f5271e..3500548 100644
> --- a/sound/isa/ad1848/ad1848.c
> +++ b/sound/isa/ad1848/ad1848.c
> @@ -70,15 +70,15 @@ static int __devinit snd_ad1848_match(struct device *dev, unsigned int n)
> return 0;
>
> if (port[n] == SNDRV_AUTO_PORT) {
> - snd_printk(KERN_ERR "%s: please specify port\n", dev->bus_id);
> + snd_printk(KERN_ERR "%s: please specify port\n", dev_name(dev));
> return 0;
> }
The comment in dev_name() makes me wonder a bit but I guess we'll deal
with it then if there's anything to deal with.
> -CS4236_DOUBLE("Master Digital Playback Switch", 0, CS4236_LEFT_MASTER, CS4236_RIGHT_MASTER, 7, 7, 1, 1),
> -CS4236_DOUBLE("Master Digital Capture Switch", 0, CS4236_DAC_MUTE, CS4236_DAC_MUTE, 7, 6, 1, 1),
> +CS4236_DOUBLE("Master Digital Playback Switch", 0,
> + CS4236_LEFT_MASTER, CS4236_RIGHT_MASTER, 7, 7, 1, 1),
> +CS4236_DOUBLE("Master Digital Capture Switch", 0,
> + CS4236_DAC_MUTE, CS4236_DAC_MUTE, 7, 6, 1, 1),
I can't say I'm personally a fan of these kinds of changes. The point of
them would supposedly be to make the code more readable but as far as I
am concerned it does the reverse.
I know that Takashi can be an 80-column fundamentalist so I'll not
object I guess. I'd personally like these (all) restored to a single
line but if he doesn't, so be it.
> --- a/sound/isa/wss/wss_lib.c
> +++ b/sound/isa/wss/wss_lib.c
[ ... ]
> -static inline void cs4231_outb(struct snd_cs4231 *chip, u8 offset, u8 val)
> +static inline void wss_outb(struct snd_wss *chip, u8 offset, u8 val)
> {
> outb(val, chip->port + offset);
> }
> +EXPORT_SYMBOL(snd_wss_out);
This EXPORT_SYMBOL() is in the wrong spot (ie, not after snd_wss_out).
> +static void snd_wss_debug(struct snd_wss *chip)
> +{
> + printk(KERN_DEBUG "CS4231 REGS: INDEX = 0x%02x ",
> + wss_inb(chip, CS4231P(REGSEL)));
> + printk(KERN_DEBUG " STATUS = 0x%02x\n",
> + wss_inb(chip, CS4231P(STATUS)));
This is an even worse example of the 80-column change here. Just makes
it worse as it destroys the What You Write Is What You Get format.
> +static void snd_wss_playback_format(struct snd_wss *chip,
[ ... ]
> - snd_cs4231_out(chip, CS4231_ALT_FEATURE_1, chip->image[CS4231_ALT_FEATURE_1] | 0x10);
> - snd_cs4231_out(chip, CS4231_PLAYBK_FORMAT, chip->image[CS4231_PLAYBK_FORMAT] = pdfr);
> - snd_cs4231_out(chip, CS4231_ALT_FEATURE_1, chip->image[CS4231_ALT_FEATURE_1] &= ~0x10);
> + snd_wss_out(chip, CS4231_ALT_FEATURE_1,
> + chip->image[CS4231_ALT_FEATURE_1] | 0x10);
> + chip->image[CS4231_PLAYBK_FORMAT] = pdfr;
> + snd_wss_out(chip, CS4231_PLAYBK_FORMAT,
> + chip->image[CS4231_PLAYBK_FORMAT]);
> + snd_wss_out(chip, CS4231_ALT_FEATURE_1,
> + chip->image[CS4231_ALT_FEATURE_1] &= ~0x10);
[ .. ]
> if (full_calib) {
> - snd_cs4231_mce_up(chip);
> + snd_wss_mce_up(chip);
> spin_lock_irqsave(&chip->reg_lock, flags);
> - if (chip->hardware != CS4231_HW_INTERWAVE && !chip->single_dma) {
> - snd_cs4231_out(chip, CS4231_PLAYBK_FORMAT,
> + if (chip->hardware != WSS_HW_INTERWAVE && !chip->single_dma) {
> + snd_wss_out(chip, CS4231_PLAYBK_FORMAT,
> (chip->image[CS4231_IFACE_CTRL] & CS4231_RECORD_ENABLE) ?
> (pdfr & 0xf0) | (chip->image[CS4231_REC_FORMAT] & 0x0f) :
> - pdfr);
> + pdfr);
> } else {
> - snd_cs4231_out(chip, CS4231_PLAYBK_FORMAT, chip->image[CS4231_PLAYBK_FORMAT] = pdfr);
> + snd_wss_out(chip, CS4231_PLAYBK_FORMAT,
> + chip->image[CS4231_PLAYBK_FORMAT] = pdfr);
> }
As long as you're at it... could you split this assignment same as you
did above?
> +static int snd_wss_timer_stop(struct snd_timer *timer)
> {
> unsigned long flags;
> - struct snd_cs4231 *chip = snd_timer_chip(timer);
> + struct snd_wss *chip = snd_timer_chip(timer);
> spin_lock_irqsave(&chip->reg_lock, flags);
> - snd_cs4231_out(chip, CS4231_ALT_FEATURE_1, chip->image[CS4231_ALT_FEATURE_1] &= ~CS4231_TIMER_ENABLE);
> + snd_wss_out(chip, CS4231_ALT_FEATURE_1,
> + chip->image[CS4231_ALT_FEATURE_1] &= ~CS4231_TIMER_ENABLE);
> spin_unlock_irqrestore(&chip->reg_lock, flags);
> return 0;
> }
Same.
> -static snd_pcm_uframes_t snd_cs4231_playback_pointer(struct snd_pcm_substream *substream)
> +static snd_pcm_uframes_t snd_wss_playback_pointer
> + (struct snd_pcm_substream *substream)
>
Please don't split function names quite like that. If the 80-column
thing must be at least keep the opening brace on the same line.
Same thing for snd_wss_capture_pointer() just below that one.
> @@ -1475,32 +1568,36 @@ int snd_cs4231_create(struct snd_card *card,
> chip->dma2 = -1;
>
> if ((chip->res_port = request_region(port, 4, "CS4231")) == NULL) {
> - snd_printk(KERN_ERR "cs4231: can't grab port 0x%lx\n", port);
> - snd_cs4231_free(chip);
> + snd_printk(KERN_ERR "wss: can't grab port 0x%lx\n", port);
> + snd_wss_free(chip);
> return -EBUSY;
> }
> chip->port = port;
> if ((long)cport >= 0 && (chip->res_cport = request_region(cport, 8, "CS4232 Control")) == NULL) {
You've left these two if assignments in. You do all the others so I
assume you forgot.
> +static struct snd_kcontrol_new snd_wss_controls[] = {
> +WSS_DOUBLE("PCM Playback Switch", 0,
> + CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 7, 7, 1, 1),
Same comment about the split.
> +module_init(alsa_wss_init)
> +module_exit(alsa_wss_exit)
Can you add a ";" after these? These macros should've not included them.
Just makes for an odd special case to remember (yes, I know there are
more of them in the tree, but I myself fix it when I get close also).
...
Right-o. That was a 4000+ line patch and I ran out of evening. Rest will
have to wait for tomorrow then. If you make changes, could you very
specifically indicate those changes so that I might be able to get away
with not reading the entire thing again? :-/
Rene.
next prev parent reply other threads:[~2008-07-23 21:26 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-18 19:51 [PATCH 10/10] wss_lib: use wss detection code instead of ad1848 one Krzysztof Helt
2008-07-20 16:09 ` Rene Herman
2008-07-23 21:28 ` Rene Herman [this message]
2008-07-24 5:26 ` Krzysztof Helt
2008-07-24 9:31 ` Rene Herman
2008-07-28 15:37 ` Takashi Iwai
2008-07-28 18:39 ` Rene Herman
2008-07-29 13:02 ` Takashi Iwai
2008-07-29 14:15 ` Rene Herman
2008-07-29 14:31 ` Takashi Iwai
2008-07-29 14:37 ` Rene Herman
2008-07-29 18:53 ` Krzysztof Helt
2008-07-29 19:00 ` Rene Herman
2008-07-24 17:19 ` Rene Herman
2008-07-24 18:47 ` Krzysztof Helt
2008-07-24 19:30 ` Rene Herman
2008-07-24 20:05 ` Rene Herman
2008-07-24 21:41 ` Krzysztof Helt
2008-07-25 9:59 ` Rene Herman
2008-08-04 1:47 ` Rene Herman
2008-08-04 4:31 ` Krzysztof Helt
-- strict thread matches above, loose matches on Subject: below --
2008-07-25 13:39 krzysztof.h1
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=4887A28F.90506@keyaccess.nl \
--to=rene.herman@keyaccess.nl \
--cc=alsa-devel@alsa-project.org \
--cc=krzysztof.h1@poczta.fm \
--cc=tiwai@suse.de \
/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.