Skip to content

ASoC: tegra: event based gpio control does not work #130

@clamor-s

Description

@clamor-s

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions