Lines Matching +full:spk +full:- +full:mute
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * poodle.c -- SoC audio for Poodle
22 #include <asm/mach-types.h>
24 #include <linux/platform_data/asoc-pxa.h>
25 #include <linux/platform_data/asoc-poodle.h>
28 #include "pxa2xx-i2s.h"
35 /* audio clock in Hz - rounded from 12.235MHz */
48 locomo_gpio_write(poodle_pdata->locomo_dev, in poodle_ext_control()
49 poodle_pdata->gpio_mute_l, 1); in poodle_ext_control()
50 locomo_gpio_write(poodle_pdata->locomo_dev, in poodle_ext_control()
51 poodle_pdata->gpio_mute_r, 1); in poodle_ext_control()
54 locomo_gpio_write(poodle_pdata->locomo_dev, in poodle_ext_control()
55 poodle_pdata->gpio_mute_l, 0); in poodle_ext_control()
56 locomo_gpio_write(poodle_pdata->locomo_dev, in poodle_ext_control()
57 poodle_pdata->gpio_mute_r, 0); in poodle_ext_control()
63 snd_soc_dapm_enable_pin(dapm, "Ext Spk"); in poodle_ext_control()
65 snd_soc_dapm_disable_pin(dapm, "Ext Spk"); in poodle_ext_control()
76 poodle_ext_control(&rtd->card->dapm); in poodle_startup()
81 /* we need to unmute the HP at shutdown as the mute burns power on poodle */
85 locomo_gpio_write(poodle_pdata->locomo_dev, in poodle_shutdown()
86 poodle_pdata->gpio_mute_l, 1); in poodle_shutdown()
87 locomo_gpio_write(poodle_pdata->locomo_dev, in poodle_shutdown()
88 poodle_pdata->gpio_mute_r, 1); in poodle_shutdown()
138 ucontrol->value.enumerated.item[0] = poodle_jack_func; in poodle_get_jack()
147 if (poodle_jack_func == ucontrol->value.enumerated.item[0]) in poodle_set_jack()
150 poodle_jack_func = ucontrol->value.enumerated.item[0]; in poodle_set_jack()
151 poodle_ext_control(&card->dapm); in poodle_set_jack()
158 ucontrol->value.enumerated.item[0] = poodle_spk_func; in poodle_get_spk()
167 if (poodle_spk_func == ucontrol->value.enumerated.item[0]) in poodle_set_spk()
170 poodle_spk_func = ucontrol->value.enumerated.item[0]; in poodle_set_spk()
171 poodle_ext_control(&card->dapm); in poodle_set_spk()
179 locomo_gpio_write(poodle_pdata->locomo_dev, in poodle_amp_event()
180 poodle_pdata->gpio_amp_on, 0); in poodle_amp_event()
182 locomo_gpio_write(poodle_pdata->locomo_dev, in poodle_amp_event()
183 poodle_pdata->gpio_amp_on, 1); in poodle_amp_event()
191 SND_SOC_DAPM_SPK("Ext Spk", poodle_amp_event),
203 {"Ext Spk", NULL, "ROUT"},
204 {"Ext Spk", NULL, "LOUT"},
223 /* poodle digital audio interface glue - connects codec <--> CPU */
225 DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-i2s")),
226 DAILINK_COMP_ARRAY(COMP_CODEC("wm8731.0-001b", "wm8731-hifi")),
227 DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
259 poodle_pdata = pdev->dev.platform_data; in poodle_probe()
260 locomo_gpio_set_dir(poodle_pdata->locomo_dev, in poodle_probe()
261 poodle_pdata->gpio_amp_on, 0); in poodle_probe()
262 /* should we mute HP at startup - burning power ?*/ in poodle_probe()
263 locomo_gpio_set_dir(poodle_pdata->locomo_dev, in poodle_probe()
264 poodle_pdata->gpio_mute_l, 0); in poodle_probe()
265 locomo_gpio_set_dir(poodle_pdata->locomo_dev, in poodle_probe()
266 poodle_pdata->gpio_mute_r, 0); in poodle_probe()
268 card->dev = &pdev->dev; in poodle_probe()
270 ret = devm_snd_soc_register_card(&pdev->dev, card); in poodle_probe()
272 dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", in poodle_probe()
279 .name = "poodle-audio",
291 MODULE_ALIAS("platform:poodle-audio");