From patchwork Fri Apr 14 14:01:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pawe=C5=82_Anikiel?= X-Patchwork-Id: 673383 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 89E85C7619A for ; Sat, 15 Apr 2023 09:12:00 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 15DE9DF6; Sat, 15 Apr 2023 11:11:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 15DE9DF6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1681549918; bh=RT4yJYI5H2AobLkSw8uXw6rTby6gpKVFlISC3mnwxvM=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Reply-To:Cc:From; b=MbQqJ4HJzeHULJNd68ruDO2TFg+ywYrUSjDsyUoxjmqVI1ifwTyw5yfj1A/FV1c7p 1SbkXDFxW6l1dT35q4lU318sJYG+1aGPWh3XC2HTilMd8xloKUk6EyX5QHL14ACv6x Q/q5lbznjoF690SXTW8SZuYLtor5uMfVHgQrmeW8= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 08453F80552; Sat, 15 Apr 2023 11:09:32 +0200 (CEST) To: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, broonie@kernel.org Subject: [PATCH 1/9] ASoC: Add Chameleon v3 audio Date: Fri, 14 Apr 2023 16:01:55 +0200 In-Reply-To: <20230414140203.707729-1-pan@semihalf.com> References: <20230414140203.707729-1-pan@semihalf.com> X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 X-Mailman-Approved-At: Sat, 15 Apr 2023 09:08:57 +0000 X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <168154977110.26.6195665054524433476@mailman-core.alsa-project.org> X-Patchwork-Original-From: =?utf-8?q?Pawe=C5=82_Anikiel_via_Alsa-devel?= From: =?utf-8?q?Pawe=C5=82_Anikiel?= Reply-To: =?utf-8?q?Pawe=C5=82_Anikiel?= Cc: tiwai@suse.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dinguyen@kernel.org, lars@metafoo.de, nuno.sa@analog.com, upstream@semihalf.com, =?utf-8?q?Pawe=C5=82_Anikiel?= Content-Disposition: inline Add machine and platform drivers for ASoC audio on Chameleon v3. The board has two audio sources: HDMI audio from the it68051 chip (RX only), and analog audio from the ssm2603 chip (RX and TX). Signed-off-by: Paweł Anikiel --- .../boot/dts/socfpga_arria10_chameleonv3.dts | 28 ++ sound/soc/Kconfig | 1 + sound/soc/Makefile | 1 + sound/soc/chameleonv3/Kconfig | 7 + sound/soc/chameleonv3/Makefile | 2 + sound/soc/chameleonv3/chv3-audio.c | 111 ++++++ sound/soc/chameleonv3/chv3-i2s.c | 347 ++++++++++++++++++ sound/soc/chameleonv3/chv3-it68051.c | 41 +++ 8 files changed, 538 insertions(+) create mode 100644 sound/soc/chameleonv3/Kconfig create mode 100644 sound/soc/chameleonv3/Makefile create mode 100644 sound/soc/chameleonv3/chv3-audio.c create mode 100644 sound/soc/chameleonv3/chv3-i2s.c create mode 100644 sound/soc/chameleonv3/chv3-it68051.c diff --git a/arch/arm/boot/dts/socfpga_arria10_chameleonv3.dts b/arch/arm/boot/dts/socfpga_arria10_chameleonv3.dts index 422d00cd4c74..c75f41058196 100644 --- a/arch/arm/boot/dts/socfpga_arria10_chameleonv3.dts +++ b/arch/arm/boot/dts/socfpga_arria10_chameleonv3.dts @@ -15,6 +15,34 @@ aliases { i2c0 = &i2c0; i2c1 = &i2c1; }; + + soc { + i2s0: i2s@c0060300 { + compatible = "google,chv3-i2s"; + reg = <0xc0060300 0x100>, + <0xc0060f00 0x10>; + interrupts = <0 20 IRQ_TYPE_LEVEL_HIGH>; + }; + + i2s1: i2s@c0060400 { + compatible = "google,chv3-i2s"; + reg = <0xc0060400 0x100>, + <0xc0060f10 0x10>; + interrupts = <0 21 IRQ_TYPE_LEVEL_HIGH>; + }; + }; + + sound { + compatible = "google,chv3-audio"; + google,audio-cpu0 = <&i2s1>; + google,audio-codec0 = <&ssm2603>; + google,audio-cpu1 = <&i2s0>; + google,audio-codec1 = <&it68051>; + }; + + it68051: audio-codec { + compatible = "ite,it68051"; + }; }; &gmac0 { diff --git a/sound/soc/Kconfig b/sound/soc/Kconfig index 848fbae26c3b..d5a24819a0eb 100644 --- a/sound/soc/Kconfig +++ b/sound/soc/Kconfig @@ -72,6 +72,7 @@ source "sound/soc/apple/Kconfig" source "sound/soc/atmel/Kconfig" source "sound/soc/au1x/Kconfig" source "sound/soc/bcm/Kconfig" +source "sound/soc/chameleonv3/Kconfig" source "sound/soc/cirrus/Kconfig" source "sound/soc/dwc/Kconfig" source "sound/soc/fsl/Kconfig" diff --git a/sound/soc/Makefile b/sound/soc/Makefile index 507eaed1d6a1..5572f4ebe59e 100644 --- a/sound/soc/Makefile +++ b/sound/soc/Makefile @@ -40,6 +40,7 @@ obj-$(CONFIG_SND_SOC) += amd/ obj-$(CONFIG_SND_SOC) += atmel/ obj-$(CONFIG_SND_SOC) += au1x/ obj-$(CONFIG_SND_SOC) += bcm/ +obj-$(CONFIG_SND_SOC) += chameleonv3/ obj-$(CONFIG_SND_SOC) += cirrus/ obj-$(CONFIG_SND_SOC) += dwc/ obj-$(CONFIG_SND_SOC) += fsl/ diff --git a/sound/soc/chameleonv3/Kconfig b/sound/soc/chameleonv3/Kconfig new file mode 100644 index 000000000000..8386c44d6e92 --- /dev/null +++ b/sound/soc/chameleonv3/Kconfig @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0-only +config SND_SOC_CHV3 + tristate "SoC Audio support for Chameleon v3" + select SND_SOC_SSM2602 + select SND_SOC_SSM2602_I2C + help + Say Y if you want to add audio support for the Chameleon v3. diff --git a/sound/soc/chameleonv3/Makefile b/sound/soc/chameleonv3/Makefile new file mode 100644 index 000000000000..a542ad412b93 --- /dev/null +++ b/sound/soc/chameleonv3/Makefile @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-only +obj-$(CONFIG_SND_SOC_CHV3) += chv3-i2s.o chv3-audio.o chv3-it68051.o diff --git a/sound/soc/chameleonv3/chv3-audio.c b/sound/soc/chameleonv3/chv3-audio.c new file mode 100644 index 000000000000..e860447c2cef --- /dev/null +++ b/sound/soc/chameleonv3/chv3-audio.c @@ -0,0 +1,111 @@ +// SPDX-License-Identifier: GPL-2.0-only +#include +#include +#include + +#include + +static int chv3_ssm2603_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); + struct snd_soc_dai *dai = asoc_rtd_to_codec(rtd, 0); + + return snd_soc_dai_set_sysclk(dai, 0, 22579200, SND_SOC_CLOCK_IN); +} + +static const struct snd_soc_ops chv3_ssm2603_ops = { + .hw_params = chv3_ssm2603_hw_params, +}; + +SND_SOC_DAILINK_DEFS(ssm2603, + DAILINK_COMP_ARRAY(COMP_CPU("chv3-i2s")), + DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "ssm2602-hifi")), /* 2602 - not a typo */ + DAILINK_COMP_ARRAY(COMP_EMPTY())); + +SND_SOC_DAILINK_DEFS(it68051, + DAILINK_COMP_ARRAY(COMP_CPU("chv3-i2s")), + DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "it68051-hifi")), + DAILINK_COMP_ARRAY(COMP_EMPTY())); + +static struct snd_soc_dai_link chv3_audio_dais[] = { +{ + .name = "ssm2603", + .stream_name = "ssm2603 PCM", + .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBM_CFM, + .ops = &chv3_ssm2603_ops, + SND_SOC_DAILINK_REG(ssm2603), +}, +{ + .name = "it68051", + .stream_name = "it68051 PCM", + .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBM_CFM, + SND_SOC_DAILINK_REG(it68051), +}, +}; + +static struct snd_soc_card chv3_audio_card = { + .name = "chv3-audio", + .owner = THIS_MODULE, + .dai_link = chv3_audio_dais, + .num_links = 2, +}; + +static int chv3_audio_probe(struct platform_device *pdev) +{ + struct snd_soc_card *card = &chv3_audio_card; + struct device_node *np; + + card->dev = &pdev->dev; + + np = of_parse_phandle(pdev->dev.of_node, "google,audio-cpu0", 0); + if (!np) { + dev_err(&pdev->dev, "no google,audio-cpu0 property\n"); + return -EINVAL; + } + chv3_audio_dais[0].cpus->of_node = np; + chv3_audio_dais[0].platforms->of_node = np; + + np = of_parse_phandle(pdev->dev.of_node, "google,audio-codec0", 0); + if (!np) { + dev_err(&pdev->dev, "no google,audio-codec0 property\n"); + return -EINVAL; + } + chv3_audio_dais[0].codecs->of_node = np; + + np = of_parse_phandle(pdev->dev.of_node, "google,audio-cpu1", 0); + if (!np) { + dev_err(&pdev->dev, "no google,audio-cpu1 property\n"); + return -EINVAL; + } + chv3_audio_dais[1].cpus->of_node = np; + chv3_audio_dais[1].platforms->of_node = np; + + np = of_parse_phandle(pdev->dev.of_node, "google,audio-codec1", 0); + if (!np) { + dev_err(&pdev->dev, "no google,audio-codec1 property\n"); + return -EINVAL; + } + chv3_audio_dais[1].codecs->of_node = np; + + return devm_snd_soc_register_card(card->dev, card); +} + +static const struct of_device_id chv3_audio_dt_ids[] = { + { .compatible = "google,chv3-audio" }, + { }, +}; + +static struct platform_driver chv3_audio_driver = { + .driver = { + .name = "chv3-audio", + .of_match_table = of_match_ptr(chv3_audio_dt_ids), + }, + .probe = chv3_audio_probe, +}; + +module_platform_driver(chv3_audio_driver); + +MODULE_AUTHOR("Pawel Anikiel "); +MODULE_DESCRIPTION("ALSA SoC Chameleon v3 audio driver"); +MODULE_LICENSE("GPL"); diff --git a/sound/soc/chameleonv3/chv3-i2s.c b/sound/soc/chameleonv3/chv3-i2s.c new file mode 100644 index 000000000000..e946bff2e6fc --- /dev/null +++ b/sound/soc/chameleonv3/chv3-i2s.c @@ -0,0 +1,347 @@ +// SPDX-License-Identifier: GPL-2.0-only +#include +#include +#include + +#include + +/* + * The I2S interface consists of two ring buffers - one for RX and one for + * TX. A ring buffer has a producer index and a consumer index. Depending + * on which way the data is flowing, either the software or the hardware + * writes data and updates the producer index, and the other end reads data + * and updates the consumer index. + * + * The pointer managed by software is updated using the .ack callback + * (see chv3_dma_ack). This seems to be the only way to reliably obtain + * the appl_ptr from within the driver and pass it to hardware. + * + * Because of the two pointer design, the ring buffer can never be full. With + * capture this isn't a problem, because the hardware being the producer + * will wait for the consumer index to move out of the way. With playback, + * however, this is problematic, because ALSA wants to fill up the buffer + * completely when waiting for hardware. In the .ack callback, the driver + * would have to wait for the consumer index to move out of the way by + * busy-waiting, which would keep stalling the kernel for quite a long time. + * + * The workaround to this problem is to "lie" to ALSA that the hw_pointer + * is one period behind what it actually is (see chv3_dma_pointer). This + * way, ALSA will not try to fill up the entire buffer, and all callbacks + * are wait-free. + */ + +#define I2S_TX_ENABLE 0x00 +#define I2S_TX_BASE_ADDR 0x04 +#define I2S_TX_BUFFER_SIZE 0x08 +#define I2S_TX_PRODUCER_IDX 0x0c +#define I2S_TX_CONSUMER_IDX 0x10 +#define I2S_RX_ENABLE 0x14 +#define I2S_RX_BASE_ADDR 0x18 +#define I2S_RX_BUFFER_SIZE 0x1c +#define I2S_RX_PRODUCER_IDX 0x20 +#define I2S_RX_CONSUMER_IDX 0x24 + +#define I2S_SOFT_RESET 0x2c +#define I2S_SOFT_RESET_RX_BIT 0x1 +#define I2S_SOFT_RESET_TX_BIT 0x2 + +#define I2S_RX_IRQ 0x4c +#define I2S_RX_IRQ_CONST 0x50 +#define I2S_TX_IRQ 0x54 +#define I2S_TX_IRQ_CONST 0x58 + +#define I2S_IRQ_MASK 0x8 +#define I2S_IRQ_CLR 0xc +#define I2S_IRQ_RX_BIT 0x1 +#define I2S_IRQ_TX_BIT 0x2 + +#define I2S_MAX_BUFFER_SIZE 0x200000 + +struct chv3_i2s_dev { + struct device *dev; + void __iomem *iobase; + void __iomem *iobase_irq; + struct snd_pcm_substream *rx_substream; + struct snd_pcm_substream *tx_substream; + int tx_bytes_to_fetch; + bool tx_ready; +}; + +static struct snd_soc_dai_driver chv3_i2s_dai = { + .name = "chv3-i2s", + .capture = { + .channels_min = 1, + .channels_max = 128, + .rates = SNDRV_PCM_RATE_CONTINUOUS, + .rate_min = 8000, + .rate_max = 96000, + .formats = SNDRV_PCM_FMTBIT_S32_LE, + }, + .playback = { + .channels_min = 1, + .channels_max = 128, + .rates = SNDRV_PCM_RATE_CONTINUOUS, + .rate_min = 8000, + .rate_max = 96000, + .formats = SNDRV_PCM_FMTBIT_S32_LE, + }, +}; + +static const struct snd_pcm_hardware chv3_dma_hw = { + .info = SNDRV_PCM_INFO_INTERLEAVED | + SNDRV_PCM_INFO_MMAP | + SNDRV_PCM_INFO_MMAP_VALID | + SNDRV_PCM_INFO_BLOCK_TRANSFER, + .buffer_bytes_max = I2S_MAX_BUFFER_SIZE, + .period_bytes_min = 64, + .period_bytes_max = 8192, + .periods_min = 4, + .periods_max = 256, +}; + +static inline void chv3_i2s_wr(struct chv3_i2s_dev *i2s, int offset, u32 val) +{ + writel(val, i2s->iobase + offset); +} + +static inline u32 chv3_i2s_rd(struct chv3_i2s_dev *i2s, int offset) +{ + return readl(i2s->iobase + offset); +} + +static irqreturn_t chv3_i2s_isr(int irq, void *data) +{ + struct chv3_i2s_dev *i2s = data; + u32 reg; + + reg = readl(i2s->iobase_irq + I2S_IRQ_CLR); + if (!reg) + return IRQ_NONE; + + if (reg & I2S_IRQ_RX_BIT) + snd_pcm_period_elapsed(i2s->rx_substream); + + if (reg & I2S_IRQ_TX_BIT) { + if (i2s->tx_ready) + snd_pcm_period_elapsed(i2s->tx_substream); + i2s->tx_ready = 1; + } + + writel(reg, i2s->iobase_irq + I2S_IRQ_CLR); + + return IRQ_HANDLED; +} + +static int chv3_dma_open(struct snd_soc_component *component, + struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); + struct chv3_i2s_dev *i2s = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0)); + int res; + + snd_soc_set_runtime_hwparams(substream, &chv3_dma_hw); + + res = snd_pcm_hw_constraint_pow2(substream->runtime, 0, + SNDRV_PCM_HW_PARAM_BUFFER_BYTES); + if (res) + return res; + + if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + i2s->rx_substream = substream; + else + i2s->tx_substream = substream; + + return 0; +} +static int chv3_dma_close(struct snd_soc_component *component, + struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); + struct chv3_i2s_dev *i2s = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0)); + + if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) + chv3_i2s_wr(i2s, I2S_RX_ENABLE, 0); + else + chv3_i2s_wr(i2s, I2S_TX_ENABLE, 0); + + return 0; +} + +static int chv3_dma_pcm_construct(struct snd_soc_component *component, + struct snd_soc_pcm_runtime *rtd) +{ + struct chv3_i2s_dev *i2s = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0)); + struct snd_pcm_substream *substream; + int res; + + substream = rtd->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; + if (substream) { + res = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, i2s->dev, + I2S_MAX_BUFFER_SIZE, &substream->dma_buffer); + if (res) + return res; + } + + substream = rtd->pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream; + if (substream) { + res = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, i2s->dev, + I2S_MAX_BUFFER_SIZE, &substream->dma_buffer); + if (res) + return res; + } + + return 0; +} + +static int chv3_dma_hw_params(struct snd_soc_component *component, + struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); + return 0; +} + +static int chv3_dma_prepare(struct snd_soc_component *component, + struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); + struct chv3_i2s_dev *i2s = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0)); + unsigned int buffer_bytes, period_bytes, period_size; + + buffer_bytes = snd_pcm_lib_buffer_bytes(substream); + period_bytes = snd_pcm_lib_period_bytes(substream); + period_size = substream->runtime->period_size; + + if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) { + chv3_i2s_wr(i2s, I2S_SOFT_RESET, I2S_SOFT_RESET_RX_BIT); + chv3_i2s_wr(i2s, I2S_RX_BASE_ADDR, substream->dma_buffer.addr); + chv3_i2s_wr(i2s, I2S_RX_BUFFER_SIZE, buffer_bytes); + chv3_i2s_wr(i2s, I2S_RX_IRQ, (period_size << 8) | 1); + chv3_i2s_wr(i2s, I2S_RX_ENABLE, 1); + } else { + i2s->tx_ready = 0; + chv3_i2s_wr(i2s, I2S_SOFT_RESET, I2S_SOFT_RESET_TX_BIT); + chv3_i2s_wr(i2s, I2S_TX_BASE_ADDR, substream->dma_buffer.addr); + chv3_i2s_wr(i2s, I2S_TX_BUFFER_SIZE, buffer_bytes); + chv3_i2s_wr(i2s, I2S_TX_IRQ, ((period_bytes / i2s->tx_bytes_to_fetch) << 8) | 1); + chv3_i2s_wr(i2s, I2S_TX_ENABLE, 1); + } + writel(I2S_IRQ_RX_BIT | I2S_IRQ_TX_BIT, i2s->iobase_irq + I2S_IRQ_MASK); + + return 0; +} + +static snd_pcm_uframes_t chv3_dma_pointer(struct snd_soc_component *component, + struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); + struct chv3_i2s_dev *i2s = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0)); + u32 period_bytes, buffer_bytes; + u32 idx_bytes; + + period_bytes = snd_pcm_lib_period_bytes(substream); + buffer_bytes = snd_pcm_lib_buffer_bytes(substream); + + if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) { + idx_bytes = chv3_i2s_rd(i2s, I2S_RX_PRODUCER_IDX); + } else { + idx_bytes = chv3_i2s_rd(i2s, I2S_TX_CONSUMER_IDX); + if (i2s->tx_ready) + idx_bytes = (idx_bytes - period_bytes) & (buffer_bytes - 1); + else + idx_bytes = 0; + } + + return bytes_to_frames(substream->runtime, idx_bytes); +} + +static int chv3_dma_ack(struct snd_soc_component *component, + struct snd_pcm_substream *substream) +{ + struct snd_pcm_runtime *runtime = substream->runtime; + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); + struct chv3_i2s_dev *i2s = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0)); + unsigned int bytes, idx; + + bytes = frames_to_bytes(runtime, runtime->control->appl_ptr); + idx = bytes & (snd_pcm_lib_buffer_bytes(substream) - 1); + + if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) + chv3_i2s_wr(i2s, I2S_RX_CONSUMER_IDX, idx); + else + chv3_i2s_wr(i2s, I2S_TX_PRODUCER_IDX, idx); + + return 0; +} + +static const struct snd_soc_component_driver chv3_i2s_comp = { + .name = "chv3-i2s-comp", + .open = chv3_dma_open, + .close = chv3_dma_close, + .pcm_construct = chv3_dma_pcm_construct, + .hw_params = chv3_dma_hw_params, + .prepare = chv3_dma_prepare, + .pointer = chv3_dma_pointer, + .ack = chv3_dma_ack, +}; + +static int chv3_i2s_probe(struct platform_device *pdev) +{ + struct chv3_i2s_dev *i2s; + int res; + int irq; + + i2s = devm_kzalloc(&pdev->dev, sizeof(*i2s), GFP_KERNEL); + if (!i2s) + return -ENOMEM; + + i2s->iobase = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(i2s->iobase)) + return PTR_ERR(i2s->iobase); + + i2s->iobase_irq = devm_platform_ioremap_resource(pdev, 1); + if (IS_ERR(i2s->iobase_irq)) + return PTR_ERR(i2s->iobase_irq); + + i2s->tx_bytes_to_fetch = (chv3_i2s_rd(i2s, I2S_TX_IRQ_CONST) >> 8) & 0xffff; + + i2s->dev = &pdev->dev; + dev_set_drvdata(&pdev->dev, i2s); + + irq = platform_get_irq(pdev, 0); + if (irq < 0) + return -ENXIO; + res = devm_request_irq(i2s->dev, irq, chv3_i2s_isr, 0, "chv3-i2s", i2s); + if (res) + return res; + + res = devm_snd_soc_register_component(&pdev->dev, &chv3_i2s_comp, + &chv3_i2s_dai, 1); + if (res) { + dev_err(&pdev->dev, "couldn't register component: %d\n", res); + return res; + } + + dev_info(&pdev->dev, "probed\n"); + + return 0; +} + +static const struct of_device_id chv3_i2s_of_match[] = { + { .compatible = "google,chv3-i2s" }, + {}, +}; + +static struct platform_driver chv3_i2s_driver = { + .probe = chv3_i2s_probe, + .driver = { + .name = "chv3-i2s", + .of_match_table = chv3_i2s_of_match, + }, +}; + +module_platform_driver(chv3_i2s_driver); + +MODULE_AUTHOR("Pawel Anikiel "); +MODULE_DESCRIPTION("Chameleon v3 I2S interface"); +MODULE_LICENSE("GPL"); diff --git a/sound/soc/chameleonv3/chv3-it68051.c b/sound/soc/chameleonv3/chv3-it68051.c new file mode 100644 index 000000000000..4813e699ec9c --- /dev/null +++ b/sound/soc/chameleonv3/chv3-it68051.c @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-2.0-only +#include +#include + +static struct snd_soc_dai_driver it68051_dai = { + .name = "it68051-hifi", + .capture = { + .stream_name = "Capture", + .channels_min = 8, + .channels_max = 8, + .rates = SNDRV_PCM_RATE_CONTINUOUS, + .formats = SNDRV_PCM_FMTBIT_S32_LE, + }, +}; + +static const struct snd_soc_component_driver soc_component_dev_it68051 = { +}; + +static int it68051_probe(struct platform_device *pdev) +{ + return devm_snd_soc_register_component(&pdev->dev, + &soc_component_dev_it68051, &it68051_dai, 1); +} + +static const struct of_device_id it68051_of_match[] = { + { .compatible = "ite,it68051", }, + { } +}; + +static struct platform_driver it68051_platform_driver = { + .driver = { + .name = "it68051", + .of_match_table = it68051_of_match, + }, + .probe = it68051_probe, +}; +module_platform_driver(it68051_platform_driver); + +MODULE_DESCRIPTION("ASoC IT68051 driver"); +MODULE_AUTHOR("Pawel Anikiel "); +MODULE_LICENSE("GPL"); From patchwork Fri Apr 14 14:01:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pawe=C5=82_Anikiel?= X-Patchwork-Id: 673384 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 45404C7619A for ; Sat, 15 Apr 2023 09:11:35 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0E81B86E; Sat, 15 Apr 2023 11:10:43 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0E81B86E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1681549893; bh=dPzhvhNtmpuYL2INdwllZ+OCLuQwF1O2dJxS5UbZZmU=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Reply-To:Cc:From; b=bVQEGQY5Eycy+BEhbyGps21iUsnrP3VajrX4drkEMXfqZy09QEV54l/yoGfg8/XQa Ej/+SVeAokaSFrQDO0suse63VyerDeqb96c9yviPdNhD+eW2qvc1GyfHHH1xYt6bFm 378PoI/SM3Rj8V1+WBI1QP9+Dz7vChqEh4B9C64k= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 0F2A2F8053D; Sat, 15 Apr 2023 11:09:29 +0200 (CEST) To: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, broonie@kernel.org Subject: [PATCH 2/9] dt-bindings: ASoC: Add chv3-i2s Date: Fri, 14 Apr 2023 16:01:56 +0200 In-Reply-To: <20230414140203.707729-1-pan@semihalf.com> References: <20230414140203.707729-1-pan@semihalf.com> X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 X-Mailman-Approved-At: Sat, 15 Apr 2023 09:08:57 +0000 X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <168154976821.26.18418440357031944166@mailman-core.alsa-project.org> X-Patchwork-Original-From: =?utf-8?q?Pawe=C5=82_Anikiel_via_Alsa-devel?= From: =?utf-8?q?Pawe=C5=82_Anikiel?= Reply-To: =?utf-8?q?Pawe=C5=82_Anikiel?= Cc: tiwai@suse.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dinguyen@kernel.org, lars@metafoo.de, nuno.sa@analog.com, upstream@semihalf.com, =?utf-8?q?Pawe=C5=82_Anikiel?= Content-Disposition: inline Add binding for chv3-i2s device. Signed-off-by: Paweł Anikiel --- .../bindings/sound/google,chv3-i2s.yaml | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/google,chv3-i2s.yaml diff --git a/Documentation/devicetree/bindings/sound/google,chv3-i2s.yaml b/Documentation/devicetree/bindings/sound/google,chv3-i2s.yaml new file mode 100644 index 000000000000..6f49cf059ac5 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/google,chv3-i2s.yaml @@ -0,0 +1,42 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/google,chv3-i2s.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Google Chameleon v3 I2S device + +maintainers: + - Paweł Anikiel + +description: | + I2S device for the Google Chameleon v3. The device handles both RX + and TX using a producer/consumer ring buffer design. + +properties: + compatible: + const: google,chv3-i2s + reg: + items: + - description: core registers + - description: irq registers + interrupts: + maxItems: 1 + +required: + - compatible + - reg + - interrupts + +additionalProperties: false + +examples: + - | + #include + + i2s0: i2s@c0060300 { + compatible = "google,chv3-i2s"; + reg = <0xc0060300 0x100>, + <0xc0060f00 0x10>; + interrupts = <0 20 IRQ_TYPE_LEVEL_HIGH>; + }; From patchwork Fri Apr 14 14:01:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pawe=C5=82_Anikiel?= X-Patchwork-Id: 674561 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C4F67C77B73 for ; Sat, 15 Apr 2023 09:11:16 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 92480A4A; Sat, 15 Apr 2023 11:10:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 92480A4A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1681549873; bh=cTPBEXxh/HiBnq0kzwtYZ8D9auqPitsgf2xFwU4eK28=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Reply-To:Cc:From; b=MPtbkBosDnFFZ5nJXoP0XYyf0bmUfx6A2VbE3qcl0Xdz4wlNQCPqRUwSXEkvv2ps9 uBGh1dDYsEX7wea3MQB5oQK7HBnHGp2Ebn2iwOkzEuk9qXuQpoGHryouj54dCE1yYC Hyb43n/Y+Gxudz5++E/s67WpL6O4Ab46w3Bm3HIk= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 99400F8052E; Sat, 15 Apr 2023 11:09:27 +0200 (CEST) To: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, broonie@kernel.org Subject: [PATCH 3/9] dt-bindings: ASoC: Add chv3-audio Date: Fri, 14 Apr 2023 16:01:57 +0200 In-Reply-To: <20230414140203.707729-1-pan@semihalf.com> References: <20230414140203.707729-1-pan@semihalf.com> X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 X-Mailman-Approved-At: Sat, 15 Apr 2023 09:08:57 +0000 X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <168154976667.26.16680054607697595873@mailman-core.alsa-project.org> X-Patchwork-Original-From: =?utf-8?q?Pawe=C5=82_Anikiel_via_Alsa-devel?= From: =?utf-8?q?Pawe=C5=82_Anikiel?= Reply-To: =?utf-8?q?Pawe=C5=82_Anikiel?= Cc: tiwai@suse.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dinguyen@kernel.org, lars@metafoo.de, nuno.sa@analog.com, upstream@semihalf.com, =?utf-8?q?Pawe=C5=82_Anikiel?= Content-Disposition: inline Add binding for chv3-audio device. Signed-off-by: Paweł Anikiel --- .../bindings/sound/google,chv3-audio.yaml | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/google,chv3-audio.yaml diff --git a/Documentation/devicetree/bindings/sound/google,chv3-audio.yaml b/Documentation/devicetree/bindings/sound/google,chv3-audio.yaml new file mode 100644 index 000000000000..8b602b60eaee --- /dev/null +++ b/Documentation/devicetree/bindings/sound/google,chv3-audio.yaml @@ -0,0 +1,49 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/google,chv3-audio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Google Chameleon v3 audio + +maintainers: + - Paweł Anikiel + +properties: + compatible: + const: google,chv3-audio + + google,audio-cpu0: + $ref: /schemas/types.yaml#/definitions/phandle + description: The phandle of controller #0 + + google,audio-codec0: + $ref: /schemas/types.yaml#/definitions/phandle + description: The phandle of codec #0 + + google,audio-cpu1: + $ref: /schemas/types.yaml#/definitions/phandle + description: The phandle of controller #1 + + google,audio-codec1: + $ref: /schemas/types.yaml#/definitions/phandle + description: The phandle of codec #1 + +required: + - compatible + - google,audio-cpu0: + - google,audio-codec0: + - google,audio-cpu1: + - google,audio-codec1: + +additionalProperties: false + +examples: + - | + sound { + compatible = "google,chv3-audio"; + google,audio-cpu0 = <&i2s1>; + google,audio-codec0 = <&ssm2603>; + google,audio-cpu1 = <&i2s0>; + google,audio-codec1 = <&it68051>; + }; From patchwork Fri Apr 14 14:01:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pawe=C5=82_Anikiel?= X-Patchwork-Id: 674558 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E17CBC7619A for ; Sat, 15 Apr 2023 09:12:50 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CB6D6AE8; Sat, 15 Apr 2023 11:11:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CB6D6AE8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1681549968; bh=zJOHL74Rw2OOuV1HsSBYFOjDRSXsAT2DALnYTa6sv0o=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Reply-To:Cc:From; b=qqgY3tB6t08DmICNK8/Enbx6MXs3lkxfegRXfKdWBn0zkRylTh7OuTEAwUQVuUzMn 0fmbHjFfZttZzEuZa21eAJY7rTA8oTEfOut0O6y683bxNpRmEp4gi7g1p474eBLdAv GV7jlk0e7qOd2tU/7zNDs0GY+WtUuoJig8Vp5p/c= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 3DAE8F80578; Sat, 15 Apr 2023 11:09:36 +0200 (CEST) To: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, broonie@kernel.org Subject: [PATCH 4/9] dt-bindings: ASoC: Add it68051 Date: Fri, 14 Apr 2023 16:01:58 +0200 In-Reply-To: <20230414140203.707729-1-pan@semihalf.com> References: <20230414140203.707729-1-pan@semihalf.com> X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 X-Mailman-Approved-At: Sat, 15 Apr 2023 09:09:07 +0000 X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <168154977537.26.15850185939544969041@mailman-core.alsa-project.org> X-Patchwork-Original-From: =?utf-8?q?Pawe=C5=82_Anikiel_via_Alsa-devel?= From: =?utf-8?q?Pawe=C5=82_Anikiel?= Reply-To: =?utf-8?q?Pawe=C5=82_Anikiel?= Cc: tiwai@suse.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dinguyen@kernel.org, lars@metafoo.de, nuno.sa@analog.com, upstream@semihalf.com, =?utf-8?q?Pawe=C5=82_Anikiel?= Content-Disposition: inline Add binding for it68051 device. Signed-off-by: Paweł Anikiel --- .../bindings/sound/ite,it68051.yaml | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/ite,it68051.yaml diff --git a/Documentation/devicetree/bindings/sound/ite,it68051.yaml b/Documentation/devicetree/bindings/sound/ite,it68051.yaml new file mode 100644 index 000000000000..341c171b8a8a --- /dev/null +++ b/Documentation/devicetree/bindings/sound/ite,it68051.yaml @@ -0,0 +1,23 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/ite,it68051.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: it68051 audio codec + +maintainers: + - Paweł Anikiel + +properties: + compatible: + const: ite,it68051 + +required: + - compatible + +examples: + - | + it68051: audio-codec { + compatible = "ite,it68051"; + }; From patchwork Fri Apr 14 14:01:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pawe=C5=82_Anikiel?= X-Patchwork-Id: 673382 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DE491C77B71 for ; Sat, 15 Apr 2023 09:12:44 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8DB2AA4B; Sat, 15 Apr 2023 11:11:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8DB2AA4B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1681549962; bh=AXUIMngCzsxNiINJkXbWpCesvLoamuuHv6HjOcT+zX4=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Reply-To:Cc:From; b=hibTOBxxrbcjBjY24jWsiLw0EpwfjeP8YldCWxmed//XdLmtkxk578zQ4QGwcZ9Yg 6jIKnLh/+fInqaN9XFHDpwQcGUrwWbylTeGV8iWBcr9xwVI1MRg6l/rg4+k4TvkTSN BBPXPSk+nByC5BcQgKMROzfYP8tha2EH6dWMl9U0= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id DA27FF80564; Sat, 15 Apr 2023 11:09:34 +0200 (CEST) To: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, broonie@kernel.org Subject: [PATCH 5/9] ASoC: ssm2602: Add workaround for playback with external MCLK Date: Fri, 14 Apr 2023 16:01:59 +0200 In-Reply-To: <20230414140203.707729-1-pan@semihalf.com> References: <20230414140203.707729-1-pan@semihalf.com> X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 X-Mailman-Approved-At: Sat, 15 Apr 2023 09:08:58 +0000 X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <168154977392.26.12888416405257429334@mailman-core.alsa-project.org> X-Patchwork-Original-From: =?utf-8?q?Pawe=C5=82_Anikiel_via_Alsa-devel?= From: =?utf-8?q?Pawe=C5=82_Anikiel?= Reply-To: =?utf-8?q?Pawe=C5=82_Anikiel?= Cc: tiwai@suse.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dinguyen@kernel.org, lars@metafoo.de, nuno.sa@analog.com, upstream@semihalf.com, =?utf-8?q?Pawe=C5=82_Anikiel?= Content-Disposition: inline Apply a workaround for what seems to be a hardware quirk: when using an external MCLK signal, powering on Output and DAC for the first time produces output distortions unless they're powered together with whole chip power. The workaround powers them on in probe for the first time, as doing it later may be impossible (e.g. when starting playback while recording, whole chip power will already be on). Here are some initialization sequences run after all other control registers were set (`ssmset reg val` sets the value of a register via i2c): ssmset 0x09 0x01 # core ssmset 0x06 0x07 # chip, out OK ssmset 0x09 0x01 # core ssmset 0x06 0x87 # out, dac ssmset 0x06 0x07 # chip OK (disable MCLK) ssmset 0x09 0x01 # core ssmset 0x06 0x1f # chip ssmset 0x06 0x07 # out, dac (enable MCLK) OK ssmset 0x09 0x01 # core ssmset 0x06 0x1f # chip ssmset 0x06 0x07 # out, dac NOT OK ssmset 0x06 0x1f # chip ssmset 0x09 0x01 # core ssmset 0x06 0x07 # out, dac NOT OK ssmset 0x09 0x01 # core ssmset 0x06 0x0f # chip, out ssmset 0x06 0x07 # dac NOT OK ssmset 0x09 0x01 # core ssmset 0x06 0x17 # chip, dac ssmset 0x06 0x07 # out NOT OK Here are some sequences run at the very start before a sw reset (and later using one of the NOT OK sequences from above): ssmset 0x09 0x01 # core ssmset 0x06 0x07 # chip, out, dac OK (disable MCLK) ssmset 0x09 0x01 # core ssmset 0x06 0x07 # chip, out, dac (enable MCLK after reset) NOT OK ssmset 0x09 0x01 # core ssmset 0x06 0x17 # chip, dac NOT OK ssmset 0x09 0x01 # core ssmset 0x06 0x0f # chip, out NOT OK ssmset 0x06 0x07 # chip, out, dac NOT OK This was tested on a Google Chameleon v3 board using an SSM2603 with an external MCLK. This doesn't seem to just be a PCB issue, as this was also observed on a ZYBO Z7-10: https://ez.analog.com/audio/f/q-a/543726/solved-ssm2603-right-output-offset-issue/480229 Signed-off-by: Paweł Anikiel --- sound/soc/codecs/ssm2602.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sound/soc/codecs/ssm2602.c b/sound/soc/codecs/ssm2602.c index cbbe83b85ada..021e0c860fa1 100644 --- a/sound/soc/codecs/ssm2602.c +++ b/sound/soc/codecs/ssm2602.c @@ -589,6 +589,17 @@ static int ssm260x_component_probe(struct snd_soc_component *component) return ret; } + /* Workaround for what seems to be a hardware quirk: when using an + * external MCLK signal, powering on Output and DAC for the first + * time produces output distortions unless they're powered together + * with whole chip power. We power them here for the first time, + * as doing it later may be impossible (e.g. when starting playback + * while recording, whole chip power will already be on) + */ + regmap_write(ssm2602->regmap, SSM2602_ACTIVE, 0x01); + regmap_write(ssm2602->regmap, SSM2602_PWR, 0x07); + regmap_write(ssm2602->regmap, SSM2602_RESET, 0x00); + /* set the update bits */ regmap_update_bits(ssm2602->regmap, SSM2602_LINVOL, LINVOL_LRIN_BOTH, LINVOL_LRIN_BOTH); From patchwork Fri Apr 14 14:02:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pawe=C5=82_Anikiel?= X-Patchwork-Id: 674559 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 70F44C7619A for ; Sat, 15 Apr 2023 09:12:23 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 564A8852; Sat, 15 Apr 2023 11:11:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 564A8852 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1681549941; bh=r3y+U3995t0uw4Qh+bshi8KZ43w075GnTe/mIOHQg6I=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Reply-To:Cc:From; b=DYSLpR9R4utKJO+OjRP3clnQr7xgh0QpEcj5TBhvbjL427XXWyJhFHZP0cqgM89mx +pCfqt3Dc8GRYGr8Cw8MWw7q+oTRoyttkQTvhcgmdmHUUMeNlyQk3xHzNp9PoK5KTn zZxGf5NRzFE937Ak7FNiP/+v9QtYVlXxBlTEWNFw= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 5CCB4F8055C; Sat, 15 Apr 2023 11:09:33 +0200 (CEST) To: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, broonie@kernel.org Subject: [PATCH 6/9] ASoC: ssm2602: Add support for CLKDIV2 Date: Fri, 14 Apr 2023 16:02:00 +0200 In-Reply-To: <20230414140203.707729-1-pan@semihalf.com> References: <20230414140203.707729-1-pan@semihalf.com> X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 X-Mailman-Approved-At: Sat, 15 Apr 2023 09:08:57 +0000 X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <168154977254.26.16999760858506591055@mailman-core.alsa-project.org> X-Patchwork-Original-From: =?utf-8?q?Pawe=C5=82_Anikiel_via_Alsa-devel?= From: =?utf-8?q?Pawe=C5=82_Anikiel?= Reply-To: =?utf-8?q?Pawe=C5=82_Anikiel?= Cc: tiwai@suse.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dinguyen@kernel.org, lars@metafoo.de, nuno.sa@analog.com, upstream@semihalf.com, =?utf-8?q?Pawe=C5=82_Anikiel?= Content-Disposition: inline The SSM260x chips have an internal MCLK /2 divider (bit D7 in register R8). Add logic that allows for more MCLK values using this divider. Signed-off-by: Paweł Anikiel --- sound/soc/codecs/ssm2602.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/ssm2602.c b/sound/soc/codecs/ssm2602.c index 021e0c860fa1..35c4743e756e 100644 --- a/sound/soc/codecs/ssm2602.c +++ b/sound/soc/codecs/ssm2602.c @@ -280,9 +280,12 @@ static inline int ssm2602_get_coeff(int mclk, int rate) int i; for (i = 0; i < ARRAY_SIZE(ssm2602_coeff_table); i++) { - if (ssm2602_coeff_table[i].rate == rate && - ssm2602_coeff_table[i].mclk == mclk) - return ssm2602_coeff_table[i].srate; + if (ssm2602_coeff_table[i].rate == rate) { + if (ssm2602_coeff_table[i].mclk == mclk) + return ssm2602_coeff_table[i].srate; + if (ssm2602_coeff_table[i].mclk == mclk / 2) + return ssm2602_coeff_table[i].srate | SRATE_CORECLK_DIV2; + } } return -EINVAL; } @@ -365,18 +368,24 @@ static int ssm2602_set_dai_sysclk(struct snd_soc_dai *codec_dai, switch (freq) { case 12288000: case 18432000: + case 24576000: + case 36864000: ssm2602->sysclk_constraints = &ssm2602_constraints_12288000; break; case 11289600: case 16934400: + case 22579200: + case 33868800: ssm2602->sysclk_constraints = &ssm2602_constraints_11289600; break; case 12000000: + case 24000000: ssm2602->sysclk_constraints = NULL; break; default: return -EINVAL; } + ssm2602->sysclk = freq; } else { unsigned int mask; From patchwork Fri Apr 14 14:02:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pawe=C5=82_Anikiel?= X-Patchwork-Id: 674560 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 912FDC7619A for ; Sat, 15 Apr 2023 09:11:56 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5AA92DF2; Sat, 15 Apr 2023 11:11:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5AA92DF2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1681549914; bh=BlWJQbfAxmqzCyKltZtuChU+IXB1xFpetJoDryTxfwY=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Reply-To:Cc:From; b=hXnnRRb0uYdyTxmJEoerTeLmlmI6PWzBN5YxA8dXVNVlxyIZzk0dQoEcmFFwEap7I xUs88R028rlgN2Ka4ZDGVXK7CaqkkCszIhHCEWpQnK79Cr7sNxPuzFqdAXK1wOkWaH FehrNeEmf/dt+cwfJYhqxS3oiVrd/ZVU4aO0m/rg= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 7E966F80544; Sat, 15 Apr 2023 11:09:30 +0200 (CEST) To: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, broonie@kernel.org Subject: [PATCH 7/9] ASoC: ssm2602: Add mute gpio Date: Fri, 14 Apr 2023 16:02:01 +0200 In-Reply-To: <20230414140203.707729-1-pan@semihalf.com> References: <20230414140203.707729-1-pan@semihalf.com> X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 X-Mailman-Approved-At: Sat, 15 Apr 2023 09:08:57 +0000 X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <168154976963.26.12831314436545841195@mailman-core.alsa-project.org> X-Patchwork-Original-From: =?utf-8?q?Pawe=C5=82_Anikiel_via_Alsa-devel?= From: =?utf-8?q?Pawe=C5=82_Anikiel?= Reply-To: =?utf-8?q?Pawe=C5=82_Anikiel?= Cc: tiwai@suse.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dinguyen@kernel.org, lars@metafoo.de, nuno.sa@analog.com, upstream@semihalf.com, =?utf-8?q?Pawe=C5=82_Anikiel?= Content-Disposition: inline The SSM2603 has a hardware mute pin. Add an optional mute gpio to control it. Signed-off-by: Paweł Anikiel --- sound/soc/codecs/ssm2602.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sound/soc/codecs/ssm2602.c b/sound/soc/codecs/ssm2602.c index 35c4743e756e..dd81e62d7a3b 100644 --- a/sound/soc/codecs/ssm2602.c +++ b/sound/soc/codecs/ssm2602.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -32,6 +33,8 @@ struct ssm2602_priv { enum ssm2602_type type; unsigned int clk_out_pwr; + + struct gpio_desc *mute_gpiod; }; /* @@ -352,6 +355,10 @@ static int ssm2602_mute(struct snd_soc_dai *dai, int mute, int direction) else regmap_update_bits(ssm2602->regmap, SSM2602_APDIGI, APDIGI_ENABLE_DAC_MUTE, 0); + + if (ssm2602->mute_gpiod) + gpiod_set_value_cansleep(ssm2602->mute_gpiod, mute); + return 0; } @@ -680,6 +687,10 @@ int ssm2602_probe(struct device *dev, enum ssm2602_type type, ssm2602->type = type; ssm2602->regmap = regmap; + ssm2602->mute_gpiod = devm_gpiod_get_optional(dev, "mute", GPIOD_OUT_LOW); + if (IS_ERR(ssm2602->mute_gpiod)) + return PTR_ERR(ssm2602->mute_gpiod); + return devm_snd_soc_register_component(dev, &soc_component_dev_ssm2602, &ssm2602_dai, 1); } From patchwork Fri Apr 14 14:02:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pawe=C5=82_Anikiel?= X-Patchwork-Id: 673381 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D3CCBC7619A for ; Sat, 15 Apr 2023 09:13:06 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2E17A83E; Sat, 15 Apr 2023 11:12:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2E17A83E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1681549984; bh=jDp+4kx/mgr+MUj12kztMcarzZvN6nKgqfQPrS9nCgo=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Reply-To:Cc:From; b=eRsCcv9i+1Z1PopIQw0HP22HTk60efKyxxWYDmqVug/LdyHFbrZkjxO+4UMUDVo12 5NXNx9FFgiiZx4k1XtdOPbDklBSD6PVGwQ01xpzcWVBb9fQIuG+uSfjuMxLNqyQ+6O Ft4Uq0CTFUAo6QdDsBbFtVtr+S+zJ1gRy6SIlfBg= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 9A6D1F8057A; Sat, 15 Apr 2023 11:09:37 +0200 (CEST) To: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, broonie@kernel.org Subject: [PATCH 8/9] dt-bindings: ASoC: Add mute-gpio to ssm2602 Date: Fri, 14 Apr 2023 16:02:02 +0200 In-Reply-To: <20230414140203.707729-1-pan@semihalf.com> References: <20230414140203.707729-1-pan@semihalf.com> X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 X-Mailman-Approved-At: Sat, 15 Apr 2023 09:09:07 +0000 X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <168154977673.26.4507407360180995918@mailman-core.alsa-project.org> X-Patchwork-Original-From: =?utf-8?q?Pawe=C5=82_Anikiel_via_Alsa-devel?= From: =?utf-8?q?Pawe=C5=82_Anikiel?= Reply-To: =?utf-8?q?Pawe=C5=82_Anikiel?= Cc: tiwai@suse.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dinguyen@kernel.org, lars@metafoo.de, nuno.sa@analog.com, upstream@semihalf.com, =?utf-8?q?Pawe=C5=82_Anikiel?= Content-Disposition: inline Add mute-gpio to ssm2602 Signed-off-by: Paweł Anikiel --- Documentation/devicetree/bindings/sound/adi,ssm2602.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/adi,ssm2602.txt b/Documentation/devicetree/bindings/sound/adi,ssm2602.txt index 3b3302fe399b..132aa9668e7e 100644 --- a/Documentation/devicetree/bindings/sound/adi,ssm2602.txt +++ b/Documentation/devicetree/bindings/sound/adi,ssm2602.txt @@ -11,6 +11,10 @@ Required properties: - reg : the I2C address of the device for I2C, the chip select number for SPI. +Optional properties: + +- mute-gpios: GPIO specifier for the mute pin + Example: ssm2602: ssm2602@1a { From patchwork Fri Apr 14 14:02:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pawe=C5=82_Anikiel?= X-Patchwork-Id: 674557 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 430D0C7619A for ; Sat, 15 Apr 2023 09:13:21 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 14DB2843; Sat, 15 Apr 2023 11:12:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 14DB2843 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1681549999; bh=kQpFsTqxr5tr9OuWMtHm6t5kRCAUTC1YPwS9aXJLyGo=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Reply-To:Cc:From; b=SYHJX7z/8PfiBrXtGVxXoV7cH1C9hY4MezUjTy1l2f2mRrXvZ+PsAldk9q/pziJf5 I/uoW+1VJoREp0jDvLLk83c6rHWtH/Jfi/EExdI5ZIs8PIAqNYOR6GcC6rr/7cR/7h GgZZIOefMmhkiNOU1SfW9R3XGDynWe651ZAlRzhE= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 6BA71F8057E; Sat, 15 Apr 2023 11:09:39 +0200 (CEST) To: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, broonie@kernel.org Subject: [PATCH 9/9] ARM: dts: chameleonv3: Add ssm2603 mute gpio Date: Fri, 14 Apr 2023 16:02:03 +0200 In-Reply-To: <20230414140203.707729-1-pan@semihalf.com> References: <20230414140203.707729-1-pan@semihalf.com> X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 X-Mailman-Approved-At: Sat, 15 Apr 2023 09:09:07 +0000 X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <168154977817.26.18087200308312475922@mailman-core.alsa-project.org> X-Patchwork-Original-From: =?utf-8?q?Pawe=C5=82_Anikiel_via_Alsa-devel?= From: =?utf-8?q?Pawe=C5=82_Anikiel?= Reply-To: =?utf-8?q?Pawe=C5=82_Anikiel?= Cc: tiwai@suse.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dinguyen@kernel.org, lars@metafoo.de, nuno.sa@analog.com, upstream@semihalf.com, =?utf-8?q?Pawe=C5=82_Anikiel?= Content-Disposition: inline The ssm2603 mute pin is connected to a gpio expander. Add this connection to the devicetree. Signed-off-by: Paweł Anikiel --- arch/arm/boot/dts/socfpga_arria10_chameleonv3.dts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/boot/dts/socfpga_arria10_chameleonv3.dts b/arch/arm/boot/dts/socfpga_arria10_chameleonv3.dts index c75f41058196..81e83ce0f8e7 100644 --- a/arch/arm/boot/dts/socfpga_arria10_chameleonv3.dts +++ b/arch/arm/boot/dts/socfpga_arria10_chameleonv3.dts @@ -3,6 +3,7 @@ * Copyright 2022 Google LLC */ /dts-v1/; +#include #include "socfpga_arria10_mercury_aa1.dtsi" / { @@ -67,6 +68,7 @@ &i2c0 { ssm2603: audio-codec@1a { compatible = "adi,ssm2603"; reg = <0x1a>; + mute-gpios = <&u80 0 GPIO_ACTIVE_LOW>; }; };