From: Takashi Iwai <tiwai@suse.de>
To: Karsten Wiese <fzu@wemgehoertderstaat.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH] ALSA: Fix capturing for envy1724ht based "audiophile 192"
Date: Mon, 21 Apr 2008 13:11:50 +0200 [thread overview]
Message-ID: <s5htzhvcvih.wl%tiwai@suse.de> (raw)
In-Reply-To: <200804200052.51804.fzu@wemgehoertderstaat.de>
At Sun, 20 Apr 2008 00:52:51 +0200,
Karsten Wiese wrote:
>
> The 1st hunk changes snd_ice1712_gpio_write_bits() to not affect the gpio's mask
> register. Lets gpio writers that are unaware of a changed mask register
> successfully write the gpio.
> The 2nd and 3rd hunks toggle "chip reset" and "eeprom based setup" sequence so
> "chip reset" becomes first. Increasement of the "chip reset" related timeout
> leads to correctly read eeprom's contents here.
> Also corrects some arguments in calls to snd_ice1712_gpio_write_bits() from
> ap192_set_rate_val().
>
> Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de>
Thanks. All changes look good to me, but I'd prefer separated
patches. Could you split it to three patches and give a changelog for
each?
Takashi
> ---
>
> Hi,
>
> patch might hamper cards that actually relied on snd_ice1712_gpio_write_bits()
> setting the gpio's mask register. Cscope tells me terratec ews and m-audio
> rev51 are might be candidates. I guess they are ok ;-)
>
> regards,
> Karsten
>
> diff -pur alsa.hg/alsa-kernel/pci/ice1712/ice1712.h fixed/alsa-kernel/pci/ice1712/ice1712.h
> --- alsa.hg/alsa-kernel/pci/ice1712/ice1712.h 2008-03-20 12:25:01.000000000 +0100
> +++ fixed/alsa-kernel/pci/ice1712/ice1712.h 2008-04-19 23:21:31.000000000 +0200
> @@ -438,10 +438,14 @@ int snd_ice1712_gpio_put(struct snd_kcon
> static inline void snd_ice1712_gpio_write_bits(struct snd_ice1712 *ice,
> unsigned int mask, unsigned int bits)
> {
> + unsigned val;
> +
> ice->gpio.direction |= mask;
> snd_ice1712_gpio_set_dir(ice, ice->gpio.direction);
> - snd_ice1712_gpio_set_mask(ice, ~mask);
> - snd_ice1712_gpio_write(ice, mask & bits);
> + val = snd_ice1712_gpio_read(ice);
> + val &= ~mask;
> + val |= mask & bits;
> + snd_ice1712_gpio_write(ice, val);
> }
>
> static inline int snd_ice1712_gpio_read_bits(struct snd_ice1712 *ice,
> diff -pur alsa.hg/alsa-kernel/pci/ice1712/ice1724.c fixed/alsa-kernel/pci/ice1712/ice1724.c
> --- alsa.hg/alsa-kernel/pci/ice1712/ice1724.c 2008-03-20 12:25:01.000000000 +0100
> +++ fixed/alsa-kernel/pci/ice1712/ice1724.c 2008-04-19 23:07:29.000000000 +0200
> @@ -2045,12 +2045,16 @@ static int __devinit snd_vt1724_read_eep
>
>
>
> -static int __devinit snd_vt1724_chip_init(struct snd_ice1712 *ice)
> +static void __devinit snd_vt1724_chip_reset(struct snd_ice1712 *ice)
> {
> outb(VT1724_RESET , ICEREG1724(ice, CONTROL));
> - udelay(200);
> + msleep(10);
> outb(0, ICEREG1724(ice, CONTROL));
> - udelay(200);
> + msleep(10);
> +}
> +
> +static int __devinit snd_vt1724_chip_init(struct snd_ice1712 *ice)
> +{
> outb(ice->eeprom.data[ICE_EEP2_SYSCONF], ICEREG1724(ice, SYS_CFG));
> outb(ice->eeprom.data[ICE_EEP2_ACLINK], ICEREG1724(ice, AC97_CFG));
> outb(ice->eeprom.data[ICE_EEP2_I2S], ICEREG1724(ice, I2S_FEATURES));
> @@ -2223,6 +2227,7 @@ static int __devinit snd_vt1724_create(s
>
> ice->irq = pci->irq;
>
> + snd_vt1724_chip_reset(ice);
> if (snd_vt1724_read_eeprom(ice, modelname) < 0) {
> snd_vt1724_free(ice);
> return -EIO;
> diff -pur alsa.hg/alsa-kernel/pci/ice1712/revo.c fixed/alsa-kernel/pci/ice1712/revo.c
> --- alsa.hg/alsa-kernel/pci/ice1712/revo.c 2008-03-17 09:25:02.000000000 +0100
> +++ fixed/alsa-kernel/pci/ice1712/revo.c 2008-04-19 23:12:33.000000000 +0200
> @@ -327,7 +327,7 @@ static void ap192_set_rate_val(struct sn
> revo_set_rate_val(ak, rate);
>
> /* reset CKS */
> - snd_ice1712_gpio_write_bits(ice, 1 << 8, rate > 96000 ? 1 : 0);
> + snd_ice1712_gpio_write_bits(ice, 1 << 8, rate > 96000 ? 1 << 8 : 0);
> /* reset DFS pins of AK5385A for ADC, too */
> if (rate > 96000)
> dfs = 2;
> @@ -338,7 +338,7 @@ static void ap192_set_rate_val(struct sn
> snd_ice1712_gpio_write_bits(ice, 3 << 9, dfs << 9);
> /* reset ADC */
> snd_ice1712_gpio_write_bits(ice, 1 << 11, 0);
> - snd_ice1712_gpio_write_bits(ice, 1 << 11, 1);
> + snd_ice1712_gpio_write_bits(ice, 1 << 11, 1 << 11);
> }
>
> static const struct snd_akm4xxx_dac_channel ap192_dac[] = {
>
next prev parent reply other threads:[~2008-04-21 11:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-19 22:52 [PATCH] ALSA: Fix capturing for envy1724ht based "audiophile 192" Karsten Wiese
2008-04-21 11:11 ` Takashi Iwai [this message]
2008-04-21 20:39 ` Karsten Wiese
2008-04-21 20:45 ` [PATCH] ice1724.c: toggle "chip reset" and "eeprom based setup" sequence Karsten Wiese
2008-04-22 10:14 ` Takashi Iwai
2008-04-21 20:45 ` [PATCH] Don't set gpio mask register in snd_ice1712_gpio_write_bits() Karsten Wiese
2008-04-21 20:45 ` [PATCH] Audiophile 192: Fix ad converter initialization Karsten Wiese
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=s5htzhvcvih.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=fzu@wemgehoertderstaat.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.