From patchwork Fri Jun 16 16:53:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 105755 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp1398062qgd; Fri, 16 Jun 2017 09:53:33 -0700 (PDT) X-Received: by 10.28.99.84 with SMTP id x81mr8144027wmb.87.1497632013824; Fri, 16 Jun 2017 09:53:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497632013; cv=none; d=google.com; s=arc-20160816; b=PacX39cP58Tnzk87lRC2y1ZU9R2WX4ec8gQMMwtH6EL5FKG+7cV5N5Ry9a0Ht7wmIT H8K+VvhWDvVYaj2/8f50l3MiHm0mkFH9eHTFPU7H4Vjf0mjsAI5KV4FwZ++lP+ubIWMl 0frLEGqPi+UYVK1Vt6KjMZUIxGT6nMoPVbIW1MgYCQ31EeDl9UbGwBGmuMdwNv11Ws3o 1a9OAiaayHbk8gyhE+4Pta41Zw67k+qo7Fh5hkiFvXmrZVjyKTaBu9Dcf4EZhnbfSzXB GSK4mv4/Roi1o51vPcLTyMiTmKXcWGrg78CmssSj18x1zVrLN2zoNUSvtm/eg6vdMkxc YDdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :delivered-to:arc-authentication-results; bh=x/bdSqzhpaj9FvuSuTjoPx8G7GTCoqQ6MEnkiSUz1OI=; b=drgkT8NmsNRwnBTwoTh/tJYoS+4rMkV/b18rzlLXQA9QmcKDecpiLaaFPhsPTZyLsn ZifRHFznPocgO9QN9ix9CnZD5wQhERiCrhLuiXSyKfzTb50cwKTsdYRKeTeo5gabmR3R qOk4jXqVPz7gNp4sn7k6FhTSd/VtjZIcgjBsmLMvc0XA1D+Oahlz7XJy0+uY2ZIHx3nA A61u+NJyQnbnbwU16Ngqjs6WS+a1ztN4DiDDnqrWGyrXUjXZ0+t1Bp4fpgfNwXZHri0t crE7jgdVR5AsNo+H6fNq6CtYocC49l69xE7Nvn/n+3t0mDmbCgGJKiFoRPdUUft1dSGs lrbg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id m70si2787415wmc.121.2017.06.16.09.53.33; Fri, 16 Jun 2017 09:53:33 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 69EB1267428; Fri, 16 Jun 2017 18:53:21 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 4452B266C99; Fri, 16 Jun 2017 18:53:19 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, SPF_PASS, T_RP_MATCHES_RCVD, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mezzanine.sirena.org.uk (mezzanine.sirena.org.uk [106.187.55.193]) by alsa0.perex.cz (Postfix) with ESMTP id 74A0A2673C9 for ; Fri, 16 Jun 2017 18:53:14 +0200 (CEST) Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1dLuUa-0007Id-7F; Fri, 16 Jun 2017 16:53:06 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1dLuUW-0003wx-Kz; Fri, 16 Jun 2017 17:53:00 +0100 From: Mark Brown To: Andy Shevchenko In-Reply-To: <20170615124638.65971-3-andriy.shevchenko@linux.intel.com> Message-Id: Date: Fri, 16 Jun 2017 17:53:00 +0100 X-SA-Exim-Connect-IP: 2001:470:1f1d:6b5::3 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: No (on mezzanine.sirena.org.uk); Unknown failure Cc: Oder Chiou , alsa-devel@alsa-project.org, Liam Girdwood , Mark Brown , John Keeping , Bard Liao Subject: [alsa-devel] Applied "ASoC: rt5677: Move platform code to board file" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: rt5677: Move platform code to board file has been applied to the asoc tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From 55e59aa0525a461abcbc226ace7a7eb9d9a07a4a Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Thu, 15 Jun 2017 15:46:37 +0300 Subject: [PATCH] ASoC: rt5677: Move platform code to board file GPIO ACPI mapping table is defined on platform basis. Codec driver shouldn't have known what platform is using it. Make codec driver more generic by moving platform code to where it belongs. Signed-off-by: Andy Shevchenko Signed-off-by: Mark Brown --- sound/soc/codecs/rt5677.c | 26 -------------------------- sound/soc/intel/boards/bdw-rt5677.c | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 26 deletions(-) -- 2.11.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c index 64cf6cc41ad1..36e530a36c82 100644 --- a/sound/soc/codecs/rt5677.c +++ b/sound/soc/codecs/rt5677.c @@ -41,15 +41,6 @@ #define RT5677_PR_BASE (RT5677_PR_RANGE_BASE + (0 * RT5677_PR_SPACING)) -/* GPIO indexes defined by ACPI */ -enum { - RT5677_GPIO_PLUG_DET = 0, - RT5677_GPIO_MIC_PRESENT_L = 1, - RT5677_GPIO_HOTWORD_DET_L = 2, - RT5677_GPIO_DSP_INT = 3, - RT5677_GPIO_HP_AMP_SHDN_L = 4, -}; - static const struct regmap_range_cfg rt5677_ranges[] = { { .name = "PR", @@ -5048,28 +5039,11 @@ static const struct acpi_device_id rt5677_acpi_match[] = { MODULE_DEVICE_TABLE(acpi, rt5677_acpi_match); #endif -static const struct acpi_gpio_params plug_det_gpio = { RT5677_GPIO_PLUG_DET, 0, false }; -static const struct acpi_gpio_params mic_present_gpio = { RT5677_GPIO_MIC_PRESENT_L, 0, false }; -static const struct acpi_gpio_params headphone_enable_gpio = { RT5677_GPIO_HP_AMP_SHDN_L, 0, false }; - -static const struct acpi_gpio_mapping bdw_rt5677_gpios[] = { - { "plug-det-gpios", &plug_det_gpio, 1 }, - { "mic-present-gpios", &mic_present_gpio, 1 }, - { "headphone-enable-gpios", &headphone_enable_gpio, 1 }, - { NULL }, -}; - static void rt5677_read_acpi_properties(struct rt5677_priv *rt5677, struct device *dev) { - int ret; u32 val; - ret = acpi_dev_add_driver_gpios(ACPI_COMPANION(dev), - bdw_rt5677_gpios); - if (ret) - dev_warn(dev, "Failed to add driver gpios\n"); - if (!device_property_read_u32(dev, "DCLK", &val)) rt5677->pdata.dmic2_clk_pin = val; diff --git a/sound/soc/intel/boards/bdw-rt5677.c b/sound/soc/intel/boards/bdw-rt5677.c index 14d9693c1641..bb98e94dd6f9 100644 --- a/sound/soc/intel/boards/bdw-rt5677.c +++ b/sound/soc/intel/boards/bdw-rt5677.c @@ -16,6 +16,7 @@ * along with this program. If not, see . */ +#include #include #include #include @@ -120,6 +121,26 @@ static struct snd_soc_jack_gpio mic_jack_gpio = { .invert = 1, }; +/* GPIO indexes defined by ACPI */ +enum { + RT5677_GPIO_PLUG_DET = 0, + RT5677_GPIO_MIC_PRESENT_L = 1, + RT5677_GPIO_HOTWORD_DET_L = 2, + RT5677_GPIO_DSP_INT = 3, + RT5677_GPIO_HP_AMP_SHDN_L = 4, +}; + +static const struct acpi_gpio_params plug_det_gpio = { RT5677_GPIO_PLUG_DET, 0, false }; +static const struct acpi_gpio_params mic_present_gpio = { RT5677_GPIO_MIC_PRESENT_L, 0, false }; +static const struct acpi_gpio_params headphone_enable_gpio = { RT5677_GPIO_HP_AMP_SHDN_L, 0, false }; + +static const struct acpi_gpio_mapping bdw_rt5677_gpios[] = { + { "plug-det-gpios", &plug_det_gpio, 1 }, + { "mic-present-gpios", &mic_present_gpio, 1 }, + { "headphone-enable-gpios", &headphone_enable_gpio, 1 }, + { NULL }, +}; + static int broadwell_ssp0_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params) { @@ -184,6 +205,12 @@ static int bdw_rt5677_init(struct snd_soc_pcm_runtime *rtd) snd_soc_card_get_drvdata(rtd->card); struct snd_soc_codec *codec = rtd->codec; struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); + int ret; + + ret = acpi_dev_add_driver_gpios(ACPI_COMPANION(codec->dev), + bdw_rt5677_gpios); + if (ret) + dev_warn(codec->dev, "Failed to add driver gpios\n"); /* Enable codec ASRC function for Stereo DAC/Stereo1 ADC/DMIC/I2S1. * The ASRC clock source is clk_i2s1_asrc.