Skip to content

Commit

Permalink
ASoC: mediatek: mt8183: make headset codec optional
Browse files Browse the repository at this point in the history
Make headset codec optional because some variant machines may not
have an audio jack.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20190716032417.19015-1-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Tzung-Bi Shih authored and broonie committed Jul 22, 2019
1 parent af62a3c commit a962a80
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,6 @@ static struct snd_soc_card mt8183_mt6358_ts3a227_max98357_card = {
.owner = THIS_MODULE,
.dai_link = mt8183_mt6358_ts3a227_max98357_dai_links,
.num_links = ARRAY_SIZE(mt8183_mt6358_ts3a227_max98357_dai_links),
.aux_dev = &mt8183_mt6358_ts3a227_max98357_headset_dev,
.num_aux_devs = 1,
};

static int
Expand Down Expand Up @@ -404,10 +402,9 @@ mt8183_mt6358_ts3a227_max98357_dev_probe(struct platform_device *pdev)
mt8183_mt6358_ts3a227_max98357_headset_dev.codec_of_node =
of_parse_phandle(pdev->dev.of_node,
"mediatek,headset-codec", 0);
if (!mt8183_mt6358_ts3a227_max98357_headset_dev.codec_of_node) {
dev_err(&pdev->dev,
"Property 'mediatek,headset-codec' missing/invalid\n");
return -EINVAL;
if (mt8183_mt6358_ts3a227_max98357_headset_dev.codec_of_node) {
card->aux_dev = &mt8183_mt6358_ts3a227_max98357_headset_dev;
card->num_aux_devs = 1;
}

default_pins =
Expand Down

0 comments on commit a962a80

Please sign in to comment.