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] < 0 || in speaker_gain_control_put()
68 ucontrol->value.integer.value[0] > 3) in speaker_gain_control_put()
69 return -EINVAL; in speaker_gain_control_put()
71 priv->gain = ucontrol->value.integer.value[0]; in speaker_gain_control_put()
74 gpiod_set_value_cansleep(priv->gpiod_gain->desc[0], in speaker_gain_control_put()
75 speaker_gain_table[priv->gain][0]); in speaker_gain_control_put()
77 gpiod_set_value_cansleep(priv->gpiod_gain->desc[1], in speaker_gain_control_put()
78 speaker_gain_table[priv->gain][1]); in speaker_gain_control_put()
89 ucontrol->value.integer.value[0] = !priv->is_mute; in speaker_mute_get()
100 priv->is_mute = !ucontrol->value.integer.value[0]; in speaker_mute_put()
102 gpiod_set_value_cansleep(priv->gpiod_mute, priv->is_mute); in speaker_mute_put()
142 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 return dev_err_probe(dev, PTR_ERR(priv->gpiod_shutdown), in max9759_probe()
156 priv->gpiod_mute = devm_gpiod_get(dev, "mute", GPIOD_OUT_HIGH); in max9759_probe()
157 if (IS_ERR(priv->gpiod_mute)) in max9759_probe()
158 return dev_err_probe(dev, PTR_ERR(priv->gpiod_mute), in max9759_probe()
159 "Failed to get 'mute' gpio"); in max9759_probe()
160 priv->is_mute = true; in max9759_probe()
162 priv->gpiod_gain = devm_gpiod_get_array(dev, "gain", GPIOD_OUT_HIGH); in max9759_probe()
163 if (IS_ERR(priv->gpiod_gain)) in max9759_probe()
164 return dev_err_probe(dev, PTR_ERR(priv->gpiod_gain), in max9759_probe()
165 "Failed to get 'gain' gpios"); in max9759_probe()
166 priv->gain = 0; in max9759_probe()
168 if (priv->gpiod_gain->ndescs != 2) { in max9759_probe()
169 dev_err(dev, "Invalid 'gain' gpios count: %d", in max9759_probe()
170 priv->gpiod_gain->ndescs); in max9759_probe()
171 return -EINVAL; in max9759_probe()