mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-30 07:34:12 +08:00
ASoC: mediatek: mt8183-da7219: remove forward declaration of headset_init
In headset_init(), it can access card by component->card. Removes the forward declaration. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200709122445.1584497-3-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
31add0d56e
commit
cbafb2cc5f
@ -449,7 +449,36 @@ static struct snd_soc_dai_link mt8183_da7219_max98357_dai_links[] = {
|
||||
};
|
||||
|
||||
static int
|
||||
mt8183_da7219_max98357_headset_init(struct snd_soc_component *component);
|
||||
mt8183_da7219_max98357_headset_init(struct snd_soc_component *component)
|
||||
{
|
||||
int ret;
|
||||
struct mt8183_da7219_max98357_priv *priv =
|
||||
snd_soc_card_get_drvdata(component->card);
|
||||
|
||||
/* Enable Headset and 4 Buttons Jack detection */
|
||||
ret = snd_soc_card_jack_new(component->card,
|
||||
"Headset Jack",
|
||||
SND_JACK_HEADSET |
|
||||
SND_JACK_BTN_0 | SND_JACK_BTN_1 |
|
||||
SND_JACK_BTN_2 | SND_JACK_BTN_3,
|
||||
&priv->headset_jack,
|
||||
NULL, 0);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
snd_jack_set_key(
|
||||
priv->headset_jack.jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
|
||||
snd_jack_set_key(
|
||||
priv->headset_jack.jack, SND_JACK_BTN_1, KEY_VOLUMEUP);
|
||||
snd_jack_set_key(
|
||||
priv->headset_jack.jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN);
|
||||
snd_jack_set_key(
|
||||
priv->headset_jack.jack, SND_JACK_BTN_3, KEY_VOICECOMMAND);
|
||||
|
||||
da7219_aad_jack_det(component, &priv->headset_jack);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct snd_soc_aux_dev mt8183_da7219_max98357_headset_dev = {
|
||||
.dlc = COMP_EMPTY(),
|
||||
@ -496,38 +525,6 @@ static struct snd_soc_card mt8183_da7219_max98357_card = {
|
||||
.num_configs = ARRAY_SIZE(mt6358_codec_conf),
|
||||
};
|
||||
|
||||
static int
|
||||
mt8183_da7219_max98357_headset_init(struct snd_soc_component *component)
|
||||
{
|
||||
int ret;
|
||||
struct mt8183_da7219_max98357_priv *priv =
|
||||
snd_soc_card_get_drvdata(component->card);
|
||||
|
||||
/* Enable Headset and 4 Buttons Jack detection */
|
||||
ret = snd_soc_card_jack_new(&mt8183_da7219_max98357_card,
|
||||
"Headset Jack",
|
||||
SND_JACK_HEADSET |
|
||||
SND_JACK_BTN_0 | SND_JACK_BTN_1 |
|
||||
SND_JACK_BTN_2 | SND_JACK_BTN_3,
|
||||
&priv->headset_jack,
|
||||
NULL, 0);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
snd_jack_set_key(
|
||||
priv->headset_jack.jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
|
||||
snd_jack_set_key(
|
||||
priv->headset_jack.jack, SND_JACK_BTN_1, KEY_VOLUMEUP);
|
||||
snd_jack_set_key(
|
||||
priv->headset_jack.jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN);
|
||||
snd_jack_set_key(
|
||||
priv->headset_jack.jack, SND_JACK_BTN_3, KEY_VOICECOMMAND);
|
||||
|
||||
da7219_aad_jack_det(component, &priv->headset_jack);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mt8183_da7219_max98357_dev_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct snd_soc_card *card = &mt8183_da7219_max98357_card;
|
||||
|
Loading…
Reference in New Issue
Block a user