From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org, Rob Herring <robh+dt@kernel.org>,
Patrick Lai <plai@codeaurora.org>,
Banajit Goswami <bgoswami@codeaurora.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.de>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
kwestfie@codeaurora.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH v5 2/2] ASoC: qcom: add apq8016 sound card support
Date: Tue, 09 Jun 2015 18:51:59 +0100 [thread overview]
Message-ID: <557727BF.8040807@linaro.org> (raw)
In-Reply-To: <20150609170738.GI14071@sirena.org.uk>
On 09/06/15 18:07, Mark Brown wrote:
> On Tue, Jun 09, 2015 at 01:59:36PM +0100, Srinivas Kandagatla wrote:
>
>> + if (cpu_dai->id == MI2S_QUATERNARY) {
>> + /* Configure the Quat MI2S to TLMM */
>> + writel(readl(pdata->mic_iomux) |
>> + MIC_CTRL_QUA_WS_SLAVE_SEL_10 |
>> + MIC_CTRL_TLMM_SCLK_EN,
>> + pdata->mic_iomux);
>> +
>> + return 0;
>> + } else if (cpu_dai->id == MI2S_PRIMARY) {
>> + writel(readl(pdata->spkr_iomux) |
>> + SPKR_CTL_PRI_WS_SLAVE_SEL_11,
>> + pdata->spkr_iomux);
>> +
>> + return 0;
>> + }
>
> Why not just do these one time at probe, we don't undo them when we shut
> the DAI down?
If I do that Am afraid that the driver would loose the flexibility of
selecting different MI2S from DT level. Hardcoding which MI2S can got to
external or internal codec is something that I wanted to avoid from the
start.
I will add the shutdown code to reset the configuration.
>
>> +
>> + dev_err(card->dev, "unsupported cpu dai configuration\n");
>> +
>> + return -EINVAL;
>
> It'd be clearer if this were part of the above code (which should still
> be written as a switch statement) - I was just asking myself what
> happens if we fall off the end of the if/else chain.
I will change this to switch case.
>
>> + /**
>> + * External codec is ADV7533
>> + * and internal codec digital part is inside apq8016
>> + * and analog part is in PMIC PM8916
>> + **/
>> + if (of_property_read_bool(np, "external"))
>> + name = "ADV7533";
>> + else
>> + name = "WCD";
>
> If this is all the property is doing why not just put a link name
> property in the DT rather than this? That makes the driver a bit more
> general and is more idiomatic.
Yes, it makes it more clear with link-name property. I will fix this in
next version.
>
>> + dai_link->name = dai_link->stream_name = name;
>
> Write two assignment statements, it's clearer and more idiomatic.
I will fix this too.
>
--srini
next prev parent reply other threads:[~2015-06-09 17:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-09 12:58 [PATCH v5 0/2] ASoC: qcom: add support to apq8016 sbc machine driver Srinivas Kandagatla
[not found] ` <1433854702-23654-1-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-06-09 12:59 ` [PATCH v5 1/2] ASoC: qcom: document apq8016 sbc machine driver bindings Srinivas Kandagatla
2015-06-09 16:57 ` Mark Brown
[not found] ` <20150609165718.GH14071-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-06-09 17:08 ` Srinivas Kandagatla
2015-06-09 17:13 ` Mark Brown
2015-06-09 17:31 ` Srinivas Kandagatla
2015-06-09 12:59 ` [PATCH v5 2/2] ASoC: qcom: add apq8016 sound card support Srinivas Kandagatla
2015-06-09 17:07 ` Mark Brown
2015-06-09 17:51 ` Srinivas Kandagatla [this message]
2015-06-09 18:04 ` Mark Brown
2015-06-09 18:22 ` Srinivas Kandagatla
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=557727BF.8040807@linaro.org \
--to=srinivas.kandagatla@linaro.org \
--cc=alsa-devel@alsa-project.org \
--cc=bgoswami@codeaurora.org \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=kwestfie@codeaurora.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=plai@codeaurora.org \
--cc=robh+dt@kernel.org \
--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).