diff options
Diffstat (limited to 'sound/soc/intel/boards/byt-max98090.c')
-rw-r--r-- | sound/soc/intel/boards/byt-max98090.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/sound/soc/intel/boards/byt-max98090.c b/sound/soc/intel/boards/byt-max98090.c index d9f81b8d915d..047be7fa0ce9 100644 --- a/sound/soc/intel/boards/byt-max98090.c +++ b/sound/soc/intel/boards/byt-max98090.c | |||
@@ -67,20 +67,27 @@ static struct snd_soc_jack_pin hs_jack_pins[] = { | |||
67 | 67 | ||
68 | static struct snd_soc_jack_gpio hs_jack_gpios[] = { | 68 | static struct snd_soc_jack_gpio hs_jack_gpios[] = { |
69 | { | 69 | { |
70 | .name = "hp-gpio", | 70 | .name = "hp", |
71 | .idx = 0, | ||
72 | .report = SND_JACK_HEADPHONE | SND_JACK_LINEOUT, | 71 | .report = SND_JACK_HEADPHONE | SND_JACK_LINEOUT, |
73 | .debounce_time = 200, | 72 | .debounce_time = 200, |
74 | }, | 73 | }, |
75 | { | 74 | { |
76 | .name = "mic-gpio", | 75 | .name = "mic", |
77 | .idx = 1, | ||
78 | .invert = 1, | 76 | .invert = 1, |
79 | .report = SND_JACK_MICROPHONE, | 77 | .report = SND_JACK_MICROPHONE, |
80 | .debounce_time = 200, | 78 | .debounce_time = 200, |
81 | }, | 79 | }, |
82 | }; | 80 | }; |
83 | 81 | ||
82 | static const struct acpi_gpio_params hp_gpios = { 0, 0, false }; | ||
83 | static const struct acpi_gpio_params mic_gpios = { 1, 0, false }; | ||
84 | |||
85 | static const struct acpi_gpio_mapping acpi_byt_max98090_gpios[] = { | ||
86 | { "hp-gpios", &hp_gpios, 1 }, | ||
87 | { "mic-gpios", &mic_gpios, 1 }, | ||
88 | {}, | ||
89 | }; | ||
90 | |||
84 | static int byt_max98090_init(struct snd_soc_pcm_runtime *runtime) | 91 | static int byt_max98090_init(struct snd_soc_pcm_runtime *runtime) |
85 | { | 92 | { |
86 | int ret; | 93 | int ret; |
@@ -140,8 +147,9 @@ static struct snd_soc_card byt_max98090_card = { | |||
140 | 147 | ||
141 | static int byt_max98090_probe(struct platform_device *pdev) | 148 | static int byt_max98090_probe(struct platform_device *pdev) |
142 | { | 149 | { |
143 | int ret_val = 0; | 150 | struct device *dev = &pdev->dev; |
144 | struct byt_max98090_private *priv; | 151 | struct byt_max98090_private *priv; |
152 | int ret_val; | ||
145 | 153 | ||
146 | priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_ATOMIC); | 154 | priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_ATOMIC); |
147 | if (!priv) { | 155 | if (!priv) { |
@@ -149,6 +157,10 @@ static int byt_max98090_probe(struct platform_device *pdev) | |||
149 | return -ENOMEM; | 157 | return -ENOMEM; |
150 | } | 158 | } |
151 | 159 | ||
160 | ret_val = devm_acpi_dev_add_driver_gpios(dev->parent, acpi_byt_max98090_gpios); | ||
161 | if (ret_val) | ||
162 | dev_dbg(dev, "Unable to add GPIO mapping table\n"); | ||
163 | |||
152 | byt_max98090_card.dev = &pdev->dev; | 164 | byt_max98090_card.dev = &pdev->dev; |
153 | snd_soc_card_set_drvdata(&byt_max98090_card, priv); | 165 | snd_soc_card_set_drvdata(&byt_max98090_card, priv); |
154 | ret_val = devm_snd_soc_register_card(&pdev->dev, &byt_max98090_card); | 166 | ret_val = devm_snd_soc_register_card(&pdev->dev, &byt_max98090_card); |
@@ -158,7 +170,7 @@ static int byt_max98090_probe(struct platform_device *pdev) | |||
158 | return ret_val; | 170 | return ret_val; |
159 | } | 171 | } |
160 | 172 | ||
161 | return ret_val; | 173 | return 0; |
162 | } | 174 | } |
163 | 175 | ||
164 | static int byt_max98090_remove(struct platform_device *pdev) | 176 | static int byt_max98090_remove(struct platform_device *pdev) |