From patchwork Mon Feb 12 12:36:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 10212511 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3D42C60467 for ; Mon, 12 Feb 2018 12:45:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F69928A30 for ; Mon, 12 Feb 2018 12:45:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23FBF28B1F; Mon, 12 Feb 2018 12:45:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3EC3E28A30 for ; Mon, 12 Feb 2018 12:45:12 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 542B3267A52; Mon, 12 Feb 2018 13:45:04 +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 3DCD3267A50; Mon, 12 Feb 2018 13:45:03 +0100 (CET) Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 379B22678BB for ; Mon, 12 Feb 2018 13:36:22 +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=A/ibWfHUyATHC1rrwboGVX5XoeBfRDweSvf/NVO/t6s=; b=PB1VrBVF1JGo aGiK5Qw0B6ELtzwYXv82BgHJjl8qOrvuDzRkMbEOL7wiUvlYj56R0FgWj7ML85OelUNzNr0ysm1S5 4h3DhkqJpJRYrTsI97QIGk6feoo+Y8H0rGrDA1TV3ATgrdtC+EZ/FhKcqfBHvHi8jn/LGSRj2yChw Dd+uU=; 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 1elDLI-00025B-Gr; Mon, 12 Feb 2018 12:36:20 +0000 Received: from broonie by debutante with local (Exim 4.90) (envelope-from ) id 1elDLI-0003sl-2U; Mon, 12 Feb 2018 12:36:20 +0000 From: Mark Brown To: Kuninori Morimoto In-Reply-To: <87r2q9uvo5.wl%kuninori.morimoto.gx@renesas.com> Message-Id: Date: Mon, 12 Feb 2018 12:36:20 +0000 Cc: alsa-devel@alsa-project.org, Mark Brown Subject: [alsa-devel] Applied "ASoC: isabelle: 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 X-Virus-Scanned: ClamAV using ClamSMTP The patch ASoC: isabelle: 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 f572634c90586fb5426d514e7c584b0b6b5028c0 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 29 Jan 2018 04:39:30 +0000 Subject: [PATCH] ASoC: isabelle: 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 = 1 -> .idle_bias_on = 0 .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/isabelle.c | 57 ++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 32 deletions(-) diff --git a/sound/soc/codecs/isabelle.c b/sound/soc/codecs/isabelle.c index 5ca99280ae00..166420376e67 100644 --- a/sound/soc/codecs/isabelle.c +++ b/sound/soc/codecs/isabelle.c @@ -867,7 +867,7 @@ static const struct snd_soc_dapm_route isabelle_intercon[] = { static int isabelle_hs_mute(struct snd_soc_dai *dai, int mute) { - snd_soc_update_bits(dai->codec, ISABELLE_DAC1_SOFTRAMP_REG, + snd_soc_component_update_bits(dai->component, ISABELLE_DAC1_SOFTRAMP_REG, BIT(4), (mute ? BIT(4) : 0)); return 0; @@ -875,7 +875,7 @@ static int isabelle_hs_mute(struct snd_soc_dai *dai, int mute) static int isabelle_hf_mute(struct snd_soc_dai *dai, int mute) { - snd_soc_update_bits(dai->codec, ISABELLE_DAC2_SOFTRAMP_REG, + snd_soc_component_update_bits(dai->component, ISABELLE_DAC2_SOFTRAMP_REG, BIT(4), (mute ? BIT(4) : 0)); return 0; @@ -883,13 +883,13 @@ static int isabelle_hf_mute(struct snd_soc_dai *dai, int mute) static int isabelle_line_mute(struct snd_soc_dai *dai, int mute) { - snd_soc_update_bits(dai->codec, ISABELLE_DAC3_SOFTRAMP_REG, + snd_soc_component_update_bits(dai->component, ISABELLE_DAC3_SOFTRAMP_REG, BIT(4), (mute ? BIT(4) : 0)); return 0; } -static int isabelle_set_bias_level(struct snd_soc_codec *codec, +static int isabelle_set_bias_level(struct snd_soc_component *component, enum snd_soc_bias_level level) { switch (level) { @@ -899,12 +899,12 @@ static int isabelle_set_bias_level(struct snd_soc_codec *codec, break; case SND_SOC_BIAS_STANDBY: - snd_soc_update_bits(codec, ISABELLE_PWR_EN_REG, + snd_soc_component_update_bits(component, ISABELLE_PWR_EN_REG, ISABELLE_CHIP_EN, BIT(0)); break; case SND_SOC_BIAS_OFF: - snd_soc_update_bits(codec, ISABELLE_PWR_EN_REG, + snd_soc_component_update_bits(component, ISABELLE_PWR_EN_REG, ISABELLE_CHIP_EN, 0); break; } @@ -916,7 +916,7 @@ static int isabelle_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 snd_soc_component *component = dai->component; u16 aif = 0; unsigned int fs_val = 0; @@ -952,7 +952,7 @@ static int isabelle_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } - snd_soc_update_bits(codec, ISABELLE_FS_RATE_CFG_REG, + snd_soc_component_update_bits(component, ISABELLE_FS_RATE_CFG_REG, ISABELLE_FS_RATE_MASK, fs_val); /* bit size */ @@ -967,7 +967,7 @@ static int isabelle_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } - snd_soc_update_bits(codec, ISABELLE_INTF_CFG_REG, + snd_soc_component_update_bits(component, ISABELLE_INTF_CFG_REG, ISABELLE_AIF_LENGTH_MASK, aif); return 0; @@ -975,7 +975,7 @@ static int isabelle_hw_params(struct snd_pcm_substream *substream, static int isabelle_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) { - struct snd_soc_codec *codec = codec_dai->codec; + struct snd_soc_component *component = codec_dai->component; unsigned int aif_val = 0; switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { @@ -1003,7 +1003,7 @@ static int isabelle_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) return -EINVAL; } - snd_soc_update_bits(codec, ISABELLE_INTF_CFG_REG, + snd_soc_component_update_bits(component, ISABELLE_INTF_CFG_REG, (ISABELLE_AIF_MS | ISABELLE_AIF_FMT_MASK), aif_val); return 0; @@ -1087,17 +1087,17 @@ static struct snd_soc_dai_driver isabelle_dai[] = { }, }; -static const struct snd_soc_codec_driver soc_codec_dev_isabelle = { - .set_bias_level = isabelle_set_bias_level, - .component_driver = { - .controls = isabelle_snd_controls, - .num_controls = ARRAY_SIZE(isabelle_snd_controls), - .dapm_widgets = isabelle_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(isabelle_dapm_widgets), - .dapm_routes = isabelle_intercon, - .num_dapm_routes = ARRAY_SIZE(isabelle_intercon), - }, - .idle_bias_off = true, +static const struct snd_soc_component_driver soc_component_dev_isabelle = { + .set_bias_level = isabelle_set_bias_level, + .controls = isabelle_snd_controls, + .num_controls = ARRAY_SIZE(isabelle_snd_controls), + .dapm_widgets = isabelle_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(isabelle_dapm_widgets), + .dapm_routes = isabelle_intercon, + .num_dapm_routes = ARRAY_SIZE(isabelle_intercon), + .use_pmdown_time = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, }; static const struct regmap_config isabelle_regmap_config = { @@ -1125,23 +1125,17 @@ static int isabelle_i2c_probe(struct i2c_client *i2c, } i2c_set_clientdata(i2c, isabelle_regmap); - ret = snd_soc_register_codec(&i2c->dev, - &soc_codec_dev_isabelle, isabelle_dai, + ret = devm_snd_soc_register_component(&i2c->dev, + &soc_component_dev_isabelle, isabelle_dai, ARRAY_SIZE(isabelle_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 isabelle_i2c_remove(struct i2c_client *client) -{ - snd_soc_unregister_codec(&client->dev); - return 0; -} - static const struct i2c_device_id isabelle_i2c_id[] = { { "isabelle", 0 }, { } @@ -1153,7 +1147,6 @@ static struct i2c_driver isabelle_i2c_driver = { .name = "isabelle", }, .probe = isabelle_i2c_probe, - .remove = isabelle_i2c_remove, .id_table = isabelle_i2c_id, };