alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Rajeev Kumar <rajeev-dlh.kumar@st.com>
Cc: alsa-devel@alsa-project.org, tiwai@suse.de,
	spear-devel@list.st.com, Vipin Kumar <vipin.kumar@st.com>,
	lrg@slimlogic.co.uk
Subject: Re: [PATCH 4/8] sound:asoc:spdif_in: Add spdif IN support
Date: Tue, 20 Mar 2012 15:55:27 +0000	[thread overview]
Message-ID: <20120320155526.GG3445@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <568712727a6488bb0c16cf9031fa498059974e6e.1332242166.git.rajeev-dlh.kumar@st.com>


[-- Attachment #1.1: Type: text/plain, Size: 1739 bytes --]

On Tue, Mar 20, 2012 at 05:03:48PM +0530, Rajeev Kumar wrote:

This looks good, a few minor things but almost good to go.

> This patch implements the spdif IN driver for ST peripheral

S/PDIF.

> +	if (irq_status & SPDIF_IRQ_FIFOWRITE)
> +		pr_err("spdif in: fifo write error\n");
> +	if (irq_status & SPDIF_IRQ_EMPTYFIFOREAD)
> +		pr_err("spdif in: empty fifo read error\n");
> +	if (irq_status & SPDIF_IRQ_FIFOFULL)
> +		pr_err("spdif in: fifo full error\n");
> +	if (irq_status & SPDIF_IRQ_OUTOFRANGE)
> +		pr_err("spdif in: out of range error\n");

dev_err().

> +	if (!devm_request_mem_region(&pdev->dev, res->start,
> +				resource_size(res), pdev->name)) {
> +		dev_warn(&pdev->dev, "Failed to get memory resourse\n");
> +		return -ENOENT;
> +	}
> +
> +	host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
> +	if (!host) {
> +		dev_warn(&pdev->dev, "kzalloc fail\n");
> +		return -ENOMEM;
> +	}

Good to see this - this is the sort of stuff I was looking for in the
I2S driver.

> +	host->clk = clk_get(&pdev->dev, NULL);
> +	if (IS_ERR(host->clk))
> +		return PTR_ERR(host->clk);

> +	pdata = dev_get_platdata(&pdev->dev);

Should really be error checking in case you didn't get your platform
data.

> +	ret = devm_request_irq(&pdev->dev, host->irq, spdif_in_irq, 0,
> +			"spdif-in", host);
> +	if (ret) {

I'm really not enthused about the idea of using devm_request_irq() here
- what steps are you taking to make sure that the IRQ can't possibly
fire after you've started tearing down the device.  In general it's
relatively hard to use devm_request_irq() safely.

> +#define SPDIF_IN_DEV_PM_OPS NULL

Just remove this if it's unconditionally empty.

> +static int __init spdif_in_init(void)

module_platform_driver().

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2012-03-20 15:55 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-20 11:33 [PATCH 0/8] Add ASoC drivers for SPEAr platform Rajeev Kumar
2012-03-20 11:33 ` [PATCH 1/8] sound:asoc: Add support for STA529 Audio Codec Rajeev Kumar
2012-03-20 15:25   ` Mark Brown
2012-03-23  3:42     ` Rajeev kumar
2012-03-23  9:07       ` Lars-Peter Clausen
2012-03-23  9:20         ` Rajeev kumar
2012-03-20 17:57   ` Lars-Peter Clausen
2012-03-23  4:00     ` Rajeev kumar
2012-03-23  8:51       ` Lars-Peter Clausen
2012-03-23  9:15         ` Rajeev kumar
2012-03-20 11:33 ` [PATCH 2/8] sound:asoc: Add support for synopsys i2s controller as per ASoC framework Rajeev Kumar
2012-03-20 15:44   ` Mark Brown
2012-03-26  9:03     ` Rajeev kumar
2012-03-26 11:10       ` Mark Brown
2012-03-27  3:51         ` Rajeev kumar
2012-03-20 11:33 ` [PATCH 3/8] sound:asoc: Add support for SPEAr ASoC pcm layer Rajeev Kumar
2012-03-20 15:50   ` Mark Brown
2012-03-20 11:33 ` [PATCH 4/8] sound:asoc:spdif_in: Add spdif IN support Rajeev Kumar
2012-03-20 15:55   ` Mark Brown [this message]
2012-03-27  9:25     ` Rajeev kumar
2012-03-20 11:33 ` [PATCH 5/8] sound:asoc:spdif_out: Add spdif out support Rajeev Kumar
2012-03-20 11:33 ` [PATCH 6/8] sound:asoc: Add support for SPEAr ASoC machine driver Rajeev Kumar
2012-03-20 16:00   ` Mark Brown
2012-03-20 11:33 ` [PATCH 7/8] sound:asoc: Add Kconfig and Makefile to support SPEAr audio driver Rajeev Kumar
2012-03-20 11:33 ` [PATCH 8/8] sound:asoc: Update Kconfig and Makefile(sound/soc/) to support SPEAr audio Rajeev Kumar

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=20120320155526.GG3445@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=rajeev-dlh.kumar@st.com \
    --cc=spear-devel@list.st.com \
    --cc=tiwai@suse.de \
    --cc=vipin.kumar@st.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).