From patchwork Mon Feb 12 12:45: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: 128081 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3204165ljc; Mon, 12 Feb 2018 05:21:39 -0800 (PST) X-Google-Smtp-Source: AH8x227NiH+uPLfiI66rF0yYT6TD+nuLBbiYgb5dtGrXSSLAvXhVuzehSG2MEbd2wBqLrpjrmQlo X-Received: by 10.28.144.20 with SMTP id s20mr3762368wmd.149.1518441699082; Mon, 12 Feb 2018 05:21:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518441699; cv=none; d=google.com; s=arc-20160816; b=g46VgK1uG/ToB6Kwb+cwxXix5OrJSl2Az/wRW3eVRCm/pgUglyCoCB/bH14mnGWzTN BdjCCQHxm6UOQ3oPCUcdTpMwb7GFb6S4uBti7Gp+QtgLdpVVStVx3EBUvJaL0mU3wvmB 0xnfGMwu1pfhIvj7d1fxFjFELp+j5Ljm4yaWZkyptwQFJKj7pF9sEROx8wLl1H/sZmwe 7GOxGkn6glbQO/CMlX+ZxItt1M+8rj0cDLvB0EA2eMjEPW98wyEMqEt71vMDeHNEjaMH YRDZVsaVFLpo2AScBhIQVhGs4umcVDNdXTw26Yk7yof836xaZKTj3RlaPbIk+GCV4tOu yzBg== 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=Szds9fsYvuBMNxC8JUw8iDxK7xwc74VWamRhB2G5DZU=; b=rs3Cmy20g1QxfUlxWb9j87GcU73u0CFvPgYRlxCWYljBEJXBM91P+eG8eH7hXdWJMS W6SMBfVxVjjqSzhriFnldiObzk9+lbo4fCfA9Ft6UcoGwmBIkrR3UPDFEj2tgxFA5Yee R129IF0/tmvJ8R2Ttl2jELBdxV5OFXlqiAYbGuvuKVk8iXxexfO4fC90a9IZHVoVdLm9 As8nMwdOEkRORWQiOfnB3o0LP/7vA8hMesI8s3V/Rdkw+EOdY55KsbpZGS3lKBnR74mj ZzJCpdI54X9aJsX4TrTzhLEWpqF2jVX8mqAey/i3/XFwp1R9k7iU4mNDJo9nl0Nhag2o NHmw== 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=p2+NWDeO; 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 k5si3791373wmg.228.2018.02.12.05.21.38; Mon, 12 Feb 2018 05:21:39 -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=p2+NWDeO; 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 B9D64268757; Mon, 12 Feb 2018 14:18:33 +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 7DCF5268752; Mon, 12 Feb 2018 14:18:32 +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 0D9D1267CC6 for ; Mon, 12 Feb 2018 13:45: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=PEXV5kZGWuFMsCbmolTzqqt6YoZa3PuR8Ue+Jv1YGY0=; b=p2+NWDeOEXRD nBtx02JSSe/UUdEmRVopetuRd9pwTSU/FBSrH4ydZ3WZQI1mC0Ls5Now3dDknbykEUeiXtSRAV/QL YozjLz+JUb5+YUU7SxBKet9P+u46JOlFSwO/WPnOT0pnNItXP1iS+Rcr2Ox3udaEtJcDlz2Mc84ud tVPYE=; 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 1elDTr-0002QN-5V; Mon, 12 Feb 2018 12:45:11 +0000 Received: from broonie by debutante with local (Exim 4.90) (envelope-from ) id 1elDTq-0005HT-Nb; Mon, 12 Feb 2018 12:45:10 +0000 From: Mark Brown To: Kuninori Morimoto In-Reply-To: <87zi4x1g9g.wl%kuninori.morimoto.gx@renesas.com> Message-Id: Date: Mon, 12 Feb 2018 12:45:10 +0000 Cc: alsa-devel@alsa-project.org, Mark Brown Subject: [alsa-devel] Applied "ASoC: rt5514: 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: rt5514: 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 04e8262ac8c3f59599ea6dfe5cd1a039828ea4ad Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 29 Jan 2018 03:45:07 +0000 Subject: [PATCH] ASoC: rt5514: 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/rt5514-spi.c | 4 +- sound/soc/codecs/rt5514.c | 124 ++++++++++++++++++++---------------------- sound/soc/codecs/rt5514.h | 2 +- 3 files changed, 61 insertions(+), 69 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/rt5514-spi.c b/sound/soc/codecs/rt5514-spi.c index 2144edca97b0..b677f144462b 100644 --- a/sound/soc/codecs/rt5514-spi.c +++ b/sound/soc/codecs/rt5514-spi.c @@ -474,9 +474,9 @@ static int __maybe_unused rt5514_suspend(struct device *dev) static int __maybe_unused rt5514_resume(struct device *dev) { - struct snd_soc_platform *platform = snd_soc_lookup_platform(dev); + struct snd_soc_component *component = snd_soc_lookup_component(dev, DRV_NAME); struct rt5514_dsp *rt5514_dsp = - snd_soc_platform_get_drvdata(platform); + snd_soc_component_get_drvdata(component); int irq = to_spi_device(dev)->irq; u8 buf[8]; diff --git a/sound/soc/codecs/rt5514.c b/sound/soc/codecs/rt5514.c index 198df016802f..2d79571098ac 100644 --- a/sound/soc/codecs/rt5514.c +++ b/sound/soc/codecs/rt5514.c @@ -327,14 +327,13 @@ static int rt5514_dsp_voice_wake_up_put(struct snd_kcontrol *kcontrol, { struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); struct rt5514_priv *rt5514 = snd_soc_component_get_drvdata(component); - struct snd_soc_codec *codec = rt5514->codec; const struct firmware *fw = NULL; u8 buf[8]; if (ucontrol->value.integer.value[0] == rt5514->dsp_enabled) return 0; - if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_OFF) { + if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { rt5514->dsp_enabled = ucontrol->value.integer.value[0]; if (rt5514->dsp_enabled) { @@ -342,11 +341,11 @@ static int rt5514_dsp_voice_wake_up_put(struct snd_kcontrol *kcontrol, !IS_ERR(rt5514->dsp_calib_clk)) { if (clk_set_rate(rt5514->dsp_calib_clk, rt5514->pdata.dsp_calib_clk_rate)) - dev_err(codec->dev, + dev_err(component->dev, "Can't set rate for mclk"); if (clk_prepare_enable(rt5514->dsp_calib_clk)) - dev_err(codec->dev, + dev_err(component->dev, "Can't enable dsp_calib_clk"); rt5514_calibration(rt5514, true); @@ -357,7 +356,7 @@ static int rt5514_dsp_voice_wake_up_put(struct snd_kcontrol *kcontrol, RT5514_DSP_MAPPING, (u8 *)&buf, sizeof(buf)); #else - dev_err(codec->dev, "There is no SPI driver for" + dev_err(component->dev, "There is no SPI driver for" " loading the firmware\n"); #endif rt5514->pll3_cal_value = buf[0] | buf[1] << 8 | @@ -369,26 +368,26 @@ static int rt5514_dsp_voice_wake_up_put(struct snd_kcontrol *kcontrol, rt5514_enable_dsp_prepare(rt5514); - request_firmware(&fw, RT5514_FIRMWARE1, codec->dev); + request_firmware(&fw, RT5514_FIRMWARE1, component->dev); if (fw) { #if IS_ENABLED(CONFIG_SND_SOC_RT5514_SPI) rt5514_spi_burst_write(0x4ff60000, fw->data, ((fw->size/8)+1)*8); #else - dev_err(codec->dev, "There is no SPI driver for" + dev_err(component->dev, "There is no SPI driver for" " loading the firmware\n"); #endif release_firmware(fw); fw = NULL; } - request_firmware(&fw, RT5514_FIRMWARE2, codec->dev); + request_firmware(&fw, RT5514_FIRMWARE2, component->dev); if (fw) { #if IS_ENABLED(CONFIG_SND_SOC_RT5514_SPI) rt5514_spi_burst_write(0x4ffc0000, fw->data, ((fw->size/8)+1)*8); #else - dev_err(codec->dev, "There is no SPI driver for" + dev_err(component->dev, "There is no SPI driver for" " loading the firmware\n"); #endif release_firmware(fw); @@ -492,7 +491,7 @@ static const struct snd_kcontrol_new rt5514_sto2_dmic_mux = * Choose divider parameter that gives the highest possible DMIC frequency in * 1MHz - 3MHz range. */ -static int rt5514_calc_dmic_clk(struct snd_soc_codec *codec, int rate) +static int rt5514_calc_dmic_clk(struct snd_soc_component *component, int rate) { int div[] = {2, 3, 4, 8, 12, 16, 24, 32}; int i; @@ -508,20 +507,20 @@ static int rt5514_calc_dmic_clk(struct snd_soc_codec *codec, int rate) return i; } - dev_warn(codec->dev, "Base clock rate %d is too high\n", rate); + dev_warn(component->dev, "Base clock rate %d is too high\n", rate); return -EINVAL; } static int rt5514_set_dmic_clk(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 rt5514_priv *rt5514 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); + struct rt5514_priv *rt5514 = snd_soc_component_get_drvdata(component); int idx; - idx = rt5514_calc_dmic_clk(codec, rt5514->sysclk); + idx = rt5514_calc_dmic_clk(component, rt5514->sysclk); if (idx < 0) - dev_err(codec->dev, "Failed to set DMIC clock\n"); + dev_err(component->dev, "Failed to set DMIC clock\n"); else regmap_update_bits(rt5514->regmap, RT5514_CLK_CTRL1, RT5514_CLK_DMIC_OUT_SEL_MASK, @@ -536,8 +535,8 @@ static int rt5514_set_dmic_clk(struct snd_soc_dapm_widget *w, static int rt5514_is_sys_clk_from_pll(struct snd_soc_dapm_widget *source, struct snd_soc_dapm_widget *sink) { - struct snd_soc_codec *codec = snd_soc_dapm_to_codec(source->dapm); - struct rt5514_priv *rt5514 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); + struct rt5514_priv *rt5514 = snd_soc_component_get_drvdata(component); if (rt5514->sysclk_src == RT5514_SCLK_S_PLL1) return 1; @@ -548,8 +547,8 @@ static int rt5514_is_sys_clk_from_pll(struct snd_soc_dapm_widget *source, static int rt5514_i2s_use_asrc(struct snd_soc_dapm_widget *source, struct snd_soc_dapm_widget *sink) { - struct snd_soc_codec *codec = snd_soc_dapm_to_codec(source->dapm); - struct rt5514_priv *rt5514 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); + struct rt5514_priv *rt5514 = snd_soc_component_get_drvdata(component); return (rt5514->sysclk > rt5514->lrck * 384); } @@ -751,21 +750,21 @@ static const struct snd_soc_dapm_route rt5514_dapm_routes[] = { static int rt5514_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 rt5514_priv *rt5514 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct rt5514_priv *rt5514 = snd_soc_component_get_drvdata(component); int pre_div, bclk_ms, frame_size; unsigned int val_len = 0; rt5514->lrck = params_rate(params); pre_div = rl6231_get_clk_info(rt5514->sysclk, rt5514->lrck); if (pre_div < 0) { - dev_err(codec->dev, "Unsupported clock setting\n"); + dev_err(component->dev, "Unsupported clock setting\n"); return -EINVAL; } frame_size = snd_soc_params_to_frame_size(params); if (frame_size < 0) { - dev_err(codec->dev, "Unsupported frame size: %d\n", frame_size); + dev_err(component->dev, "Unsupported frame size: %d\n", frame_size); return -EINVAL; } @@ -808,8 +807,8 @@ static int rt5514_hw_params(struct snd_pcm_substream *substream, static int rt5514_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) { - struct snd_soc_codec *codec = dai->codec; - struct rt5514_priv *rt5514 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct rt5514_priv *rt5514 = snd_soc_component_get_drvdata(component); unsigned int reg_val = 0; switch (fmt & SND_SOC_DAIFMT_INV_MASK) { @@ -862,8 +861,8 @@ static int rt5514_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) static int rt5514_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int freq, int dir) { - struct snd_soc_codec *codec = dai->codec; - struct rt5514_priv *rt5514 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct rt5514_priv *rt5514 = snd_soc_component_get_drvdata(component); unsigned int reg_val = 0; if (freq == rt5514->sysclk && clk_id == rt5514->sysclk_src) @@ -879,7 +878,7 @@ static int rt5514_set_dai_sysclk(struct snd_soc_dai *dai, break; default: - dev_err(codec->dev, "Invalid clock id (%d)\n", clk_id); + dev_err(component->dev, "Invalid clock id (%d)\n", clk_id); return -EINVAL; } @@ -897,13 +896,13 @@ static int rt5514_set_dai_sysclk(struct snd_soc_dai *dai, static int rt5514_set_dai_pll(struct snd_soc_dai *dai, int pll_id, int source, unsigned int freq_in, unsigned int freq_out) { - struct snd_soc_codec *codec = dai->codec; - struct rt5514_priv *rt5514 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct rt5514_priv *rt5514 = snd_soc_component_get_drvdata(component); struct rl6231_pll_code pll_code; int ret; if (!freq_in || !freq_out) { - dev_dbg(codec->dev, "PLL disabled\n"); + dev_dbg(component->dev, "PLL disabled\n"); rt5514->pll_in = 0; rt5514->pll_out = 0; @@ -930,17 +929,17 @@ static int rt5514_set_dai_pll(struct snd_soc_dai *dai, int pll_id, int source, break; default: - dev_err(codec->dev, "Unknown PLL source %d\n", source); + dev_err(component->dev, "Unknown PLL source %d\n", source); return -EINVAL; } ret = rl6231_pll_calc(freq_in, freq_out, &pll_code); if (ret < 0) { - dev_err(codec->dev, "Unsupport input clock %d\n", freq_in); + dev_err(component->dev, "Unsupport input clock %d\n", freq_in); return ret; } - dev_dbg(codec->dev, "bypass=%d m=%d n=%d k=%d\n", + dev_dbg(component->dev, "bypass=%d m=%d n=%d k=%d\n", pll_code.m_bp, (pll_code.m_bp ? 0 : pll_code.m_code), pll_code.n_code, pll_code.k_code); @@ -961,8 +960,8 @@ static int rt5514_set_dai_pll(struct snd_soc_dai *dai, int pll_id, int source, static int rt5514_set_tdm_slot(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 rt5514_priv *rt5514 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct rt5514_priv *rt5514 = snd_soc_component_get_drvdata(component); unsigned int val = 0, val2 = 0; if (rx_mask || tx_mask) @@ -1047,10 +1046,10 @@ static int rt5514_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, return 0; } -static int rt5514_set_bias_level(struct snd_soc_codec *codec, +static int rt5514_set_bias_level(struct snd_soc_component *component, enum snd_soc_bias_level level) { - struct rt5514_priv *rt5514 = snd_soc_codec_get_drvdata(codec); + struct rt5514_priv *rt5514 = snd_soc_component_get_drvdata(component); int ret; switch (level) { @@ -1058,7 +1057,7 @@ static int rt5514_set_bias_level(struct snd_soc_codec *codec, if (IS_ERR(rt5514->mclk)) break; - if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_ON) { + if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_ON) { clk_disable_unprepare(rt5514->mclk); } else { ret = clk_prepare_enable(rt5514->mclk); @@ -1068,7 +1067,7 @@ static int rt5514_set_bias_level(struct snd_soc_codec *codec, break; case SND_SOC_BIAS_STANDBY: - if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_OFF) { + if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { /* * If the DSP is enabled in start of recording, the DSP * should be disabled, and sync back to normal recording @@ -1092,13 +1091,13 @@ static int rt5514_set_bias_level(struct snd_soc_codec *codec, return 0; } -static int rt5514_probe(struct snd_soc_codec *codec) +static int rt5514_probe(struct snd_soc_component *component) { - struct rt5514_priv *rt5514 = snd_soc_codec_get_drvdata(codec); - struct platform_device *pdev = container_of(codec->dev, + struct rt5514_priv *rt5514 = snd_soc_component_get_drvdata(component); + struct platform_device *pdev = container_of(component->dev, struct platform_device, dev); - rt5514->mclk = devm_clk_get(codec->dev, "mclk"); + rt5514->mclk = devm_clk_get(component->dev, "mclk"); if (PTR_ERR(rt5514->mclk) == -EPROBE_DEFER) return -EPROBE_DEFER; @@ -1109,7 +1108,7 @@ static int rt5514_probe(struct snd_soc_codec *codec) return -EPROBE_DEFER; } - rt5514->codec = codec; + rt5514->component = component; rt5514->pll3_cal_value = 0x0078b000; return 0; @@ -1162,18 +1161,18 @@ static struct snd_soc_dai_driver rt5514_dai[] = { } }; -static const struct snd_soc_codec_driver soc_codec_dev_rt5514 = { - .probe = rt5514_probe, - .idle_bias_off = true, - .set_bias_level = rt5514_set_bias_level, - .component_driver = { - .controls = rt5514_snd_controls, - .num_controls = ARRAY_SIZE(rt5514_snd_controls), - .dapm_widgets = rt5514_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(rt5514_dapm_widgets), - .dapm_routes = rt5514_dapm_routes, - .num_dapm_routes = ARRAY_SIZE(rt5514_dapm_routes), - }, +static const struct snd_soc_component_driver soc_component_dev_rt5514 = { + .probe = rt5514_probe, + .set_bias_level = rt5514_set_bias_level, + .controls = rt5514_snd_controls, + .num_controls = ARRAY_SIZE(rt5514_snd_controls), + .dapm_widgets = rt5514_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(rt5514_dapm_widgets), + .dapm_routes = rt5514_dapm_routes, + .num_dapm_routes = ARRAY_SIZE(rt5514_dapm_routes), + .use_pmdown_time = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, }; static const struct regmap_config rt5514_i2c_regmap = { @@ -1313,17 +1312,11 @@ static int rt5514_i2c_probe(struct i2c_client *i2c, if (ret != 0) dev_warn(&i2c->dev, "Failed to apply regmap patch: %d\n", ret); - return snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt5514, + return devm_snd_soc_register_component(&i2c->dev, + &soc_component_dev_rt5514, rt5514_dai, ARRAY_SIZE(rt5514_dai)); } -static int rt5514_i2c_remove(struct i2c_client *i2c) -{ - snd_soc_unregister_codec(&i2c->dev); - - return 0; -} - static const struct dev_pm_ops rt5514_i2_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(NULL, rt5514_i2c_resume) }; @@ -1336,7 +1329,6 @@ static struct i2c_driver rt5514_i2c_driver = { .pm = &rt5514_i2_pm_ops, }, .probe = rt5514_i2c_probe, - .remove = rt5514_i2c_remove, .id_table = rt5514_i2c_id, }; module_i2c_driver(rt5514_i2c_driver); diff --git a/sound/soc/codecs/rt5514.h b/sound/soc/codecs/rt5514.h index f0f3400ce6b1..d1ef0b3f566f 100644 --- a/sound/soc/codecs/rt5514.h +++ b/sound/soc/codecs/rt5514.h @@ -272,7 +272,7 @@ enum { struct rt5514_priv { struct rt5514_platform_data pdata; - struct snd_soc_codec *codec; + struct snd_soc_component *component; struct regmap *i2c_regmap, *regmap; struct clk *mclk, *dsp_calib_clk; int sysclk;