Lines Matching +full:mute +full:- +full:gpios

1 // SPDX-License-Identifier: GPL-2.0
12 #include <sound/soc-dapm.h>
28 struct snd_soc_component *c = snd_soc_dapm_to_component(w->dapm); in pga_event()
32 gpiod_set_value_cansleep(priv->gpiod_shutdown, 0); in pga_event()
34 gpiod_set_value_cansleep(priv->gpiod_shutdown, 1); in pga_event()
48 ucontrol->value.integer.value[0] = priv->gain; in speaker_gain_control_get()
67 if (ucontrol->value.integer.value[0] > 3) in speaker_gain_control_put()
68 return -EINVAL; in speaker_gain_control_put()
70 priv->gain = ucontrol->value.integer.value[0]; in speaker_gain_control_put()
73 gpiod_set_value_cansleep(priv->gpiod_gain->desc[0], in speaker_gain_control_put()
74 speaker_gain_table[priv->gain][0]); in speaker_gain_control_put()
76 gpiod_set_value_cansleep(priv->gpiod_gain->desc[1], in speaker_gain_control_put()
77 speaker_gain_table[priv->gain][1]); in speaker_gain_control_put()
88 ucontrol->value.integer.value[0] = !priv->is_mute; in speaker_mute_get()
99 priv->is_mute = !ucontrol->value.integer.value[0]; in speaker_mute_put()
101 gpiod_set_value_cansleep(priv->gpiod_mute, priv->is_mute); in speaker_mute_put()
141 struct device *dev = &pdev->dev; in max9759_probe()
147 return -ENOMEM; in max9759_probe()
151 priv->gpiod_shutdown = devm_gpiod_get(dev, "shutdown", GPIOD_OUT_HIGH); in max9759_probe()
152 if (IS_ERR(priv->gpiod_shutdown)) { in max9759_probe()
153 err = PTR_ERR(priv->gpiod_shutdown); in max9759_probe()
154 if (err != -EPROBE_DEFER) in max9759_probe()
159 priv->gpiod_mute = devm_gpiod_get(dev, "mute", GPIOD_OUT_HIGH); in max9759_probe()
160 if (IS_ERR(priv->gpiod_mute)) { in max9759_probe()
161 err = PTR_ERR(priv->gpiod_mute); in max9759_probe()
162 if (err != -EPROBE_DEFER) in max9759_probe()
163 dev_err(dev, "Failed to get 'mute' gpio: %d", err); in max9759_probe()
166 priv->is_mute = true; in max9759_probe()
168 priv->gpiod_gain = devm_gpiod_get_array(dev, "gain", GPIOD_OUT_HIGH); in max9759_probe()
169 if (IS_ERR(priv->gpiod_gain)) { in max9759_probe()
170 err = PTR_ERR(priv->gpiod_gain); in max9759_probe()
171 if (err != -EPROBE_DEFER) in max9759_probe()
172 dev_err(dev, "Failed to get 'gain' gpios: %d", err); in max9759_probe()
175 priv->gain = 0; in max9759_probe()
177 if (priv->gpiod_gain->ndescs != 2) { in max9759_probe()
178 dev_err(dev, "Invalid 'gain' gpios count: %d", in max9759_probe()
179 priv->gpiod_gain->ndescs); in max9759_probe()
180 return -EINVAL; in max9759_probe()