From patchwork Mon Feb 12 12:37:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 128027 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3173984ljc; Mon, 12 Feb 2018 04:46:11 -0800 (PST) X-Google-Smtp-Source: AH8x2270WWMDPQwOsrhOHz5gEUAckzq6J7QnYFTxC2QqlyD74y3+rKdqzAdfoqkYaBL8VscJXX64 X-Received: by 10.223.186.15 with SMTP id o15mr10260940wrg.101.1518439571567; Mon, 12 Feb 2018 04:46:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518439571; cv=none; d=google.com; s=arc-20160816; b=xv4tpyJPOou8Tfusv+dNdUZdFNIK/Y9b8gsn0kcU+kjZwu6fU+6P4BQTn2TEOt5Gbq dxoroD8FBr2nWiTmgfLlOmHDwQJ2KpOg5qKgDBO184RumXfbsyydvWECleFHrxRvPHg+ 7GyVq9oKTSfpNzEfa+oE+RxvUvY446yaGyNJ3Hrz5KXmqlH9zOziK/gSiE0vgZzLpBCa ZudoSPbyV3fxxmrKFEt8eIjpjlY6snQxbbgfHglVjp7Ru455qQ8438QgB+0cSaCy+K9T vy68fQEaYy+1+qt24C7E+vNCTBzfRL6a6a7GCHMOwT3hobkM+xH/sbgsX7gqLA9hJQrz 931g== 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=iGkYa+MIx9FH1f5bpLEWP2SmIo1Vox7ajTyBwLwxrkc=; b=lmx44HAErX5z8YrBCyhuW0mgh6FXrqVfdfKPZ9dzm0sCRXX5LtfZtWtLP0GoNWvfnP FJv4mlraAWuJQRViu3dNTkGvmeTjry1IsmMFtS3op6AWv+gRHV1XIMJZAz5hzi/JGdLb CJd4f+OXkG3yezAez0yuV12OWzgBes7cCN2E06af41K+rgb6P/5+Ds6EiEwIVdSFgD2k twoWMs9/72NaJD4rgkWKBnc2RmAh2a5H+isiuB8JKks++nSBo0/DoeuQwyUmNLRpJc1l CQiaFnRjcUqhrP5O47kRi2+kS/eUDFqkpMon4qCsvCE9EuR/z6/ZNVdhYpHKVUaztT6H ClKg== 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=GW+nEwB8; 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 s5si6363316wre.305.2018.02.12.04.46.11; Mon, 12 Feb 2018 04:46:11 -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=GW+nEwB8; 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 864B7267D33; Mon, 12 Feb 2018 13:45:57 +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 0C5612678E4; Mon, 12 Feb 2018 13:45:56 +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 4CF7E2675F1 for ; Mon, 12 Feb 2018 13:37:13 +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=gITxo7euA+vh23qCrhEFa3LTCd99uvV/gRiLLOf7les=; b=GW+nEwB8hHvd 6QvSHdYCdgZz/tQ5bYuZPSABiNWHLHA1ujcm7juUTGUsxX804/bBbc0sM6ZUjqinzfs+0jsbPltFP y8NFyqiyBCj+QbKACiOPf99nZ4RDsmhELXDiWwy+zhDxSGuDCZIXmFdXN6M7YXdsCSNwh9hQJxDDU SIbTY=; 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 1elDM7-00025g-AX; Mon, 12 Feb 2018 12:37:11 +0000 Received: from broonie by debutante with local (Exim 4.90) (envelope-from ) id 1elDM6-0003yB-S8; Mon, 12 Feb 2018 12:37:10 +0000 From: Mark Brown To: Kuninori Morimoto In-Reply-To: <87y3khuvra.wl%kuninori.morimoto.gx@renesas.com> Message-Id: Date: Mon, 12 Feb 2018 12:37:10 +0000 Cc: alsa-devel@alsa-project.org, Mark Brown Subject: [alsa-devel] Applied "ASoC: mc13783: 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: mc13783: 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 78c97ec04b108d3fff70526e6bdb5bc2ebebe4bd Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 29 Jan 2018 04:37:36 +0000 Subject: [PATCH] ASoC: mc13783: 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/mc13783.c | 68 ++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 35 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/mc13783.c b/sound/soc/codecs/mc13783.c index be7a45f05bbf..7b0d2610cd27 100644 --- a/sound/soc/codecs/mc13783.c +++ b/sound/soc/codecs/mc13783.c @@ -107,13 +107,13 @@ static int mc13783_pcm_hw_params_dac(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { - struct snd_soc_codec *codec = dai->codec; + struct snd_soc_component *component = dai->component; unsigned int rate = params_rate(params); int i; for (i = 0; i < ARRAY_SIZE(mc13783_rates); i++) { if (rate == mc13783_rates[i]) { - snd_soc_update_bits(codec, MC13783_AUDIO_DAC, + snd_soc_component_update_bits(component, MC13783_AUDIO_DAC, 0xf << 17, i << 17); return 0; } @@ -126,7 +126,7 @@ static int mc13783_pcm_hw_params_codec(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { - struct snd_soc_codec *codec = dai->codec; + struct snd_soc_component *component = dai->component; unsigned int rate = params_rate(params); unsigned int val; @@ -141,7 +141,7 @@ static int mc13783_pcm_hw_params_codec(struct snd_pcm_substream *substream, return -EINVAL; } - snd_soc_update_bits(codec, MC13783_AUDIO_CODEC, AUDIO_CODEC_CDCFS8K16K, + snd_soc_component_update_bits(component, MC13783_AUDIO_CODEC, AUDIO_CODEC_CDCFS8K16K, val); return 0; @@ -160,7 +160,7 @@ static int mc13783_pcm_hw_params_sync(struct snd_pcm_substream *substream, static int mc13783_set_fmt(struct snd_soc_dai *dai, unsigned int fmt, unsigned int reg) { - struct snd_soc_codec *codec = dai->codec; + struct snd_soc_component *component = dai->component; unsigned int val = 0; unsigned int mask = AUDIO_CFS(3) | AUDIO_BCL_INV | AUDIO_CFS_INV | AUDIO_CSM | AUDIO_C_CLK_EN | AUDIO_C_RESET; @@ -208,7 +208,7 @@ static int mc13783_set_fmt(struct snd_soc_dai *dai, unsigned int fmt, val |= AUDIO_C_RESET; - snd_soc_update_bits(codec, reg, mask, val); + snd_soc_component_update_bits(component, reg, mask, val); return 0; } @@ -255,7 +255,7 @@ static int mc13783_set_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int freq, int dir, unsigned int reg) { - struct snd_soc_codec *codec = dai->codec; + struct snd_soc_component *component = dai->component; int clk; unsigned int val = 0; unsigned int mask = AUDIO_CLK(0x7) | AUDIO_CLK_SEL; @@ -275,7 +275,7 @@ static int mc13783_set_sysclk(struct snd_soc_dai *dai, val |= AUDIO_CLK(clk); - snd_soc_update_bits(codec, reg, mask, val); + snd_soc_component_update_bits(component, reg, mask, val); return 0; } @@ -308,7 +308,7 @@ static int mc13783_set_tdm_slot_dac(struct snd_soc_dai *dai, unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width) { - struct snd_soc_codec *codec = dai->codec; + struct snd_soc_component *component = dai->component; unsigned int val = 0; unsigned int mask = SSI_NETWORK_DAC_SLOT_MASK | SSI_NETWORK_DAC_RXSLOT_MASK; @@ -344,7 +344,7 @@ static int mc13783_set_tdm_slot_dac(struct snd_soc_dai *dai, return -EINVAL; } - snd_soc_update_bits(codec, MC13783_SSI_NETWORK, mask, val); + snd_soc_component_update_bits(component, MC13783_SSI_NETWORK, mask, val); return 0; } @@ -353,7 +353,7 @@ static int mc13783_set_tdm_slot_codec(struct snd_soc_dai *dai, unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width) { - struct snd_soc_codec *codec = dai->codec; + struct snd_soc_component *component = dai->component; unsigned int val = 0; unsigned int mask = 0x3f; @@ -366,7 +366,7 @@ static int mc13783_set_tdm_slot_codec(struct snd_soc_dai *dai, val |= (0x00 << 2); /* primary timeslot RX/TX(?) is 0 */ val |= (0x01 << 4); /* secondary timeslot TX is 1 */ - snd_soc_update_bits(codec, MC13783_SSI_NETWORK, mask, val); + snd_soc_component_update_bits(component, MC13783_SSI_NETWORK, mask, val); return 0; } @@ -606,12 +606,12 @@ static struct snd_kcontrol_new mc13783_control_list[] = { SOC_SINGLE("MC2 Capture Bias Switch", MC13783_AUDIO_TX, 1, 1, 0), }; -static int mc13783_probe(struct snd_soc_codec *codec) +static int mc13783_probe(struct snd_soc_component *component) { - struct mc13783_priv *priv = snd_soc_codec_get_drvdata(codec); + struct mc13783_priv *priv = snd_soc_component_get_drvdata(component); - snd_soc_codec_init_regmap(codec, - dev_get_regmap(codec->dev->parent, NULL)); + snd_soc_component_init_regmap(component, + dev_get_regmap(component->dev->parent, NULL)); /* these are the reset values */ mc13xxx_reg_write(priv->mc13xxx, MC13783_AUDIO_RX0, 0x25893); @@ -638,14 +638,12 @@ static int mc13783_probe(struct snd_soc_codec *codec) return 0; } -static int mc13783_remove(struct snd_soc_codec *codec) +static void mc13783_remove(struct snd_soc_component *component) { - struct mc13783_priv *priv = snd_soc_codec_get_drvdata(codec); + struct mc13783_priv *priv = snd_soc_component_get_drvdata(component); /* Make sure VAUDIOON is off */ mc13xxx_reg_rmw(priv->mc13xxx, MC13783_AUDIO_RX0, 0x3, 0); - - return 0; } #define MC13783_RATES_RECORD (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000) @@ -731,17 +729,19 @@ static struct snd_soc_dai_driver mc13783_dai_sync[] = { } }; -static const struct snd_soc_codec_driver soc_codec_dev_mc13783 = { - .probe = mc13783_probe, - .remove = mc13783_remove, - .component_driver = { - .controls = mc13783_control_list, - .num_controls = ARRAY_SIZE(mc13783_control_list), - .dapm_widgets = mc13783_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(mc13783_dapm_widgets), - .dapm_routes = mc13783_routes, - .num_dapm_routes = ARRAY_SIZE(mc13783_routes), - }, +static const struct snd_soc_component_driver soc_component_dev_mc13783 = { + .probe = mc13783_probe, + .remove = mc13783_remove, + .controls = mc13783_control_list, + .num_controls = ARRAY_SIZE(mc13783_control_list), + .dapm_widgets = mc13783_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(mc13783_dapm_widgets), + .dapm_routes = mc13783_routes, + .num_dapm_routes = ARRAY_SIZE(mc13783_routes), + .idle_bias_on = 1, + .use_pmdown_time = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, }; static int __init mc13783_codec_probe(struct platform_device *pdev) @@ -782,10 +782,10 @@ static int __init mc13783_codec_probe(struct platform_device *pdev) priv->mc13xxx = dev_get_drvdata(pdev->dev.parent); if (priv->adc_ssi_port == priv->dac_ssi_port) - ret = snd_soc_register_codec(&pdev->dev, &soc_codec_dev_mc13783, + ret = devm_snd_soc_register_component(&pdev->dev, &soc_component_dev_mc13783, mc13783_dai_sync, ARRAY_SIZE(mc13783_dai_sync)); else - ret = snd_soc_register_codec(&pdev->dev, &soc_codec_dev_mc13783, + ret = devm_snd_soc_register_component(&pdev->dev, &soc_component_dev_mc13783, mc13783_dai_async, ARRAY_SIZE(mc13783_dai_async)); return ret; @@ -793,8 +793,6 @@ static int __init mc13783_codec_probe(struct platform_device *pdev) static int mc13783_codec_remove(struct platform_device *pdev) { - snd_soc_unregister_codec(&pdev->dev); - return 0; }