aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorKarsten Wiese <fzu@wemgehoertderstaat.de>2008-04-22 12:52:45 +0200
committerTakashi Iwai <tiwai@suse.de>2008-04-24 12:00:39 +0200
commit775c199e6af5e4212bfa7ebeadee09563c14694b (patch)
tree4d62ec09ee333eadc028ff28ea3a64856eba073d /sound
parent988f0664779674c7c06252a6d549eee8debd5d76 (diff)
downloadmrst-s0i3-test-775c199e6af5e4212bfa7ebeadee09563c14694b.tar.gz
mrst-s0i3-test-775c199e6af5e4212bfa7ebeadee09563c14694b.tar.xz
mrst-s0i3-test-775c199e6af5e4212bfa7ebeadee09563c14694b.zip
[ALSA] Don't set gpio mask register in snd_ice1712_gpio_write_bits()
Some calls to snd_ice1712_gpio_write() go wrong, if snd_ice1712_gpio_write_bits() ran before and changed the gpio mask register. Read the actual gpio value and combine it with the to be set bits in the cpu instead. Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/ice1712/ice1712.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/pci/ice1712/ice1712.h b/sound/pci/ice1712/ice1712.h
index a3bea2247c7..3208901c740 100644
--- a/sound/pci/ice1712/ice1712.h
+++ b/sound/pci/ice1712/ice1712.h
@@ -438,10 +438,14 @@ int snd_ice1712_gpio_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_valu
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,