From: Koro Chen <koro.chen@mediatek.com>
To: Paul Bolle <pebolle@tiscali.nl>
Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org,
srv_heupstream@mediatek.com, tiwai@suse.de,
linux-kernel@vger.kernel.org, s.hauer@pengutronix.de,
lgirdwood@gmail.com, robh+dt@kernel.org, broonie@kernel.org,
linux-mediatek@lists.infradead.org, galak@codeaurora.org,
matthias.bgg@gmail.com, linux-arm-kernel@lists.infradead.org
Subject: Re: [alsa-devel] [PATCH 1/3] ASoC: mediatek: Add AFE platform driver
Date: Fri, 12 Jun 2015 09:55:58 +0800 [thread overview]
Message-ID: <1434074158.10969.5.camel@mtksdaap41> (raw)
In-Reply-To: <1434006187.24094.40.camel@x220>
On Thu, 2015-06-11 at 09:03 +0200, Paul Bolle wrote:
> On Wed, 2015-06-10 at 22:24 +0800, Koro Chen wrote:
> > --- /dev/null
> > +++ b/sound/soc/mediatek/Kconfig
>
> > +config SND_SOC_MEDIATEK
> > + bool "ASoC support for Mediatek chip"
> > + depends on ARCH_MEDIATEK
> > + help
> > + This adds ASoC platform driver support for Mediatek chip
> > + that can be used with other codecs.
> > + Select Y if you have such device.
> > + Ex: MT8173
>
> > --- /dev/null
> > +++ b/sound/soc/mediatek/Makefile
>
> > +obj-$(CONFIG_SND_SOC_MEDIATEK) += mtk-afe-pcm.o
>
> > --- /dev/null
> > +++ b/sound/soc/mediatek/mtk-afe-pcm.c
>
> > +#include <linux/module.h>
>
> > +static void mtk_afe_set_i2s_enable(struct mtk_afe *afe, bool enable)
> > +{
> > + unsigned int val;
> > +
> > + regmap_read(afe->regmap, AFE_I2S_CON2, &val);
> > + if (!!(val & AFE_I2S_CON2_EN) == !!enable)
>
> (What does negating a bool twice do?)
>
Because bool actually can be unsigned char, although actually in this
driver, the caller always passes "true" or "false" to this function.
Do you think if this is the case, should I still need to do !!?
> > + return; /* must skip soft reset */
> > +
> > + /* I2S soft reset begin */
> > + regmap_update_bits(afe->regmap, AUDIO_TOP_CON1, 0x4, 0x4);
> > +
> > + /* input */
> > + regmap_update_bits(afe->regmap, AFE_I2S_CON2, 0x1, !!enable);
>
> Ditto.
>
> > +
> > + /* output */
> > + regmap_update_bits(afe->regmap, AFE_I2S_CON1, 0x1, !!enable);
>
> Ditto.
>
> > +
> > + /* I2S soft reset end */
> > + udelay(1);
> > + regmap_update_bits(afe->regmap, AUDIO_TOP_CON1, 0x4, 0);
> > +}
>
> > +static const struct of_device_id mtk_afe_pcm_dt_match[] = {
> > + { .compatible = "mediatek,mt8173-afe-pcm", },
> > + { }
> > +};
>
> > +static struct platform_driver mtk_afe_pcm_driver = {
> > + .driver = {
> > + .name = "mtk-afe-pcm",
> > + .owner = THIS_MODULE,
> > + .of_match_table = mtk_afe_pcm_dt_match,
> > + .pm = &mtk_afe_pm_ops,
> > + },
> > + .probe = mtk_afe_pcm_dev_probe,
> > + .remove = mtk_afe_pcm_dev_remove,
> > +};
>
> > +MODULE_DESCRIPTION("Mediatek ALSA SoC AFE platform driver");
> > +MODULE_AUTHOR("Koro Chen <koro.chen@mediatek.com>");
> > +MODULE_LICENSE("GPL v2");
> > +MODULE_DEVICE_TABLE(of, mtk_afe_pcm_dt_match);
>
> (The common pattern is to have MODULE_DEVICE_TABLE() directly follow
> that table.)
>
Thank you for mentioning this, I will fix it.
> SND_SOC_MEDIATEK is a bool symbol and mtk-afe-pcm.o is built-in only.
> But the code uses a few module specific constructs. I spotted
> THIS_MODULE, MODULE_DESCRIPTION, MODULE_AUTHOR, MODULE_LICENSE, and
> MODULE_DEVICE_TABLE.
>
> Is SND_SOC_MEDIATEK perhaps meant to be bool?
>
> Likewise for SND_SOC_MT8173_MAX98090 (in 2/3) and
> SND_SOC_MT8173_RT5650_RT5676 (in 3/3).
>
OK, yes, I think I should replace it by tristate, thank you!
> Thanks,
>
>
> Paul Bolle
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next prev parent reply other threads:[~2015-06-12 1:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-10 14:24 [PATCH 0/3] ASoC: Mediatek: Add support for MT8173 SoC Koro Chen
[not found] ` <1433946276-25969-1-git-send-email-koro.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-06-10 14:24 ` [PATCH 1/3] ASoC: mediatek: Add AFE platform driver Koro Chen
2015-06-11 7:03 ` Paul Bolle
2015-06-11 7:13 ` Paul Bolle
2015-06-12 1:55 ` Koro Chen [this message]
2015-06-12 7:37 ` [alsa-devel] " Paul Bolle
2015-06-12 8:24 ` Koro Chen
[not found] ` <1433946276-25969-2-git-send-email-koro.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-06-12 13:06 ` Mark Brown
[not found] ` <20150612130638.GZ1921-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-06-15 2:06 ` Koro Chen
2015-06-10 14:24 ` [PATCH 3/3] ASoC: mediatek: Add machine driver for rt5650 rt5676 codec Koro Chen
2015-06-12 13:15 ` Mark Brown
2015-06-10 14:24 ` [PATCH 2/3] ASoC: mediatek: Add machine driver for MAX98090 codec Koro Chen
[not found] ` <1433946276-25969-3-git-send-email-koro.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-06-12 13:13 ` Mark Brown
[not found] ` <20150612131325.GA1921-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-06-15 2:31 ` Koro Chen
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=1434074158.10969.5.camel@mtksdaap41 \
--to=koro.chen@mediatek.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=pebolle@tiscali.nl \
--cc=robh+dt@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=srv_heupstream@mediatek.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).