Alsa-devel
Threads by month
- ----- 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
- 388 discussions
14 Jun '23
From: Yingkun Meng <mengyingkun(a)loongson.cn>
The audio card uses loongson I2S controller present in
7axxx/2kxxx chips to transfer audio data.
On loongson platform, the chip has only one I2S controller.
Signed-off-by: Yingkun Meng <mengyingkun(a)loongson.cn>
---
.../sound/loongson,ls-audio-card.yaml | 70 +++++++++++++++++++
1 file changed, 70 insertions(+)
create mode 100644 Documentation/devicetree/bindings/sound/loongson,ls-audio-card.yaml
diff --git a/Documentation/devicetree/bindings/sound/loongson,ls-audio-card.yaml b/Documentation/devicetree/bindings/sound/loongson,ls-audio-card.yaml
new file mode 100644
index 000000000000..61e8babed402
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/loongson,ls-audio-card.yaml
@@ -0,0 +1,70 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/loongson,ls-audio-card.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Loongson 7axxx/2kxxx ASoC audio sound card driver
+
+maintainers:
+ - Yingkun Meng <mengyingkun(a)loongson.cn>
+
+description:
+ The binding describes the sound card present in loongson
+ 7axxx/2kxxx platform. The sound card is an ASoC component
+ which uses Loongson I2S controller to transfer the audio data.
+
+properties:
+ compatible:
+ const: loongson,ls-audio-card
+
+ model:
+ $ref: /schemas/types.yaml#/definitions/string
+ description: User specified audio sound card name
+
+ mclk-fs:
+ $ref: simple-card.yaml#/definitions/mclk-fs
+
+ cpu:
+ description: Holds subnode which indicates cpu dai.
+ type: object
+ additionalProperties: false
+ properties:
+ sound-dai:
+ maxItems: 1
+ required:
+ - sound-dai
+
+ codec:
+ description: Holds subnode which indicates codec dai.
+ type: object
+ additionalProperties: false
+ properties:
+ sound-dai:
+ maxItems: 1
+ required:
+ - sound-dai
+
+required:
+ - compatible
+ - model
+ - mclk-fs
+ - cpu
+ - codec
+
+additionalProperties: false
+
+examples:
+ - |
+ sound {
+ compatible = "loongson,ls-audio-card";
+ model = "loongson-audio";
+ mclk-fs = <512>;
+
+ cpu {
+ sound-dai = <&i2s>;
+ };
+ codec {
+ sound-dai = <&es8323>;
+ };
+ };
--
2.33.0
2
4
14 Jun '23
From: Yingkun Meng <mengyingkun(a)loongson.cn>
The Loongson ASoC Sound Card is a general ASoC DAI Link driver that
can be used for Loongson CPU DAI drivers and external CODECs.
The driver supports the use of ACPI table to describe device resources.
On loongson 7axxx platforms, the audio device is an ACPI device.
Signed-off-by: Yingkun Meng <mengyingkun(a)loongson.cn>
---
sound/soc/loongson/Kconfig | 10 ++
sound/soc/loongson/Makefile | 4 +
sound/soc/loongson/loongson_card.c | 237 +++++++++++++++++++++++++++++
3 files changed, 251 insertions(+)
create mode 100644 sound/soc/loongson/loongson_card.c
diff --git a/sound/soc/loongson/Kconfig b/sound/soc/loongson/Kconfig
index 4478ac91e402..c175f9de19a8 100644
--- a/sound/soc/loongson/Kconfig
+++ b/sound/soc/loongson/Kconfig
@@ -13,4 +13,14 @@ config SND_SOC_LOONGSON_I2S_PCI
The controller is found in loongson bridge chips or SoCs,
and work as a PCI device.
+config SND_SOC_LOONGSON_CARD
+ tristate "Loongson Sound Card Driver"
+ select SND_SOC_LOONGSON_I2S_PCI
+ help
+ Say Y or M if you want to add support for SoC audio using
+ loongson I2S controller.
+
+ The driver add support for ALSA SoC Audio support using
+ loongson I2S controller.
+
endmenu
diff --git a/sound/soc/loongson/Makefile b/sound/soc/loongson/Makefile
index cfd0de1b1b22..a173a0fe17fe 100644
--- a/sound/soc/loongson/Makefile
+++ b/sound/soc/loongson/Makefile
@@ -2,3 +2,7 @@
#Platform Support
snd-soc-loongson-i2s-pci-objs := loongson_i2s_pci.o loongson_i2s.o
obj-$(CONFIG_SND_SOC_LOONGSON_I2S_PCI) += snd-soc-loongson-i2s-pci.o
+
+#Machine Support
+snd-soc-loongson-card-objs := loongson_card.o
+obj-$(CONFIG_SND_SOC_LOONGSON_CARD) += snd-soc-loongson-card.o
diff --git a/sound/soc/loongson/loongson_card.c b/sound/soc/loongson/loongson_card.c
new file mode 100644
index 000000000000..7f0ce8957a4f
--- /dev/null
+++ b/sound/soc/loongson/loongson_card.c
@@ -0,0 +1,237 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Loongson ASoC Audio driver
+ *
+ * Copyright (C) 2022 Loongson Technology Corporation Limited
+ */
+
+#include <linux/module.h>
+#include <sound/soc.h>
+#include <sound/soc-acpi.h>
+#include <linux/acpi.h>
+#include <linux/pci.h>
+#include <sound/pcm_params.h>
+
+static char codec_name[SND_ACPI_I2C_ID_LEN];
+
+struct loongson_card_data {
+ struct snd_soc_card snd_card;
+ unsigned int mclk_fs;
+};
+
+static int loongson_card_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params)
+{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
+ struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
+ struct loongson_card_data *ls_card = snd_soc_card_get_drvdata(rtd->card);
+ int ret, mclk;
+
+ if (ls_card->mclk_fs) {
+ mclk = ls_card->mclk_fs * params_rate(params);
+ ret = snd_soc_dai_set_sysclk(cpu_dai, 0, mclk,
+ SND_SOC_CLOCK_OUT);
+ if (ret < 0) {
+ dev_err(codec_dai->dev, "cpu_dai clock not set\n");
+ return ret;
+ }
+
+ ret = snd_soc_dai_set_sysclk(codec_dai, 0, mclk,
+ SND_SOC_CLOCK_IN);
+ if (ret < 0) {
+ dev_err(codec_dai->dev, "codec_dai clock not set\n");
+ return ret;
+ }
+ }
+ return 0;
+}
+
+static const struct snd_soc_ops loongson_ops = {
+ .hw_params = loongson_card_hw_params,
+};
+
+SND_SOC_DAILINK_DEFS(analog,
+ DAILINK_COMP_ARRAY(COMP_CPU("loongson-i2s")),
+ DAILINK_COMP_ARRAY(COMP_EMPTY()),
+ DAILINK_COMP_ARRAY(COMP_EMPTY()));
+
+static struct snd_soc_dai_link loongson_dai_links[] = {
+ {
+ .name = "HiFi PAIF TX",
+ .stream_name = "Playback",
+ .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_IB_NF
+ | SND_SOC_DAIFMT_CBC_CFC,
+ SND_SOC_DAILINK_REG(analog),
+ .ops = &loongson_ops,
+ },
+ {
+ .name = "HiFi PAIF RX",
+ .stream_name = "Capture",
+ .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_IB_NF
+ | SND_SOC_DAIFMT_CBC_CFC,
+ SND_SOC_DAILINK_REG(analog),
+ .ops = &loongson_ops,
+ },
+};
+
+static int loongson_card_parse_acpi(struct loongson_card_data *data)
+{
+ struct snd_soc_card *card = &data->snd_card;
+ struct fwnode_handle *fwnode = card->dev->fwnode;
+ struct fwnode_reference_args args;
+ const char *codec_dai_name;
+ struct acpi_device *adev;
+ struct device *phy_dev;
+ int ret, i;
+
+ /* fixup platform name based on reference node */
+ memset(&args, 0, sizeof(args));
+ ret = acpi_node_get_property_reference(fwnode, "cpu", 0, &args);
+ if (ACPI_FAILURE(ret) || !is_acpi_device_node(args.fwnode)) {
+ dev_err(card->dev, "No matching phy in ACPI table\n");
+ return ret;
+ }
+ adev = to_acpi_device_node(args.fwnode);
+ phy_dev = acpi_get_first_physical_node(adev);
+ if (!phy_dev)
+ return -EPROBE_DEFER;
+ for (i = 0; i < card->num_links; i++)
+ loongson_dai_links[i].platforms->name = dev_name(phy_dev);
+
+ /* fixup codec name based on reference node */
+ memset(&args, 0, sizeof(args));
+ ret = acpi_node_get_property_reference(fwnode, "codec", 0, &args);
+ if (ACPI_FAILURE(ret) || !is_acpi_device_node(args.fwnode)) {
+ dev_err(card->dev, "No matching phy in ACPI table\n");
+ return ret;
+ }
+ adev = to_acpi_device_node(args.fwnode);
+ snprintf(codec_name, sizeof(codec_name), "i2c-%s", acpi_dev_name(adev));
+ for (i = 0; i < card->num_links; i++)
+ loongson_dai_links[i].codecs->name = codec_name;
+
+ device_property_read_string(card->dev, "codec-dai-name",
+ &codec_dai_name);
+ for (i = 0; i < card->num_links; i++)
+ loongson_dai_links[i].codecs->dai_name = codec_dai_name;
+
+ return 0;
+}
+
+static int loongson_card_parse_of(struct loongson_card_data *data)
+{
+ const char *cpu_dai_name, *codec_dai_name;
+ struct device_node *cpu, *codec;
+ struct snd_soc_card *card = &data->snd_card;
+ struct device *dev = card->dev;
+ struct of_phandle_args args;
+ int ret, i;
+
+ cpu = of_get_child_by_name(dev->of_node, "cpu");
+ if (!cpu) {
+ dev_err(dev, "platform property missing or invalid\n");
+ return -EINVAL;
+ }
+ codec = of_get_child_by_name(dev->of_node, "codec");
+ if (!codec) {
+ dev_err(dev, "audio-codec property missing or invalid\n");
+ ret = -EINVAL;
+ goto err;
+ }
+
+ ret = of_parse_phandle_with_args(cpu, "sound-dai",
+ "#sound-dai-cells", 0, &args);
+ if (ret) {
+ dev_err(dev, "codec node missing #sound-dai-cells\n");
+ goto err;
+ }
+ for (i = 0; i < card->num_links; i++)
+ loongson_dai_links[i].cpus->of_node = args.np;
+
+ ret = of_parse_phandle_with_args(codec, "sound-dai",
+ "#sound-dai-cells", 0, &args);
+ if (ret) {
+ dev_err(dev, "codec node missing #sound-dai-cells\n");
+ goto err;
+ }
+ for (i = 0; i < card->num_links; i++)
+ loongson_dai_links[i].codecs->of_node = args.np;
+
+ snd_soc_of_get_dai_name(cpu, &cpu_dai_name);
+ snd_soc_of_get_dai_name(codec, &codec_dai_name);
+ for (i = 0; i < card->num_links; i++) {
+ loongson_dai_links[i].cpus->dai_name = cpu_dai_name;
+ loongson_dai_links[i].codecs->dai_name = codec_dai_name;
+ }
+ of_node_put(cpu);
+ of_node_put(codec);
+
+ return 0;
+
+err:
+ of_node_put(cpu);
+ of_node_put(codec);
+ return ret;
+}
+
+static int loongson_asoc_card_probe(struct platform_device *pdev)
+{
+ struct loongson_card_data *ls_priv;
+ struct snd_soc_card *card;
+ int ret;
+
+ ls_priv = devm_kzalloc(&pdev->dev, sizeof(*ls_priv), GFP_KERNEL);
+ if (!ls_priv)
+ return -ENOMEM;
+
+ card = &ls_priv->snd_card;
+
+ card->dev = &pdev->dev;
+ card->owner = THIS_MODULE;
+ card->dai_link = loongson_dai_links;
+ card->num_links = ARRAY_SIZE(loongson_dai_links);
+ snd_soc_card_set_drvdata(card, ls_priv);
+
+ ret = device_property_read_string(&pdev->dev, "model", &card->name);
+ if (ret) {
+ dev_err(&pdev->dev, "Error parsing card name: %d\n", ret);
+ return ret;
+ }
+ ret = device_property_read_u32(&pdev->dev, "mclk-fs", &ls_priv->mclk_fs);
+ if (ret) {
+ dev_err(&pdev->dev, "Error parsing mclk-fs: %d\n", ret);
+ return ret;
+ }
+
+ if (has_acpi_companion(&pdev->dev))
+ ret = loongson_card_parse_acpi(ls_priv);
+ else
+ ret = loongson_card_parse_of(ls_priv);
+ if (ret < 0)
+ return ret;
+
+ ret = devm_snd_soc_register_card(&pdev->dev, card);
+
+ return ret;
+}
+
+static const struct of_device_id loongson_asoc_dt_ids[] = {
+ { .compatible = "loongson,ls-audio-card" },
+ { /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(of, loongson_asoc_dt_ids);
+
+static struct platform_driver loongson_audio_driver = {
+ .probe = loongson_asoc_card_probe,
+ .driver = {
+ .name = "loongson-asoc-card",
+ .pm = &snd_soc_pm_ops,
+ .of_match_table = of_match_ptr(loongson_asoc_dt_ids),
+ },
+};
+module_platform_driver(loongson_audio_driver);
+
+MODULE_DESCRIPTION("Loongson ASoc Sound Card driver");
+MODULE_AUTHOR("Loongson Technology Corporation Limited");
+MODULE_LICENSE("GPL");
--
2.33.0
2
2
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>
Reported-by: kernel test robot <lkp(a)intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202306060223.9hdivLrx-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202306060320.Sphw0ihy-lkp@intel.com/
---
sound/soc/Kconfig | 1 +
sound/soc/Makefile | 1 +
sound/soc/loongson/Kconfig | 16 +
sound/soc/loongson/Makefile | 4 +
sound/soc/loongson/loongson_i2s.c | 213 +++++++++++
sound/soc/loongson/loongson_i2s.h | 70 ++++
sound/soc/loongson/loongson_i2s_pci.c | 500 ++++++++++++++++++++++++++
7 files changed, 805 insertions(+)
create mode 100644 sound/soc/loongson/Kconfig
create mode 100644 sound/soc/loongson/Makefile
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..cfd0de1b1b22
--- /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
+obj-$(CONFIG_SND_SOC_LOONGSON_I2S_PCI) += snd-soc-loongson-i2s-pci.o
diff --git a/sound/soc/loongson/loongson_i2s.c b/sound/soc/loongson/loongson_i2s.c
new file mode 100644
index 000000000000..31e7cf93ee6e
--- /dev/null
+++ b/sound/soc/loongson/loongson_i2s.c
@@ -0,0 +1,213 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Loongson-2K I2S master mode driver
+ *
+ * Copyright (C) 2022 Loongson Technology Corporation Limited
+ */
+
+#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);
+ u32 val;
+ int ret = 0;
+
+ switch (cmd) {
+ case SNDRV_PCM_TRIGGER_START:
+ /* 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, 2000);
+ 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, 2000);
+ if (ret < 0)
+ dev_warn(dai->dev, "wait BCLK ready timeout\n");
+ }
+ fallthrough;
+ 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;
+
+ if (i2s->rev_id == 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);
+ } else if (i2s->rev_id == 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);
+ } else
+ dev_err(i2s->dev, "I2S revision invalid\n");
+
+ 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 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,
+};
+
+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)
+};
+
+void loongson_i2s_init(struct loongson_i2s *i2s)
+{
+ if (i2s->rev_id == 1) {
+ regmap_write(i2s->regmap, LS_I2S_CTRL, I2S_CTRL_RESET);
+ udelay(200);
+ }
+}
diff --git a/sound/soc/loongson/loongson_i2s.h b/sound/soc/loongson/loongson_i2s.h
new file mode 100644
index 000000000000..7735eadb3bf3
--- /dev/null
+++ b/sound/soc/loongson/loongson_i2s.h
@@ -0,0 +1,70 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * ALSA I2S interface for the Loongson chip
+ *
+ */
+#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;
+
+void loongson_i2s_init(struct loongson_i2s *i2s);
+
+#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..f09713b560e9
--- /dev/null
+++ b/sound/soc/loongson/loongson_i2s_pci.c
@@ -0,0 +1,500 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Loongson-2K I2S master mode driver
+ *
+ * Copyright (C) 2022 Loongson Technology Corporation Limited
+ */
+
+#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 <linux/acpi.h>
+#include <linux/pci.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 */
+
+#define BAR_NUM 0
+
+/*
+ * 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 */
+};
+
+struct loongson_runtime_data {
+ struct loongson_dma_data *dma_data;
+
+ struct loongson_dma_desc *dma_desc_arr;
+ dma_addr_t dma_desc_arr_phy;
+
+ 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:
+ ret = -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 = component->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) {
+ dev_err(dev, "dma data too small\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;
+ }
+ if (num_periods > 0) {
+ 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_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);
+ ret = request_irq(dma_data->irq, loongson_pcm_dma_irq,
+ IRQF_TRIGGER_HIGH, LS_I2S_DRVNAME, substream);
+ if (ret < 0)
+ goto irq_err;
+
+ prtd->dma_data = dma_data;
+ substream->runtime->private_data = prtd;
+
+ return 0;
+irq_err:
+ dma_free_coherent(card->dev, sizeof(*prtd->dma_pos_desc),
+ prtd->dma_pos_desc, prtd->dma_pos_desc_phy);
+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_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_card *card = substream->pcm->card;
+ struct loongson_runtime_data *prtd = substream->runtime->private_data;
+ struct loongson_dma_data *dma_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);
+
+ dma_data = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
+ free_irq(dma_data->irq, substream);
+
+ 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_pcm *pcm = rtd->pcm;
+
+ return snd_pcm_set_fixed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
+ pcm->card->dev,
+ ls_pcm_hardware.buffer_bytes_max);
+}
+
+static 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,
+};
+
+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 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,
+ .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;
+ }
+
+ ret = pci_request_region(pdev, BAR_NUM, LS_I2S_DRVNAME);
+ if (ret) {
+ dev_err(&pdev->dev, "request regions failed %d\n", ret);
+ return ret;
+ }
+
+ i2s = devm_kzalloc(&pdev->dev, sizeof(*i2s), GFP_KERNEL);
+ if (!i2s) {
+ ret = -ENOMEM;
+ goto err_release;
+ }
+ i2s->rev_id = pdev->revision;
+ i2s->dev = &pdev->dev;
+ pci_set_drvdata(pdev, i2s);
+
+ i2s->reg_base = pcim_iomap(pdev, BAR_NUM, 0);
+ if (!i2s->reg_base) {
+ dev_err(&pdev->dev, "pci_iomap_error\n");
+ ret = -EIO;
+ goto err_release;
+ }
+
+ i2s->regmap = devm_regmap_init_mmio(&pdev->dev, i2s->reg_base,
+ &loongson_i2s_regmap_config);
+ if (IS_ERR(i2s->regmap)) {
+ dev_err(&pdev->dev, "Failed to initialize register map");
+ ret = PTR_ERR(i2s->regmap);
+ goto err_release;
+ }
+
+ 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");
+ ret = tx_data->irq;
+ goto err_release;
+ }
+
+ rx_data->irq = fwnode_irq_get_byname(fwnode, "rx");
+ if (rx_data->irq < 0) {
+ dev_err(&pdev->dev, "dma rx irq invalid\n");
+ ret = rx_data->irq;
+ goto err_release;
+ }
+
+ device_property_read_u32(&pdev->dev, "clock-frequency", &i2s->clk_rate);
+ if (!i2s->clk_rate) {
+ dev_err(&pdev->dev, "clock-frequency property invalid\n");
+ ret = -EINVAL;
+ goto err_release;
+ }
+
+ dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+
+ loongson_i2s_init(i2s);
+
+ 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);
+ goto err_release;
+ }
+
+ return 0;
+err_release:
+ pci_release_region(pdev, BAR_NUM);
+ return ret;
+}
+
+static void loongson_i2s_pci_remove(struct pci_dev *pdev)
+{
+ pci_release_region(pdev, BAR_NUM);
+}
+
+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,
+ .remove = loongson_i2s_pci_remove,
+ .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
2
2
Re: [PATCH 6/7] ASoC: dt-bindings: mediatek,mt79xx-wm8960: add mt79xx-wm8960 document
by Krzysztof Kozlowski 14 Jun '23
by Krzysztof Kozlowski 14 Jun '23
14 Jun '23
On 14/06/2023 09:40, Maso Huang (黃加竹) wrote:
>>> Signed-off-by: Maso Huang <maso.huang(a)mediatek.com>
>>> ---
>>> .../sound/mediatek,mt79xx-wm8960.yaml | 53
>> +++++++++++++++++++
>>> 1 file changed, 53 insertions(+)
>>> create mode 100644
>> Documentation/devicetree/bindings/sound/mediatek,mt79xx-wm8960.yaml
>>>
>>> diff --git
>> a/Documentation/devicetree/bindings/sound/mediatek,mt79xx-wm8960.yaml
>> b/Documentation/devicetree/bindings/sound/mediatek,mt79xx-wm8960.yaml
>>> new file mode 100644
>>> index 000000000000..26b38bb629da
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/sound/mediatek,mt79xx-
>> wm8960.yaml
>>> @@ -0,0 +1,53 @@
>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>> +%YAML 1.2
>>> +---
>>> +$id:
>> http://devicetree.org/schemas/sound/mediatek,mt79xx-wm8960.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: MediaTek MT79xx ASOC sound card with WM8960 codec
>>
>> What is a MT79xx ASOC? Is it some specific SoC name? What does "A"
>> stands for in SoC? XX also looks odd, I thought Mediatek uses only
>> numbers.
>>
>
> I'll use mt7986 instead of mt79xx in v2 patch.
> And ASoC means ALSA SoC.
ALSA is Linux stuff, so does not belong to bindings. I have no clue what
is "ALSA SoC" (as SoC means System on Chip).
Please describe real hardware not Linux or your configuration or some SW.
Best regards,
Krzysztof
1
0
Re: [PATCH 7/7] ASoC: dt-bindings: mediatek,mt79xx-afe: add audio afe document
by Krzysztof Kozlowski 14 Jun '23
by Krzysztof Kozlowski 14 Jun '23
14 Jun '23
On 14/06/2023 09:37, Maso Huang (黃加竹) wrote:
>>>> I already saw AFE, why it cannot be part of existing bindings?
>>
>> Can you answer this?
>>
>
> Did you mean mtk-afe-pcm.txt?
> If yes, I'll modify mtk-afe-pcm.txt to yaml format, and add mt7986 to
> its compatible list.
>
No, I meant mediatek,mt8188-afe.yaml.
Aren't you working on some old tree? If so, please don't...
Best regards,
Krzysztof
1
0
Re: [PATCH 7/7] ASoC: dt-bindings: mediatek,mt79xx-afe: add audio afe document
by Krzysztof Kozlowski 14 Jun '23
by Krzysztof Kozlowski 14 Jun '23
14 Jun '23
On 14/06/2023 05:17, Maso Huang (黃加竹) wrote:
> On Tue, 2023-06-13 at 10:51 +0200, Krzysztof Kozlowski wrote:
>>
>> External email : Please do not click links or open attachments until
>> you have verified the sender or the content.
>>
>> On 12/06/2023 12:52, Maso Hunag wrote:
>>> From: Maso Huang <maso.huang(a)mediatek.com>
>>>
>>> Add mt79xx audio afe document.
>>
>> Please use scripts/get_maintainers.pl to get a list of necessary
>> people
>> and lists to CC. It might happen, that command when run on an older
>> kernel, gives you outdated entries. Therefore please be sure you
>> base
>> your patches on recent Linux kernel.
>>
>
> Hi Krzysztif,
>
> Thanks for your review. And sorry for missing some necessary
> maintainers.
> What's your suggestion, resend these patches again with them, or add
> them back in v2 patch?
You need to fix the patch anyway, so use get_maintainers.pl in v2. I
don't understand why you Cc here many unrelated people but not the
actual maintainers which get_maintainers.pl asks you to Cc!
>
>>>
>>> Signed-off-by: Maso Huang <maso.huang(a)mediatek.com>
>>> ---
>>> .../bindings/sound/mediatek,mt79xx-afe.yaml | 102
>> ++++++++++++++++++
>>> 1 file changed, 102 insertions(+)
>>> create mode 100644
>> Documentation/devicetree/bindings/sound/mediatek,mt79xx-afe.yaml
>>>
>>> diff --git
>> a/Documentation/devicetree/bindings/sound/mediatek,mt79xx-afe.yaml
>> b/Documentation/devicetree/bindings/sound/mediatek,mt79xx-afe.yaml
>>> new file mode 100644
>>> index 000000000000..11ef1cfdf49b
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/sound/mediatek,mt79xx-
>> afe.yaml
>>> @@ -0,0 +1,102 @@
>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>> +%YAML 1.2
>>> +---
>>> +$id: http://devicetree.org/schemas/sound/mediatek,mt79xx-afe.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: MediaTek AFE PCM controller for MT79xx
>>
>> 79XX sounds weird. Are you sure you are not using wildcards (which
>> are
>> not allowed)?
>>
>
> We would like to use mt79xx for mt7986/mt7981/mt7988 series.
> Or is it better to just use mt7986 for this series?
You cannot use wildcard. Get some internal review of your patches prior
to submission to mailing list.
https://elixir.bootlin.com/linux/v6.1-rc1/source/Documentation/devicetree/b…
>
>>> +
>>> +maintainers:
>>> + - Maso Huang <maso.huang(a)mediatek.com>
>>> +
>>> +properties:
>>> + compatible:
>>> + oneOf:
>>> + - const: mediatek,mt79xx-afe
>>> + - items:
>>> + - enum:
>>> + - mediatek,mt7981-afe
>>> + - mediatek,mt7986-afe
>>> + - mediatek,mt7988-afe
>>> + - const: mediatek,mt79xx-afe
>>
>> I already saw AFE, why it cannot be part of existing bindings?
Can you answer this?
>>
>> This list is odd. 79xx, 7981? So it is wildcard?
>>
>
> Yes, it is wildcard for mt7986/mt7981/mt7988 series.
> Is it better to just use mt7986 for this series?
No wildcards.
Best regards,
Krzysztof
1
0
HDA can only support single register read and write operations so does not
benefit from block writes. This means it gets no benefit from using the
rbtree register cache over the maple tree register cache so convert it to
use maple trees instead, it is more modern.
Signed-off-by: Mark Brown <broonie(a)kernel.org>
---
sound/hda/hdac_regmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/hda/hdac_regmap.c b/sound/hda/hdac_regmap.c
index fe3587547cfe..2caa1f9b858e 100644
--- a/sound/hda/hdac_regmap.c
+++ b/sound/hda/hdac_regmap.c
@@ -358,7 +358,7 @@ static const struct regmap_config hda_regmap_cfg = {
.writeable_reg = hda_writeable_reg,
.readable_reg = hda_readable_reg,
.volatile_reg = hda_volatile_reg,
- .cache_type = REGCACHE_RBTREE,
+ .cache_type = REGCACHE_MAPLE,
.reg_read = hda_reg_read,
.reg_write = hda_reg_write,
.use_single_read = true,
---
base-commit: 9561de3a55bed6bdd44a12820ba81ec416e705a7
change-id: 20230609-alsa-hda-maple-02f75ebb067e
Best regards,
--
Mark Brown <broonie(a)kernel.org>
2
10
bug in snd_usb_audio alsa driver, likely cause for audio freezes
by GitHub issues - opened 13 Jun '23
by GitHub issues - opened 13 Jun '23
13 Jun '23
alsa-project/alsa-lib issue #328 was opened from VMichailidis:
For the past few days I've been encountering this bug where during media playback audio will stop, a few seconds later the video will stop and allow the audio section to catch up. Also during voice calls and video games audio will occasionally stop.
Initially I was using pipewire and jounalctl wasn't reporting any issues, eventually I switched to pulseaudio. The switch didn't fix anything, however journalctl has been reporting the following message:
```
Jun 13 17:18:25 melchior pulseaudio[1347]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Jun 13 17:18:25 melchior pulseaudio[1347]: Most likely this is a bug in the ALSA driver 'snd_usb_audio'. Please report this issue to the ALSA developers.
Jun 13 17:18:25 melchior pulseaudio[1347]: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.
```
So I resolved to raise the issue here.
Here is the rest of the relevant journalctl output
```
journalctl | grep ALSA
Jun 07 22:12:14 melchior pulseaudio[44796]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Jun 07 22:12:14 melchior pulseaudio[44796]: Most likely this is a bug in the ALSA driver 'snd_usb_audio'. Please report this issue to the ALSA developers.
Jun 07 23:41:12 melchior pulseaudio[1273]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Jun 07 23:41:12 melchior pulseaudio[1273]: Most likely this is a bug in the ALSA driver 'snd_usb_audio'. Please report this issue to the ALSA developers.
Jun 08 01:39:23 melchior pulseaudio[946]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Jun 08 01:39:23 melchior pulseaudio[946]: Most likely this is a bug in the ALSA driver 'snd_usb_audio'. Please report this issue to the ALSA developers.
Jun 08 18:00:28 melchior pulseaudio[1495]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Jun 08 18:00:28 melchior pulseaudio[1495]: Most likely this is a bug in the ALSA driver 'snd_usb_audio'. Please report this issue to the ALSA developers.
Jun 09 23:18:45 melchior pulseaudio[1692]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Jun 09 23:18:45 melchior pulseaudio[1692]: Most likely this is a bug in the ALSA driver 'snd_usb_audio'. Please report this issue to the ALSA developers.
Jun 10 00:10:17 melchior pulseaudio[1516]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Jun 10 00:10:17 melchior pulseaudio[1516]: Most likely this is a bug in the ALSA driver 'snd_usb_audio'. Please report this issue to the ALSA developers.
Jun 10 15:00:28 melchior pulseaudio[1491]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Jun 10 15:00:28 melchior pulseaudio[1491]: Most likely this is a bug in the ALSA driver 'snd_usb_audio'. Please report this issue to the ALSA developers.
Jun 11 01:16:33 melchior pulseaudio[1346]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Jun 11 01:16:33 melchior pulseaudio[1346]: Most likely this is a bug in the ALSA driver 'snd_usb_audio'. Please report this issue to the ALSA developers.
Jun 11 13:30:54 melchior pulseaudio[1334]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Jun 11 13:30:54 melchior pulseaudio[1334]: Most likely this is a bug in the ALSA driver 'snd_usb_audio'. Please report this issue to the ALSA developers.
Jun 11 17:13:20 melchior pulseaudio[1644]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Jun 11 17:13:20 melchior pulseaudio[1644]: Most likely this is a bug in the ALSA driver 'snd_usb_audio'. Please report this issue to the ALSA developers.
Jun 12 19:53:14 melchior pulseaudio[1168]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Jun 12 19:53:14 melchior pulseaudio[1168]: Most likely this is a bug in the ALSA driver 'snd_usb_audio'. Please report this issue to the ALSA developers.
Jun 13 17:18:25 melchior pulseaudio[1347]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Jun 13 17:18:25 melchior pulseaudio[1347]: Most likely this is a bug in the ALSA driver 'snd_usb_audio'. Please report this issue to the ALSA developers.
```
```
journalctl | grep pulseaudio
Jun 07 21:51:03 melchior dbus-daemon[515]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.57' (uid=1000 pid=44796 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 07 21:51:03 melchior pulseaudio[44796]: Failed to open cookie file '/home/basil/.config/pulse/cookie': No such file or directory
Jun 07 21:51:03 melchior pulseaudio[44796]: Failed to load authentication key '/home/basil/.config/pulse/cookie': No such file or directory
Jun 07 21:51:03 melchior pulseaudio[44796]: stat('/etc/pulse/default.pa.d'): No such file or directory
Jun 07 22:12:14 melchior pulseaudio[44796]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Jun 07 22:12:14 melchior pulseaudio[44796]: Most likely this is a bug in the ALSA driver 'snd_usb_audio'. Please report this issue to the ALSA developers.
Jun 07 22:12:14 melchior pulseaudio[44796]: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.
Jun 07 22:48:10 melchior dbus-daemon[515]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.143' (uid=1000 pid=44796 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 07 22:48:10 melchior dbus-daemon[515]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.144' (uid=1000 pid=44796 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 07 22:48:10 melchior dbus-daemon[515]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.145' (uid=1000 pid=44796 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 07 22:48:10 melchior dbus-daemon[515]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.146' (uid=1000 pid=44796 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 07 22:48:10 melchior dbus-daemon[515]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.147' (uid=1000 pid=44796 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 07 22:48:10 melchior pulseaudio[44796]: Error opening PCM device iec958:3: No such file or directory
Jun 07 22:48:10 melchior systemd[563]: pulseaudio.service: Consumed 14.257s CPU time.
Jun 07 22:48:44 melchior dbus-daemon[563]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.18' (uid=1000 pid=1273 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 07 22:48:44 melchior pulseaudio[1273]: Failed to open cookie file '/home/basil/.config/pulse/cookie': No such file or directory
Jun 07 22:48:44 melchior pulseaudio[1273]: Failed to load authentication key '/home/basil/.config/pulse/cookie': No such file or directory
Jun 07 22:48:44 melchior pulseaudio[1273]: stat('/etc/pulse/default.pa.d'): No such file or directory
Jun 07 23:05:43 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.pci-0000_03_00.1.hdmi-stereo-extra3"
Jun 07 23:16:17 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_input.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.mono-fallback"
Jun 07 23:16:17 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.iec958-stereo.monitor"
Jun 07 23:16:40 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.iec958-stereo.monitor"
Jun 07 23:25:05 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.iec958-stereo"
Jun 07 23:25:05 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.iec958-stereo.monitor"
Jun 07 23:25:05 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.analog-stereo"
Jun 07 23:25:05 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.analog-stereo.monitor"
Jun 07 23:25:05 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.analog-stereo.monitor"
Jun 07 23:25:07 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.analog-stereo"
Jun 07 23:25:07 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.analog-stereo.monitor"
Jun 07 23:25:07 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.iec958-stereo"
Jun 07 23:25:07 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.iec958-stereo.monitor"
Jun 07 23:25:07 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.iec958-stereo.monitor"
Jun 07 23:25:10 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.iec958-stereo"
Jun 07 23:25:10 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.iec958-stereo.monitor"
Jun 07 23:25:10 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.analog-stereo"
Jun 07 23:25:10 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.analog-stereo.monitor"
Jun 07 23:25:10 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.analog-stereo.monitor"
Jun 07 23:41:12 melchior pulseaudio[1273]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Jun 07 23:41:12 melchior pulseaudio[1273]: Most likely this is a bug in the ALSA driver 'snd_usb_audio'. Please report this issue to the ALSA developers.
Jun 07 23:41:12 melchior pulseaudio[1273]: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.
Jun 07 23:49:49 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.analog-stereo.monitor"
Jun 08 00:05:37 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.analog-stereo.monitor"
Jun 08 00:22:52 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.analog-stereo"
Jun 08 00:22:52 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.analog-stereo.monitor"
Jun 08 00:22:52 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.iec958-stereo"
Jun 08 00:22:52 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.iec958-stereo.monitor"
Jun 08 00:22:52 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.iec958-stereo.monitor"
Jun 08 00:31:33 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.iec958-stereo"
Jun 08 00:31:33 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.iec958-stereo.monitor"
Jun 08 00:31:33 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.analog-stereo"
Jun 08 00:31:33 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_input.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.mono-fallback"
Jun 08 00:31:33 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_input.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.mono-fallback"
Jun 08 00:31:36 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_input.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.mono-fallback"
Jun 08 00:31:36 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.analog-stereo.monitor"
Jun 08 00:34:26 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.analog-stereo"
Jun 08 00:34:26 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.analog-stereo.monitor"
Jun 08 00:34:26 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.iec958-stereo"
Jun 08 00:34:26 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.iec958-stereo.monitor"
Jun 08 00:34:26 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.iec958-stereo.monitor"
Jun 08 01:08:06 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.iec958-stereo.monitor"
Jun 08 01:14:21 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_input.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.mono-fallback"
Jun 08 01:14:21 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.iec958-stereo.monitor"
Jun 08 01:14:41 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.iec958-stereo.monitor"
Jun 08 01:38:21 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.iec958-stereo"
Jun 08 01:38:21 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.iec958-stereo"
Jun 08 01:38:21 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_output.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.iec958-stereo"
Jun 08 01:38:21 melchior kdeconnectd[824]: org.kde.pulseaudio: No object for name "alsa_input.usb-Elgato_Systems_Elgato_Wave_1_AS31J1A08137-00.mono-fallback"
Jun 08 01:38:21 melchior pulseaudio[1273]: Error opening PCM device hw:3: No such file or directory
Jun 08 01:38:21 melchior systemd[638]: pulseaudio.service: Consumed 1min 30.529s CPU time.
Jun 08 01:38:53 melchior dbus-daemon[491]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.14' (uid=1000 pid=946 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 08 01:38:53 melchior pulseaudio[946]: Failed to open cookie file '/home/basil/.config/pulse/cookie': No such file or directory
Jun 08 01:38:53 melchior pulseaudio[946]: Failed to load authentication key '/home/basil/.config/pulse/cookie': No such file or directory
Jun 08 01:38:53 melchior pulseaudio[946]: stat('/etc/pulse/default.pa.d'): No such file or directory
Jun 08 01:39:23 melchior pulseaudio[946]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Jun 08 01:39:23 melchior pulseaudio[946]: Most likely this is a bug in the ALSA driver 'snd_usb_audio'. Please report this issue to the ALSA developers.
Jun 08 01:39:23 melchior pulseaudio[946]: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.
Jun 08 02:01:24 melchior dbus-daemon[491]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.37' (uid=1000 pid=946 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 08 02:01:24 melchior dbus-daemon[491]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.38' (uid=1000 pid=946 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 08 02:01:24 melchior dbus-daemon[491]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.39' (uid=1000 pid=946 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 08 02:01:24 melchior dbus-daemon[491]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.40' (uid=1000 pid=946 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 08 02:01:24 melchior dbus-daemon[491]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.41' (uid=1000 pid=946 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 08 02:01:24 melchior systemd[610]: pulseaudio.service: Consumed 12.550s CPU time.
Jun 08 11:45:49 melchior dbus-daemon[516]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.18' (uid=1000 pid=1235 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 08 11:45:50 melchior pulseaudio[1235]: Failed to open cookie file '/home/basil/.config/pulse/cookie': No such file or directory
Jun 08 11:45:50 melchior pulseaudio[1235]: Failed to load authentication key '/home/basil/.config/pulse/cookie': No such file or directory
Jun 08 11:45:50 melchior pulseaudio[1235]: stat('/etc/pulse/default.pa.d'): No such file or directory
Jun 08 12:32:43 melchior dbus-daemon[516]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.36' (uid=1000 pid=1235 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 08 12:32:43 melchior dbus-daemon[516]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.37' (uid=1000 pid=1235 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 08 12:32:43 melchior dbus-daemon[516]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.38' (uid=1000 pid=1235 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 08 12:32:43 melchior dbus-daemon[516]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.39' (uid=1000 pid=1235 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 08 12:32:43 melchior dbus-daemon[516]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.40' (uid=1000 pid=1235 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 08 12:32:43 melchior systemd[606]: pulseaudio.service: Consumed 12.826s CPU time.
Jun 08 17:56:45 melchior dbus-daemon[528]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.18' (uid=1000 pid=1495 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 08 17:56:46 melchior pulseaudio[1495]: Failed to open cookie file '/home/basil/.config/pulse/cookie': No such file or directory
Jun 08 17:56:46 melchior pulseaudio[1495]: Failed to load authentication key '/home/basil/.config/pulse/cookie': No such file or directory
Jun 08 17:56:46 melchior pulseaudio[1495]: stat('/etc/pulse/default.pa.d'): No such file or directory
Jun 08 18:00:28 melchior pulseaudio[1495]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Jun 08 18:00:28 melchior pulseaudio[1495]: Most likely this is a bug in the ALSA driver 'snd_usb_audio'. Please report this issue to the ALSA developers.
Jun 08 18:00:28 melchior pulseaudio[1495]: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.
Jun 09 02:20:10 melchior dbus-daemon[528]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.111' (uid=1000 pid=1495 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 09 02:20:10 melchior dbus-daemon[528]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.112' (uid=1000 pid=1495 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 09 02:20:10 melchior dbus-daemon[528]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.113' (uid=1000 pid=1495 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 09 02:20:10 melchior dbus-daemon[528]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.114' (uid=1000 pid=1495 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 09 02:20:10 melchior dbus-daemon[528]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.115' (uid=1000 pid=1495 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 09 02:20:10 melchior systemd[616]: pulseaudio.service: Consumed 1min 809ms CPU time.
Jun 09 19:31:43 melchior dbus-daemon[496]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.23' (uid=1000 pid=1692 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 09 19:31:44 melchior pulseaudio[1692]: Failed to open cookie file '/home/basil/.config/pulse/cookie': No such file or directory
Jun 09 19:31:44 melchior pulseaudio[1692]: Failed to load authentication key '/home/basil/.config/pulse/cookie': No such file or directory
Jun 09 19:31:44 melchior pulseaudio[1692]: stat('/etc/pulse/default.pa.d'): No such file or directory
Jun 09 23:18:45 melchior pulseaudio[1692]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Jun 09 23:18:45 melchior pulseaudio[1692]: Most likely this is a bug in the ALSA driver 'snd_usb_audio'. Please report this issue to the ALSA developers.
Jun 09 23:18:45 melchior pulseaudio[1692]: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.
Jun 10 00:08:24 melchior dbus-daemon[496]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.53' (uid=1000 pid=1692 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 10 00:08:24 melchior dbus-daemon[496]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.54' (uid=1000 pid=1692 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 10 00:08:24 melchior dbus-daemon[496]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.55' (uid=1000 pid=1692 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 10 00:08:24 melchior dbus-daemon[496]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.56' (uid=1000 pid=1692 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 10 00:08:24 melchior dbus-daemon[496]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.57' (uid=1000 pid=1692 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 10 00:08:24 melchior pulseaudio[1692]: Error opening PCM device hw:3: No such file or directory
Jun 10 00:08:24 melchior systemd[615]: pulseaudio.service: Consumed 21.103s CPU time.
Jun 10 00:09:16 melchior dbus-daemon[505]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.18' (uid=1000 pid=1516 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 10 00:09:16 melchior pulseaudio[1516]: Failed to open cookie file '/home/basil/.config/pulse/cookie': No such file or directory
Jun 10 00:09:16 melchior pulseaudio[1516]: Failed to load authentication key '/home/basil/.config/pulse/cookie': No such file or directory
Jun 10 00:09:16 melchior pulseaudio[1516]: stat('/etc/pulse/default.pa.d'): No such file or directory
Jun 10 00:10:17 melchior pulseaudio[1516]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Jun 10 00:10:17 melchior pulseaudio[1516]: Most likely this is a bug in the ALSA driver 'snd_usb_audio'. Please report this issue to the ALSA developers.
Jun 10 00:10:17 melchior pulseaudio[1516]: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.
Jun 10 00:41:02 melchior dbus-daemon[505]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.28' (uid=1000 pid=1516 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 10 00:41:02 melchior dbus-daemon[505]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.29' (uid=1000 pid=1516 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 10 00:41:02 melchior dbus-daemon[505]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.30' (uid=1000 pid=1516 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 10 00:41:02 melchior dbus-daemon[505]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.31' (uid=1000 pid=1516 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 10 00:41:02 melchior dbus-daemon[505]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.32' (uid=1000 pid=1516 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 10 00:41:02 melchior systemd[627]: pulseaudio.service: Consumed 12.940s CPU time.
Jun 10 14:47:13 melchior dbus-daemon[472]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.18' (uid=1000 pid=1491 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 10 14:47:13 melchior pulseaudio[1491]: Failed to open cookie file '/home/basil/.config/pulse/cookie': No such file or directory
Jun 10 14:47:13 melchior pulseaudio[1491]: Failed to load authentication key '/home/basil/.config/pulse/cookie': No such file or directory
Jun 10 14:47:13 melchior pulseaudio[1491]: stat('/etc/pulse/default.pa.d'): No such file or directory
Jun 10 15:00:28 melchior pulseaudio[1491]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Jun 10 15:00:28 melchior pulseaudio[1491]: Most likely this is a bug in the ALSA driver 'snd_usb_audio'. Please report this issue to the ALSA developers.
Jun 10 15:00:28 melchior pulseaudio[1491]: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.
Jun 10 15:27:53 melchior dbus-daemon[472]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.35' (uid=1000 pid=1491 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 10 15:27:53 melchior dbus-daemon[472]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.36' (uid=1000 pid=1491 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 10 15:27:53 melchior dbus-daemon[472]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.37' (uid=1000 pid=1491 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 10 15:27:53 melchior dbus-daemon[472]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.38' (uid=1000 pid=1491 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 10 15:27:53 melchior dbus-daemon[472]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.39' (uid=1000 pid=1491 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 10 15:27:53 melchior pulseaudio[1491]: Error opening PCM device iec958:3: No such file or directory
Jun 10 15:27:53 melchior systemd[618]: pulseaudio.service: Consumed 7.926s CPU time.
Jun 10 18:38:08 melchior dbus-daemon[492]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.18' (uid=1000 pid=1304 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 10 18:38:08 melchior pulseaudio[1304]: Failed to open cookie file '/home/basil/.config/pulse/cookie': No such file or directory
Jun 10 18:38:08 melchior pulseaudio[1304]: Failed to load authentication key '/home/basil/.config/pulse/cookie': No such file or directory
Jun 10 18:38:08 melchior pulseaudio[1304]: stat('/etc/pulse/default.pa.d'): No such file or directory
Jun 10 22:55:47 melchior dbus-daemon[492]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.90' (uid=1000 pid=1304 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 10 22:55:47 melchior dbus-daemon[492]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.91' (uid=1000 pid=1304 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 10 22:55:47 melchior dbus-daemon[492]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.92' (uid=1000 pid=1304 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 10 22:55:47 melchior dbus-daemon[492]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.93' (uid=1000 pid=1304 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 10 22:55:47 melchior dbus-daemon[492]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.94' (uid=1000 pid=1304 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 10 22:55:47 melchior systemd[612]: pulseaudio.service: Consumed 20.163s CPU time.
Jun 11 00:59:13 melchior dbus-daemon[513]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.18' (uid=1000 pid=1346 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 11 00:59:14 melchior pulseaudio[1346]: Failed to open cookie file '/home/basil/.config/pulse/cookie': No such file or directory
Jun 11 00:59:14 melchior pulseaudio[1346]: Failed to load authentication key '/home/basil/.config/pulse/cookie': No such file or directory
Jun 11 00:59:14 melchior pulseaudio[1346]: stat('/etc/pulse/default.pa.d'): No such file or directory
Jun 11 01:16:33 melchior pulseaudio[1346]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Jun 11 01:16:33 melchior pulseaudio[1346]: Most likely this is a bug in the ALSA driver 'snd_usb_audio'. Please report this issue to the ALSA developers.
Jun 11 01:16:33 melchior pulseaudio[1346]: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.
Jun 11 01:29:42 melchior dbus-daemon[513]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.39' (uid=1000 pid=1346 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 11 01:29:42 melchior dbus-daemon[513]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.40' (uid=1000 pid=1346 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 11 01:29:42 melchior dbus-daemon[513]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.41' (uid=1000 pid=1346 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 11 01:29:42 melchior dbus-daemon[513]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.42' (uid=1000 pid=1346 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 11 01:29:42 melchior dbus-daemon[513]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.43' (uid=1000 pid=1346 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 11 01:29:42 melchior pulseaudio[1346]: Error opening PCM device hw:3: No such file or directory
Jun 11 01:29:42 melchior systemd[638]: pulseaudio.service: Consumed 7.162s CPU time.
Jun 11 11:37:46 melchior dbus-daemon[468]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.18' (uid=1000 pid=1334 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 11 11:37:46 melchior pulseaudio[1334]: Failed to open cookie file '/home/basil/.config/pulse/cookie': No such file or directory
Jun 11 11:37:46 melchior pulseaudio[1334]: Failed to load authentication key '/home/basil/.config/pulse/cookie': No such file or directory
Jun 11 11:37:46 melchior pulseaudio[1334]: stat('/etc/pulse/default.pa.d'): No such file or directory
Jun 11 13:30:54 melchior pulseaudio[1334]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Jun 11 13:30:54 melchior pulseaudio[1334]: Most likely this is a bug in the ALSA driver 'snd_usb_audio'. Please report this issue to the ALSA developers.
Jun 11 13:30:54 melchior pulseaudio[1334]: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.
Jun 11 13:51:22 melchior dbus-daemon[468]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.57' (uid=1000 pid=1334 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 11 13:51:22 melchior dbus-daemon[468]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.58' (uid=1000 pid=1334 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 11 13:51:22 melchior dbus-daemon[468]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.59' (uid=1000 pid=1334 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 11 13:51:22 melchior dbus-daemon[468]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.60' (uid=1000 pid=1334 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 11 13:51:22 melchior dbus-daemon[468]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.61' (uid=1000 pid=1334 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 11 13:51:22 melchior pulseaudio[1334]: Error opening PCM device hw:3: No such file or directory
Jun 11 13:51:22 melchior systemd[618]: pulseaudio.service: Consumed 11.444s CPU time.
Jun 11 15:53:44 melchior dbus-daemon[536]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.18' (uid=1000 pid=1644 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 11 15:53:44 melchior pulseaudio[1644]: Failed to open cookie file '/home/basil/.config/pulse/cookie': No such file or directory
Jun 11 15:53:44 melchior pulseaudio[1644]: Failed to load authentication key '/home/basil/.config/pulse/cookie': No such file or directory
Jun 11 15:53:44 melchior pulseaudio[1644]: stat('/etc/pulse/default.pa.d'): No such file or directory
Jun 11 17:13:20 melchior pulseaudio[1644]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Jun 11 17:13:20 melchior pulseaudio[1644]: Most likely this is a bug in the ALSA driver 'snd_usb_audio'. Please report this issue to the ALSA developers.
Jun 11 17:13:20 melchior pulseaudio[1644]: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.
Jun 11 21:20:39 melchior dbus-daemon[536]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.63' (uid=1000 pid=1644 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 11 21:20:39 melchior dbus-daemon[536]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.64' (uid=1000 pid=1644 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 11 21:20:39 melchior dbus-daemon[536]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.65' (uid=1000 pid=1644 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 11 21:20:39 melchior dbus-daemon[536]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.66' (uid=1000 pid=1644 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 11 21:20:39 melchior dbus-daemon[536]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.67' (uid=1000 pid=1644 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 11 21:20:39 melchior systemd[621]: pulseaudio.service: Consumed 13.392s CPU time.
Jun 12 14:01:16 melchior dbus-daemon[472]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.16' (uid=1000 pid=1168 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 12 14:01:17 melchior pulseaudio[1168]: Failed to open cookie file '/home/basil/.config/pulse/cookie': No such file or directory
Jun 12 14:01:17 melchior pulseaudio[1168]: Failed to load authentication key '/home/basil/.config/pulse/cookie': No such file or directory
Jun 12 14:01:17 melchior pulseaudio[1168]: stat('/etc/pulse/default.pa.d'): No such file or directory
Jun 12 19:53:14 melchior pulseaudio[1168]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Jun 12 19:53:14 melchior pulseaudio[1168]: Most likely this is a bug in the ALSA driver 'snd_usb_audio'. Please report this issue to the ALSA developers.
Jun 12 19:53:14 melchior pulseaudio[1168]: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.
Jun 12 23:14:09 melchior dbus-daemon[472]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.71' (uid=1000 pid=1168 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 12 23:14:09 melchior dbus-daemon[472]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.72' (uid=1000 pid=1168 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 12 23:14:09 melchior dbus-daemon[472]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.73' (uid=1000 pid=1168 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 12 23:14:09 melchior dbus-daemon[472]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.74' (uid=1000 pid=1168 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 12 23:14:09 melchior dbus-daemon[472]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.75' (uid=1000 pid=1168 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 12 23:14:09 melchior systemd[652]: pulseaudio.service: Consumed 4min 4.210s CPU time.
Jun 12 23:14:41 melchior dbus-daemon[510]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.23' (uid=1000 pid=1890 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 12 23:14:42 melchior pulseaudio[1890]: Failed to open cookie file '/home/basil/.config/pulse/cookie': No such file or directory
Jun 12 23:14:42 melchior pulseaudio[1890]: Failed to load authentication key '/home/basil/.config/pulse/cookie': No such file or directory
Jun 12 23:14:42 melchior pulseaudio[1890]: stat('/etc/pulse/default.pa.d'): No such file or directory
Jun 12 23:22:19 melchior dbus-daemon[510]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.47' (uid=1000 pid=1890 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 12 23:22:19 melchior dbus-daemon[510]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.48' (uid=1000 pid=1890 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 12 23:22:19 melchior dbus-daemon[510]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.49' (uid=1000 pid=1890 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 12 23:22:19 melchior dbus-daemon[510]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.50' (uid=1000 pid=1890 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 12 23:22:19 melchior dbus-daemon[510]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.51' (uid=1000 pid=1890 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 12 23:22:19 melchior pulseaudio[1890]: Error opening PCM device hw:3: No such file or directory
Jun 12 23:22:19 melchior systemd[623]: pulseaudio.service: Consumed 2.341s CPU time.
Jun 13 15:42:21 melchior dbus-daemon[498]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.18' (uid=1000 pid=1347 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
Jun 13 15:42:21 melchior pulseaudio[1347]: Failed to open cookie file '/home/basil/.config/pulse/cookie': No such file or directory
Jun 13 15:42:21 melchior pulseaudio[1347]: Failed to load authentication key '/home/basil/.config/pulse/cookie': No such file or directory
Jun 13 15:42:21 melchior pulseaudio[1347]: stat('/etc/pulse/default.pa.d'): No such file or directory
Jun 13 17:18:25 melchior pulseaudio[1347]: ALSA woke us up to write new data to the device, but there was actually nothing to write.
Jun 13 17:18:25 melchior pulseaudio[1347]: Most likely this is a bug in the ALSA driver 'snd_usb_audio'. Please report this issue to the ALSA developers.
Jun 13 17:18:25 melchior pulseaudio[1347]: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.
```
Issue URL : https://github.com/alsa-project/alsa-lib/issues/328
Repository URL: https://github.com/alsa-project/alsa-lib
1
0
Several weeks ago, I sent a series [1] for adding a potentiometer as an
auxiliary device in ASoC. The feedback was that the potentiometer should
be directly handled in IIO (as other potentiometers) and something more
generic should be present in ASoC in order to have a binding to import
some IIO devices into sound cards.
The series related to the IIO potentiometer device is already applied.
This series introduces audio-iio-aux. Its goal is to offer the binding
between IIO and ASoC.
It exposes attached IIO devices as ASoC auxiliary devices and allows to
control them through mixer controls.
On my system, the IIO device is a potentiometer and it is present in an
amplifier design present in the audio path.
Compare to the previous iteration
https://lore.kernel.org/linux-kernel/20230523151223.109551-1-herve.codina@b…
This v3 series mainly:
- Reworks/Simplifies some IIO code.
- Reworks/Simplified the audio-iio-aux driver.
- Removes an already applied patch.
Best regards,
Hervé
[1] https://lore.kernel.org/linux-kernel/20230203111422.142479-1-herve.codina@b…
[2] https://lore.kernel.org/linux-kernel/20230421085245.302169-1-herve.codina@b…
Changes v2 -> v3
- Patches 1, 2
No changes.
- Patch 3, 4
Add 'Acked-by: Jonathan Cameron <Jonathan.Cameron(a)huawei.com>'.
- Patch 5 (new in v3)
Removed the 'unused' variable and check the null pointer when used.
- Patch 6 (new in v3)
Introduce {min,max}_array().
- Patch 7 (new in v3)
Use max_array() in iio_channel_read_max().
- Patch 8 (new in v3)
Replace a FIXME comment by a TODO one.
- Patch 9 (patch 5 in v2)
Removed the 'unused' variable and check the null pointer when used.
Use min_array().
Remplace a FIXME comment by a TODO one.
- Patch 10 (patch 6 in v2)
Convert existing macros to return a compound litteral instead of
adding a new helper.
- Patch 11 (patch 7 in v2)
Remove the file name from the C file header.
Use directly converted DAPM macros.
Replace <linux/module.h> by <linux/mod_devicetable.h>.
Add <linux/platform_device.h>.
Be sure that min <= max. Swap values if it is not the case.
Move the bool structure member after the int ones.
Remove unneeded assignements.
Use dev_err_probe() when relevant.
Use str_on_off().
Use static_assert() instead of BUILD_BUG_ON().
Remove unneeded comma and blank line.
Use device_property_*() instead of the OF API.
- patch 8 available in v2 removed as already applied
- Patch 12 (patch 9 in v2)
Use devm_add_action_or_reset().
Call simple_populate_aux() from simple_parse_of().
Changes v1 -> v2
- Patch 1
Rename simple-iio-aux to audio-iio-aux
Rename invert to snd-control-invert-range
Remove the /schemas/iio/iio-consumer.yaml reference
Remove the unneeded '|' after description
- Patch 2 (new in v2)
Introduce the simple-audio-card additional-devs subnode
- Patch 3 (new in v2)
Check err before switch() in iio_channel_read_max()
- Patch 4 (new in v2)
Fix raw reads and raw writes documentation
- Patch 5 (patch 2 in v1)
Check err before switch() in iio_channel_read_min()
Fix documentation
- Patch 6 (path 3 in v1)
No changes
- Patch 7 (patch 4 in v1)
Rename simple-iio-aux to audio-iio-aux
Rename invert to snd-control-invert-range
Remove the mask usage from audio_iio_aux_{get,put}_volsw helpers
Use directly PTR_ERR() in dev_err_probe() parameter
Remove the '!!' construction
Remove of_match_ptr()
- Patch 8 (new in v2)
Add a missing of_node_put() in the simple-card driver
- Patch 9 (new in v2)
Handle additional-devs in the simple-card driver
Herve Codina (12):
ASoC: dt-bindings: Add audio-iio-aux
ASoC: dt-bindings: simple-card: Add additional-devs subnode
iio: inkern: Check error explicitly in iio_channel_read_max()
iio: consumer.h: Fix raw values documentation notes
iio: inkern: Remove the 'unused' variable usage in
iio_channel_read_max()
minmax: Introduce {min,max}_array()
iio: inkern: Use max_array() to get the maximum value from an array
iio: inkern: Replace a FIXME comment by a TODO one
iio: inkern: Add a helper to query an available minimum raw value
ASoC: soc-dapm.h: Convert macros to return a compound litteral
ASoC: codecs: Add support for the generic IIO auxiliary devices
ASoC: simple-card: Handle additional devices
.../bindings/sound/audio-iio-aux.yaml | 64 ++++
.../bindings/sound/simple-card.yaml | 53 +++
drivers/iio/inkern.c | 84 ++++-
include/linux/iio/consumer.h | 37 +-
include/linux/minmax.h | 26 ++
include/sound/soc-dapm.h | 138 +++++---
sound/soc/codecs/Kconfig | 12 +
sound/soc/codecs/Makefile | 2 +
sound/soc/codecs/audio-iio-aux.c | 334 ++++++++++++++++++
sound/soc/generic/simple-card.c | 46 ++-
10 files changed, 726 insertions(+), 70 deletions(-)
create mode 100644 Documentation/devicetree/bindings/sound/audio-iio-aux.yaml
create mode 100644 sound/soc/codecs/audio-iio-aux.c
--
2.40.1
2
28
A lot of the Cirrus Logic devices only support single register
read/write operations so they get no benefit from using the rbtree cache
over the more modern maple tree cache, convert them to use maple tree.
Signed-off-by: Mark Brown <broonie(a)kernel.org>
---
Mark Brown (10):
ASoC: cs35l32: Use maple tree register cache
ASoC: cs35l33: Use maple tree register cache
ASoC: cs35l34: Use maple tree register cache
ASoC: cs35l35: Use maple tree register cache
ASoC: cs4234: Use maple tree register cache
ASoC: cs42l42: Use maple tree register cache
ASoC: cs42l73: Use maple tree register cache
ASoC: cs42l83: Use maple tree register cache
ASoC: cs43130: Use maple tree register cache
ASoC: cs35l30: Use maple tree register cache
sound/soc/codecs/cs35l32.c | 2 +-
sound/soc/codecs/cs35l33.c | 2 +-
sound/soc/codecs/cs35l34.c | 2 +-
sound/soc/codecs/cs35l35.c | 2 +-
sound/soc/codecs/cs4234.c | 2 +-
sound/soc/codecs/cs42l42.c | 2 +-
sound/soc/codecs/cs42l73.c | 2 +-
sound/soc/codecs/cs42l83-i2c.c | 2 +-
sound/soc/codecs/cs43130.c | 2 +-
sound/soc/codecs/cs53l30.c | 2 +-
10 files changed, 10 insertions(+), 10 deletions(-)
---
base-commit: 9561de3a55bed6bdd44a12820ba81ec416e705a7
change-id: 20230609-asoc-cirrus-maple-0aba1f5c18b8
Best regards,
--
Mark Brown <broonie(a)kernel.org>
3
13