mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 23:53:32 +00:00
[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>
This commit is contained in:
parent
988f066477
commit
775c199e6a
1 changed files with 6 additions and 2 deletions
|
@ -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,
|
static inline void snd_ice1712_gpio_write_bits(struct snd_ice1712 *ice,
|
||||||
unsigned int mask, unsigned int bits)
|
unsigned int mask, unsigned int bits)
|
||||||
{
|
{
|
||||||
|
unsigned val;
|
||||||
|
|
||||||
ice->gpio.direction |= mask;
|
ice->gpio.direction |= mask;
|
||||||
snd_ice1712_gpio_set_dir(ice, ice->gpio.direction);
|
snd_ice1712_gpio_set_dir(ice, ice->gpio.direction);
|
||||||
snd_ice1712_gpio_set_mask(ice, ~mask);
|
val = snd_ice1712_gpio_read(ice);
|
||||||
snd_ice1712_gpio_write(ice, mask & bits);
|
val &= ~mask;
|
||||||
|
val |= mask & bits;
|
||||||
|
snd_ice1712_gpio_write(ice, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int snd_ice1712_gpio_read_bits(struct snd_ice1712 *ice,
|
static inline int snd_ice1712_gpio_read_bits(struct snd_ice1712 *ice,
|
||||||
|
|
Loading…
Reference in a new issue