From patchwork Wed Jul 19 11:27:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 108274 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp688420qge; Wed, 19 Jul 2017 04:27:33 -0700 (PDT) X-Received: by 10.28.156.202 with SMTP id f193mr5115076wme.22.1500463653677; Wed, 19 Jul 2017 04:27:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500463653; cv=none; d=google.com; s=arc-20160816; b=jL+/E66ooVmLF+TGV3Gg/W2oGHtWgveO/k9ng030vnLgZVcyqK9RklzyCiWBwfd9Ep zrEL119HzupsEPwAN9t3wohpHHW95h0sOQD1vR3z9URx56g0ITLSaw2RVAqRNQL/BRJO KpB/Hxzr+y38mW4LA0DbzXkANHepv6sRpGS1afxJvfJvLsh0DYl0qwzasuRljEwINnbD +2WaC5eJjZ3UyLVHFbNg3D1QecYcp4Kt3bDBkq4FEMTrxyrRGoJRmbiwH8TI4DlEnT5u k2kA2f7bzRPU22OfQw4pJli3PFwsaBZ3YcPaOqkK3YCujaiRa6Snlz3E6GR7VvSbRksw lmFw== 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=PH6d/Sws015cfaP69XF143EVasIFPcEll2jUkffw5II=; b=PaQ+ZZkcSl4loXIYPspQY2mt8HNHuIiG8QZlA0Tx1d/G+AMvVnae14iacZfmhsTyms z0zPFOkYGTb9dQCspwpP4GsTRCnDi+2QW5gjw/4FdffPFwhBXibmT60pNSCFjUBJKvQe 74Zw4pbkSJmkUe7PAe8hIcAT4oPq+AGjlCTbd9cE31Hm862zRAp6Up+0RQBNgGoRJzsQ gSBLUqU9iZAR4eI4xpXdiVVufaXEhbN1lLaJN2Rs1K238cmVpE1c1sPgyyQe3CtVmqhU enXmQzZ+FVCaFmO7PCkM+qNV2XAu3uDuB6NCIZZH6YTUn+fYDDQoBDEw0b6VxYOkiHOr BwiQ== 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 i17si111490wrc.474.2017.07.19.04.27.32; Wed, 19 Jul 2017 04:27: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 71C27267326; Wed, 19 Jul 2017 13:27:22 +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 4EB3B267327; Wed, 19 Jul 2017 13:27:20 +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=HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, SPF_PASS, 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 20193266998 for ; Wed, 19 Jul 2017 13:27:17 +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 1dXn8J-0002Uc-O4; Wed, 19 Jul 2017 11:27:14 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1dXn8H-0002cG-85; Wed, 19 Jul 2017 12:27:09 +0100 From: Mark Brown To: Andy Shevchenko In-Reply-To: <20170718173419.65980-2-andriy.shevchenko@linux.intel.com> Message-Id: Date: Wed, 19 Jul 2017 12:27:09 +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: Hide platform data in the module sources" 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: Hide platform data in the module sources 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 ddc9e69b9dc23d4c0d8ed829575327746ea77a04 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Tue, 18 Jul 2017 20:34:17 +0300 Subject: [PATCH] ASoC: rt5677: Hide platform data in the module sources There is no user of legacy platform data. Remove separate header and hide its content inside module sources. Signed-off-by: Andy Shevchenko Signed-off-by: Mark Brown --- include/sound/rt5677.h | 45 --------------------------------------------- sound/soc/codecs/rt5677.c | 29 +++++++++++++++++------------ sound/soc/codecs/rt5677.h | 30 +++++++++++++++++++++++++++++- 3 files changed, 46 insertions(+), 58 deletions(-) delete mode 100644 include/sound/rt5677.h -- 2.13.2 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/include/sound/rt5677.h b/include/sound/rt5677.h deleted file mode 100644 index a6207043ac3c..000000000000 --- a/include/sound/rt5677.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * linux/sound/rt5677.h -- Platform data for RT5677 - * - * Copyright 2013 Realtek Semiconductor Corp. - * Author: Oder Chiou - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#ifndef __LINUX_SND_RT5677_H -#define __LINUX_SND_RT5677_H - -enum rt5677_dmic2_clk { - RT5677_DMIC_CLK1 = 0, - RT5677_DMIC_CLK2 = 1, -}; - - -struct rt5677_platform_data { - /* IN1/IN2/LOUT1/LOUT2/LOUT3 can optionally be differential */ - bool in1_diff; - bool in2_diff; - bool lout1_diff; - bool lout2_diff; - bool lout3_diff; - /* DMIC2 clock source selection */ - enum rt5677_dmic2_clk dmic2_clk_pin; - - /* configures GPIO, 0 - floating, 1 - pulldown, 2 - pullup */ - u8 gpio_config[6]; - - /* jd1 can select 0 ~ 3 as OFF, GPIO1, GPIO2 and GPIO3 respectively */ - unsigned int jd1_gpio; - /* jd2 and jd3 can select 0 ~ 3 as - OFF, GPIO4, GPIO5 and GPIO6 respectively */ - unsigned int jd2_gpio; - unsigned int jd3_gpio; - - /* Set MICBIAS1 VDD 1v8 or 3v3 */ - bool micbias1_vdd_3v3; -}; - -#endif diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c index 36e530a36c82..0f9642c2198a 100644 --- a/sound/soc/codecs/rt5677.c +++ b/sound/soc/codecs/rt5677.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -5019,25 +5020,21 @@ static const struct regmap_config rt5677_regmap = { }; static const struct i2c_device_id rt5677_i2c_id[] = { - { "rt5677", RT5677 }, - { "rt5676", RT5676 }, { } }; MODULE_DEVICE_TABLE(i2c, rt5677_i2c_id); static const struct of_device_id rt5677_of_match[] = { - { .compatible = "realtek,rt5677", }, + { .compatible = "realtek,rt5677", RT5677 }, { } }; MODULE_DEVICE_TABLE(of, rt5677_of_match); -#ifdef CONFIG_ACPI static const struct acpi_device_id rt5677_acpi_match[] = { { "RT5677CE", RT5677 }, { } }; MODULE_DEVICE_TABLE(acpi, rt5677_acpi_match); -#endif static void rt5677_read_acpi_properties(struct rt5677_priv *rt5677, struct device *dev) @@ -5147,7 +5144,6 @@ static void rt5677_free_irq(struct i2c_client *i2c) static int rt5677_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { - struct rt5677_platform_data *pdata = dev_get_platdata(&i2c->dev); struct rt5677_priv *rt5677; int ret; unsigned int val; @@ -5159,16 +5155,25 @@ static int rt5677_i2c_probe(struct i2c_client *i2c, i2c_set_clientdata(i2c, rt5677); - rt5677->type = id->driver_data; + if (i2c->dev.of_node) { + const struct of_device_id *match_id; + + match_id = of_match_device(rt5677_of_match, &i2c->dev); + if (match_id) + rt5677->type = (enum rt5677_type)match_id->data; - if (pdata) - rt5677->pdata = *pdata; - else if (i2c->dev.of_node) rt5677_read_device_properties(rt5677, &i2c->dev); - else if (ACPI_HANDLE(&i2c->dev)) + } else if (ACPI_HANDLE(&i2c->dev)) { + const struct acpi_device_id *acpi_id; + + acpi_id = acpi_match_device(rt5677_acpi_match, &i2c->dev); + if (acpi_id) + rt5677->type = (enum rt5677_type)acpi_id->driver_data; + rt5677_read_acpi_properties(rt5677, &i2c->dev); - else + } else { return -EINVAL; + } /* pow-ldo2 and reset are optional. The codec pins may be statically * connected on the board without gpios. If the gpio device property diff --git a/sound/soc/codecs/rt5677.h b/sound/soc/codecs/rt5677.h index d46855a42c40..97239973edc4 100644 --- a/sound/soc/codecs/rt5677.h +++ b/sound/soc/codecs/rt5677.h @@ -12,7 +12,6 @@ #ifndef __RT5677_H__ #define __RT5677_H__ -#include #include #include @@ -1761,6 +1760,35 @@ enum { RT5677_I2S4_SOURCE = (0x1 << 18), }; +enum rt5677_dmic2_clk { + RT5677_DMIC_CLK1 = 0, + RT5677_DMIC_CLK2 = 1, +}; + +struct rt5677_platform_data { + /* IN1/IN2/LOUT1/LOUT2/LOUT3 can optionally be differential */ + bool in1_diff; + bool in2_diff; + bool lout1_diff; + bool lout2_diff; + bool lout3_diff; + /* DMIC2 clock source selection */ + enum rt5677_dmic2_clk dmic2_clk_pin; + + /* configures GPIO, 0 - floating, 1 - pulldown, 2 - pullup */ + u8 gpio_config[6]; + + /* jd1 can select 0 ~ 3 as OFF, GPIO1, GPIO2 and GPIO3 respectively */ + unsigned int jd1_gpio; + /* jd2 and jd3 can select 0 ~ 3 as + OFF, GPIO4, GPIO5 and GPIO6 respectively */ + unsigned int jd2_gpio; + unsigned int jd3_gpio; + + /* Set MICBIAS1 VDD 1v8 or 3v3 */ + bool micbias1_vdd_3v3; +}; + struct rt5677_priv { struct snd_soc_codec *codec; struct rt5677_platform_data pdata;