Repository navigation
Closed
Description
linux/sound/soc/tegra/tegra_asoc_machine.c
Lines 79 to 108 in 0a40673
| static int tegra_machine_event(struct snd_soc_dapm_widget *w, | |
| struct snd_kcontrol *k, int event) | |
| { | |
| struct snd_soc_dapm_context *dapm = w->dapm; | |
| struct tegra_machine *machine = snd_soc_card_get_drvdata(dapm->card); | |
| if (machine->asoc->dapm_event) { | |
| int ret = machine->asoc->dapm_event(w, k, event); | |
| if (ret <= 0) | |
| return ret; | |
| } | |
| if (!strcmp(w->name, "Int Spk") || !strcmp(w->name, "Speakers")) | |
| gpiod_set_value_cansleep(machine->gpiod_spkr_en, | |
| SND_SOC_DAPM_EVENT_ON(event)); | |
| if (!strcmp(w->name, "Mic Jack")) | |
| gpiod_set_value_cansleep(machine->gpiod_ext_mic_en, | |
| SND_SOC_DAPM_EVENT_ON(event)); | |
| if (!strcmp(w->name, "Int Mic")) | |
| gpiod_set_value_cansleep(machine->gpiod_int_mic_en, | |
| SND_SOC_DAPM_EVENT_ON(event)); | |
| if (!strcmp(w->name, "Headphone") || !strcmp(w->name, "Headphone Jack")) | |
| gpiod_set_value_cansleep(machine->gpiod_hp_mute, | |
| !SND_SOC_DAPM_EVENT_ON(event)); | |
| return 0; | |
| } |
I am binding here https://github.com/clamor-s/linux/blob/p895/arch/arm/boot/dts/tegra30-lge-p895.dts#L1825-L1826 gpios, required for mics to work. If I just bind them as hogs everything is fine, but once I bind them inside tegra_asoc both mics fail.
Metadata
Metadata
Assignees
Labels
No labels
Activity
[-]Event based gpio control does not work[/-][+]ASoC: tegra: event based gpio control does not work[/+]digetx commentedon Oct 1, 2022
You don't have
Mic JackandInt Micinnvidia,audio-routing. DTB checker should tell you about the error.clamor-s commentedon Oct 1, 2022
So I need to route audio via those in dts? Isn't enabling those in alsa ucm enough?
digetx commentedon Oct 1, 2022
Although, the DT seems okay. There are no event handlers set up for
Internal Mic 1andInternal Mic 2in the machine driver.You could either add
tegra_machine_event()forInternal Mic 1andInternal Mic 2or useMic JackandInt Micin the routing instead ofInternal Mic 1/2.clamor-s commentedon Oct 1, 2022
I would like to, but I have too much audio devices to handle since it is a phone. I will add tegra_machine_event() if you do not mind.
digetx commentedon Oct 1, 2022
The problem with
Internal Mic 1/2that you can't tell which one is internal or external mic. I assume you'll need to use a custommachine->asoc->dapm_event()handler in this case.digetx commentedon Oct 1, 2022
Maybe adding new
nvidia,int-mic1-en-gpiosnvidia,int-mic2-en-gpioswon't be a bad solution.digetx commentedon Oct 1, 2022
I'm not sure what are those
Internal Mic 1/2, it looks like you have three mics. Perhaps one isnoise cancellation?clamor-s commentedon Oct 1, 2022
yes, mic2 is for noise cancellation. Mic1 is main and Mic Jack is headset.
As I told, I have quite few of audio devices, since it is a phone.
clamor-s commentedon Oct 1, 2022
Adding tegra_machine_event worked perfectly
LoongArch: BPF: Support 64-bit pointers to kfuncs