mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-30 02:21:15 +00:00
ASoC: audio-graph-card: add hp and mic detect gpios same as simple-card
This patch adds headphone and microphone jack detection gpios as same as simple-card driver. Signed-off-by: Katsuhiro Suzuki <suzuki.katsuhiro@socionext.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
8d1bd113a1
commit
f6de35cc14
1 changed files with 19 additions and 1 deletions
|
@ -21,7 +21,6 @@
|
||||||
#include <linux/of_graph.h>
|
#include <linux/of_graph.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/string.h>
|
#include <linux/string.h>
|
||||||
#include <sound/jack.h>
|
|
||||||
#include <sound/simple_card_utils.h>
|
#include <sound/simple_card_utils.h>
|
||||||
|
|
||||||
struct graph_card_data {
|
struct graph_card_data {
|
||||||
|
@ -32,6 +31,8 @@ struct graph_card_data {
|
||||||
unsigned int mclk_fs;
|
unsigned int mclk_fs;
|
||||||
} *dai_props;
|
} *dai_props;
|
||||||
unsigned int mclk_fs;
|
unsigned int mclk_fs;
|
||||||
|
struct asoc_simple_jack hp_jack;
|
||||||
|
struct asoc_simple_jack mic_jack;
|
||||||
struct snd_soc_dai_link *dai_link;
|
struct snd_soc_dai_link *dai_link;
|
||||||
struct gpio_desc *pa_gpio;
|
struct gpio_desc *pa_gpio;
|
||||||
};
|
};
|
||||||
|
@ -278,6 +279,22 @@ static int asoc_graph_get_dais_count(struct device *dev)
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int asoc_graph_soc_card_probe(struct snd_soc_card *card)
|
||||||
|
{
|
||||||
|
struct graph_card_data *priv = snd_soc_card_get_drvdata(card);
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = asoc_simple_card_init_hp(card, &priv->hp_jack, NULL);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
ret = asoc_simple_card_init_mic(card, &priv->mic_jack, NULL);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int asoc_graph_card_probe(struct platform_device *pdev)
|
static int asoc_graph_card_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct graph_card_data *priv;
|
struct graph_card_data *priv;
|
||||||
|
@ -319,6 +336,7 @@ static int asoc_graph_card_probe(struct platform_device *pdev)
|
||||||
card->num_links = num;
|
card->num_links = num;
|
||||||
card->dapm_widgets = asoc_graph_card_dapm_widgets;
|
card->dapm_widgets = asoc_graph_card_dapm_widgets;
|
||||||
card->num_dapm_widgets = ARRAY_SIZE(asoc_graph_card_dapm_widgets);
|
card->num_dapm_widgets = ARRAY_SIZE(asoc_graph_card_dapm_widgets);
|
||||||
|
card->probe = asoc_graph_soc_card_probe;
|
||||||
|
|
||||||
ret = asoc_graph_card_parse_of(priv);
|
ret = asoc_graph_card_parse_of(priv);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue