mailman.alsa-project.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

Sound-open-firmware

Thread Start a new thread
Download
Threads by month
  • ----- 2025 -----
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2018 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2017 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2016 -----
  • December
  • November
  • October
sound-open-firmware@alsa-project.org

January 2021

  • 11 participants
  • 18 discussions
[Sound-open-firmware] [PATCH v3 3/4] ASoC: SOF: Intel: hda: Modify existing helper to disable WAKEEN
by Kai-Heng Feng 12 Jan '21

12 Jan '21
Modify hda_codec_jack_wake_enable() to also support disable WAKEEN. In addition, this patch also moves the WAKEEN disablement call out of hda_codec_jack_check() into hda_codec_jack_wake_enable(). This is a preparation for next patch. No functional change intended. --- v3: No change. v2: Mention it moves the disabling part into another function. sound/soc/sof/intel/hda-codec.c | 16 +++++++--------- sound/soc/sof/intel/hda-dsp.c | 6 ++++-- sound/soc/sof/intel/hda.h | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c index df59c79cfdfc..b7e9931ead57 100644 --- a/sound/soc/sof/intel/hda-codec.c +++ b/sound/soc/sof/intel/hda-codec.c @@ -63,16 +63,18 @@ static int hda_codec_load_module(struct hda_codec *codec) } /* enable controller wake up event for all codecs with jack connectors */ -void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev) +void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev, bool enable) { struct hda_bus *hbus = sof_to_hbus(sdev); struct hdac_bus *bus = sof_to_bus(sdev); struct hda_codec *codec; unsigned int mask = 0; - list_for_each_codec(codec, hbus) - if (codec->jacktbl.used) - mask |= BIT(codec->core.addr); + if (enable) { + list_for_each_codec(codec, hbus) + if (codec->jacktbl.used) + mask |= BIT(codec->core.addr); + } snd_hdac_chip_updatew(bus, WAKEEN, STATESTS_INT_MASK, mask); } @@ -81,12 +83,8 @@ void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev) void hda_codec_jack_check(struct snd_sof_dev *sdev) { struct hda_bus *hbus = sof_to_hbus(sdev); - struct hdac_bus *bus = sof_to_bus(sdev); struct hda_codec *codec; - /* disable controller Wake Up event*/ - snd_hdac_chip_updatew(bus, WAKEEN, STATESTS_INT_MASK, 0); - list_for_each_codec(codec, hbus) /* * Wake up all jack-detecting codecs regardless whether an event @@ -96,7 +94,7 @@ void hda_codec_jack_check(struct snd_sof_dev *sdev) pm_request_resume(&codec->core.dev); } #else -void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev) {} +void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev, bool enable) {} void hda_codec_jack_check(struct snd_sof_dev *sdev) {} #endif /* CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC */ EXPORT_SYMBOL_NS(hda_codec_jack_wake_enable, SND_SOC_SOF_HDA_AUDIO_CODEC); diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c index 2b001151fe37..7d00107cf3b2 100644 --- a/sound/soc/sof/intel/hda-dsp.c +++ b/sound/soc/sof/intel/hda-dsp.c @@ -617,7 +617,7 @@ static int hda_suspend(struct snd_sof_dev *sdev, bool runtime_suspend) #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) if (runtime_suspend) - hda_codec_jack_wake_enable(sdev); + hda_codec_jack_wake_enable(sdev, true); /* power down all hda link */ snd_hdac_ext_bus_link_power_down_all(bus); @@ -683,8 +683,10 @@ static int hda_resume(struct snd_sof_dev *sdev, bool runtime_resume) #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) /* check jack status */ - if (runtime_resume) + if (runtime_resume) { + hda_codec_jack_wake_enable(sdev, false); hda_codec_jack_check(sdev); + } /* turn off the links that were off before suspend */ list_for_each_entry(hlink, &bus->hlink_list, list) { diff --git a/sound/soc/sof/intel/hda.h b/sound/soc/sof/intel/hda.h index 9ec8ae0fd649..a3b6f3e9121c 100644 --- a/sound/soc/sof/intel/hda.h +++ b/sound/soc/sof/intel/hda.h @@ -650,7 +650,7 @@ void sof_hda_bus_init(struct hdac_bus *bus, struct device *dev); */ void hda_codec_probe_bus(struct snd_sof_dev *sdev, bool hda_codec_use_common_hdmi); -void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev); +void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev, bool enable); void hda_codec_jack_check(struct snd_sof_dev *sdev); #endif /* CONFIG_SND_SOC_SOF_HDA */ -- 2.29.2
1 0
0 0
[Sound-open-firmware] [PATCH v3 2/4] ASoC: SOF: Intel: hda: Resume codec to do jack detection
by Kai-Heng Feng 12 Jan '21

12 Jan '21
Instead of queueing jackpoll_work, runtime resume the codec to let it use different jack detection methods based on jackpoll_interval. This partially matches SOF driver's behavior with commit a6e7d0a4bdb0 ("ALSA: hda: fix jack detection with Realtek codecs when in D3"), the difference is SOF unconditionally resumes the codec. --- v3: Remove wrong assumption that only Realtek codec is used by SOF. v2: No change. sound/soc/sof/intel/hda-codec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c index 6875fa570c2c..df59c79cfdfc 100644 --- a/sound/soc/sof/intel/hda-codec.c +++ b/sound/soc/sof/intel/hda-codec.c @@ -93,8 +93,7 @@ void hda_codec_jack_check(struct snd_sof_dev *sdev) * has been recorded in STATESTS */ if (codec->jacktbl.used) - schedule_delayed_work(&codec->jackpoll_work, - codec->jackpoll_interval); + pm_request_resume(&codec->core.dev); } #else void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev) {} -- 2.29.2
1 0
0 0
Re: [Sound-open-firmware] [PATCH] ASoC: SOF: Intel: avoid reverse module dependency
by Kai Vehmanen 07 Jan '21

07 Jan '21
Hi Arnd, On Wed, 6 Jan 2021, Arnd Bergmann wrote: > On Tue, Jan 5, 2021 at 8:07 PM Arnd Bergmann <arnd(a)kernel.org> wrote: > > Change it to use the normal probe order of starting with a specific > > device in a driver, turning the sof-acpi-dev.c driver into a library. > > There were a couple of build failures introduced by this version. I have > one that does build now, and can post that if others think this is the > direction they want to go. thanks for the follow-up. We have many SOF maintainers still out on holidays this week, so let's give some time for people to digest. This is certainly a big change. The version you posted is already sufficient to describe the idea for sure. Br, Kai
1 0
0 0
[Sound-open-firmware] [PATCH v2 1/3] ASoC: SOF: Intel: hda: Resume codec to do jack detection
by Kai-Heng Feng 07 Jan '21

07 Jan '21
Instead of queueing jackpoll_work, runtime resume the codec to let it use different jack detection methods based on jackpoll_interval. This matches SOF driver's behavior with commit a6e7d0a4bdb0 ("ALSA: hda: fix jack detection with Realtek codecs when in D3"). Since SOF only uses Realtek codec, we don't need any additional check for the resume. Signed-off-by: Kai-Heng Feng <kai.heng.feng(a)canonical.com> --- v2: No change. sound/soc/sof/intel/hda-codec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c index 6875fa570c2c..df59c79cfdfc 100644 --- a/sound/soc/sof/intel/hda-codec.c +++ b/sound/soc/sof/intel/hda-codec.c @@ -93,8 +93,7 @@ void hda_codec_jack_check(struct snd_sof_dev *sdev) * has been recorded in STATESTS */ if (codec->jacktbl.used) - schedule_delayed_work(&codec->jackpoll_work, - codec->jackpoll_interval); + pm_request_resume(&codec->core.dev); } #else void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev) {} -- 2.29.2
2 7
0 0
Re: [Sound-open-firmware] [PATCH] ALSA: hda: fix SND_INTEL_DSP_CONFIG dependency
by Kai Vehmanen 05 Jan '21

05 Jan '21
Hey, On Tue, 5 Jan 2021, Arnd Bergmann wrote: > On Mon, Jan 4, 2021 at 4:05 PM Takashi Iwai <tiwai(a)suse.de> wrote: > > As I wrote in another post, a part of the problem is that SOF PCI and > > ACPI drivers call snd_intel_dsp_driver_probe() unconditionally, even > > if no Intel driver is bound. > > Makes sense. Is there an existing Kconfig that could be used to > decide whether the drivers use SND_INTEL_DSP_CONFIG or not? no, unfortunately not. This is selected per platform in sound/soc/sof/intel/Kconfig. CONFIG_SND_SOC_SOF_INTEL_PCI is close, but there is at least one platform that does not use SND_INTEL_DSP_CONFIG. > According to sof_pci_ids[], all PCI IDs are Intel specific, but I can't > tell which ones need the DSP config. Indeed currently all the ids are Intel ones (and with exception of old Merrifield, all use DSP config). But that's just how it is now. > Could it be part of the device specific driver_data? This would certainly be a clean way and allow to remove the Intel-specific calls from sof_pci_probe(). As a short-term solution, IS_REACHABLE() seems ok as well. Br, Kai
1 0
0 0
Re: [Sound-open-firmware] [PATCH] ALSA: hda: fix SND_INTEL_DSP_CONFIG dependency
by Jaroslav Kysela 04 Jan '21

