From: John Linville <linville@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: jgarzik@pobox.com, herbert@gondor.apana.org.au
Subject: Re: i810_audio MMIO patch
Date: Wed, 30 Jun 2004 15:56:06 -0400 [thread overview]
Message-ID: <200406301956.i5UJu6mp007649@savage.devel.redhat.com> (raw)
Attached is a second patch to account for (most of) Herbert Xu's
comments.
I have left-out the part about changing state->card to a
local variable where it is used a lot. Unfortunately, that usage is
somewhat pervasive and I would prefer to make those changes in a separate
patch -- after I have had a chance to do some testing.
If you'd prefer one patch to account for the original plus these
changes, let me know and I'll be happy to provide it.
John
diff -urNp linux-2.4.21.orig/drivers/sound/i810_audio.c linux-2.4.21/drivers/sound/i810_audio.c
--- linux-2.4.21.orig/drivers/sound/i810_audio.c 2004-06-30 15:35:09.034185181 -0400
+++ linux-2.4.21/drivers/sound/i810_audio.c 2004-06-30 13:06:28.000000000 -0400
@@ -455,8 +455,10 @@ struct i810_card {
#define I810_IOREAD(size, type, card, off) \
({ \
type val; \
- if (card->use_mmio) val=read##size(card->iobase_mmio+off); \
- else val=in##size(card->iobase+off); \
+ if (card->use_mmio) \
+ val=read##size(card->iobase_mmio+off); \
+ else \
+ val=in##size(card->iobase+off); \
val; \
})
@@ -466,8 +468,10 @@ struct i810_card {
#define I810_IOWRITE(size, val, card, off) \
({ \
- if (card->use_mmio) write##size(val, card->iobase_mmio+off); \
- else out##size(val, card->iobase+off); \
+ if (card->use_mmio) \
+ write##size(val, card->iobase_mmio+off); \
+ else \
+ out##size(val, card->iobase+off); \
})
#define I810_IOWRITEL(val, card, off) I810_IOWRITE(l, val, card, off)
@@ -2818,9 +2822,11 @@ static int i810_ac97_power_up_bus(struct
* See if the primary codec comes ready. This must happen
* before we start doing DMA stuff
*/
- /* see i810_ac97_init for the next 7 lines (jsaw) */
- if (card->use_mmio) readw(card->ac97base_mmio);
- else inw(card->ac97base);
+ /* see i810_ac97_init for the next 10 lines (jsaw) */
+ if (card->use_mmio)
+ readw(card->ac97base_mmio);
+ else
+ inw(card->ac97base);
if (ich_use_mmio(card)) {
primary_codec_id = (int) readl(card->iobase_mmio + SDM) & 0x3;
printk(KERN_INFO "i810_audio: Primary codec has ID %d\n",
@@ -2838,8 +2844,10 @@ static int i810_ac97_power_up_bus(struct
else
printk("no response.\n");
}
- if (card->use_mmio) readw(card->ac97base_mmio);
- else inw(card->ac97base);
+ if (card->use_mmio)
+ readw(card->ac97base_mmio);
+ else
+ inw(card->ac97base);
return 1;
}
@@ -2883,8 +2891,10 @@ static int __devinit i810_ac97_init(stru
for (num_ac97 = 0; num_ac97 < nr_ac97_max; num_ac97++) {
/* codec reset */
printk(KERN_INFO "i810_audio: Resetting connection %d\n", num_ac97);
- if (card->use_mmio) readw(card->ac97base_mmio + 0x80*num_ac97);
- else inw(card->ac97base + 0x80*num_ac97);
+ if (card->use_mmio)
+ readw(card->ac97base_mmio + 0x80*num_ac97);
+ else
+ inw(card->ac97base + 0x80*num_ac97);
/* If we have the SDATA_IN Map Register, as on ICH4, we
do not loop thru all possible codec IDs but thru all
@@ -3162,7 +3172,7 @@ static int __devinit i810_probe(struct p
}
}
- if (!(card->use_mmio) && !(card->iobase)) {
+ if (!(card->use_mmio) && (!(card->iobase) || !(card->ac97base))) {
printk(KERN_ERR "i810_audio: No I/O resources available.\n");
goto out_mem;
}
next reply other threads:[~2004-06-30 20:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-30 19:56 John Linville [this message]
2004-07-04 15:50 ` Jeff Garzik
2004-07-12 9:34 ` Takashi Iwai
-- strict thread matches above, loose matches on Subject: below --
2004-06-29 20:31 John Linville
2004-06-30 10:22 ` Herbert Xu
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=200406301956.i5UJu6mp007649@savage.devel.redhat.com \
--to=linville@redhat.com \
--cc=herbert@gondor.apana.org.au \
--cc=jgarzik@pobox.com \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®