From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Ricardo Neri <ricardo.neri@ti.com>
Cc: x0055901@ti.com, alsa-devel@alsa-project.org,
peter.ujfalusi@ti.com, tomi.valkeinen@ti.com, s-guiriec@ti.com,
lrg@ti.com
Subject: Re: [PATCH 1/3] OMAPDSS/ASoC: Relocate ASoC HDMI codec. Part 2
Date: Sun, 12 Feb 2012 13:20:38 +0000 [thread overview]
Message-ID: <20120212132036.GC3395@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1329006197-28332-2-git-send-email-ricardo.neri@ti.com>
[-- Attachment #1.1: Type: text/plain, Size: 1964 bytes --]
On Sat, Feb 11, 2012 at 06:23:15PM -0600, Ricardo Neri wrote:
> The ASoC HDMI codec is to be relocated under sound/soc/codecs. This
> patch places the codec under ASoC. A previous patch removed the code
> from DSS. The purpose of the relocation is to give a more logical
> organization to OMAP HDMI code.
Looks pretty clean, a few things below but mostly fairly nitpicky.
> sound/soc/codecs/omap-hdmi.c | 422 ++++++++++++++++++++++++++++++++++++++++++
If this is relocating the code shouldn't some old code be being deleted?
> + switch (sample_freq) {
> + case 32000:
> + if ((deep_color == 125) && ((pclk == 54054)
> + || (pclk == 74250)))
> + *n = 8192;
> + else
> + *n = 4096;
Use a switch on deep_color too (in all these cases).
> +
> +static int hdmi_audio_startup(struct snd_pcm_substream *substream,
> + struct snd_soc_dai *dai)
> +{
> + if (omapdss_hdmi_get_hdmi_mode() != HDMI_HDMI) {
> + pr_err("Current video settings do not support audio.\n");
dev_ prints please (throughout the driver).
> + priv = kzalloc(sizeof(*priv), GFP_KERNEL);
> + if (priv == NULL)
> + return -ENOMEM;
Use devm_ functions for this and mapping the io region - that way you
don't have to worry about them when cleaning up and doing error
handling...
> + hdmi_rsrc = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +
> + if (!hdmi_rsrc) {
> + dev_err(&pdev->dev, "Cannot obtain IORESOURCE_MEM HDMI\n");
> + return -EINVAL;
> + }
...like here :) You should also move the allocation and mapping to the
platform device probe and only register the CODEC once you've got
everything else, this is more idiomatic for the Linux driver stack.
> +static struct snd_soc_dai_driver hdmi_codec_dai_drv = {
> + .name = "hdmi-audio-codec",
Should proably have an omap- in here somewhere.
> +static int __init hdmi_codec_init(void)
> +{
> + return platform_driver_register(&hdmi_codec_driver);
> +}
> +module_init(hdmi_codec_init);
module_platform_driver()
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2012-02-12 13:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-12 0:23 [PATCH 0/3] ASoC: Relocate the OMAP HDMI codec to sound Ricardo Neri
2012-02-12 0:23 ` [PATCH 1/3] OMAPDSS/ASoC: Relocate ASoC HDMI codec. Part 2 Ricardo Neri
2012-02-12 13:20 ` Mark Brown [this message]
2012-02-14 18:12 ` Ricardo Neri
2012-02-12 0:23 ` [PATCH 2/3] ASoC: OMAP: HDMI: Update codec name Ricardo Neri
2012-02-12 0:23 ` [PATCH 3/3] ASoC: OMAP: Update Kconfig and Makefile files for HDMI audio codec Ricardo Neri
2012-02-12 13:21 ` Mark Brown
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=20120212132036.GC3395@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=lrg@ti.com \
--cc=peter.ujfalusi@ti.com \
--cc=ricardo.neri@ti.com \
--cc=s-guiriec@ti.com \
--cc=tomi.valkeinen@ti.com \
--cc=x0055901@ti.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).