Skip to contentSkip to conversation

ASoC: Accept any logical value WM8903 GPIO set()

PATCH In review Mark Brown 2 participants 2 messages Jan 31, 2011

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 ASoC: Accept any logical value WM8903 GPIO set()

---
 sound/soc/codecs/wm8903.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
sound/soc/codecs/wm8903.c +2 -1
index 54383c3..27cd8f5 100644
@@ -1904,7 +1904,8 @@ static void wm8903_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
 	struct snd_soc_codec *codec = wm8903->codec;
 
 	snd_soc_update_bits(codec, WM8903_GPIO_CONTROL_1 + offset,
-			    WM8903_GP1_LVL_MASK, value << WM8903_GP1_LVL_SHIFT);
+			    WM8903_GP1_LVL_MASK,
+			    !!value << WM8903_GP1_LVL_SHIFT);
 }
 
 static struct gpio_chip wm8903_template_chip = {
Signature · 1 line
1.7.2.3
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Mark Brown
---
 sound/soc/codecs/wm8903.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
sound/soc/codecs/wm8903.c +0 -0
index 54383c3..27cd8f5 100644

sound/soc/codecs/wm8903.c static void wm8903_gpio_set(struct gpio_chip *chip, unsigned offset, int value) · line 1911

Quoted 9 lines
sound/soc/codecs/wm8903.c +2 -1
@@ -1904,7 +1904,8 @@ static void wm8903_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
 	struct snd_soc_codec *codec = wm8903->codec;
 
 	snd_soc_update_bits(codec, WM8903_GPIO_CONTROL_1 + offset,
-			    WM8903_GP1_LVL_MASK, value << WM8903_GP1_LVL_SHIFT);
+			    WM8903_GP1_LVL_MASK,
+			    !!value << WM8903_GP1_LVL_SHIFT);
 }
 
 static struct gpio_chip wm8903_template_chip = {
Signature · 3 lines
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk