aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorKarsten Wiese <fzu@wemgehoertderstaat.de>2008-04-22 06:52:45 -0400
committerTakashi Iwai <tiwai@suse.de>2008-04-24 06:00:39 -0400
commit775c199e6af5e4212bfa7ebeadee09563c14694b (patch)
tree4d62ec09ee333eadc028ff28ea3a64856eba073d /sound/pci
parent988f0664779674c7c06252a6d549eee8debd5d76 (diff)
[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/pci')
-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 a3bea2247c7f..3208901c740e 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
438static inline void snd_ice1712_gpio_write_bits(struct snd_ice1712 *ice, 438static inline void snd_ice1712_gpio_write_bits(struct snd_ice1712 *ice,
439 unsigned int mask, unsigned int bits) 439 unsigned int mask, unsigned int bits)
440{ 440{
441 unsigned val;
442
441 ice->gpio.direction |= mask; 443 ice->gpio.direction |= mask;
442 snd_ice1712_gpio_set_dir(ice, ice->gpio.direction); 444 snd_ice1712_gpio_set_dir(ice, ice->gpio.direction);
443 snd_ice1712_gpio_set_mask(ice, ~mask); 445 val = snd_ice1712_gpio_read(ice);
444 snd_ice1712_gpio_write(ice, mask & bits); 446 val &= ~mask;
447 val |= mask & bits;
448 snd_ice1712_gpio_write(ice, val);
445} 449}
446 450
447static inline int snd_ice1712_gpio_read_bits(struct snd_ice1712 *ice, 451static inline int snd_ice1712_gpio_read_bits(struct snd_ice1712 *ice,