devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Kenneth Westfield" <kwestfie@codeaurora.org>
To: Mark Brown <broonie@kernel.org>
Cc: Kenneth Westfield <kwestfie@codeaurora.org>,
	ALSA Mailing List <alsa-devel@alsa-project.org>,
	Device Tree Mailing List <devicetree@vger.kernel.org>,
	MSM Mailing List <linux-arm-msm@vger.kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>, Takashi Iwai <tiwai@suse.de>,
	Rob Herring <rob.herring@calxeda.com>,
	Greg KH <gregkh@linuxfoundation.org>,
	David Brown <davidb@codeaurora.org>,
	Bryan Huntsman <bryanh@codeaurora.org>,
	Banajit Goswami <bgoswami@codeaurora.org>,
	Patrick Lai <plai@codeaurora.org>
Subject: Re: [PATCH 3/9] ASoC: ipq806x: add native LPAIF driver
Date: Mon, 8 Dec 2014 14:06:47 -0800	[thread overview]
Message-ID: <618bab4577b2f74052f94c4c49ad6f52.squirrel@www.codeaurora.org> (raw)

On Tue, November 25, 2014 1:44 pm, Mark Brown wrote:
> On Wed, Nov 19, 2014 at 10:52:43AM -0800, Kenneth Westfield wrote:
>> +static int lpaif_pcm_int_enable(uint8_t dma_ch)
>> +{
>> +	uint32_t intr_val;
>> +	uint32_t status_val;
>> +	unsigned long flags;
>> +
>> +	if (dma_ch >= LPAIF_MAX_CHANNELS) {
>> +		pr_err("%s: invalid DMA channel given: %hhu\n",
>> +				__func__, dma_ch);
> dev_err().

Now using it in most cases, except for two or three functions that would need to have a handle
passed to it solely for the purpose of using dev_*.

>> +	while (intrsrc) {
>> +		dma_ch = lpaif_dai_find_dma_channel(intrsrc);
>> +		if (dma_ch != -1) {
>> +			if (lpaif_dai[dma_ch]->callback) {
>> +
>> +				ret = lpaif_dai[dma_ch]->callback(intrsrc,
>> +					lpaif_dai[dma_ch]->private_data);
>> +			}
>> +			intrsrc &= ~LPAIF_PER_CH(dma_ch);
>> +		} else {
>> +			pr_err("%s: error getting channel\n", __func__);
>> +			break;
>> +		}
>> +	}
>> +	return ret;
>> +}
> This all looks like a very simple demux of a single register - don't we have a generic irqchip
that can handle it?  It looks like that's what you're trying to implement here, each DMA channel
could be requesting the three interrupts it has separately rather than open coding an interrupt
controller here.
> I'm not actually immediately seeing one right now but it'd be simple to add (or regmap-irq could
do it if we used a regmap, though it assumes threading and isn't a great fit).

I will look into this.  If one fits perfectly, great. If not, then I will add one.


-- 
Kenneth Westfield
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,  a Linux Foundation
Collaborative Project

             reply	other threads:[~2014-12-08 22:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-08 22:06 Kenneth Westfield [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-11-19 18:52 [PATCH 0/9] ASoC: QCOM: Add support for ipq806x SOC Kenneth Westfield
2014-11-19 18:52 ` [PATCH 3/9] ASoC: ipq806x: add native LPAIF driver Kenneth Westfield
2014-11-25 21:44   ` 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=618bab4577b2f74052f94c4c49ad6f52.squirrel@www.codeaurora.org \
    --to=kwestfie@codeaurora.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=bgoswami@codeaurora.org \
    --cc=broonie@kernel.org \
    --cc=bryanh@codeaurora.org \
    --cc=davidb@codeaurora.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=plai@codeaurora.org \
    --cc=rob.herring@calxeda.com \
    --cc=tiwai@suse.de \
    /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).