Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751368AbbFKHD2 (ORCPT ); Thu, 11 Jun 2015 03:03:28 -0400 Received: from lb2-smtp-cloud2.xs4all.net ([194.109.24.25]:52825 "EHLO lb2-smtp-cloud2.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750819AbbFKHDW (ORCPT ); Thu, 11 Jun 2015 03:03:22 -0400 Message-ID: <1434006187.24094.40.camel@x220> Subject: Re: [PATCH 1/3] ASoC: mediatek: Add AFE platform driver From: Paul Bolle To: Koro Chen Cc: robh+dt@kernel.org, matthias.bgg@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.de, srv_heupstream@mediatek.com, linux-mediatek@lists.infradead.org, s.hauer@pengutronix.de, galak@codeaurora.org, lgirdwood@gmail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Date: Thu, 11 Jun 2015 09:03:07 +0200 In-Reply-To: <1433946276-25969-2-git-send-email-koro.chen@mediatek.com> References: <1433946276-25969-1-git-send-email-koro.chen@mediatek.com> <1433946276-25969-2-git-send-email-koro.chen@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4 (3.10.4-4.fc20) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2589 Lines: 98 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 > +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?) > + 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 "); > +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.) 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). Thanks, Paul Bolle -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/