From patchwork Mon Feb 12 12:41:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 128046 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3197551ljc; Mon, 12 Feb 2018 05:13:44 -0800 (PST) X-Google-Smtp-Source: AH8x227ZUrz6WKSXRpl7cDx4LwGO3vt4BK0rRZ/JswAyF4JWhNPTD/PxpyIjEMIOTiUB/tAICR0c X-Received: by 10.28.112.21 with SMTP id l21mr3891949wmc.70.1518441224550; Mon, 12 Feb 2018 05:13:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518441224; cv=none; d=google.com; s=arc-20160816; b=c3sQOcAY2jSQvvmzBfzy17tgBq2iJ0DhoJaeuKQUwouSprMEL+R4h9huceBtrA8H6R 0qCNaeLDEt6aJ/sj+DDG/raw4NETYuvMv42Omsuz8uwsQ5zo3+sw0+1nSmfZAx6Mrfzc 9C5p2tf0MytZNYXv3u53juiR+lu1OU2U34HIsvc3y4Vyd7ywvhHqxhp1gNN/fBc2FIsp kEMpBwxWvlp0USVPwZ/oRhGuhh3mr0RgVCy83tiOsD2acVYu+1XBqI6e8yR6OZYjYITE FjGRVKoVW4dz/gq4X8PmzGIhT3kz7omPkj3dgHBtVzIi/CR+9AApt1fDHd9aR2Inmdbs KBug== 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=mie6Am1aKG/h7VpkWMubY2zyGl8wEVOBUdNUhp2oibw=; b=mHy0530Yqgc2XxIZzUvSsbFXWPYdEs6ZHepdO5gqFNZVZhGmcKgYUV62ffaAzSzU5a 2VyQ6w+jpwpXROZVsaTwlOsRdz+/ugKejkW7RvdSaJXv31nnr8W0Ra2oaKeoBNun7nl8 DE+DauBV3tweSt2jc1pX6tPF54ue73GY7+GDNgrgGXnE7Rlb6S2EbF++rJBe+cdkU4Rn OLK4OLcdth0smJVkvNZ6SjSTEixaTrgTslf4Ep45alPG+6+y7HBY0cnZSixTCNYGZLj5 a8BiiJ3Ws+O1SZWZMjsHRDvuBY1sBj/BRofrJtO1TMNKxPMaW7rOwBRsuiDhCOWo+5Xw lwJw== 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=A4Plyyjf; 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 y138si3535733wmc.255.2018.02.12.05.13.44; Mon, 12 Feb 2018 05:13: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=A4Plyyjf; 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 716272684C6; Mon, 12 Feb 2018 14:13:00 +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 75BFC2684C3; Mon, 12 Feb 2018 14:12:59 +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 556F42679B5 for ; Mon, 12 Feb 2018 13:41:36 +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=qF1GGAUer2I7Un+v79cnuE63q+rD9INTSIwhCNJBYMs=; b=A4Plyyjf52Mq 48S80KRT/3SBvFKG9mEQkdq/DN7vsIU4ku7VAgMjBS3u4K+DV6jL9lHjFpsw3jLoTSdTP8xh99Mhz crcyMQrcwnpmshZASb6NIw5B2ESV3s57Hnf20LqjZbuCOTrtoQdIln0xN59MhSkcX/a5e+8kELnO3 WdHR0=; 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 1elDQM-0002GS-Hc; Mon, 12 Feb 2018 12:41:34 +0000 Received: from broonie by debutante with local (Exim 4.90) (envelope-from ) id 1elDQM-0004s7-3N; Mon, 12 Feb 2018 12:41:34 +0000 From: Mark Brown To: Kuninori Morimoto In-Reply-To: <87r2q9z4yk.wl%kuninori.morimoto.gx@renesas.com> Message-Id: Date: Mon, 12 Feb 2018 12:41:34 +0000 Cc: alsa-devel@alsa-project.org, Mark Brown Subject: [alsa-devel] Applied "ASoC: max98371: 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: max98371: 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 1ae91ac7f787ee4078d93147d633ce3377ece748 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 29 Jan 2018 04:05:15 +0000 Subject: [PATCH] ASoC: max98371: 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/max98371.c | 43 +++++++++++++++++++------------------------ sound/soc/codecs/max98371.h | 1 - 2 files changed, 19 insertions(+), 25 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/max98371.c b/sound/soc/codecs/max98371.c index 7bc2a17c1e94..d4ba1392aaf8 100644 --- a/sound/soc/codecs/max98371.c +++ b/sound/soc/codecs/max98371.c @@ -187,15 +187,15 @@ static const struct snd_kcontrol_new max98371_snd_controls[] = { static int max98371_dai_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) { - struct snd_soc_codec *codec = codec_dai->codec; - struct max98371_priv *max98371 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = codec_dai->component; + struct max98371_priv *max98371 = snd_soc_component_get_drvdata(component); unsigned int val = 0; switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { case SND_SOC_DAIFMT_CBS_CFS: break; default: - dev_err(codec->dev, "DAI clock mode unsupported"); + dev_err(component->dev, "DAI clock mode unsupported"); return -EINVAL; } @@ -210,7 +210,7 @@ static int max98371_dai_set_fmt(struct snd_soc_dai *codec_dai, val |= MAX98371_DAI_LEFT; break; default: - dev_err(codec->dev, "DAI wrong mode unsupported"); + dev_err(component->dev, "DAI wrong mode unsupported"); return -EINVAL; } regmap_update_bits(max98371->regmap, MAX98371_FMT, @@ -222,8 +222,8 @@ static int max98371_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 max98371_priv *max98371 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct max98371_priv *max98371 = snd_soc_component_get_drvdata(component); int blr_clk_ratio, ch_size, channels = params_channels(params); int rate = params_rate(params); @@ -348,15 +348,17 @@ static struct snd_soc_dai_driver max98371_dai[] = { } }; -static const struct snd_soc_codec_driver max98371_codec = { - .component_driver = { - .controls = max98371_snd_controls, - .num_controls = ARRAY_SIZE(max98371_snd_controls), - .dapm_routes = max98371_audio_map, - .num_dapm_routes = ARRAY_SIZE(max98371_audio_map), - .dapm_widgets = max98371_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(max98371_dapm_widgets), - }, +static const struct snd_soc_component_driver max98371_component = { + .controls = max98371_snd_controls, + .num_controls = ARRAY_SIZE(max98371_snd_controls), + .dapm_routes = max98371_audio_map, + .num_dapm_routes = ARRAY_SIZE(max98371_audio_map), + .dapm_widgets = max98371_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(max98371_dapm_widgets), + .idle_bias_on = 1, + .use_pmdown_time = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, }; static const struct regmap_config max98371_regmap = { @@ -397,21 +399,15 @@ static int max98371_i2c_probe(struct i2c_client *i2c, } dev_info(&i2c->dev, "device version %x\n", reg); - ret = snd_soc_register_codec(&i2c->dev, &max98371_codec, + ret = devm_snd_soc_register_component(&i2c->dev, &max98371_component, max98371_dai, ARRAY_SIZE(max98371_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 max98371_i2c_remove(struct i2c_client *client) -{ - snd_soc_unregister_codec(&client->dev); - return 0; -} - static const struct i2c_device_id max98371_i2c_id[] = { { "max98371", 0 }, { } @@ -432,7 +428,6 @@ static struct i2c_driver max98371_i2c_driver = { .of_match_table = of_match_ptr(max98371_of_match), }, .probe = max98371_i2c_probe, - .remove = max98371_i2c_remove, .id_table = max98371_i2c_id, }; diff --git a/sound/soc/codecs/max98371.h b/sound/soc/codecs/max98371.h index 9f6330964d98..06e9ba784e0b 100644 --- a/sound/soc/codecs/max98371.h +++ b/sound/soc/codecs/max98371.h @@ -62,6 +62,5 @@ struct max98371_priv { struct regmap *regmap; - struct snd_soc_codec *codec; }; #endif