Alsa-devel
Threads by month
- ----- 2025 -----
- July
- 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
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
June 2023
- 152 participants
- 392 discussions

v1.2.7: Regression detecting builtin microphone on Lenovo T14G1 (Intel Comet Lake)
by GitHub issues - opened 19 Jun '23
by GitHub issues - opened 19 Jun '23
19 Jun '23
alsa-project/alsa-ucm-conf issue #325 was opened from myrkr:
I'm currently testing an update of alsa-ucm-conf from version v1.2.5.1 to version v1.2.9 and noticed a regression.
Kernel: v6.1.34
alsa-lib: v1.2.6.1
pulseaudio: 14.2
I use a Lenovo T14G1 with an HDMI monitor connected via USB-C (but the monitor is not in use by Xorg). I want to use the built-in speaker and microphone of the device.
Before the update I got the following output from "pactl list":
[pactl-before.log](https://github.com/alsa-project/alsa-ucm-conf/files/11788…
```
Card #0
Name: alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic
Driver: module-alsa-card.c
Owner Module: 1
Properties:
alsa.card = "0"
alsa.card_name = "sof-hda-dsp"
alsa.long_card_name = "LENOVO-20S1S19N00-ThinkPadT14Gen1"
device.bus_path = "pci-0000:00:1f.3-platform-skl_hda_dsp_generic"
sysfs.path = "/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0"
device.bus = "pci"
device.vendor.id = "8086"
device.vendor.name = "Intel Corporation"
device.product.id = "02c8"
device.product.name = "Comet Lake PCH-LP cAVS"
device.string = "0"
device.description = "Comet Lake PCH-LP cAVS"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
Profiles:
HiFi: Play HiFi quality Music (sinks: 4, sources: 2, priority: 8000, available: yes)
off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
Active Profile: HiFi
Ports:
[Out] HDMI3: HDMI / DisplayPort 3 Output (type: HDMI, priority: 700, latency offset: 0 usec, not available)
Part of profile(s): HiFi
[Out] HDMI2: HDMI / DisplayPort 2 Output (type: HDMI, priority: 600, latency offset: 0 usec, not available)
Part of profile(s): HiFi
[Out] HDMI1: HDMI / DisplayPort 1 Output (type: HDMI, priority: 500, latency offset: 0 usec, not available)
Part of profile(s): HiFi
[Out] Speaker: Speaker (type: Speaker, priority: 100, latency offset: 0 usec, availability unknown)
Part of profile(s): HiFi
[Out] Headphones: Headphones (type: Headphones, priority: 200, latency offset: 0 usec, not available)
Part of profile(s): HiFi
[In] Mic2: Headphones Stereo Microphone (type: Mic, priority: 200, latency offset: 0 usec, not available)
Part of profile(s): HiFi
[In] Mic1: Digital Microphone (type: Mic, priority: 100, latency offset: 0 usec, availability unknown)
Part of profile(s): HiFi
```
On this cards the ports `Speaker` and `Mic1` are currently selected and usable.
After the update to version v1.2.9 the output shows:
[pactl-after.log](https://github.com/alsa-project/alsa-ucm-conf/files/117881…
```
Card #0
Name: alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic
Driver: module-alsa-card.c
Owner Module: 1
Properties:
alsa.card = "0"
alsa.card_name = "sof-hda-dsp"
alsa.long_card_name = "LENOVO-20S1S19N00-ThinkPadT14Gen1"
device.bus_path = "pci-0000:00:1f.3-platform-skl_hda_dsp_generic"
sysfs.path = "/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0"
device.bus = "pci"
device.vendor.id = "8086"
device.vendor.name = "Intel Corporation"
device.product.id = "02c8"
device.product.name = "Comet Lake PCH-LP cAVS"
device.string = "0"
device.description = "Comet Lake PCH-LP cAVS"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
Profiles:
input:stereo-fallback: Stereo Input (sinks: 0, sources: 1, priority: 51, available: no)
input:multichannel-input: Multichannel Input (sinks: 0, sources: 1, priority: 1, available: yes)
output:stereo-fallback: Stereo Output (sinks: 1, sources: 0, priority: 5100, available: yes)
output:stereo-fallback+input:stereo-fallback: Stereo Output + Stereo Input (sinks: 1, sources: 1, priority: 5151, available: no)
output:stereo-fallback+input:multichannel-input: Stereo Output + Multichannel Input (sinks: 1, sources: 1, priority: 5101, available: yes)
output:multichannel-output: Multichannel Output (sinks: 1, sources: 0, priority: 100, available: yes)
output:multichannel-output+input:stereo-fallback: Multichannel Output + Stereo Input (sinks: 1, sources: 1, priority: 151, available: no)
output:multichannel-output+input:multichannel-input: Multichannel Duplex (sinks: 1, sources: 1, priority: 101, available: yes)
off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
Active Profile: output:stereo-fallback+input:multichannel-input
Ports:
analog-input-mic: Microphone (type: Mic, priority: 8700, latency offset: 0 usec, not available)
Part of profile(s): input:stereo-fallback, output:stereo-fallback+input:stereo-fallback, output:multichannel-output+input:stereo-fallback
analog-output-speaker: Speakers (type: Speaker, priority: 10000, latency offset: 0 usec, availability unknown)
Properties:
device.icon_name = "audio-speakers"
Part of profile(s): output:stereo-fallback, output:stereo-fallback+input:stereo-fallback, output:stereo-fallback+input:multichannel-input
analog-output-headphones: Headphones (type: Headphones, priority: 9900, latency offset: 0 usec, not available)
Properties:
device.icon_name = "audio-headphones"
Part of profile(s): output:stereo-fallback, output:stereo-fallback+input:stereo-fallback, output:stereo-fallback+input:multichannel-input
```
The `Speakers` are selected for output but there is no port I can select for input.
I did a `git bisect` and found out that reverting the following commit from v1.2.7 solves the problem:
```
commit e2cfda5b53f4718f1128fb4df75ec8fb7274d36b
Author: Jaroslav Kysela <perex(a)perex.cz>
Date: Mon May 23 13:33:24 2022 +0200
HDMI - use new Macro syntax
Signed-off-by: Jaroslav Kysela <perex(a)perex.cz>
```
Issue URL : https://github.com/alsa-project/alsa-ucm-conf/issues/325
Repository URL: https://github.com/alsa-project/alsa-ucm-conf
1
0
From: Yingkun Meng <mengyingkun(a)loongson.cn>
Loongson I2S controller is found on 7axxx/2kxxx chips from loongson,
it is a PCI device with two private DMA controllers, one for playback,
the other for capture.
The driver supports the use of DTS or ACPI to describe device resources.
Signed-off-by: Yingkun Meng <mengyingkun(a)loongson.cn>
---
changes v3 -> v4
Add __packed attribute for loongson_dma_desc struct.
sound/soc/Kconfig | 1 +
sound/soc/Makefile | 1 +
sound/soc/loongson/Kconfig | 16 ++
sound/soc/loongson/Makefile | 4 +
sound/soc/loongson/loongson_dma.c | 350 ++++++++++++++++++++++++++
sound/soc/loongson/loongson_dma.h | 16 ++
sound/soc/loongson/loongson_i2s.c | 269 ++++++++++++++++++++
sound/soc/loongson/loongson_i2s.h | 71 ++++++
sound/soc/loongson/loongson_i2s_pci.c | 171 +++++++++++++
9 files changed, 899 insertions(+)
create mode 100644 sound/soc/loongson/Kconfig
create mode 100644 sound/soc/loongson/Makefile
create mode 100644 sound/soc/loongson/loongson_dma.c
create mode 100644 sound/soc/loongson/loongson_dma.h
create mode 100644 sound/soc/loongson/loongson_i2s.c
create mode 100644 sound/soc/loongson/loongson_i2s.h
create mode 100644 sound/soc/loongson/loongson_i2s_pci.c
diff --git a/sound/soc/Kconfig b/sound/soc/Kconfig
index 4b6e5a802880..bfa9622e1ab1 100644
--- a/sound/soc/Kconfig
+++ b/sound/soc/Kconfig
@@ -79,6 +79,7 @@ source "sound/soc/google/Kconfig"
source "sound/soc/hisilicon/Kconfig"
source "sound/soc/jz4740/Kconfig"
source "sound/soc/kirkwood/Kconfig"
+source "sound/soc/loongson/Kconfig"
source "sound/soc/img/Kconfig"
source "sound/soc/intel/Kconfig"
source "sound/soc/mediatek/Kconfig"
diff --git a/sound/soc/Makefile b/sound/soc/Makefile
index 9d9b228e4508..8376fdb217ed 100644
--- a/sound/soc/Makefile
+++ b/sound/soc/Makefile
@@ -46,6 +46,7 @@ obj-$(CONFIG_SND_SOC) += fsl/
obj-$(CONFIG_SND_SOC) += google/
obj-$(CONFIG_SND_SOC) += hisilicon/
obj-$(CONFIG_SND_SOC) += jz4740/
+obj-$(CONFIG_SND_SOC) += loongson/
obj-$(CONFIG_SND_SOC) += img/
obj-$(CONFIG_SND_SOC) += intel/
obj-$(CONFIG_SND_SOC) += mediatek/
diff --git a/sound/soc/loongson/Kconfig b/sound/soc/loongson/Kconfig
new file mode 100644
index 000000000000..4478ac91e402
--- /dev/null
+++ b/sound/soc/loongson/Kconfig
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: GPL-2.0
+menu "SoC Audio for Loongson CPUs"
+ depends on LOONGARCH || COMPILE_TEST
+
+config SND_SOC_LOONGSON_I2S_PCI
+ tristate "Loongson I2S-PCI Device Driver"
+ select REGMAP_MMIO
+ depends on PCI
+ help
+ Say Y or M if you want to add support for I2S driver for
+ Loongson I2S controller.
+
+ The controller is found in loongson bridge chips or SoCs,
+ and work as a PCI device.
+
+endmenu
diff --git a/sound/soc/loongson/Makefile b/sound/soc/loongson/Makefile
new file mode 100644
index 000000000000..099af7989103
--- /dev/null
+++ b/sound/soc/loongson/Makefile
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
+#Platform Support
+snd-soc-loongson-i2s-pci-objs := loongson_i2s_pci.o loongson_i2s.o loongson_dma.o
+obj-$(CONFIG_SND_SOC_LOONGSON_I2S_PCI) += snd-soc-loongson-i2s-pci.o
diff --git a/sound/soc/loongson/loongson_dma.c b/sound/soc/loongson/loongson_dma.c
new file mode 100644
index 000000000000..65b6719e61c5
--- /dev/null
+++ b/sound/soc/loongson/loongson_dma.c
@@ -0,0 +1,350 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// Loongson ALSA SoC Platform (DMA) driver
+//
+// Copyright (C) 2023 Loongson Technology Corporation Limited
+// Author: Yingkun Meng <mengyingkun(a)loongson.cn>
+//
+
+#include <linux/module.h>
+#include <linux/io-64-nonatomic-lo-hi.h>
+#include <linux/delay.h>
+#include <linux/pm_runtime.h>
+#include <linux/dma-mapping.h>
+#include <sound/soc.h>
+#include <sound/pcm.h>
+#include <sound/pcm_params.h>
+#include "loongson_i2s.h"
+
+/* DMA dma_order Register */
+#define DMA_ORDER_STOP (1 << 4) /* DMA stop */
+#define DMA_ORDER_START (1 << 3) /* DMA start */
+#define DMA_ORDER_ASK_VALID (1 << 2) /* DMA ask valid flag */
+#define DMA_ORDER_AXI_UNCO (1 << 1) /* Uncache access */
+#define DMA_ORDER_ADDR_64 (1 << 0) /* 64bits address support */
+
+#define DMA_ORDER_ASK_MASK (~0x1fUL) /* Ask addr mask */
+#define DMA_ORDER_CTRL_MASK (0x0fUL) /* Control mask */
+
+/*
+ * DMA registers descriptor.
+ */
+struct loongson_dma_desc {
+ u32 order; /* Next descriptor address register */
+ u32 saddr; /* Source address register */
+ u32 daddr; /* Device address register */
+ u32 length; /* Total length register */
+ u32 step_length; /* Memory stride register */
+ u32 step_times; /* Repeat time register */
+ u32 cmd; /* Command register */
+ u32 stats; /* Status register */
+ u32 order_hi; /* Next descriptor high address register */
+ u32 saddr_hi; /* High source address register */
+ u32 res[6]; /* Reserved */
+} __packed;
+
+struct loongson_runtime_data {
+ struct loongson_dma_data *dma_data;
+
+ struct loongson_dma_desc *dma_desc_arr;
+ dma_addr_t dma_desc_arr_phy;
+ int dma_desc_arr_size;
+
+ struct loongson_dma_desc *dma_pos_desc;
+ dma_addr_t dma_pos_desc_phy;
+};
+
+static const struct snd_pcm_hardware ls_pcm_hardware = {
+ .info = SNDRV_PCM_INFO_MMAP |
+ SNDRV_PCM_INFO_INTERLEAVED |
+ SNDRV_PCM_INFO_MMAP_VALID |
+ SNDRV_PCM_INFO_RESUME |
+ SNDRV_PCM_INFO_PAUSE,
+ .formats = (SNDRV_PCM_FMTBIT_S8 |
+ SNDRV_PCM_FMTBIT_S16_LE |
+ SNDRV_PCM_FMTBIT_S20_3LE |
+ SNDRV_PCM_FMTBIT_S24_LE),
+ .period_bytes_min = 128,
+ .period_bytes_max = 128 * 1024,
+ .periods_min = 1,
+ .periods_max = PAGE_SIZE / sizeof(struct loongson_dma_desc),
+ .buffer_bytes_max = 1024 * 1024,
+};
+
+static struct
+loongson_dma_desc *dma_desc_save(struct loongson_runtime_data *prtd)
+{
+ void __iomem *order_reg = prtd->dma_data->order_addr;
+ u64 val;
+
+ val = (u64)prtd->dma_pos_desc_phy & DMA_ORDER_ASK_MASK;
+ val |= (readq(order_reg) & DMA_ORDER_CTRL_MASK);
+ val |= DMA_ORDER_ASK_VALID;
+ writeq(val, order_reg);
+
+ while (readl(order_reg) & DMA_ORDER_ASK_VALID)
+ udelay(2);
+
+ return prtd->dma_pos_desc;
+}
+
+static int loongson_pcm_trigger(struct snd_soc_component *component,
+ struct snd_pcm_substream *substream, int cmd)
+{
+ struct loongson_runtime_data *prtd = substream->runtime->private_data;
+ struct device *dev = substream->pcm->card->dev;
+ void __iomem *order_reg = prtd->dma_data->order_addr;
+ u64 val;
+ int ret = 0;
+
+ switch (cmd) {
+ case SNDRV_PCM_TRIGGER_START:
+ case SNDRV_PCM_TRIGGER_RESUME:
+ case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
+ val = prtd->dma_pos_desc_phy & DMA_ORDER_ASK_MASK;
+ if (dev->coherent_dma_mask == DMA_BIT_MASK(64))
+ val |= DMA_ORDER_ADDR_64;
+ else
+ val &= ~DMA_ORDER_ADDR_64;
+ val |= (readq(order_reg) & DMA_ORDER_CTRL_MASK);
+ val |= DMA_ORDER_START;
+ writeq(val, order_reg);
+
+ while ((readl(order_reg) & DMA_ORDER_START))
+ udelay(2);
+ break;
+ case SNDRV_PCM_TRIGGER_STOP:
+ case SNDRV_PCM_TRIGGER_SUSPEND:
+ case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
+ dma_desc_save(prtd);
+
+ /* dma stop */
+ val = readq(order_reg) | DMA_ORDER_STOP;
+ writeq(val, order_reg);
+ udelay(1000);
+
+ break;
+ default:
+ dev_err(dev, "Invalid pcm trigger operation\n");
+ return -EINVAL;
+ }
+
+ return ret;
+}
+
+static int loongson_pcm_hw_params(struct snd_soc_component *component,
+ struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params)
+{
+ struct snd_pcm_runtime *runtime = substream->runtime;
+ struct device *dev = substream->pcm->card->dev;
+ struct loongson_runtime_data *prtd = runtime->private_data;
+ size_t buf_len = params_buffer_bytes(params);
+ size_t period_len = params_period_bytes(params);
+ dma_addr_t order_addr, mem_addr;
+ struct loongson_dma_desc *desc;
+ u32 num_periods;
+ int i;
+
+ if (buf_len % period_len) {
+ dev_err(dev, "buf len not multiply of period len\n");
+ return -EINVAL;
+ }
+
+ num_periods = buf_len / period_len;
+ if (!num_periods || num_periods > prtd->dma_desc_arr_size) {
+ dev_err(dev, "dma data too small or too big\n");
+ return -EINVAL;
+ }
+
+ snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer);
+ runtime->dma_bytes = buf_len;
+
+ /* initialize dma descriptor array */
+ mem_addr = runtime->dma_addr;
+ order_addr = prtd->dma_desc_arr_phy;
+ for (i = 0; i < num_periods; i++) {
+ desc = &prtd->dma_desc_arr[i];
+
+ /* next descriptor physical address */
+ order_addr += sizeof(*desc);
+ desc->order = lower_32_bits(order_addr | BIT(0));
+ desc->order_hi = upper_32_bits(order_addr);
+
+ desc->saddr = lower_32_bits(mem_addr);
+ desc->saddr_hi = upper_32_bits(mem_addr);
+ desc->daddr = prtd->dma_data->dev_addr;
+
+ desc->cmd = BIT(0);
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ desc->cmd |= BIT(12);
+
+ desc->length = period_len >> 2;
+ desc->step_length = 0;
+ desc->step_times = 1;
+
+ mem_addr += period_len;
+ }
+ desc = &prtd->dma_desc_arr[num_periods - 1];
+ desc->order = lower_32_bits(prtd->dma_desc_arr_phy | BIT(0));
+ desc->order_hi = upper_32_bits(prtd->dma_desc_arr_phy);
+
+ /* init position descriptor */
+ *prtd->dma_pos_desc = *prtd->dma_desc_arr;
+
+ return 0;
+}
+
+static snd_pcm_uframes_t
+loongson_pcm_pointer(struct snd_soc_component *component,
+ struct snd_pcm_substream *substream)
+{
+ struct snd_pcm_runtime *runtime = substream->runtime;
+ struct loongson_runtime_data *prtd = runtime->private_data;
+ struct loongson_dma_desc *desc;
+ snd_pcm_uframes_t x;
+ u64 addr;
+
+ desc = dma_desc_save(prtd);
+ addr = ((u64)desc->saddr_hi << 32) | desc->saddr;
+
+ x = bytes_to_frames(runtime, addr - runtime->dma_addr);
+ if (x == runtime->buffer_size)
+ x = 0;
+ return x;
+}
+
+static irqreturn_t loongson_pcm_dma_irq(int irq, void *devid)
+{
+ struct snd_pcm_substream *substream = devid;
+
+ snd_pcm_period_elapsed(substream);
+ return IRQ_HANDLED;
+}
+
+static int loongson_pcm_open(struct snd_soc_component *component,
+ struct snd_pcm_substream *substream)
+{
+ struct snd_pcm_runtime *runtime = substream->runtime;
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_card *card = substream->pcm->card;
+ struct loongson_runtime_data *prtd;
+ struct loongson_dma_data *dma_data;
+ int ret;
+
+ /*
+ * For mysterious reasons (and despite what the manual says)
+ * playback samples are lost if the DMA count is not a multiple
+ * of the DMA burst size. Let's add a rule to enforce that.
+ */
+ snd_pcm_hw_constraint_step(runtime, 0,
+ SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 128);
+ snd_pcm_hw_constraint_step(runtime, 0,
+ SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 128);
+ snd_pcm_hw_constraint_integer(substream->runtime,
+ SNDRV_PCM_HW_PARAM_PERIODS);
+ snd_soc_set_runtime_hwparams(substream, &ls_pcm_hardware);
+
+ prtd = kzalloc(sizeof(*prtd), GFP_KERNEL);
+ if (!prtd)
+ return -ENOMEM;
+
+ prtd->dma_desc_arr = dma_alloc_coherent(card->dev, PAGE_SIZE,
+ &prtd->dma_desc_arr_phy,
+ GFP_KERNEL);
+ if (!prtd->dma_desc_arr) {
+ ret = -ENOMEM;
+ goto desc_err;
+ }
+ prtd->dma_desc_arr_size = PAGE_SIZE / sizeof(*prtd->dma_desc_arr);
+
+ prtd->dma_pos_desc = dma_alloc_coherent(card->dev,
+ sizeof(*prtd->dma_pos_desc),
+ &prtd->dma_pos_desc_phy,
+ GFP_KERNEL);
+ if (!prtd->dma_pos_desc) {
+ ret = -ENOMEM;
+ goto pos_err;
+ }
+
+ dma_data = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
+ prtd->dma_data = dma_data;
+
+ substream->runtime->private_data = prtd;
+
+ return 0;
+pos_err:
+ dma_free_coherent(card->dev, PAGE_SIZE, prtd->dma_desc_arr,
+ prtd->dma_desc_arr_phy);
+desc_err:
+ kfree(prtd);
+
+ return ret;
+}
+
+static int loongson_pcm_close(struct snd_soc_component *component,
+ struct snd_pcm_substream *substream)
+{
+ struct snd_card *card = substream->pcm->card;
+ struct loongson_runtime_data *prtd = substream->runtime->private_data;
+
+ dma_free_coherent(card->dev, PAGE_SIZE, prtd->dma_desc_arr,
+ prtd->dma_desc_arr_phy);
+
+ dma_free_coherent(card->dev, sizeof(*prtd->dma_pos_desc),
+ prtd->dma_pos_desc, prtd->dma_pos_desc_phy);
+
+ kfree(prtd);
+ return 0;
+}
+
+static int loongson_pcm_mmap(struct snd_soc_component *component,
+ struct snd_pcm_substream *substream,
+ struct vm_area_struct *vma)
+{
+ return remap_pfn_range(vma, vma->vm_start,
+ substream->dma_buffer.addr >> PAGE_SHIFT,
+ vma->vm_end - vma->vm_start, vma->vm_page_prot);
+}
+
+static int loongson_pcm_new(struct snd_soc_component *component,
+ struct snd_soc_pcm_runtime *rtd)
+{
+ struct snd_card *card = rtd->card->snd_card;
+ struct snd_pcm_substream *substream;
+ struct loongson_dma_data *dma_data;
+ unsigned int i;
+ int ret;
+
+ for_each_pcm_streams(i) {
+ substream = rtd->pcm->streams[i].substream;
+ if (!substream)
+ continue;
+
+ dma_data = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0),
+ substream);
+ ret = devm_request_irq(card->dev, dma_data->irq,
+ loongson_pcm_dma_irq,
+ IRQF_TRIGGER_HIGH, LS_I2S_DRVNAME,
+ substream);
+ if (ret < 0) {
+ dev_err(card->dev, "request irq for DMA failed\n");
+ return ret;
+ }
+ }
+
+ return snd_pcm_set_fixed_buffer_all(rtd->pcm, SNDRV_DMA_TYPE_DEV,
+ card->dev,
+ ls_pcm_hardware.buffer_bytes_max);
+}
+
+const struct snd_soc_component_driver loongson_i2s_component = {
+ .name = LS_I2S_DRVNAME,
+ .open = loongson_pcm_open,
+ .close = loongson_pcm_close,
+ .hw_params = loongson_pcm_hw_params,
+ .trigger = loongson_pcm_trigger,
+ .pointer = loongson_pcm_pointer,
+ .mmap = loongson_pcm_mmap,
+ .pcm_construct = loongson_pcm_new,
+};
diff --git a/sound/soc/loongson/loongson_dma.h b/sound/soc/loongson/loongson_dma.h
new file mode 100644
index 000000000000..073ee8c0c046
--- /dev/null
+++ b/sound/soc/loongson/loongson_dma.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * ALSA ASoC interface for the Loongson platform
+ *
+ * Copyright (C) 2023 Loongson Technology Corporation Limited
+ * Author: Yingkun Meng <mengyingkun(a)loongson.cn>
+ */
+
+#ifndef _LOONGSON_DMA_H
+#define _LOONGSON_DMA_H
+
+#include <sound/soc.h>
+
+extern const struct snd_soc_component_driver loongson_i2s_component;
+
+#endif
diff --git a/sound/soc/loongson/loongson_i2s.c b/sound/soc/loongson/loongson_i2s.c
new file mode 100644
index 000000000000..35d34568be79
--- /dev/null
+++ b/sound/soc/loongson/loongson_i2s.c
@@ -0,0 +1,269 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// Common functions for loongson I2S controller driver
+//
+// Copyright (C) 2023 Loongson Technology Corporation Limited.
+// Author: Yingkun Meng <mengyingkun(a)loongson.cn>
+//
+
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/delay.h>
+#include <linux/pm_runtime.h>
+#include <linux/dma-mapping.h>
+#include <sound/soc.h>
+#include <linux/regmap.h>
+#include <sound/pcm_params.h>
+#include "loongson_i2s.h"
+
+#define LOONGSON_I2S_FORMATS (SNDRV_PCM_FMTBIT_S8 | \
+ SNDRV_PCM_FMTBIT_S16_LE | \
+ SNDRV_PCM_FMTBIT_S20_3LE | \
+ SNDRV_PCM_FMTBIT_S24_LE)
+
+static int loongson_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
+ struct snd_soc_dai *dai)
+{
+ struct loongson_i2s *i2s = snd_soc_dai_get_drvdata(dai);
+ int ret = 0;
+
+ switch (cmd) {
+ case SNDRV_PCM_TRIGGER_START:
+ case SNDRV_PCM_TRIGGER_RESUME:
+ case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ regmap_update_bits(i2s->regmap, LS_I2S_CTRL,
+ I2S_CTRL_TX_EN | I2S_CTRL_TX_DMA_EN,
+ I2S_CTRL_TX_EN | I2S_CTRL_TX_DMA_EN);
+ else
+ regmap_update_bits(i2s->regmap, LS_I2S_CTRL,
+ I2S_CTRL_RX_EN | I2S_CTRL_RX_DMA_EN,
+ I2S_CTRL_RX_EN | I2S_CTRL_RX_DMA_EN);
+ break;
+ case SNDRV_PCM_TRIGGER_STOP:
+ case SNDRV_PCM_TRIGGER_SUSPEND:
+ case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ regmap_update_bits(i2s->regmap, LS_I2S_CTRL,
+ I2S_CTRL_TX_EN | I2S_CTRL_TX_DMA_EN, 0);
+ else
+ regmap_update_bits(i2s->regmap, LS_I2S_CTRL,
+ I2S_CTRL_RX_EN | I2S_CTRL_RX_DMA_EN, 0);
+ break;
+ default:
+ ret = -EINVAL;
+ }
+
+ return ret;
+}
+
+static int loongson_i2s_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params,
+ struct snd_soc_dai *dai)
+{
+ struct loongson_i2s *i2s = snd_soc_dai_get_drvdata(dai);
+ u32 clk_rate = i2s->clk_rate;
+ u32 sysclk = i2s->sysclk;
+ u32 bits = params_width(params);
+ u32 chans = params_channels(params);
+ u32 fs = params_rate(params);
+ u32 bclk_ratio, mclk_ratio;
+ u32 mclk_ratio_frac;
+ u32 val = 0;
+
+ switch (i2s->rev_id) {
+ case 0:
+ bclk_ratio = DIV_ROUND_CLOSEST(clk_rate,
+ (bits * chans * fs * 2)) - 1;
+ mclk_ratio = DIV_ROUND_CLOSEST(clk_rate, (sysclk * 2)) - 1;
+
+ /* According to 2k1000LA user manual, set bits == depth */
+ val |= (bits << 24);
+ val |= (bits << 16);
+ val |= (bclk_ratio << 8);
+ val |= mclk_ratio;
+ regmap_write(i2s->regmap, LS_I2S_CFG, val);
+
+ break;
+ case 1:
+ bclk_ratio = DIV_ROUND_CLOSEST(sysclk,
+ (bits * chans * fs * 2)) - 1;
+ mclk_ratio = clk_rate / sysclk;
+ mclk_ratio_frac = DIV_ROUND_CLOSEST(((u64)clk_rate << 16),
+ sysclk) - (mclk_ratio << 16);
+
+ regmap_read(i2s->regmap, LS_I2S_CFG, &val);
+ val |= (bits << 24);
+ val |= (bclk_ratio << 8);
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ val |= (bits << 16);
+ else
+ val |= bits;
+ regmap_write(i2s->regmap, LS_I2S_CFG, val);
+
+ val = (mclk_ratio_frac << 16) | mclk_ratio;
+ regmap_write(i2s->regmap, LS_I2S_CFG1, val);
+
+ break;
+ default:
+ dev_err(i2s->dev, "I2S revision invalid\n");
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+static int loongson_i2s_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id,
+ unsigned int freq, int dir)
+{
+ struct loongson_i2s *i2s = snd_soc_dai_get_drvdata(dai);
+
+ i2s->sysclk = freq;
+
+ return 0;
+}
+
+static int loongson_i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
+{
+ struct loongson_i2s *i2s = snd_soc_dai_get_drvdata(dai);
+ u32 val;
+ int ret;
+
+ switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
+ case SND_SOC_DAIFMT_I2S:
+ break;
+ case SND_SOC_DAIFMT_RIGHT_J:
+ regmap_update_bits(i2s->regmap, LS_I2S_CTRL, I2S_CTRL_MSB,
+ I2S_CTRL_MSB);
+ break;
+ default:
+ return -EINVAL;
+ }
+
+
+ switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
+ case SND_SOC_DAIFMT_BC_FC:
+ break;
+ case SND_SOC_DAIFMT_BP_FC:
+ /* Enable master mode */
+ regmap_update_bits(i2s->regmap, LS_I2S_CTRL, I2S_CTRL_MASTER,
+ I2S_CTRL_MASTER);
+ if (i2s->rev_id == 1) {
+ ret = regmap_read_poll_timeout_atomic(i2s->regmap,
+ LS_I2S_CTRL, val,
+ val & I2S_CTRL_CLK_READY,
+ 10, 500000);
+ if (ret < 0)
+ dev_warn(dai->dev, "wait BCLK ready timeout\n");
+ }
+ break;
+ case SND_SOC_DAIFMT_BC_FP:
+ /* Enable MCLK */
+ if (i2s->rev_id == 1) {
+ regmap_update_bits(i2s->regmap, LS_I2S_CTRL,
+ I2S_CTRL_MCLK_EN,
+ I2S_CTRL_MCLK_EN);
+ ret = regmap_read_poll_timeout_atomic(i2s->regmap,
+ LS_I2S_CTRL, val,
+ val & I2S_CTRL_MCLK_READY,
+ 10, 500000);
+ if (ret < 0)
+ dev_warn(dai->dev, "wait MCLK ready timeout\n");
+ }
+ break;
+ case SND_SOC_DAIFMT_BP_FP:
+ /* Enable MCLK */
+ if (i2s->rev_id == 1) {
+ regmap_update_bits(i2s->regmap, LS_I2S_CTRL,
+ I2S_CTRL_MCLK_EN,
+ I2S_CTRL_MCLK_EN);
+ ret = regmap_read_poll_timeout_atomic(i2s->regmap,
+ LS_I2S_CTRL, val,
+ val & I2S_CTRL_MCLK_READY,
+ 10, 500000);
+ if (ret < 0)
+ dev_warn(dai->dev, "wait MCLK ready timeout\n");
+ }
+
+ /* Enable master mode */
+ regmap_update_bits(i2s->regmap, LS_I2S_CTRL, I2S_CTRL_MASTER,
+ I2S_CTRL_MASTER);
+ if (i2s->rev_id == 1) {
+ ret = regmap_read_poll_timeout_atomic(i2s->regmap,
+ LS_I2S_CTRL, val,
+ val & I2S_CTRL_CLK_READY,
+ 10, 500000);
+ if (ret < 0)
+ dev_warn(dai->dev, "wait BCLK ready timeout\n");
+ }
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+static const struct snd_soc_dai_ops loongson_i2s_dai_ops = {
+ .trigger = loongson_i2s_trigger,
+ .hw_params = loongson_i2s_hw_params,
+ .set_sysclk = loongson_i2s_set_dai_sysclk,
+ .set_fmt = loongson_i2s_set_fmt,
+};
+
+static int loongson_i2s_dai_probe(struct snd_soc_dai *cpu_dai)
+{
+ struct loongson_i2s *i2s = dev_get_drvdata(cpu_dai->dev);
+
+ snd_soc_dai_init_dma_data(cpu_dai, &i2s->playback_dma_data,
+ &i2s->capture_dma_data);
+ snd_soc_dai_set_drvdata(cpu_dai, i2s);
+
+ return 0;
+}
+
+struct snd_soc_dai_driver loongson_i2s_dai = {
+ .name = "loongson-i2s",
+ .probe = loongson_i2s_dai_probe,
+ .playback = {
+ .stream_name = "CPU-Playback",
+ .channels_min = 1,
+ .channels_max = 2,
+ .rates = SNDRV_PCM_RATE_8000_96000,
+ .formats = LOONGSON_I2S_FORMATS,
+ },
+ .capture = {
+ .stream_name = "CPU-Capture",
+ .channels_min = 1,
+ .channels_max = 2,
+ .rates = SNDRV_PCM_RATE_8000_96000,
+ .formats = LOONGSON_I2S_FORMATS,
+ },
+ .ops = &loongson_i2s_dai_ops,
+ .symmetric_rate = 1,
+};
+
+static int i2s_suspend(struct device *dev)
+{
+ struct loongson_i2s *i2s = dev_get_drvdata(dev);
+
+ regcache_cache_only(i2s->regmap, true);
+
+ return 0;
+}
+
+static int i2s_resume(struct device *dev)
+{
+ struct loongson_i2s *i2s = dev_get_drvdata(dev);
+ int ret;
+
+ regcache_cache_only(i2s->regmap, false);
+ regcache_mark_dirty(i2s->regmap);
+ ret = regcache_sync(i2s->regmap);
+
+ return ret;
+}
+
+const struct dev_pm_ops loongson_i2s_pm = {
+ SET_SYSTEM_SLEEP_PM_OPS(i2s_suspend, i2s_resume)
+};
diff --git a/sound/soc/loongson/loongson_i2s.h b/sound/soc/loongson/loongson_i2s.h
new file mode 100644
index 000000000000..52788f6a94ad
--- /dev/null
+++ b/sound/soc/loongson/loongson_i2s.h
@@ -0,0 +1,71 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * ALSA I2S interface for the Loongson platform
+ *
+ * Copyright (C) 2023 Loongson Technology Corporation Limited
+ * Author: Yingkun Meng <mengyingkun(a)loongson.cn>
+ */
+
+#ifndef _LOONGSON_I2S_H
+#define _LOONGSON_I2S_H
+
+#include <linux/regmap.h>
+#include <sound/dmaengine_pcm.h>
+
+/* I2S Common Registers */
+#define LS_I2S_VER 0x00 /* I2S Version */
+#define LS_I2S_CFG 0x04 /* I2S Config */
+#define LS_I2S_CTRL 0x08 /* I2S Control */
+#define LS_I2S_RX_DATA 0x0C /* I2S DMA RX Address */
+#define LS_I2S_TX_DATA 0x10 /* I2S DMA TX Address */
+
+/* 2K2000 I2S Specify Registers */
+#define LS_I2S_CFG1 0x14 /* I2S Config1 */
+
+/* 7A2000 I2S Specify Registers */
+#define LS_I2S_TX_ORDER 0x100 /* TX DMA Order */
+#define LS_I2S_RX_ORDER 0x110 /* RX DMA Order */
+
+/* Loongson I2S Control Register */
+#define I2S_CTRL_MCLK_READY (1 << 16) /* MCLK ready */
+#define I2S_CTRL_MASTER (1 << 15) /* Master mode */
+#define I2S_CTRL_MSB (1 << 14) /* MSB bit order */
+#define I2S_CTRL_RX_EN (1 << 13) /* RX enable */
+#define I2S_CTRL_TX_EN (1 << 12) /* TX enable */
+#define I2S_CTRL_RX_DMA_EN (1 << 11) /* DMA RX enable */
+#define I2S_CTRL_CLK_READY (1 << 8) /* BCLK ready */
+#define I2S_CTRL_TX_DMA_EN (1 << 7) /* DMA TX enable */
+#define I2S_CTRL_RESET (1 << 4) /* Controller soft reset */
+#define I2S_CTRL_MCLK_EN (1 << 3) /* Enable MCLK */
+#define I2S_CTRL_RX_INT_EN (1 << 1) /* RX interrupt enable */
+#define I2S_CTRL_TX_INT_EN (1 << 0) /* TX interrupt enable */
+
+#define LS_I2S_DRVNAME "loongson-i2s"
+
+struct loongson_dma_data {
+ dma_addr_t dev_addr; /* device physical address for DMA */
+ void __iomem *order_addr; /* DMA order register */
+ u32 irq; /* DMA irq */
+};
+
+struct loongson_i2s {
+ struct device *dev;
+ union {
+ struct snd_dmaengine_dai_dma_data playback_dma_data;
+ struct loongson_dma_data tx_dma_data;
+ };
+ union {
+ struct snd_dmaengine_dai_dma_data capture_dma_data;
+ struct loongson_dma_data rx_dma_data;
+ };
+ struct regmap *regmap;
+ void __iomem *reg_base;
+ u32 rev_id;
+ u32 clk_rate;
+ u32 sysclk;
+};
+
+extern const struct dev_pm_ops loongson_i2s_pm;
+extern struct snd_soc_dai_driver loongson_i2s_dai;
+
+#endif
diff --git a/sound/soc/loongson/loongson_i2s_pci.c b/sound/soc/loongson/loongson_i2s_pci.c
new file mode 100644
index 000000000000..6dcfb17d3276
--- /dev/null
+++ b/sound/soc/loongson/loongson_i2s_pci.c
@@ -0,0 +1,171 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// loongson_i2s_pci.c -- Loongson I2S controller driver
+//
+// Copyright (C) 2023 Loongson Technology Corporation Limited
+// Author: Yingkun Meng <mengyingkun(a)loongson.cn>
+//
+
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <linux/pm_runtime.h>
+#include <linux/dma-mapping.h>
+#include <linux/acpi.h>
+#include <linux/pci.h>
+#include <sound/soc.h>
+#include "loongson_i2s.h"
+#include "loongson_dma.h"
+
+static bool loongson_i2s_wr_reg(struct device *dev, unsigned int reg)
+{
+ switch (reg) {
+ case LS_I2S_CFG:
+ case LS_I2S_CTRL:
+ case LS_I2S_RX_DATA:
+ case LS_I2S_TX_DATA:
+ case LS_I2S_CFG1:
+ return true;
+ default:
+ return false;
+ };
+}
+
+static bool loongson_i2s_rd_reg(struct device *dev, unsigned int reg)
+{
+ switch (reg) {
+ case LS_I2S_VER:
+ case LS_I2S_CFG:
+ case LS_I2S_CTRL:
+ case LS_I2S_RX_DATA:
+ case LS_I2S_TX_DATA:
+ case LS_I2S_CFG1:
+ return true;
+ default:
+ return false;
+ };
+}
+
+static bool loongson_i2s_volatile_reg(struct device *dev, unsigned int reg)
+{
+ switch (reg) {
+ case LS_I2S_CFG:
+ case LS_I2S_CTRL:
+ case LS_I2S_RX_DATA:
+ case LS_I2S_TX_DATA:
+ case LS_I2S_CFG1:
+ return true;
+ default:
+ return false;
+ };
+}
+
+static const struct regmap_config loongson_i2s_regmap_config = {
+ .reg_bits = 32,
+ .reg_stride = 4,
+ .val_bits = 32,
+ .max_register = LS_I2S_CFG1,
+ .writeable_reg = loongson_i2s_wr_reg,
+ .readable_reg = loongson_i2s_rd_reg,
+ .volatile_reg = loongson_i2s_volatile_reg,
+ .cache_type = REGCACHE_FLAT,
+};
+
+static int loongson_i2s_pci_probe(struct pci_dev *pdev,
+ const struct pci_device_id *pid)
+{
+ const struct fwnode_handle *fwnode = pdev->dev.fwnode;
+ struct loongson_dma_data *tx_data, *rx_data;
+ struct loongson_i2s *i2s;
+ int ret;
+
+ if (pcim_enable_device(pdev)) {
+ dev_err(&pdev->dev, "pci_enable_device failed\n");
+ return -ENODEV;
+ }
+
+ i2s = devm_kzalloc(&pdev->dev, sizeof(*i2s), GFP_KERNEL);
+ if (!i2s)
+ return -ENOMEM;
+
+ i2s->rev_id = pdev->revision;
+ i2s->dev = &pdev->dev;
+ pci_set_drvdata(pdev, i2s);
+
+ ret = pcim_iomap_regions(pdev, 1 << 0, dev_name(&pdev->dev));
+ if (ret < 0) {
+ dev_err(&pdev->dev, "iomap_regions failed\n");
+ return ret;
+ }
+ i2s->reg_base = pcim_iomap_table(pdev)[0];
+ i2s->regmap = devm_regmap_init_mmio(&pdev->dev, i2s->reg_base,
+ &loongson_i2s_regmap_config);
+ if (IS_ERR(i2s->regmap)) {
+ dev_err(&pdev->dev, "regmap_init_mmio failed\n");
+ return PTR_ERR(i2s->regmap);
+ }
+
+ tx_data = &i2s->tx_dma_data;
+ rx_data = &i2s->rx_dma_data;
+
+ tx_data->dev_addr = (dma_addr_t)i2s->reg_base + LS_I2S_TX_DATA;
+ tx_data->order_addr = i2s->reg_base + LS_I2S_TX_ORDER;
+
+ rx_data->dev_addr = (dma_addr_t)i2s->reg_base + LS_I2S_RX_DATA;
+ rx_data->order_addr = i2s->reg_base + LS_I2S_RX_ORDER;
+
+ tx_data->irq = fwnode_irq_get_byname(fwnode, "tx");
+ if (tx_data->irq < 0) {
+ dev_err(&pdev->dev, "dma tx irq invalid\n");
+ return tx_data->irq;
+ }
+
+ rx_data->irq = fwnode_irq_get_byname(fwnode, "rx");
+ if (rx_data->irq < 0) {
+ dev_err(&pdev->dev, "dma rx irq invalid\n");
+ return rx_data->irq;
+ }
+
+ device_property_read_u32(&pdev->dev, "clock-frequency", &i2s->clk_rate);
+ if (!i2s->clk_rate) {
+ dev_err(&pdev->dev, "clock-frequency property invalid\n");
+ return -EINVAL;
+ }
+
+ dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+
+ if (i2s->rev_id == 1) {
+ regmap_write(i2s->regmap, LS_I2S_CTRL, I2S_CTRL_RESET);
+ udelay(200);
+ }
+
+ ret = devm_snd_soc_register_component(&pdev->dev,
+ &loongson_i2s_component,
+ &loongson_i2s_dai, 1);
+ if (ret) {
+ dev_err(&pdev->dev, "register DAI failed %d\n", ret);
+ return ret;
+ }
+
+ return 0;
+}
+
+static const struct pci_device_id loongson_i2s_ids[] = {
+ { PCI_DEVICE(PCI_VENDOR_ID_LOONGSON, 0x7a27) },
+ { },
+};
+MODULE_DEVICE_TABLE(pci, loongson_i2s_ids);
+
+static struct pci_driver loongson_i2s_driver = {
+ .name = "loongson-i2s-pci",
+ .id_table = loongson_i2s_ids,
+ .probe = loongson_i2s_pci_probe,
+ .driver = {
+ .owner = THIS_MODULE,
+ .pm = pm_sleep_ptr(&loongson_i2s_pm),
+ },
+};
+module_pci_driver(loongson_i2s_driver);
+
+MODULE_DESCRIPTION("Loongson I2S Master Mode ASoC Driver");
+MODULE_AUTHOR("Loongson Technology Corporation Limited");
+MODULE_LICENSE("GPL");
--
2.33.0
4
9
It would be better to replace the traditional ternary conditional
operator with max()/min()
Signed-off-by: Li Dong <lidong(a)vivo.com>
---
sound/soc/starfive/jh7110_tdm.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/sound/soc/starfive/jh7110_tdm.c b/sound/soc/starfive/jh7110_tdm.c
index 5f5a6ca7dbda..a17437dd8c3e 100644
--- a/sound/soc/starfive/jh7110_tdm.c
+++ b/sound/soc/starfive/jh7110_tdm.c
@@ -187,15 +187,8 @@ static int jh7110_tdm_syncdiv(struct jh7110_tdm_dev *tdm)
{
u32 sl, sscale, syncdiv;
- if (tdm->rx.sl >= tdm->tx.sl)
- sl = tdm->rx.sl;
- else
- sl = tdm->tx.sl;
-
- if (tdm->rx.sscale >= tdm->tx.sscale)
- sscale = tdm->rx.sscale;
- else
- sscale = tdm->tx.sscale;
+ sl = max(tdm->rx.sl, tdm->tx.sl);
+ sscale = max(tdm->rx.sscale, tdm->tx.sscale);
syncdiv = tdm->pcmclk / tdm->samplerate - 1;
--
2.31.1.windows.1
1
0
This patch chain adds support for the Cirrus Logic cs42l43 PC focused
SoundWire CODEC. The chain is currently based of Lee's for-mfd-next
branch.
Thanks,
Charles
Charles Keepax (4):
dt-bindings: mfd: cirrus,cs42l43: Add initial DT binding
mfd: cs42l43: Add support for cs42l43 core driver
pinctrl: cs42l43: Add support for the cs42l43
ASoC: cs42l43: Add support for the cs42l43
Lucas Tanure (2):
soundwire: bus: Allow SoundWire peripherals to register IRQ handlers
spi: cs42l43: Add SPI controller support
.../bindings/sound/cirrus,cs42l43.yaml | 313 +++
MAINTAINERS | 4 +
drivers/mfd/Kconfig | 23 +
drivers/mfd/Makefile | 3 +
drivers/mfd/cs42l43-i2c.c | 86 +
drivers/mfd/cs42l43-sdw.c | 213 ++
drivers/mfd/cs42l43.c | 1141 +++++++++
drivers/mfd/cs42l43.h | 23 +
drivers/pinctrl/cirrus/Kconfig | 11 +
drivers/pinctrl/cirrus/Makefile | 2 +
drivers/pinctrl/cirrus/pinctrl-cs42l43.c | 609 +++++
drivers/soundwire/bus.c | 31 +
drivers/soundwire/bus_type.c | 12 +
drivers/spi/Kconfig | 7 +
drivers/spi/Makefile | 1 +
drivers/spi/spi-cs42l43.c | 281 ++
include/linux/mfd/cs42l43-regs.h | 1172 +++++++++
include/linux/mfd/cs42l43.h | 102 +
include/linux/soundwire/sdw.h | 9 +
include/sound/cs42l43.h | 17 +
sound/soc/codecs/Kconfig | 16 +
sound/soc/codecs/Makefile | 4 +
sound/soc/codecs/cs42l43-jack.c | 967 +++++++
sound/soc/codecs/cs42l43-sdw.c | 74 +
sound/soc/codecs/cs42l43.c | 2278 +++++++++++++++++
sound/soc/codecs/cs42l43.h | 131 +
26 files changed, 7530 insertions(+)
create mode 100644 Documentation/devicetree/bindings/sound/cirrus,cs42l43.yaml
create mode 100644 drivers/mfd/cs42l43-i2c.c
create mode 100644 drivers/mfd/cs42l43-sdw.c
create mode 100644 drivers/mfd/cs42l43.c
create mode 100644 drivers/mfd/cs42l43.h
create mode 100644 drivers/pinctrl/cirrus/pinctrl-cs42l43.c
create mode 100644 drivers/spi/spi-cs42l43.c
create mode 100644 include/linux/mfd/cs42l43-regs.h
create mode 100644 include/linux/mfd/cs42l43.h
create mode 100644 include/sound/cs42l43.h
create mode 100644 sound/soc/codecs/cs42l43-jack.c
create mode 100644 sound/soc/codecs/cs42l43-sdw.c
create mode 100644 sound/soc/codecs/cs42l43.c
create mode 100644 sound/soc/codecs/cs42l43.h
--
2.30.2
4
14
This patch chain adds support for the Cirrus Logic cs42l43 PC focused
SoundWire CODEC. The chain is currently based of Lee's for-mfd-next
branch.
Thanks,
Charles
Charles Keepax (4):
dt-bindings: mfd: cirrus,cs42l43: Add initial DT binding
mfd: cs42l43: Add support for cs42l43 core driver
pinctrl: cs42l43: Add support for the cs42l43
ASoC: cs42l43: Add support for the cs42l43
Lucas Tanure (2):
soundwire: bus: Allow SoundWire peripherals to register IRQ handlers
spi: cs42l43: Add SPI controller support
.../bindings/sound/cirrus,cs42l43.yaml | 313 +++
MAINTAINERS | 4 +
drivers/mfd/Kconfig | 23 +
drivers/mfd/Makefile | 3 +
drivers/mfd/cs42l43-i2c.c | 87 +
drivers/mfd/cs42l43-sdw.c | 222 ++
drivers/mfd/cs42l43.c | 1262 +++++++++
drivers/mfd/cs42l43.h | 23 +
drivers/pinctrl/cirrus/Kconfig | 11 +
drivers/pinctrl/cirrus/Makefile | 2 +
drivers/pinctrl/cirrus/pinctrl-cs42l43.c | 609 +++++
drivers/soundwire/bus.c | 32 +
drivers/soundwire/bus_type.c | 12 +
drivers/spi/Kconfig | 7 +
drivers/spi/Makefile | 1 +
drivers/spi/spi-cs42l43.c | 281 ++
include/linux/mfd/cs42l43-regs.h | 1184 +++++++++
include/linux/mfd/cs42l43.h | 102 +
include/linux/soundwire/sdw.h | 9 +
include/sound/cs42l43.h | 17 +
sound/soc/codecs/Kconfig | 16 +
sound/soc/codecs/Makefile | 4 +
sound/soc/codecs/cs42l43-jack.c | 969 +++++++
sound/soc/codecs/cs42l43-sdw.c | 74 +
sound/soc/codecs/cs42l43.c | 2278 +++++++++++++++++
sound/soc/codecs/cs42l43.h | 131 +
26 files changed, 7676 insertions(+)
create mode 100644 Documentation/devicetree/bindings/sound/cirrus,cs42l43.yaml
create mode 100644 drivers/mfd/cs42l43-i2c.c
create mode 100644 drivers/mfd/cs42l43-sdw.c
create mode 100644 drivers/mfd/cs42l43.c
create mode 100644 drivers/mfd/cs42l43.h
create mode 100644 drivers/pinctrl/cirrus/pinctrl-cs42l43.c
create mode 100644 drivers/spi/spi-cs42l43.c
create mode 100644 include/linux/mfd/cs42l43-regs.h
create mode 100644 include/linux/mfd/cs42l43.h
create mode 100644 include/sound/cs42l43.h
create mode 100644 sound/soc/codecs/cs42l43-jack.c
create mode 100644 sound/soc/codecs/cs42l43-sdw.c
create mode 100644 sound/soc/codecs/cs42l43.c
create mode 100644 sound/soc/codecs/cs42l43.h
--
2.30.2
1
6

18 Jun '23
alsa-project/alsa-ucm-conf pull request #324 was opened from a-wai:
The earpiece speaker is a mono device, using only a single channel (in our case, the left one) from the DA0 output. This causes loss of information as the right channel is completely discarded when playing stereo audio.
In order to avoid this issue, set `AIF1 DA0 Stereo Playback Route` to `Mix Mono` when using the "Earpiece" output port (and only in this case).
Request URL : https://github.com/alsa-project/alsa-ucm-conf/pull/324
Patch URL : https://github.com/alsa-project/alsa-ucm-conf/pull/324.patch
Repository URL: https://github.com/alsa-project/alsa-ucm-conf
1
0
alsa-project/alsa-utils pull request #221 was opened from critkitten:
fix three compile warnings
Request URL : https://github.com/alsa-project/alsa-utils/pull/221
Patch URL : https://github.com/alsa-project/alsa-utils/pull/221.patch
Repository URL: https://github.com/alsa-project/alsa-utils
1
0

topology: nhlt: intel: support m/n divider and xtal/cardinal/pll clock source
by GitHub pull_request - edited 18 Jun '23
by GitHub pull_request - edited 18 Jun '23
18 Jun '23
alsa-project/alsa-utils pull request #220 was edited from brentlu:
Current alsatplg supports only cardinal clock source without m/n divider. Code in SOF ssp driver is ported here to implement the divider function.
I tested the code on ADL brya device with following setting:
MCLK: 19.2MHz
BCLK: 3.072Mz (m 24 n 25)
PR of topology is here: https://github.com/thesofproject/sof/pull/7826
Request URL : https://github.com/alsa-project/alsa-utils/pull/220
Patch URL : https://github.com/alsa-project/alsa-utils/pull/220.patch
Repository URL: https://github.com/alsa-project/alsa-utils
1
0

Mixer settings faulty on M-Audio C400 (usb) after suspend until they're touched in alsamixer
by GitHub issues - opened 17 Jun '23
by GitHub issues - opened 17 Jun '23
17 Jun '23
alsa-project/alsa-lib issue #331 was opened from ri0t:
I don't know if this is the right place to report it, but:
* I do a suspend and resume on my machine
* Now, my mixer settings for my M-Audio C400 usb-soundcard are set to output all signals on the first pcm out
* alsamixer doesn't reflect the true settings of the mixer, instead it shows the last used (correct, or wanted) settings
* Once i touch one of the mixer controls in alsamixer, the settings get set to the correct values (+ that change i did)
* This repeats every suspend/resume-cycle
I've observed this on Debian Bullseye and now on NixOS 23.05.
Thanks in advance, even if you point me to a better place to post this.
I can supply more debug info, once i know what you need, but the upload from alsa-info to www.alsa-project.org failed somehow without providing me a url. So, here's some basics:
```
!!Kernel Information
!!------------------
Kernel release: #1-NixOS SMP PREEMPT_DYNAMIC Tue May 30 13:03:33 UTC 2023
Operating System: GNU/Linux
Architecture: x86_64
Processor: unknown
SMP Enabled: Yes
!!ALSA Version
!!------------
Driver version: k6.1.31
Library version:
Utilities version: 1.2.9
!!Loaded ALSA modules
!!-------------------
snd_hda_intel (card 0)
snd_usb_audio (card 1)
snd_hda_intel (card 2)
!!Sound Servers on this system
!!----------------------------
PipeWire:
Installed - Yes (/run/current-system/sw/bin/pipewire)
Running - Yes
Jack:
Installed - Yes (/run/current-system/sw/bin/jackd)
Running - No
Jack2:
Installed - Yes (/run/current-system/sw/bin/jackdbus)
Running - Yes
!!Soundcards recognised by ALSA
!!-----------------------------
0 [NVidia ]: HDA-Intel - HDA NVidia
HDA NVidia at 0xfc080000 irq 119
1 [C400 ]: USB-Audio - Fast Track C400
M-Audio Fast Track C400 at usb-0000:0c:00.3-1, high speed
2 [Generic ]: HDA-Intel - HD-Audio Generic
HD-Audio Generic at 0xfcb00000 irq 125
!!USB Stream information
!!----------------------
--startcollapse--
M-Audio Fast Track C400 at usb-0000:0c:00.3-1, high speed : USB Audio
Playback:
Status: Running
Interface = 2
Altset = 1
Packet Size = 162
Momentary freq = 48000 Hz (0x6.0000)
Interface 2
Altset 1
Format: S24_3LE
Channels: 6
Endpoint: 0x01 (1 OUT) (ADAPTIVE)
Rates: 44100, 48000, 88200, 96000
Data packet interval: 125 us
Bits: 0
Sync Endpoint: 0x81 (1 IN)
Sync EP Interface: 3
Sync EP Altset: 1
Implicit Feedback Mode: Yes
Capture:
Status: Stop
Interface 3
Altset 1
Format: S24_3LE
Channels: 4
Endpoint: 0x81 (1 IN) (ASYNC)
Rates: 44100, 48000, 88200, 96000
Data packet interval: 125 us
Bits: 0
--endcollapse--
!!Modprobe options (Sound related)
!!--------------------------------
snd_pcsp: index=-2
snd_usb_audio: index=-2
snd_atiixp_modem: index=-2
snd_intel8x0m: index=-2
snd_via82xx_modem: index=-2
!!Loaded sound module options
!!---------------------------
!!Module: snd_usb_audio
autoclock : Y
delayed_register : (null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null)
device_setup : 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
enable : Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y
id : (null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null)
ignore_ctl_error : N
implicit_fb : N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N
index : -2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
lowlatency : Y
pid : -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
quirk_alias : (null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null)
quirk_flags : 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
skip_validation : N
use_vmalloc : Y
vid : -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
!!USB Mixer information
!!---------------------
--startcollapse--
USB Mixer: usb_id=0x07632030, ctrlif=1, ctlerr=0
Card: M-Audio Fast Track C400 at usb-0000:0c:00.3-1, high speed
Unit: 64
Control: name="Effect Return 6", index=0
Info: id=64, control=1, cmask=0x400, channels=1, type="S16"
Volume: min=46854, max=65403, dBmin=-7297, dBmax=-51
Unit: 64
Control: name="Effect Return 5", index=0
Info: id=64, control=1, cmask=0x8, channels=1, type="S16"
Volume: min=46854, max=65403, dBmin=-7297, dBmax=-51
Unit: 64
Control: name="Effect Return 4", index=0
Info: id=64, control=1, cmask=0x100, channels=1, type="S16"
Volume: min=46854, max=65403, dBmin=-7297, dBmax=-51
Unit: 64
Control: name="Effect Return 3", index=0
Info: id=64, control=1, cmask=0x2, channels=1, type="S16"
Volume: min=46854, max=65403, dBmin=-7297, dBmax=-51
Unit: 64
Control: name="Effect Return 2", index=0
Info: id=64, control=1, cmask=0x40, channels=1, type="S16"
Volume: min=46854, max=65403, dBmin=-7297, dBmax=-51
Unit: 64
Control: name="Effect Return 1", index=0
Info: id=64, control=1, cmask=0x0, channels=1, type="S16"
Volume: min=46854, max=65403, dBmin=-7297, dBmax=-51
Unit: 64
Control: name="In4-Out6 Playback Volume", index=0
Info: id=64, control=1, cmask=0x10, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="In4-Out5 Playback Volume", index=0
Info: id=64, control=1, cmask=0x8, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="In4-Out4 Playback Volume", index=0
Info: id=64, control=1, cmask=0x4, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="In4-Out3 Playback Volume", index=0
Info: id=64, control=1, cmask=0x2, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="In4-Out2 Playback Volume", index=0
Info: id=64, control=1, cmask=0x1, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="In4-Out1 Playback Volume", index=0
Info: id=64, control=1, cmask=0x0, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="In3-Out6 Playback Volume", index=0
Info: id=64, control=1, cmask=0x10, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="In3-Out5 Playback Volume", index=0
Info: id=64, control=1, cmask=0x8, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="In3-Out4 Playback Volume", index=0
Info: id=64, control=1, cmask=0x4, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="In3-Out3 Playback Volume", index=0
Info: id=64, control=1, cmask=0x2, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="In3-Out2 Playback Volume", index=0
Info: id=64, control=1, cmask=0x1, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="In3-Out1 Playback Volume", index=0
Info: id=64, control=1, cmask=0x0, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="In2-Out6 Playback Volume", index=0
Info: id=64, control=1, cmask=0x10, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="In2-Out5 Playback Volume", index=0
Info: id=64, control=1, cmask=0x8, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="In2-Out4 Playback Volume", index=0
Info: id=64, control=1, cmask=0x4, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="In2-Out3 Playback Volume", index=0
Info: id=64, control=1, cmask=0x2, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="In2-Out2 Playback Volume", index=0
Info: id=64, control=1, cmask=0x1, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="In2-Out1 Playback Volume", index=0
Info: id=64, control=1, cmask=0x0, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="In1-Out6 Playback Volume", index=0
Info: id=64, control=1, cmask=0x10, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="In1-Out5 Playback Volume", index=0
Info: id=64, control=1, cmask=0x8, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="In1-Out4 Playback Volume", index=0
Info: id=64, control=1, cmask=0x4, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="In1-Out3 Playback Volume", index=0
Info: id=64, control=1, cmask=0x2, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="In1-Out2 Playback Volume", index=0
Info: id=64, control=1, cmask=0x1, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="In1-Out1 Playback Volume", index=0
Info: id=64, control=1, cmask=0x0, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM6-Out6 Playback Volume", index=0
Info: id=64, control=1, cmask=0x10, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM6-Out5 Playback Volume", index=0
Info: id=64, control=1, cmask=0x8, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM6-Out4 Playback Volume", index=0
Info: id=64, control=1, cmask=0x4, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM6-Out3 Playback Volume", index=0
Info: id=64, control=1, cmask=0x2, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM6-Out2 Playback Volume", index=0
Info: id=64, control=1, cmask=0x1, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM6-Out1 Playback Volume", index=0
Info: id=64, control=1, cmask=0x0, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM5-Out6 Playback Volume", index=0
Info: id=64, control=1, cmask=0x10, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM5-Out5 Playback Volume", index=0
Info: id=64, control=1, cmask=0x8, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM5-Out4 Playback Volume", index=0
Info: id=64, control=1, cmask=0x4, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM5-Out3 Playback Volume", index=0
Info: id=64, control=1, cmask=0x2, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM5-Out2 Playback Volume", index=0
Info: id=64, control=1, cmask=0x1, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM5-Out1 Playback Volume", index=0
Info: id=64, control=1, cmask=0x0, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM4-Out6 Playback Volume", index=0
Info: id=64, control=1, cmask=0x10, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM4-Out5 Playback Volume", index=0
Info: id=64, control=1, cmask=0x8, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM4-Out4 Playback Volume", index=0
Info: id=64, control=1, cmask=0x4, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM4-Out3 Playback Volume", index=0
Info: id=64, control=1, cmask=0x2, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM4-Out2 Playback Volume", index=0
Info: id=64, control=1, cmask=0x1, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM4-Out1 Playback Volume", index=0
Info: id=64, control=1, cmask=0x0, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM3-Out6 Playback Volume", index=0
Info: id=64, control=1, cmask=0x10, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM3-Out5 Playback Volume", index=0
Info: id=64, control=1, cmask=0x8, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM3-Out4 Playback Volume", index=0
Info: id=64, control=1, cmask=0x4, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM3-Out3 Playback Volume", index=0
Info: id=64, control=1, cmask=0x2, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM3-Out2 Playback Volume", index=0
Info: id=64, control=1, cmask=0x1, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM3-Out1 Playback Volume", index=0
Info: id=64, control=1, cmask=0x0, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM2-Out6 Playback Volume", index=0
Info: id=64, control=1, cmask=0x10, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM2-Out5 Playback Volume", index=0
Info: id=64, control=1, cmask=0x8, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM2-Out4 Playback Volume", index=0
Info: id=64, control=1, cmask=0x4, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM2-Out3 Playback Volume", index=0
Info: id=64, control=1, cmask=0x2, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM2-Out2 Playback Volume", index=0
Info: id=64, control=1, cmask=0x1, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM2-Out1 Playback Volume", index=0
Info: id=64, control=1, cmask=0x0, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM1-Out6 Playback Volume", index=0
Info: id=64, control=1, cmask=0x10, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM1-Out5 Playback Volume", index=0
Info: id=64, control=1, cmask=0x8, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM1-Out4 Playback Volume", index=0
Info: id=64, control=1, cmask=0x4, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM1-Out3 Playback Volume", index=0
Info: id=64, control=1, cmask=0x2, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM1-Out2 Playback Volume", index=0
Info: id=64, control=1, cmask=0x1, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM1-Out1 Playback Volume", index=0
Info: id=64, control=1, cmask=0x0, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 64
Control: name="PCM Volume", index=4
Info: id=64, control=10, cmask=0xf, channels=4, type="S16"
Volume: min=0, max=0, dBmin=0, dBmax=0
Unit: 64
Control: name="PCM Volume", index=3
Info: id=64, control=8, cmask=0xf, channels=4, type="S16"
Volume: min=0, max=0, dBmin=0, dBmax=0
Unit: 64
Control: name="PCM Volume", index=2
Info: id=64, control=7, cmask=0xf, channels=4, type="S16"
Volume: min=0, max=0, dBmin=0, dBmax=0
Unit: 64
Control: name="PCM Volume", index=1
Info: id=64, control=6, cmask=0xf, channels=4, type="S16"
Volume: min=0, max=0, dBmin=0, dBmax=0
Unit: 64
Control: name="PCM Volume", index=0
Info: id=64, control=5, cmask=0xf, channels=4, type="S16"
Volume: min=0, max=0, dBmin=0, dBmax=0
Unit: 64
Control: name="Line Volume", index=3
Info: id=64, control=4, cmask=0xf, channels=4, type="S16"
Volume: min=0, max=0, dBmin=0, dBmax=0
Unit: 64
Control: name="Line Volume", index=2
Info: id=64, control=3, cmask=0xf, channels=4, type="S16"
Volume: min=0, max=0, dBmin=0, dBmax=0
Unit: 64
Control: name="Line Volume", index=1
Info: id=64, control=2, cmask=0xf, channels=4, type="S16"
Volume: min=0, max=0, dBmin=0, dBmax=0
Unit: 64
Control: name="Line Volume", index=0
Info: id=64, control=1, cmask=0xf, channels=4, type="S16"
Volume: min=0, max=0, dBmin=0, dBmax=0
Unit: 66
Control: name="Effect Send AIn4", index=0
Info: id=66, control=1, cmask=0x100, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 66
Control: name="Effect Send AIn3", index=0
Info: id=66, control=1, cmask=0x80, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 66
Control: name="Effect Send AIn2", index=0
Info: id=66, control=1, cmask=0x40, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 66
Control: name="Effect Send AIn1", index=0
Info: id=66, control=1, cmask=0x20, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 66
Control: name="Effect Send DOut6", index=0
Info: id=66, control=1, cmask=0x10, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 66
Control: name="Effect Send DOut5", index=0
Info: id=66, control=1, cmask=0x8, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 66
Control: name="Effect Send DOut4", index=0
Info: id=66, control=1, cmask=0x4, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 66
Control: name="Effect Send DOut3", index=0
Info: id=66, control=1, cmask=0x2, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 66
Control: name="Effect Send DOut2", index=0
Info: id=66, control=1, cmask=0x1, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 66
Control: name="Effect Send DOut1", index=0
Info: id=66, control=1, cmask=0x0, channels=1, type="S16"
Volume: min=46587, max=64766, dBmin=-7401, dBmax=-300
Unit: 67
Control: name="Effect Feedback Volume", index=0
Info: id=67, control=5, cmask=0x0, channels=1, type="U8"
Volume: min=0, max=255, dBmin=0, dBmax=99
Unit: 67
Control: name="Effect Duration", index=0
Info: id=67, control=4, cmask=0x0, channels=1, type="S16"
Volume: min=0, max=65535, dBmin=0, dBmax=0
Unit: 67
Control: name="Effect Volume", index=0
Info: id=67, control=3, cmask=0x0, channels=1, type="U8"
Volume: min=0, max=255, dBmin=0, dBmax=99
Unit: 67
Control: name="Effect Program Switch", index=0
Unit: 128
Control: name="PCM Clock Source", index=0
Info: id=128, control=1, cmask=0x0, channels=1, type="U8"
Volume: min=1, max=2, dBmin=0, dBmax=0
Unit: 130
Control: name="Clock Source 130 Validity", index=0
Info: id=130, control=2, cmask=0x0, channels=1, type="BOOLEAN"
Volume: min=0, max=1, dBmin=0, dBmax=0
--endcollapse--
!!-------Mixer controls for card C400
Card sysdefault:1 'C400'/'M-Audio Fast Track C400 at usb-0000:0c:00.3-1, high speed'
Mixer name : 'USB Mixer'
Components : 'USB0763:2030'
Controls : 91
Simple ctrls : 90
Simple mixer control 'PCM',0
Capabilities: volume
Playback channels: Front Left - Front Right - Rear Left - Rear Right
Capture channels: Front Left - Front Right - Rear Left - Rear Right
Limits: 0 - 0
Front Left: 0 [0%]
Front Right: 0 [0%]
Rear Left: 0 [0%]
Rear Right: 0 [0%]
Simple mixer control 'PCM Clock Source',0
Capabilities: enum
Items: 'Internal' 'SPDIF'
Item0: 'Internal'
Simple mixer control 'PCM1-Out1',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 148 [93%] [-7.92dB]
Simple mixer control 'PCM1-Out2',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM1-Out3',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM1-Out4',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM1-Out5',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM1-Out6',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM2-Out1',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM2-Out2',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 148 [93%] [-7.92dB]
Simple mixer control 'PCM2-Out3',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM2-Out4',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM2-Out5',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM2-Out6',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM3-Out1',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM3-Out2',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM3-Out3',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM3-Out4',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM3-Out5',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM3-Out6',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM4-Out1',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM4-Out2',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM4-Out3',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM4-Out4',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM4-Out5',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM4-Out6',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM5-Out1',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM5-Out2',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM5-Out3',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM5-Out4',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM5-Out5',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM5-Out6',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM6-Out1',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM6-Out2',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM6-Out3',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM6-Out4',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM6-Out5',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM6-Out6',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'PCM',1
Capabilities: volume
Playback channels: Front Left - Front Right - Rear Left - Rear Right
Capture channels: Front Left - Front Right - Rear Left - Rear Right
Limits: 0 - 0
Front Left: 0 [0%]
Front Right: 0 [0%]
Rear Left: 0 [0%]
Rear Right: 0 [0%]
Simple mixer control 'PCM',2
Capabilities: volume
Playback channels: Front Left - Front Right - Rear Left - Rear Right
Capture channels: Front Left - Front Right - Rear Left - Rear Right
Limits: 0 - 0
Front Left: 0 [0%]
Front Right: 0 [0%]
Rear Left: 0 [0%]
Rear Right: 0 [0%]
Simple mixer control 'PCM',3
Capabilities: volume
Playback channels: Front Left - Front Right - Rear Left - Rear Right
Capture channels: Front Left - Front Right - Rear Left - Rear Right
Limits: 0 - 0
Front Left: 0 [0%]
Front Right: 0 [0%]
Rear Left: 0 [0%]
Rear Right: 0 [0%]
Simple mixer control 'PCM',4
Capabilities: volume
Playback channels: Front Left - Front Right - Rear Left - Rear Right
Capture channels: Front Left - Front Right - Rear Left - Rear Right
Limits: 0 - 0
Front Left: 0 [0%]
Front Right: 0 [0%]
Rear Left: 0 [0%]
Rear Right: 0 [0%]
Simple mixer control 'Line',0
Capabilities: volume
Playback channels: Front Left - Front Right - Rear Left - Rear Right
Capture channels: Front Left - Front Right - Rear Left - Rear Right
Limits: 0 - 0
Front Left: 0 [0%]
Front Right: 0 [0%]
Rear Left: 0 [0%]
Rear Right: 0 [0%]
Simple mixer control 'Line',1
Capabilities: volume
Playback channels: Front Left - Front Right - Rear Left - Rear Right
Capture channels: Front Left - Front Right - Rear Left - Rear Right
Limits: 0 - 0
Front Left: 0 [0%]
Front Right: 0 [0%]
Rear Left: 0 [0%]
Rear Right: 0 [0%]
Simple mixer control 'Line',2
Capabilities: volume
Playback channels: Front Left - Front Right - Rear Left - Rear Right
Capture channels: Front Left - Front Right - Rear Left - Rear Right
Limits: 0 - 0
Front Left: 0 [0%]
Front Right: 0 [0%]
Rear Left: 0 [0%]
Rear Right: 0 [0%]
Simple mixer control 'Line',3
Capabilities: volume
Playback channels: Front Left - Front Right - Rear Left - Rear Right
Capture channels: Front Left - Front Right - Rear Left - Rear Right
Limits: 0 - 0
Front Left: 0 [0%]
Front Right: 0 [0%]
Rear Left: 0 [0%]
Rear Right: 0 [0%]
Simple mixer control 'Effect',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 255
Mono: 0 [0%] [0.00dB]
Simple mixer control 'Effect Duration',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 285
Mono: 0 [0%]
Simple mixer control 'Effect Feedback',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 255
Mono: 0 [0%]
Simple mixer control 'Effect Program',0
Capabilities: enum
Items: 'Room 1' 'Room 2' 'Room 3' 'Hall 1' 'Hall 2' 'Plate' 'Delay' 'Echo'
Item0: 'Room 1'
Simple mixer control 'Effect Return 1',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 162
Mono: 0 [0%]
Simple mixer control 'Effect Return 2',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 162
Mono: 0 [0%]
Simple mixer control 'Effect Return 3',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 162
Mono: 0 [0%]
Simple mixer control 'Effect Return 4',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 162
Mono: 0 [0%]
Simple mixer control 'Effect Return 5',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 162
Mono: 0 [0%]
Simple mixer control 'Effect Return 6',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 162
Mono: 0 [0%]
Simple mixer control 'Effect Send AIn1',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 159
Mono: 0 [0%]
Simple mixer control 'Effect Send AIn2',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 159
Mono: 0 [0%]
Simple mixer control 'Effect Send AIn3',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 159
Mono: 0 [0%]
Simple mixer control 'Effect Send AIn4',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 159
Mono: 0 [0%]
Simple mixer control 'Effect Send DOut1',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 159
Mono: 0 [0%]
Simple mixer control 'Effect Send DOut2',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 159
Mono: 0 [0%]
Simple mixer control 'Effect Send DOut3',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 159
Mono: 0 [0%]
Simple mixer control 'Effect Send DOut4',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 159
Mono: 0 [0%]
Simple mixer control 'Effect Send DOut5',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 159
Mono: 0 [0%]
Simple mixer control 'Effect Send DOut6',0
Capabilities: volume volume-joined
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 159
Mono: 0 [0%]
Simple mixer control 'In1-Out1',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'In1-Out2',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'In1-Out3',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'In1-Out4',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'In1-Out5',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'In1-Out6',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'In2-Out1',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'In2-Out2',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'In2-Out3',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'In2-Out4',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'In2-Out5',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'In2-Out6',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'In3-Out1',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'In3-Out2',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'In3-Out3',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'In3-Out4',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'In3-Out5',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'In3-Out6',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'In4-Out1',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'In4-Out2',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'In4-Out3',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'In4-Out4',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'In4-Out5',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
Simple mixer control 'In4-Out6',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 159
Mono: Playback 0 [0%] [-74.01dB]
!!-------Mixer controls for card Generic
Card sysdefault:2 'Generic'/'HD-Audio Generic at 0xfcb00000 irq 125'
Mixer name : 'Realtek ALC1220'
Components : 'HDA:10ec1220,1458a0c3,00100101'
Controls : 47
Simple ctrls : 21
Simple mixer control 'Master',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 87
Mono: Playback 61 [70%] [-19.50dB] [on]
Simple mixer control 'Headphone',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 87
Mono:
Front Left: Playback 87 [100%] [0.00dB] [on]
Front Right: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'PCM',0
Capabilities: pvolume
Playback channels: Front Left - Front Right
Limits: Playback 0 - 255
Mono:
Front Left: Playback 255 [100%] [0.00dB]
Front Right: Playback 255 [100%] [0.00dB]
Simple mixer control 'Front',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 87
Mono:
Front Left: Playback 87 [100%] [0.00dB] [on]
Front Right: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'Front Mic',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 31
Mono:
Front Left: Playback 0 [0%] [-34.50dB] [off]
Front Right: Playback 0 [0%] [-34.50dB] [off]
Simple mixer control 'Front Mic Boost',0
Capabilities: volume
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: 0 - 3
Front Left: 0 [0%] [0.00dB]
Front Right: 0 [0%] [0.00dB]
Simple mixer control 'Surround',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 87
Mono:
Front Left: Playback 87 [100%] [0.00dB] [on]
Front Right: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'Center',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 87
Mono: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'LFE',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 87
Mono: Playback 87 [100%] [0.00dB] [on]
Simple mixer control 'Line',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 31
Mono:
Front Left: Playback 0 [0%] [-34.50dB] [off]
Front Right: Playback 0 [0%] [-34.50dB] [off]
Simple mixer control 'Line Boost',0
Capabilities: volume
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: 0 - 3
Front Left: 0 [0%] [0.00dB]
Front Right: 0 [0%] [0.00dB]
Simple mixer control 'IEC958',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [on]
Simple mixer control 'IEC958 Default PCM',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [on]
Simple mixer control 'Capture',0
Capabilities: cvolume cswitch
Capture channels: Front Left - Front Right
Limits: Capture 0 - 63
Front Left: Capture 39 [62%] [12.00dB] [on]
Front Right: Capture 39 [62%] [12.00dB] [on]
Simple mixer control 'Capture',1
Capabilities: cvolume cswitch
Capture channels: Front Left - Front Right
Limits: Capture 0 - 63
Front Left: Capture 0 [0%] [-17.25dB] [off]
Front Right: Capture 0 [0%] [-17.25dB] [off]
Simple mixer control 'Auto-Mute Mode',0
Capabilities: enum
Items: 'Disabled' 'Enabled'
Item0: 'Enabled'
Simple mixer control 'Input Source',0
Capabilities: cenum
Items: 'Front Mic' 'Rear Mic' 'Line'
Item0: 'Front Mic'
Simple mixer control 'Input Source',1
Capabilities: cenum
Items: 'Front Mic' 'Rear Mic' 'Line'
Item0: 'Front Mic'
Simple mixer control 'Loopback Mixing',0
Capabilities: enum
Items: 'Disabled' 'Enabled'
Item0: 'Disabled'
Simple mixer control 'Rear Mic',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 31
Mono:
Front Left: Playback 0 [0%] [-34.50dB] [off]
Front Right: Playback 0 [0%] [-34.50dB] [off]
Simple mixer control 'Rear Mic Boost',0
Capabilities: volume
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: 0 - 3
Front Left: 0 [0%] [0.00dB]
Front Right: 0 [0%] [0.00dB]
```
Issue URL : https://github.com/alsa-project/alsa-lib/issues/331
Repository URL: https://github.com/alsa-project/alsa-lib
1
0
From: Arnd Bergmann <arnd(a)arndb.de>
The PM functions are never referenced when CONFIG_PM_SLEEP is
disabled:
sound/soc/codecs/max98388.c:854:12: error: unused function 'max98388_suspend' [-Werror,-Wunused-function]
static int max98388_suspend(struct device *dev)
^
sound/soc/codecs/max98388.c:864:12: error: unused function 'max98388_resume' [-Werror,-Wunused-function]
static int max98388_resume(struct device *dev)
Fix this by using the modern SYSTEM_SLEEP_PM_OPS() macro in place of
the deprecated SET_SYSTEM_SLEEP_PM_OPS() version, and use pm_sleep_ptr()
to hide the entire structure as well.
On a related note, the of_match_ptr() and ACPI_PTR() macros have the same
problem and would cause the device id table to be unused when the driver
is built-in and the respective subsystems are disabled. This does not
cause warnings unless -Wunused-const-variable is passed to the compiler,
but it's better to just not use the macros at all here.
Signed-off-by: Arnd Bergmann <arnd(a)arndb.de>
---
sound/soc/codecs/max98388.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/max98388.c b/sound/soc/codecs/max98388.c
index 8062a71150074..3d03c4bac6c55 100644
--- a/sound/soc/codecs/max98388.c
+++ b/sound/soc/codecs/max98388.c
@@ -873,7 +873,7 @@ static int max98388_resume(struct device *dev)
}
static const struct dev_pm_ops max98388_pm = {
- SET_SYSTEM_SLEEP_PM_OPS(max98388_suspend, max98388_resume)
+ SYSTEM_SLEEP_PM_OPS(max98388_suspend, max98388_resume)
};
static const struct regmap_config max98388_regmap = {
@@ -998,9 +998,9 @@ MODULE_DEVICE_TABLE(acpi, max98388_acpi_match);
static struct i2c_driver max98388_i2c_driver = {
.driver = {
.name = "max98388",
- .of_match_table = of_match_ptr(max98388_of_match),
- .acpi_match_table = ACPI_PTR(max98388_acpi_match),
- .pm = &max98388_pm,
+ .of_match_table = max98388_of_match,
+ .acpi_match_table = max98388_acpi_match,
+ .pm = pm_sleep_ptr(&max98388_pm),
},
.probe = max98388_i2c_probe,
.id_table = max98388_i2c_id,
--
2.39.2
3
8