From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 7FAD5CCD193 for ; Mon, 20 Oct 2025 17:49:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uyCd/4JIj55gxSeGf4+DJdNpJNeCwDGuxusuHQkGxZw=; b=vStWr4TsEoUk5EW+EI2erBkpCH aeOXRqAyFW/3aoOCMjGXEJTUSl7+Hs6wnKiI75cDQ4RjxhcqS8BuzPemvmJCwbuJWwG9Ba9Oxuv+p jWJe+yJNeYxnbOJbBwtvZCfDZBKckHm3cyGy64+afis0onE7dBylkr8wv0KzCAo83KHmhUq46IX3j 6cCt0pzYcKoPIGduUNn+k7mwTEeeapoz28OO0qEaRmcrOOl1Q8diPhOtjIlv2ZBdUx9Q9TnLBpP0H eK2sVsj/t1OVOTygDDDLk+TgQkQtKCnwmXFO3SRzaoVmZWvQfCFQHIj/GXkNS44BbuOkr5fbsd4Bc naSXcVkQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vAu0q-0000000EXmA-2aY0; Mon, 20 Oct 2025 17:49:40 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vAu0o-0000000EXln-0KrM for linux-arm-kernel@lists.infradead.org; Mon, 20 Oct 2025 17:49:39 +0000 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-4270a3464bcso2343719f8f.2 for ; Mon, 20 Oct 2025 10:49:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760982576; x=1761587376; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uyCd/4JIj55gxSeGf4+DJdNpJNeCwDGuxusuHQkGxZw=; b=gGOEYSmLhcs5F6TrZKepq05lZWCY2DKJl7rUms2ax2auSOYaeZkGEFKBsTezUM9Gm6 6JBFqyD2JkP5kmVuswukBHM/dS0hxR/juMUMy+YKV2h4MzDHal7Xt1jn4dtuXpbT4caY 9iDS8iP9YDaBbBtRN4vVvuBvjqt0S+keMwRVOQuv5fNgyyHQHV6hhX46zVgilp1V4Esa AdJxWYgyRL/IdI1NdqGn7nK2qI0FMkwOr6vHfBC/Drqg7Gb359qSFnGDBMqvHjK5vZ1/ EA0jqdupOH5ppU2/oKx4+xVmAdGT6ePuB7YMgEdaaiIINTi0zW3506u8R4qJMDz4P5FO EBBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760982576; x=1761587376; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uyCd/4JIj55gxSeGf4+DJdNpJNeCwDGuxusuHQkGxZw=; b=GS+cf/fvTskGMvwjVTRrl4Hrh1rw5dPWZ1tlFse0KCc0bPq0OAMdBFr4+PwUZR28zU 8uSGAKr31Ke3J0TCLDEbG52XtrxwTXOej08bFE/KiYkcvfngGMGq299iaiinX70CXIDp Dkr6gK8JHDv9vEqypLhRVWAOCYV5BtpFpB6rzdWlTokBmz1+Qo4iBk+rn9MiSJzf//6b 1q3iNNOI54IxbM7sRCnL9oqQzgC6vQt0oAk45beG561BT2v6Av+969yywbTJCPKiAzUP tjgwbYCCUhnrp3ZsGWQm/x80YrctLemArFmxBXXGB0vv+kBvUY5zElnGy1e674IssDDM EZlQ== X-Forwarded-Encrypted: i=1; AJvYcCXI0+2YVIfgvZGER9dzvR5r/mvsxlYEPUP8Ug2+H8nTwkbR5khi0OJ8kGaolKvDNAr2a4GnqlvgwRc2oXzjcga3@lists.infradead.org X-Gm-Message-State: AOJu0YzDhP8EvPStyA/9A9ncvHsRtRv71ekvEOayWYk7wwEPyUohgnts CMBcMMmUWeHb/KNSfn35FvJWm4Sms2Yd60n2ZJYDH5dc7nESVE+Lvnkj X-Gm-Gg: ASbGnctzNHdFGcF7tyrWLLWxn8/jcPQO2zeosJAHdlMvTjfVC4+0pzE0GSjRGL4tUg4 14rKgbobbipszg3rq1/AZZ7Jcgj35/kHijhVFC+V0GoT5yqvKf6w00g46GH03TaCGvHgyfbvm6x 1OMzQHpw3dRlkc1hLnYh9LZD4a7yIedVcNc5UZAuMNT6CcOXy89YwTc19I/XEUx1P3MFP0WHrRP mGrlvQJC5s5EdgdODiKqAkewe4bdlLmlUxG2eNyd8eeW5FRZqXhYgSahPGJx1nJt8yp8Iv79/Q+ l1iRwjWoJE/bi5NaFV2V8GBkw1ILFNcHKpupoHPQTkEoeqEBAxYnoMFVxQ04ywjyYo9eenHJ//t OqCKoYa44+NUUIupI6UZFsv8iT3YSzeSX7eBMfbjHFbccHyf3R5IzneOxs2jCXngg1hc6001TKV FQErZYEGY3jGCYAMkqiDvaFI2xjW1Z6x1QQnGhs59i3N2AAvHaFkknHOq4v1B3JAIExYEzQdN8R hBc5w== X-Google-Smtp-Source: AGHT+IFVJfltDBGpXshwdA6ycK/H046cTrEtcv4sm/ksCoAaIUW3ZG+YpLxzBGC+3OrZRm/196984w== X-Received: by 2002:a05:6000:4021:b0:427:8b:441a with SMTP id ffacd0b85a97d-42704d7e960mr9407198f8f.11.1760982575740; Mon, 20 Oct 2025 10:49:35 -0700 (PDT) Received: from jernej-laptop.localnet (178-79-73-218.dynamic.telemach.net. [178.79.73.218]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-427ea5b3c34sm16212597f8f.17.2025.10.20.10.49.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Oct 2025 10:49:35 -0700 (PDT) From: Jernej =?UTF-8?B?xaBrcmFiZWM=?= To: Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Mark Brown , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Chen-Yu Tsai Cc: linux-sunxi@lists.linux.dev, linux-sound@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 04/11] ASoC: sun4i-spdif: Support SPDIF output on A523 family Date: Mon, 20 Oct 2025 19:49:34 +0200 Message-ID: <13867454.uLZWGnKmhe@jernej-laptop> In-Reply-To: <20251020171059.2786070-5-wens@kernel.org> References: <20251020171059.2786070-1-wens@kernel.org> <20251020171059.2786070-5-wens@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251020_104938_148852_CD6C7D15 X-CRM114-Status: GOOD ( 28.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, Dne ponedeljek, 20. oktober 2025 ob 19:10:50 Srednjeevropski poletni =C4=8D= as je Chen-Yu Tsai napisal(a): > The TX side of the SPDIF block on the A523 is almost the same the > previous generations, the only difference being that it has separate > module clock inputs for the TX and RX side. >=20 > Since this driver currently only supports TX, add support for a > different clock name so that TX and RX clocks can be separated > if RX support is ever added. Then add support for the A523. >=20 > Signed-off-by: Chen-Yu Tsai > --- > sound/soc/sunxi/sun4i-spdif.c | 28 +++++++++++++++++++++++++--- > 1 file changed, 25 insertions(+), 3 deletions(-) >=20 > diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c > index 34e5bd94e9af..6a58dc4311de 100644 > --- a/sound/soc/sunxi/sun4i-spdif.c > +++ b/sound/soc/sunxi/sun4i-spdif.c > @@ -177,6 +177,7 @@ struct sun4i_spdif_quirks { > bool has_reset; > unsigned int val_fctl_ftx; > unsigned int mclk_multiplier; > + const char *tx_clk_name; > }; > =20 > struct sun4i_spdif_dev { > @@ -323,6 +324,7 @@ static int sun4i_spdif_hw_params(struct snd_pcm_subst= ream *substream, > } > mclk *=3D host->quirks->mclk_multiplier; > =20 > + dev_info(&pdev->dev, "Setting SPDIF clock rate to %u\n", mclk); > ret =3D clk_set_rate(host->spdif_clk, mclk); > if (ret < 0) { > dev_err(&pdev->dev, > @@ -542,7 +544,6 @@ static struct snd_soc_dai_driver sun4i_spdif_dai =3D { > .formats =3D SUN4I_FORMATS, > }, > .ops =3D &sun4i_spdif_dai_ops, > - .name =3D "spdif", Why this change? > }; > =20 > static const struct sun4i_spdif_quirks sun4i_a10_spdif_quirks =3D { > @@ -572,6 +573,14 @@ static const struct sun4i_spdif_quirks sun50i_h6_spd= if_quirks =3D { > .mclk_multiplier =3D 1, > }; > =20 > +static const struct sun4i_spdif_quirks sun55i_a523_spdif_quirks =3D { > + .reg_dac_txdata =3D SUN8I_SPDIF_TXFIFO, > + .val_fctl_ftx =3D SUN50I_H6_SPDIF_FCTL_FTX, > + .has_reset =3D true, > + .mclk_multiplier =3D 1, > + .tx_clk_name =3D "tx", > +}; > + > static const struct of_device_id sun4i_spdif_of_match[] =3D { > { > .compatible =3D "allwinner,sun4i-a10-spdif", > @@ -594,6 +603,15 @@ static const struct of_device_id sun4i_spdif_of_matc= h[] =3D { > /* Essentially the same as the H6, but without RX */ > .data =3D &sun50i_h6_spdif_quirks, > }, > + { > + .compatible =3D "allwinner,sun55i-a523-spdif", > + /* > + * Almost the same as H6, but has split the TX and RX clocks, > + * has a separate reset bit for the RX side, and has some > + * expanded features for the RX side. > + */ > + .data =3D &sun55i_a523_spdif_quirks, > + }, > { /* sentinel */ } > }; > MODULE_DEVICE_TABLE(of, sun4i_spdif_of_match); > @@ -635,6 +653,7 @@ static int sun4i_spdif_probe(struct platform_device *= pdev) > const struct sun4i_spdif_quirks *quirks; > int ret; > void __iomem *base; > + const char *tx_clk_name =3D "spdif"; Reverse tree? Otherwise it looks good. Best regards, Jernej > =20 > dev_dbg(&pdev->dev, "Entered %s\n", __func__); > =20 > @@ -671,9 +690,12 @@ static int sun4i_spdif_probe(struct platform_device = *pdev) > return PTR_ERR(host->apb_clk); > } > =20 > - host->spdif_clk =3D devm_clk_get(&pdev->dev, "spdif"); > + if (quirks->tx_clk_name) > + tx_clk_name =3D quirks->tx_clk_name; > + host->spdif_clk =3D devm_clk_get(&pdev->dev, tx_clk_name); > if (IS_ERR(host->spdif_clk)) { > - dev_err(&pdev->dev, "failed to get a spdif clock.\n"); > + dev_err(&pdev->dev, "failed to get the \"%s\" clock.\n", > + tx_clk_name); > return PTR_ERR(host->spdif_clk); > } > =20 >=20