From: Nicolin Chen <nicoleotsuka@gmail.com>
To: Shengjiu Wang <shengjiu.wang@nxp.com>
Cc: timur@kernel.org, Xiubo.Lee@gmail.com, festevam@gmail.com,
broonie@kernel.org, perex@perex.cz, tiwai@suse.com,
alsa-devel@alsa-project.org, lgirdwood@gmail.com,
robh+dt@kernel.org, devicetree@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/2] ASoC: fsl_aud2htx: Add aud2htx module driver
Date: Wed, 4 Nov 2020 17:35:40 -0800 [thread overview]
Message-ID: <20201105013539.GA16459@Asurada-Nvidia> (raw)
In-Reply-To: <1604281947-26874-2-git-send-email-shengjiu.wang@nxp.com>
On Mon, Nov 02, 2020 at 09:52:27AM +0800, Shengjiu Wang wrote:
> The AUD2HTX is a digital module that provides a bridge between
> the Audio Subsystem and the HDMI RTX Subsystem. This module
> includes intermediate storage to queue SDMA transactions prior
> to being synchronized and passed to the HDMI RTX Subsystem over
> the Audio Link.
>
> The AUD2HTX contains a DMA request routed to the SDMA module.
> This DMA request is controlled based on the watermark level in
> the 32-entry sample buffer.
>
> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Despite some small comments inline.
> +static int fsl_aud2htx_dai_probe(struct snd_soc_dai *cpu_dai)
> +{
> + struct fsl_aud2htx *aud2htx = dev_get_drvdata(cpu_dai->dev);
> +
> + /* DMA request when number of entries < WTMK_LOW */
> + regmap_update_bits(aud2htx->regmap, AUD2HTX_CTRL_EXT,
> + AUD2HTX_CTRE_DT_MASK, 0);
> +
> + /* Disable interrupts*/
> + regmap_update_bits(aud2htx->regmap, AUD2HTX_IRQ_MASK,
> + AUD2HTX_WM_HIGH_IRQ_MASK |
> + AUD2HTX_WM_LOW_IRQ_MASK |
> + AUD2HTX_OVF_MASK,
> + AUD2HTX_WM_HIGH_IRQ_MASK |
> + AUD2HTX_WM_LOW_IRQ_MASK |
> + AUD2HTX_OVF_MASK);
> +
> + /* Configure watermark */
> + regmap_update_bits(aud2htx->regmap, AUD2HTX_CTRL_EXT,
> + AUD2HTX_CTRE_WL_MASK,
> + AUD2HTX_WTMK_LOW << AUD2HTX_CTRE_WL_SHIFT);
> + regmap_update_bits(aud2htx->regmap, AUD2HTX_CTRL_EXT,
> + AUD2HTX_CTRE_WH_MASK,
> + AUD2HTX_WTMK_HIGH << AUD2HTX_CTRE_WH_SHIFT);
If there isn't a hard requirement from hardware, feels better to
combine all the writes to AUD2HTX_CTRL_EXT into one single MMIO.
> +static irqreturn_t fsl_aud2htx_isr(int irq, void *dev_id)
> +{
> + return IRQ_HANDLED;
Empty isr? Perhaps can drop the request_irq() at all?
> +static int fsl_aud2htx_probe(struct platform_device *pdev)
> +{
> + struct fsl_aud2htx *aud2htx;
> + struct resource *res;
> + void __iomem *regs;
> + int ret, irq;
> +
> + aud2htx = devm_kzalloc(&pdev->dev, sizeof(*aud2htx), GFP_KERNEL);
> + if (!aud2htx)
> + return -ENOMEM;
> +
> + aud2htx->pdev = pdev;
> +
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + regs = devm_ioremap_resource(&pdev->dev, res);
> + if (IS_ERR(regs)) {
> + dev_err(&pdev->dev, "failed ioremap\n");
> + return PTR_ERR(regs);
> + }
> +
> + aud2htx->regmap = devm_regmap_init_mmio(&pdev->dev, regs,
> + &fsl_aud2htx_regmap_config);
> + if (IS_ERR(aud2htx->regmap)) {
> + dev_err(&pdev->dev, "failed to init regmap");
> + return PTR_ERR(aud2htx->regmap);
> + }
> +
> + irq = platform_get_irq(pdev, 0);
> + if (irq < 0) {
> + dev_err(&pdev->dev, "no irq for node %s\n",
> + dev_name(&pdev->dev));
dev_err() already prints dev_name, so not necessary to print again.
next prev parent reply other threads:[~2020-11-05 1:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-02 1:52 [PATCH v3 1/2] ASoC: dt-bindings: fsl_aud2htx: Add binding doc for aud2htx module Shengjiu Wang
2020-11-02 1:52 ` [PATCH v3 2/2] ASoC: fsl_aud2htx: Add aud2htx module driver Shengjiu Wang
2020-11-05 1:35 ` Nicolin Chen [this message]
2020-11-06 2:51 ` Shengjiu Wang
2020-11-06 21:38 ` Nicolin Chen
2020-11-04 22:34 ` [PATCH v3 1/2] ASoC: dt-bindings: fsl_aud2htx: Add binding doc for aud2htx module Rob Herring
2020-11-06 11:54 ` Mark Brown
2020-11-06 12:20 ` Mark Brown
2020-11-06 21:27 ` Nicolin Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201105013539.GA16459@Asurada-Nvidia \
--to=nicoleotsuka@gmail.com \
--cc=Xiubo.Lee@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=perex@perex.cz \
--cc=robh+dt@kernel.org \
--cc=shengjiu.wang@nxp.com \
--cc=timur@kernel.org \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).