From patchwork Mon Feb 12 12:46:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 128093 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3206472ljc; Mon, 12 Feb 2018 05:24:44 -0800 (PST) X-Google-Smtp-Source: AH8x226+1M4JPosVctdxxniZ6DWN1WBYioLJFw6hfOuUOAtjLGQj0Mp0UPTN5kq+jMY+buDRZKmb X-Received: by 10.28.135.208 with SMTP id j199mr3605172wmd.151.1518441884319; Mon, 12 Feb 2018 05:24:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518441884; cv=none; d=google.com; s=arc-20160816; b=fytyS+x78XIVyhjXAAUX7bOx0hiaiNbhiIwvpe394vHtwVHy/d/9W2JZ/kPZBTZ3Zp 4khaMQ4nirYMW96iWcLHlZuh159pMMNe/GJW21w/6k+id4Y4Ofw+kUGS5DABTlUr3ww0 4atNn8fDvqBDdhZ6RfJ7as8X4NXP7RO7vAeTDiZ3YRYKXw1CUhaEV6XPhabH0TpjTrAg hKl8iQurnxCx5ayefwgQBbBhtKkwT8qIYtQLsJsuTlKGnq7oVn57iS3zhGUAyy2MjF4C iMhkOy77P4AM3OiVrY/TRiRLR025mykegLQE9IbRelfo8k4l2PdzcuFuTkUfgLoGVit9 Y6dg== 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 :dkim-signature:delivered-to:arc-authentication-results; bh=B3hp6tjVJCYeaoaNuMciinTpf8VzF5HffE05gC656rw=; b=XyGWwZlw69fxAnG7UIGL9eiz0K6akeI/ufJoPo/d2plNJWUkSlGhUqSY+RZNXFCTiQ A+qqsEydFjM/iJVuCqWnMlBxOW9vacmoznhf/hGRGfMPPCV+nRwo5+PBe0BtLvb0+29S UFsTsdhh9YIJF72uEB5PEigIWqk7NN52/xVJNVWBup0B02Dc8sfZx4p1hUyTZY6Jp5Uk UP/MymvJ5BTD81Ckj/RgFq3LFYDZ6FJMv3bIWxsQOlSXfq/TUGEn79wXPCW2vwJBDqAP aIlTbyuj6NkRlid08Wy5AEdoe97GUnI1xb8IbTenMkge7CLqDjvEAEpDP97+7mTlmc6B Nn4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=mbDsRZ3m; 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 o7si6486620wrh.154.2018.02.12.05.24.44; Mon, 12 Feb 2018 05:24:44 -0800 (PST) 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; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=mbDsRZ3m; 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 6BF6A268892; Mon, 12 Feb 2018 14:21:48 +0100 (CET) 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 0CDEE268893; Mon, 12 Feb 2018 14:21:47 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 6E1FC267DBD for ; Mon, 12 Feb 2018 13:46:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=Vn1SVzDj9s24Ds1s0BlTxB1/guSFVXXsYykLUAl6KOQ=; b=mbDsRZ3msBwS IyBXcGTC0bPxcUyjCC+ehtGo9LmsyEaFZ8RlBaTarBBT/ZSfysKBcwaBBfIxzRzwFhcIb5xYptSRH kRy0I9YZlmXnzGh22n7wV9VjgUlKfl8FyBEqFBNW/vDtP/RmGbzhqOfmSo8cHtyhBhODWg2WUYIot WFxtc=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1elDV2-0002Rk-NY; Mon, 12 Feb 2018 12:46:24 +0000 Received: from broonie by debutante with local (Exim 4.90) (envelope-from ) id 1elDV2-0005VH-9E; Mon, 12 Feb 2018 12:46:24 +0000 From: Mark Brown To: Kuninori Morimoto In-Reply-To: <87lggh2wdg.wl%kuninori.morimoto.gx@renesas.com> Message-Id: Date: Mon, 12 Feb 2018 12:46:24 +0000 Cc: alsa-devel@alsa-project.org, Mark Brown Subject: [alsa-devel] Applied "ASoC: wm9867: replace codec to component" 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: wm9867: replace codec to component has been applied to the asoc tree at https://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 91880a6b6ba398c74420b4b0d0ef6fc3005f71ca Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 29 Jan 2018 03:11:46 +0000 Subject: [PATCH] ASoC: wm9867: replace codec to component Now we can replace Codec to Component. Let's do it. Note: xxx_codec_xxx() -> xxx_component_xxx() .idle_bias_off = 0 -> .idle_bias_on = 1 .ignore_pmdown_time = 0 -> .use_pmdown_time = 1 - -> .endianness = 1 - -> .non_legacy_dai_naming = 1 Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- sound/soc/codecs/max9867.c | 65 +++++++++++++++++++++------------------------- sound/soc/codecs/max9867.h | 2 +- 2 files changed, 31 insertions(+), 36 deletions(-) -- 2.16.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/codecs/max9867.c b/sound/soc/codecs/max9867.c index 2f60924fe919..a4e8fafb7e6d 100644 --- a/sound/soc/codecs/max9867.c +++ b/sound/soc/codecs/max9867.c @@ -179,8 +179,8 @@ static inline int get_ni_value(int mclk, int rate) static int max9867_dai_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { - struct snd_soc_codec *codec = dai->codec; - struct max9867_priv *max9867 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct max9867_priv *max9867 = snd_soc_component_get_drvdata(component); unsigned int ni_h, ni_l; int value; @@ -227,7 +227,7 @@ static int max9867_dai_hw_params(struct snd_pcm_substream *substream, bclk_value = MAX9867_IFC1B_PCLK_16; break; default: - dev_err(codec->dev, + dev_err(component->dev, "unsupported sampling rate\n"); return -EINVAL; } @@ -239,7 +239,7 @@ static int max9867_dai_hw_params(struct snd_pcm_substream *substream, bclk_value = MAX9867_IFC1B_32BIT; break; default: - dev_err(codec->dev, "unsupported sampling rate\n"); + dev_err(component->dev, "unsupported sampling rate\n"); return -EINVAL; } regmap_update_bits(max9867->regmap, MAX9867_IFC1B, @@ -251,8 +251,8 @@ static int max9867_dai_hw_params(struct snd_pcm_substream *substream, static int max9867_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - struct snd_soc_codec *codec = dai->codec; - struct max9867_priv *max9867 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct max9867_priv *max9867 = snd_soc_component_get_drvdata(component); regmap_update_bits(max9867->regmap, MAX9867_PWRMAN, MAX9867_SHTDOWN_MASK, MAX9867_SHTDOWN_MASK); @@ -261,8 +261,8 @@ static int max9867_prepare(struct snd_pcm_substream *substream, static int max9867_mute(struct snd_soc_dai *dai, int mute) { - struct snd_soc_codec *codec = dai->codec; - struct max9867_priv *max9867 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct max9867_priv *max9867 = snd_soc_component_get_drvdata(component); if (mute) regmap_update_bits(max9867->regmap, MAX9867_DACLEVEL, @@ -276,8 +276,8 @@ static int max9867_mute(struct snd_soc_dai *dai, int mute) static int max9867_set_dai_sysclk(struct snd_soc_dai *codec_dai, int clk_id, unsigned int freq, int dir) { - struct snd_soc_codec *codec = codec_dai->codec; - struct max9867_priv *max9867 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = codec_dai->component; + struct max9867_priv *max9867 = snd_soc_component_get_drvdata(component); int value = 0; /* Set the prescaler based on the master clock frequency*/ @@ -306,8 +306,8 @@ static int max9867_set_dai_sysclk(struct snd_soc_dai *codec_dai, static int max9867_dai_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) { - struct snd_soc_codec *codec = codec_dai->codec; - struct max9867_priv *max9867 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = codec_dai->component; + struct max9867_priv *max9867 = snd_soc_component_get_drvdata(component); u8 iface1A = 0, iface1B = 0; switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { @@ -404,25 +404,27 @@ static int max9867_resume(struct device *dev) } #endif -static int max9867_probe(struct snd_soc_codec *codec) +static int max9867_probe(struct snd_soc_component *component) { - struct max9867_priv *max9867 = snd_soc_codec_get_drvdata(codec); + struct max9867_priv *max9867 = snd_soc_component_get_drvdata(component); - dev_dbg(codec->dev, "max98090_probe\n"); - max9867->codec = codec; + dev_dbg(component->dev, "max98090_probe\n"); + max9867->component = component; return 0; } -static const struct snd_soc_codec_driver max9867_codec = { - .probe = max9867_probe, - .component_driver = { - .controls = max9867_snd_controls, - .num_controls = ARRAY_SIZE(max9867_snd_controls), - .dapm_routes = max9867_audio_map, - .num_dapm_routes = ARRAY_SIZE(max9867_audio_map), - .dapm_widgets = max9867_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(max9867_dapm_widgets), - }, +static const struct snd_soc_component_driver max9867_component = { + .probe = max9867_probe, + .controls = max9867_snd_controls, + .num_controls = ARRAY_SIZE(max9867_snd_controls), + .dapm_routes = max9867_audio_map, + .num_dapm_routes = ARRAY_SIZE(max9867_audio_map), + .dapm_widgets = max9867_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(max9867_dapm_widgets), + .idle_bias_on = 1, + .use_pmdown_time = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, }; static bool max9867_volatile_register(struct device *dev, unsigned int reg) @@ -497,21 +499,15 @@ static int max9867_i2c_probe(struct i2c_client *i2c, return ret; } dev_info(&i2c->dev, "device revision: %x\n", reg); - ret = snd_soc_register_codec(&i2c->dev, &max9867_codec, + ret = devm_snd_soc_register_component(&i2c->dev, &max9867_component, max9867_dai, ARRAY_SIZE(max9867_dai)); if (ret < 0) { - dev_err(&i2c->dev, "Failed to register codec: %d\n", ret); + dev_err(&i2c->dev, "Failed to register component: %d\n", ret); return ret; } return ret; } -static int max9867_i2c_remove(struct i2c_client *client) -{ - snd_soc_unregister_codec(&client->dev); - return 0; -} - static const struct i2c_device_id max9867_i2c_id[] = { { "max9867", 0 }, { } @@ -535,7 +531,6 @@ static struct i2c_driver max9867_i2c_driver = { .pm = &max9867_pm_ops, }, .probe = max9867_i2c_probe, - .remove = max9867_i2c_remove, .id_table = max9867_i2c_id, }; diff --git a/sound/soc/codecs/max9867.h b/sound/soc/codecs/max9867.h index 65590b4ad62a..c0aea3d1f2ba 100644 --- a/sound/soc/codecs/max9867.h +++ b/sound/soc/codecs/max9867.h @@ -75,7 +75,7 @@ /* codec private data */ struct max9867_priv { struct regmap *regmap; - struct snd_soc_codec *codec; + struct snd_soc_component *component; unsigned int sysclk; unsigned int pclk; unsigned int master;