[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170224140936.4b4b8bd5@bbrezillon>
Date: Fri, 24 Feb 2017 14:09:36 +0100
From: Boris Brezillon <boris.brezillon@...e-electrons.com>
To: Eric Anholt <eric@...olt.net>
Cc: Florian Fainelli <f.fainelli@...il.com>,
David Airlie <airlied@...ux.ie>,
dri-devel@...ts.freedesktop.org, Mark Brown <broonie@...nel.org>,
Liam Girdwood <lgirdwood@...il.com>,
Lars-Peter Clausen <lars@...afoo.de>,
Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
devicetree@...r.kernel.org, Stephen Warren <swarren@...dotorg.org>,
Lee Jones <lee@...nel.org>, linux-kernel@...r.kernel.org,
bcm-kernel-feedback-list@...adcom.com,
linux-rpi-kernel@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH 2/3] drm/vc4: Add HDMI audio support
Hi Eric,
On Tue, 7 Feb 2017 13:07:02 -0800
Eric Anholt <eric@...olt.net> wrote:
> +static int vc4_hdmi_audio_init(struct vc4_hdmi *hdmi)
> +{
> + struct snd_soc_dai_link *dai_link = &hdmi->audio.link;
> + struct snd_soc_card *card = &hdmi->audio.card;
> + struct device *dev = &hdmi->pdev->dev;
> + const __be32 *addr;
> + int ret;
> +
> + if (!of_find_property(dev->of_node, "dmas", NULL)) {
> + dev_warn(dev,
> + "'dmas' DT property is missing, no HDMI audio\n");
> + return 0;
> + }
> +
> + /*
> + * Get the physical address of VC4_HD_MAI_DATA. We need to retrieve
> + * the bus address specified in the DT, because the physical address
> + * (the one returned by platform_get_resource()) is not appropriate
> + * for DMA transfers.
> + * This VC/MMU should probably be exposed to avoid this kind of hacks.
> + */
> + addr = of_get_address(dev->of_node, 1, NULL, NULL);
> + hdmi->audio.dma_data.addr = be32_to_cpup(addr) + VC4_HD_MAI_DATA;
> + hdmi->audio.dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
> + hdmi->audio.dma_data.maxburst = 2;
> +
> + ret = devm_snd_dmaengine_pcm_register(dev, &pcm_conf, 0);
> + if (ret) {
> + dev_err(dev, "Could not register PCM component: %d\n", ret);
> + return ret;
> + }
> +
> + ret = devm_snd_soc_register_component(dev, &vc4_hdmi_audio_cpu_dai_comp,
> + &vc4_hdmi_audio_cpu_dai_drv, 1);
> + if (ret) {
> + dev_err(dev, "Could not register CPU DAI: %d\n", ret);
> + return ret;
> + }
> +
> + /* register codec and codec dai */
> + ret = snd_soc_register_codec(dev, &vc4_hdmi_audio_codec_drv,
> + &vc4_hdmi_audio_codec_dai_drv, 1);
> + if (ret) {
> + dev_err(dev, "Could not register codec: %d\n", ret);
> + return ret;
> + }
> +
> + dai_link->name = "MAI";
> + dai_link->stream_name = "MAI PCM";
> + dai_link->codec_dai_name = vc4_hdmi_audio_codec_dai_drv.name;
> + dai_link->cpu_dai_name = dev_name(dev);
> + dai_link->codec_name = dev_name(dev);
> + dai_link->platform_name = dev_name(dev);
> +
> + card->dai_link = dai_link;
> + card->num_links = 1;
> + card->name = "vc4-hdmi-audio";
I know I'm the one who chose this name, but maybe we should just change
it for "vc4-hdmi", since audio is kind of implied here ;-).
Powered by blists - more mailing lists