04 Jan '21
Dne 03. 01. 21 v 14:52 Arnd Bergmann napsal(a): > From: Arnd Bergmann <arnd(a)arndb.de> > > The sof-pci-dev driver fails to link when built into the kernel > and CONFIG_SND_INTEL_DSP_CONFIG is set to =m: > > arm-linux-gnueabi-ld: sound/soc/sof/sof-pci-dev.o: in function `sof_pci_probe': > sof-pci-dev.c:(.text+0x1c): undefined reference to `snd_intel_dsp_driver_probe' > > All other drivers using this interface already use a 'select > SND_INTEL_DSP_CONFIG' statement to force the it to be present, so it > seems reasonable to do the same here. > > The stub implementation in the header makes the problem harder to find, > as it avoids the link error when SND_INTEL_DSP_CONFIG is completely > disabled, without any obvious upsides. Remove these stubs to make it > clearer that the driver is in fact needed here. > > Fixes: 82d9d54a6c0e ("ALSA: hda: add Intel DSP configuration / probe code") > Signed-off-by: Arnd Bergmann <arnd(a)arndb.de> > --- > include/sound/intel-dsp-config.h | 17 ----------------- > sound/soc/sof/Kconfig | 2 ++ > 2 files changed, 2 insertions(+), 17 deletions(-) > > diff --git a/include/sound/intel-dsp-config.h b/include/sound/intel-dsp-config.h > index d4609077c258..94667e870029 100644 > --- a/include/sound/intel-dsp-config.h > +++ b/include/sound/intel-dsp-config.h > @@ -18,24 +18,7 @@ enum { > SND_INTEL_DSP_DRIVER_LAST = SND_INTEL_DSP_DRIVER_SOF > }; > > -#if IS_ENABLED(CONFIG_SND_INTEL_DSP_CONFIG) The SOF drivers selects the DSP config code only when required (for specific platforms - see sound/soc/sof/intel/Kconfig). It seems that the above if should be modified as: #if IS_BUILDIN(CONFIG_SND_INTEL_DSP_CONFIG) || (defined(MODULE) && IS_MODULE(CONFIG_SND_INTEL_DSP_CONFIG)) So the buildin drivers which do not require the DSP config probe can be compiled without this dependency. Jaroslav -- Jaroslav Kysela <perex(a)perex.cz> Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
2 1
0 0
Re: [Sound-open-firmware] [PATCH] ALSA: hda: fix SND_INTEL_DSP_CONFIG dependency
by Takashi Iwai 04 Jan '21

