ODROID-COMMON:Add Mixer control for LINE-OUT Mute

Mute : amixer -c0 sset 'LINE_OUT mute' on
Unmute : amixer -c0 sset 'LINE_OUT mute' off
Boot on state : unmute

Change-Id: If899ea5607cbef8b62fb35b66c79089beb192d1a
This commit is contained in:
Kevin Kim
2019-02-20 18:13:24 +09:00
parent c84e9bd830
commit 6388e218f9
2 changed files with 9 additions and 6 deletions

View File

@@ -92,8 +92,8 @@
auge_sound {
compatible = "amlogic, g12a-sound-card";
aml-audio-card,name = "AML-AUGESOUND";
/*avout mute gpio*/
avout_mute-gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>;
/*line-out mute gpio*/
mute_gpio = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
/*for audio effect ,eqdrc */
aml-audio-card,effect = <&audio_effect>;

View File

@@ -735,7 +735,7 @@ static int spk_mute_get(struct snd_kcontrol *kcontrol,
}
static const struct snd_kcontrol_new card_controls[] = {
SOC_SINGLE_BOOL_EXT("SPK mute", 0,
SOC_SINGLE_BOOL_EXT("LINE_OUT mute", 0,
spk_mute_get,
spk_mute_set),
};
@@ -750,7 +750,7 @@ static int aml_card_parse_gpios(struct device_node *node,
bool active_low;
int ret;
gpio = of_get_named_gpio_flags(node, "spk_mute", 0, &flags);
gpio = of_get_named_gpio_flags(node, "mute_gpio", 0, &flags);
priv->spk_mute_gpio = gpio;
if (gpio_is_valid(gpio)) {
@@ -758,14 +758,16 @@ static int aml_card_parse_gpios(struct device_node *node,
flags = active_low ? GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW;
priv->spk_mute_active_low = active_low;
ret = devm_gpio_request_one(dev, gpio, flags, "spk_mute");
ret = devm_gpio_request_one(dev, gpio, flags, "line_mute");
if (ret < 0)
return ret;
ret = snd_soc_add_card_controls(soc_card, card_controls,
ARRAY_SIZE(card_controls));
}
pr_info("add line-out mute controls\n");
}
#if !defined(CONFIG_ARCH_MESON64_ODROID_COMMON)
priv->avout_mute_desc = gpiod_get(dev,
"avout_mute",
GPIOD_OUT_HIGH);
@@ -773,6 +775,7 @@ static int aml_card_parse_gpios(struct device_node *node,
gpiod_direction_output(priv->avout_mute_desc,
GPIOF_OUT_INIT_HIGH);
pr_info("set av out GPIOF_OUT_INIT_HIGH!\n");
#endif
return 0;
}