From patchwork Mon Feb 12 12:51:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 10212981 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 9B69E60329 for ; Mon, 12 Feb 2018 13:36:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B0B828B51 for ; Mon, 12 Feb 2018 13:36:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 800C028C73; Mon, 12 Feb 2018 13:36:21 +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 7C9D528B51 for ; Mon, 12 Feb 2018 13:36:20 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 5F5E1268D43; Mon, 12 Feb 2018 14:34:53 +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 094EC268D3D; Mon, 12 Feb 2018 14:34:52 +0100 (CET) Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 6DCA12680F6 for ; Mon, 12 Feb 2018 13:51:47 +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=iLCCBWdmZizValACbzM9XCjTkqY7IMa40L7/QmNIjXc=; b=T9DLz/o14GXl X0LFBZKZ+tbCpkvilx1bMygs4yz5ojenAkSxHHhQw2VjHGL3l/KImHE42OcXY/UoF8jFdUVCbYJ8c g2pWbmjI3ZU6ypYloUu5FWvP9zpmGax/uIlN1Ra147pCSEuP+YbTD1TL3vDCuX4spZdYq5532VlIv WethM=; 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 1elDaA-0002a1-3y; Mon, 12 Feb 2018 12:51:42 +0000 Received: from broonie by debutante with local (Exim 4.90) (envelope-from ) id 1elDa9-0006QK-Lf; Mon, 12 Feb 2018 12:51:41 +0000 From: Mark Brown To: Kuninori Morimoto In-Reply-To: <87d11t5q3g.wl%kuninori.morimoto.gx@renesas.com> Message-Id: Date: Mon, 12 Feb 2018 12:51:41 +0000 Cc: alsa-devel@alsa-project.org, Mark Brown , Charles Keepax Subject: [alsa-devel] Applied "ASoC: wm2000: 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: wm2000: 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 e5449affbf96cceaa042e33b0d1e5db0bd6ecf3c Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 29 Jan 2018 02:59:05 +0000 Subject: [PATCH] ASoC: wm2000: 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 Acked-by: Charles Keepax Signed-off-by: Mark Brown --- sound/soc/codecs/wm2000.c | 78 ++++++++++++++++++++++------------------------- 1 file changed, 36 insertions(+), 42 deletions(-) diff --git a/sound/soc/codecs/wm2000.c b/sound/soc/codecs/wm2000.c index abfa052c07d8..c5ae07234a00 100644 --- a/sound/soc/codecs/wm2000.c +++ b/sound/soc/codecs/wm2000.c @@ -607,8 +607,8 @@ static int wm2000_anc_set_mode(struct wm2000_priv *wm2000) static int wm2000_anc_mode_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); - struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); + struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); + struct wm2000_priv *wm2000 = dev_get_drvdata(component->dev); ucontrol->value.integer.value[0] = wm2000->anc_active; @@ -618,8 +618,8 @@ static int wm2000_anc_mode_get(struct snd_kcontrol *kcontrol, static int wm2000_anc_mode_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); - struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); + struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); + struct wm2000_priv *wm2000 = dev_get_drvdata(component->dev); unsigned int anc_active = ucontrol->value.integer.value[0]; int ret; @@ -640,8 +640,8 @@ static int wm2000_anc_mode_put(struct snd_kcontrol *kcontrol, static int wm2000_speaker_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); - struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); + struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); + struct wm2000_priv *wm2000 = dev_get_drvdata(component->dev); ucontrol->value.integer.value[0] = wm2000->spk_ena; @@ -651,8 +651,8 @@ static int wm2000_speaker_get(struct snd_kcontrol *kcontrol, static int wm2000_speaker_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); - struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); + struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); + struct wm2000_priv *wm2000 = dev_get_drvdata(component->dev); unsigned int val = ucontrol->value.integer.value[0]; int ret; @@ -683,8 +683,8 @@ static const struct snd_kcontrol_new wm2000_controls[] = { static int wm2000_anc_power_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { - struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); - struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); + struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); + struct wm2000_priv *wm2000 = dev_get_drvdata(component->dev); int ret; mutex_lock(&wm2000->lock); @@ -724,16 +724,16 @@ static const struct snd_soc_dapm_route wm2000_audio_map[] = { }; #ifdef CONFIG_PM -static int wm2000_suspend(struct snd_soc_codec *codec) +static int wm2000_suspend(struct snd_soc_component *component) { - struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); + struct wm2000_priv *wm2000 = dev_get_drvdata(component->dev); return wm2000_anc_transition(wm2000, ANC_OFF); } -static int wm2000_resume(struct snd_soc_codec *codec) +static int wm2000_resume(struct snd_soc_component *component) { - struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); + struct wm2000_priv *wm2000 = dev_get_drvdata(component->dev); return wm2000_anc_set_mode(wm2000); } @@ -782,9 +782,9 @@ static const struct regmap_config wm2000_regmap = { .readable_reg = wm2000_readable_reg, }; -static int wm2000_probe(struct snd_soc_codec *codec) +static int wm2000_probe(struct snd_soc_component *component) { - struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); + struct wm2000_priv *wm2000 = dev_get_drvdata(component->dev); /* This will trigger a transition to standby mode by default */ wm2000_anc_set_mode(wm2000); @@ -792,27 +792,28 @@ static int wm2000_probe(struct snd_soc_codec *codec) return 0; } -static int wm2000_remove(struct snd_soc_codec *codec) +static void wm2000_remove(struct snd_soc_component *component) { - struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); + struct wm2000_priv *wm2000 = dev_get_drvdata(component->dev); - return wm2000_anc_transition(wm2000, ANC_OFF); + wm2000_anc_transition(wm2000, ANC_OFF); } -static const struct snd_soc_codec_driver soc_codec_dev_wm2000 = { - .probe = wm2000_probe, - .remove = wm2000_remove, - .suspend = wm2000_suspend, - .resume = wm2000_resume, - - .component_driver = { - .controls = wm2000_controls, - .num_controls = ARRAY_SIZE(wm2000_controls), - .dapm_widgets = wm2000_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(wm2000_dapm_widgets), - .dapm_routes = wm2000_audio_map, - .num_dapm_routes = ARRAY_SIZE(wm2000_audio_map), - }, +static const struct snd_soc_component_driver soc_component_dev_wm2000 = { + .probe = wm2000_probe, + .remove = wm2000_remove, + .suspend = wm2000_suspend, + .resume = wm2000_resume, + .controls = wm2000_controls, + .num_controls = ARRAY_SIZE(wm2000_controls), + .dapm_widgets = wm2000_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(wm2000_dapm_widgets), + .dapm_routes = wm2000_audio_map, + .num_dapm_routes = ARRAY_SIZE(wm2000_audio_map), + .idle_bias_on = 1, + .use_pmdown_time = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, }; static int wm2000_i2c_probe(struct i2c_client *i2c, @@ -916,7 +917,8 @@ static int wm2000_i2c_probe(struct i2c_client *i2c, wm2000_reset(wm2000); - ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_wm2000, NULL, 0); + ret = devm_snd_soc_register_component(&i2c->dev, + &soc_component_dev_wm2000, NULL, 0); err_supplies: regulator_bulk_disable(WM2000_NUM_SUPPLIES, wm2000->supplies); @@ -926,13 +928,6 @@ static int wm2000_i2c_probe(struct i2c_client *i2c, return ret; } -static int wm2000_i2c_remove(struct i2c_client *i2c) -{ - snd_soc_unregister_codec(&i2c->dev); - - return 0; -} - static const struct i2c_device_id wm2000_i2c_id[] = { { "wm2000", 0 }, { } @@ -944,7 +939,6 @@ static struct i2c_driver wm2000_i2c_driver = { .name = "wm2000", }, .probe = wm2000_i2c_probe, - .remove = wm2000_i2c_remove, .id_table = wm2000_i2c_id, };