04 Jan '21
On Sun, 03 Jan 2021 14:52:32 +0100, Arnd Bergmann wrote: > > From: Arnd Bergmann <arnd(a)arndb.de> > > The sof-pci-dev driver fails to link when built into the kernel > and CONFIG_SND_INTEL_DSP_CONFIG is set to =m: > > arm-linux-gnueabi-ld: sound/soc/sof/sof-pci-dev.o: in function `sof_pci_probe': > sof-pci-dev.c:(.text+0x1c): undefined reference to `snd_intel_dsp_driver_probe' > > All other drivers using this interface already use a 'select > SND_INTEL_DSP_CONFIG' statement to force the it to be present, so it > seems reasonable to do the same here. > > The stub implementation in the header makes the problem harder to find, > as it avoids the link error when SND_INTEL_DSP_CONFIG is completely > disabled, without any obvious upsides. Remove these stubs to make it > clearer that the driver is in fact needed here. > > Fixes: 82d9d54a6c0e ("ALSA: hda: add Intel DSP configuration / probe code") > Signed-off-by: Arnd Bergmann <arnd(a)arndb.de> IMO, the problem is rather the unconditional calls of snd_intel_dsp_driver_probe() in snd-soc-sof-pci and snd-soc-sof-acpi drivers. Those calls should be done only if Intel drivers are involved. So, wrapping the call with ifdef CONFIG_SND_SOC_SOF_INTEL_PCI or CONFIG_SND_SOC_SOF_INTEL_ACPI would work better (although those are a bit uglier). thanks, Takashi > --- > include/sound/intel-dsp-config.h | 17 ----------------- > sound/soc/sof/Kconfig | 2 ++ > 2 files changed, 2 insertions(+), 17 deletions(-) > > diff --git a/include/sound/intel-dsp-config.h b/include/sound/intel-dsp-config.h > index d4609077c258..94667e870029 100644 > --- a/include/sound/intel-dsp-config.h > +++ b/include/sound/intel-dsp-config.h > @@ -18,24 +18,7 @@ enum { > SND_INTEL_DSP_DRIVER_LAST = SND_INTEL_DSP_DRIVER_SOF > }; > > -#if IS_ENABLED(CONFIG_SND_INTEL_DSP_CONFIG) > - > int snd_intel_dsp_driver_probe(struct pci_dev *pci); > int snd_intel_acpi_dsp_driver_probe(struct device *dev, const u8 acpi_hid[ACPI_ID_LEN]); > > -#else > - > -static inline int snd_intel_dsp_driver_probe(struct pci_dev *pci) > -{ > - return SND_INTEL_DSP_DRIVER_ANY; > -} > - > -static inline > -int snd_intel_acpi_dsp_driver_probe(struct device *dev, const u8 acpi_hid[ACPI_ID_LEN]) > -{ > - return SND_INTEL_DSP_DRIVER_ANY; > -} > - > -#endif > - > #endif > diff --git a/sound/soc/sof/Kconfig b/sound/soc/sof/Kconfig > index 031dad5fc4c7..051fd3d27047 100644 > --- a/sound/soc/sof/Kconfig > +++ b/sound/soc/sof/Kconfig > @@ -12,6 +12,7 @@ if SND_SOC_SOF_TOPLEVEL > config SND_SOC_SOF_PCI > tristate "SOF PCI enumeration support" > depends on PCI > + select SND_INTEL_DSP_CONFIG > select SND_SOC_SOF > select SND_SOC_ACPI if ACPI > help > @@ -23,6 +24,7 @@ config SND_SOC_SOF_PCI > config SND_SOC_SOF_ACPI > tristate "SOF ACPI enumeration support" > depends on ACPI || COMPILE_TEST > + select SND_INTEL_DSP_CONFIG > select SND_SOC_SOF > select SND_SOC_ACPI if ACPI > select IOSF_MBI if X86 && PCI > -- > 2.29.2 >
1 0
0 0
[Sound-open-firmware] [PATCH 1/2] ASoC: SOF: Intel: hda: Modify existing helper to disable WAKEEN
by Kai-Heng Feng 04 Jan '21

04 Jan '21
Modify hda_codec_jack_wake_enable() to also support disable WAKEEN. This is a preparation for next patch. No functional change intended. Signed-off-by: Kai-Heng Feng <kai.heng.feng(a)canonical.com> --- sound/soc/sof/intel/hda-codec.c | 16 +++++++--------- sound/soc/sof/intel/hda-dsp.c | 6 ++++-- sound/soc/sof/intel/hda.h | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c index 6875fa570c2c..bc9ac4abdab5 100644 --- a/sound/soc/sof/intel/hda-codec.c +++ b/sound/soc/sof/intel/hda-codec.c @@ -63,16 +63,18 @@ static int hda_codec_load_module(struct hda_codec *codec) } /* enable controller wake up event for all codecs with jack connectors */ -void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev) +void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev, bool enable) { struct hda_bus *hbus = sof_to_hbus(sdev); struct hdac_bus *bus = sof_to_bus(sdev); struct hda_codec *codec; unsigned int mask = 0; - list_for_each_codec(codec, hbus) - if (codec->jacktbl.used) - mask |= BIT(codec->core.addr); + if (enable) { + list_for_each_codec(codec, hbus) + if (codec->jacktbl.used) + mask |= BIT(codec->core.addr); + } snd_hdac_chip_updatew(bus, WAKEEN, STATESTS_INT_MASK, mask); } @@ -81,12 +83,8 @@ void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev) void hda_codec_jack_check(struct snd_sof_dev *sdev) { struct hda_bus *hbus = sof_to_hbus(sdev); - struct hdac_bus *bus = sof_to_bus(sdev); struct hda_codec *codec; - /* disable controller Wake Up event*/ - snd_hdac_chip_updatew(bus, WAKEEN, STATESTS_INT_MASK, 0); - list_for_each_codec(codec, hbus) /* * Wake up all jack-detecting codecs regardless whether an event @@ -97,7 +95,7 @@ void hda_codec_jack_check(struct snd_sof_dev *sdev) codec->jackpoll_interval); } #else -void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev) {} +void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev, bool enable) {} void hda_codec_jack_check(struct snd_sof_dev *sdev) {} #endif /* CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC */ EXPORT_SYMBOL_NS(hda_codec_jack_wake_enable, SND_SOC_SOF_HDA_AUDIO_CODEC); diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c index 2b001151fe37..7d00107cf3b2 100644 --- a/sound/soc/sof/intel/hda-dsp.c +++ b/sound/soc/sof/intel/hda-dsp.c @@ -617,7 +617,7 @@ static int hda_suspend(struct snd_sof_dev *sdev, bool runtime_suspend) #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) if (runtime_suspend) - hda_codec_jack_wake_enable(sdev); + hda_codec_jack_wake_enable(sdev, true); /* power down all hda link */ snd_hdac_ext_bus_link_power_down_all(bus); @@ -683,8 +683,10 @@ static int hda_resume(struct snd_sof_dev *sdev, bool runtime_resume) #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) /* check jack status */ - if (runtime_resume) + if (runtime_resume) { + hda_codec_jack_wake_enable(sdev, false); hda_codec_jack_check(sdev); + } /* turn off the links that were off before suspend */ list_for_each_entry(hlink, &bus->hlink_list, list) { diff --git a/sound/soc/sof/intel/hda.h b/sound/soc/sof/intel/hda.h index 9ec8ae0fd649..a3b6f3e9121c 100644 --- a/sound/soc/sof/intel/hda.h +++ b/sound/soc/sof/intel/hda.h @@ -650,7 +650,7 @@ void sof_hda_bus_init(struct hdac_bus *bus, struct device *dev); */ void hda_codec_probe_bus(struct snd_sof_dev *sdev, bool hda_codec_use_common_hdmi); -void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev); +void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev, bool enable); void hda_codec_jack_check(struct snd_sof_dev *sdev); #endif /* CONFIG_SND_SOC_SOF_HDA */ -- 2.29.2
2 7
0 0
  • ← Newer
  • 1
  • 2
  • Older →

HyperKitty Powered by HyperKitty version 1.3.8.