From patchwork Mon Feb 12 12:51: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: 128116 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3215740ljc; Mon, 12 Feb 2018 05:35:06 -0800 (PST) X-Google-Smtp-Source: AH8x227DnFI3/pRxqAzpjWs8MSKwEM1mvl0AtYoW0yRKedCL8to2S2DsRw0DNd/a3CDC/dU0qTtv X-Received: by 10.28.129.212 with SMTP id c203mr3445541wmd.98.1518442506222; Mon, 12 Feb 2018 05:35:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518442506; cv=none; d=google.com; s=arc-20160816; b=zYFWN617SJbjNdsXbDlU9tBjXv/SB4cqvO2vlnMMqHQTMBcK6QVzY6Zm7eFqsMy+pz e/v011Rrb48LUXFR4ED9ek2SHNycDxeWjbSjXOkL9ItBqdJrH8LIP1MdxhUAAD6i2Aff aw5MSQ2VB85ffCADV3LlvSLPHLFYyUS4MAyXnsdT3JNuFO3wiwCiYjMXMInJLV8FbEGD /+apm9dNfRyIcKon742f3oPWrOLDfQwPcPaEUxSz7lkqJLtRaDv9tq9YVw+4bGVKJOmF Ll2cRc2r7J0Jd3Q0+QW/n5k8dueKgbe/AlAr2g+Qo2rdz2sQKQ6zAln2+jGC5z9AhMxr MltQ== 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=s33W3KnHm013x1O5iVFxh/FbGkryX7vaAoqgrvGOqhk=; b=t9LJGo4uZqrTc3osRQrE0oH/OD/yRzAFBxIEcUVCLhBXWiVBgQiVxbmvyz+EX5uLXw kJdrvwPW5hCgfVPkfzbnWw2APAIpu3VTJHG/vHR6LdVHwMsfbN5lb5mj9pvb4KtP7Dp5 w3uZjIxEoS30/lw/tDUguqpVilFZZ9qlQfHbSjYpLQJEJQinWwNb4tJA2xhFVe88Ipcj SmoebPWbYowZdtJc0rdE3KZvbI7Uf7E+rvwqr4uEvVmRn/P27TlTnRZ7+Cd9kQmh1l8J yjTj98uHZFNjmASkjx3V/bfb5v6ukCwxROHXFaJe/1tysiOtsYQeP7YbkakiBaVWLbJK OxAQ== 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=Jjumf9a+; 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 i5si5918651wre.295.2018.02.12.05.35.06; Mon, 12 Feb 2018 05:35:06 -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=Jjumf9a+; 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 3DC31268CD0; Mon, 12 Feb 2018 14:33:28 +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 23F71268CCF; Mon, 12 Feb 2018 14:33:27 +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 5928B268092 for ; Mon, 12 Feb 2018 13:51: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=52QW6HV7v37nC5cahiZ83bfiYosUfyNODjKEb2ZARAU=; b=Jjumf9a+vTdj 84m5bp7AC4yCS+8eSs2mFqpcpRb/V+qOytw17wYNKcvx4P6HYQZyvWDrNoVcGsSdMg/dgKd5/fAZ3 I/2mkDJmVUhApc8ThAptbDtLkeg2f7ycfiBqHaIIVjWyxE77xTqltElfuBEwqTjLQRDuLHoClu+6M yB5/A=; 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 1elDZf-0002YA-97; Mon, 12 Feb 2018 12:51:11 +0000 Received: from broonie by debutante with local (Exim 4.90) (envelope-from ) id 1elDZe-0006Lp-QR; Mon, 12 Feb 2018 12:51:10 +0000 From: Mark Brown To: Kuninori Morimoto In-Reply-To: <87607l5q1f.wl%kuninori.morimoto.gx@renesas.com> Message-Id: Date: Mon, 12 Feb 2018 12:51:10 +0000 Cc: alsa-devel@alsa-project.org, Mark Brown Subject: [alsa-devel] Applied "ASoC: wm8580: 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: wm8580: 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 8f5a59354c64e7e4305e8029d9f3ba1f0df5d444 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 29 Jan 2018 03:00:20 +0000 Subject: [PATCH] ASoC: wm8580: 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/wm8580.c | 150 ++++++++++++++++++++++------------------------ 1 file changed, 71 insertions(+), 79 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/wm8580.c b/sound/soc/codecs/wm8580.c index 910801dddd64..fa4ad1b093eb 100644 --- a/sound/soc/codecs/wm8580.c +++ b/sound/soc/codecs/wm8580.c @@ -262,8 +262,8 @@ static int wm8580_out_vu(struct snd_kcontrol *kcontrol, { struct soc_mixer_control *mc = (struct soc_mixer_control *)kcontrol->private_value; - struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); - struct wm8580_priv *wm8580 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); + struct wm8580_priv *wm8580 = snd_soc_component_get_drvdata(component); unsigned int reg = mc->reg; unsigned int reg2 = mc->rreg; int ret; @@ -279,8 +279,8 @@ static int wm8580_out_vu(struct snd_kcontrol *kcontrol, return ret; /* Now write again with the volume update bit set */ - snd_soc_update_bits(codec, reg, 0x100, 0x100); - snd_soc_update_bits(codec, reg2, 0x100, 0x100); + snd_soc_component_update_bits(component, reg, 0x100, 0x100); + snd_soc_component_update_bits(component, reg2, 0x100, 0x100); return 0; } @@ -465,8 +465,8 @@ static int wm8580_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id, int source, unsigned int freq_in, unsigned int freq_out) { int offset; - struct snd_soc_codec *codec = codec_dai->codec; - struct wm8580_priv *wm8580 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = codec_dai->component; + struct wm8580_priv *wm8580 = snd_soc_component_get_drvdata(component); struct pll_state *state; struct _pll_div pll_div; unsigned int reg; @@ -505,25 +505,25 @@ static int wm8580_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id, /* Always disable the PLL - it is not safe to leave it running * while reprogramming it. */ - snd_soc_update_bits(codec, WM8580_PWRDN2, pwr_mask, pwr_mask); + snd_soc_component_update_bits(component, WM8580_PWRDN2, pwr_mask, pwr_mask); if (!freq_in || !freq_out) return 0; - snd_soc_write(codec, WM8580_PLLA1 + offset, pll_div.k & 0x1ff); - snd_soc_write(codec, WM8580_PLLA2 + offset, (pll_div.k >> 9) & 0x1ff); - snd_soc_write(codec, WM8580_PLLA3 + offset, + snd_soc_component_write(component, WM8580_PLLA1 + offset, pll_div.k & 0x1ff); + snd_soc_component_write(component, WM8580_PLLA2 + offset, (pll_div.k >> 9) & 0x1ff); + snd_soc_component_write(component, WM8580_PLLA3 + offset, (pll_div.k >> 18 & 0xf) | (pll_div.n << 4)); - reg = snd_soc_read(codec, WM8580_PLLA4 + offset); + reg = snd_soc_component_read32(component, WM8580_PLLA4 + offset); reg &= ~0x1b; reg |= pll_div.prescale | pll_div.postscale << 1 | pll_div.freqmode << 3; - snd_soc_write(codec, WM8580_PLLA4 + offset, reg); + snd_soc_component_write(component, WM8580_PLLA4 + offset, reg); /* All done, turn it on */ - snd_soc_update_bits(codec, WM8580_PWRDN2, pwr_mask, 0); + snd_soc_component_update_bits(component, WM8580_PWRDN2, pwr_mask, 0); return 0; } @@ -539,8 +539,8 @@ static int wm8580_paif_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 wm8580_priv *wm8580 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct wm8580_priv *wm8580 = snd_soc_component_get_drvdata(component); u16 paifa = 0; u16 paifb = 0; int i, ratio, osr; @@ -572,12 +572,12 @@ static int wm8580_paif_hw_params(struct snd_pcm_substream *substream, if (ratio == wm8580_sysclk_ratios[i]) break; if (i == ARRAY_SIZE(wm8580_sysclk_ratios)) { - dev_err(codec->dev, "Invalid clock ratio %d/%d\n", + dev_err(component->dev, "Invalid clock ratio %d/%d\n", wm8580->sysclk[dai->driver->id], params_rate(params)); return -EINVAL; } paifa |= i; - dev_dbg(codec->dev, "Running at %dfs with %dHz clock\n", + dev_dbg(component->dev, "Running at %dfs with %dHz clock\n", wm8580_sysclk_ratios[i], wm8580->sysclk[dai->driver->id]); if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { @@ -585,21 +585,21 @@ static int wm8580_paif_hw_params(struct snd_pcm_substream *substream, case 128: case 192: osr = WM8580_DACOSR; - dev_dbg(codec->dev, "Selecting 64x OSR\n"); + dev_dbg(component->dev, "Selecting 64x OSR\n"); break; default: osr = 0; - dev_dbg(codec->dev, "Selecting 128x OSR\n"); + dev_dbg(component->dev, "Selecting 128x OSR\n"); break; } - snd_soc_update_bits(codec, WM8580_PAIF3, WM8580_DACOSR, osr); + snd_soc_component_update_bits(component, WM8580_PAIF3, WM8580_DACOSR, osr); } - snd_soc_update_bits(codec, WM8580_PAIF1 + dai->driver->id, + snd_soc_component_update_bits(component, WM8580_PAIF1 + dai->driver->id, WM8580_AIF_RATE_MASK | WM8580_AIF_BCLKSEL_MASK, paifa); - snd_soc_update_bits(codec, WM8580_PAIF3 + dai->driver->id, + snd_soc_component_update_bits(component, WM8580_PAIF3 + dai->driver->id, WM8580_AIF_LENGTH_MASK, paifb); return 0; } @@ -607,13 +607,13 @@ static int wm8580_paif_hw_params(struct snd_pcm_substream *substream, static int wm8580_set_paif_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 aifa; unsigned int aifb; int can_invert_lrclk; - aifa = snd_soc_read(codec, WM8580_PAIF1 + codec_dai->driver->id); - aifb = snd_soc_read(codec, WM8580_PAIF3 + codec_dai->driver->id); + aifa = snd_soc_component_read32(component, WM8580_PAIF1 + codec_dai->driver->id); + aifb = snd_soc_component_read32(component, WM8580_PAIF3 + codec_dai->driver->id); aifb &= ~(WM8580_AIF_FMT_MASK | WM8580_AIF_LRP | WM8580_AIF_BCP); @@ -679,8 +679,8 @@ static int wm8580_set_paif_dai_fmt(struct snd_soc_dai *codec_dai, return -EINVAL; } - snd_soc_write(codec, WM8580_PAIF1 + codec_dai->driver->id, aifa); - snd_soc_write(codec, WM8580_PAIF3 + codec_dai->driver->id, aifb); + snd_soc_component_write(component, WM8580_PAIF1 + codec_dai->driver->id, aifa); + snd_soc_component_write(component, WM8580_PAIF3 + codec_dai->driver->id, aifb); return 0; } @@ -688,12 +688,12 @@ static int wm8580_set_paif_dai_fmt(struct snd_soc_dai *codec_dai, static int wm8580_set_dai_clkdiv(struct snd_soc_dai *codec_dai, int div_id, int div) { - struct snd_soc_codec *codec = codec_dai->codec; + struct snd_soc_component *component = codec_dai->component; unsigned int reg; switch (div_id) { case WM8580_MCLK: - reg = snd_soc_read(codec, WM8580_PLLB4); + reg = snd_soc_component_read32(component, WM8580_PLLB4); reg &= ~WM8580_PLLB4_MCLKOUTSRC_MASK; switch (div) { @@ -715,11 +715,11 @@ static int wm8580_set_dai_clkdiv(struct snd_soc_dai *codec_dai, default: return -EINVAL; } - snd_soc_write(codec, WM8580_PLLB4, reg); + snd_soc_component_write(component, WM8580_PLLB4, reg); break; case WM8580_CLKOUTSRC: - reg = snd_soc_read(codec, WM8580_PLLB4); + reg = snd_soc_component_read32(component, WM8580_PLLB4); reg &= ~WM8580_PLLB4_CLKOUTSRC_MASK; switch (div) { @@ -741,7 +741,7 @@ static int wm8580_set_dai_clkdiv(struct snd_soc_dai *codec_dai, default: return -EINVAL; } - snd_soc_write(codec, WM8580_PLLB4, reg); + snd_soc_component_write(component, WM8580_PLLB4, reg); break; default: @@ -754,8 +754,8 @@ static int wm8580_set_dai_clkdiv(struct snd_soc_dai *codec_dai, static int wm8580_set_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int freq, int dir) { - struct snd_soc_codec *codec = dai->codec; - struct wm8580_priv *wm8580 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct wm8580_priv *wm8580 = snd_soc_component_get_drvdata(component); int ret, sel, sel_mask, sel_shift; switch (dai->driver->id) { @@ -790,14 +790,14 @@ static int wm8580_set_sysclk(struct snd_soc_dai *dai, int clk_id, sel = 3 << sel_shift; break; default: - dev_err(codec->dev, "Unknown clock %d\n", clk_id); + dev_err(component->dev, "Unknown clock %d\n", clk_id); return -EINVAL; } /* We really should validate PLL settings but not yet */ wm8580->sysclk[dai->driver->id] = freq; - ret = snd_soc_update_bits(codec, WM8580_CLKSEL, sel_mask, sel); + ret = snd_soc_component_update_bits(component, WM8580_CLKSEL, sel_mask, sel); if (ret < 0) return ret; @@ -806,22 +806,22 @@ static int wm8580_set_sysclk(struct snd_soc_dai *dai, int clk_id, static int wm8580_digital_mute(struct snd_soc_dai *codec_dai, int mute) { - struct snd_soc_codec *codec = codec_dai->codec; + struct snd_soc_component *component = codec_dai->component; unsigned int reg; - reg = snd_soc_read(codec, WM8580_DAC_CONTROL5); + reg = snd_soc_component_read32(component, WM8580_DAC_CONTROL5); if (mute) reg |= WM8580_DAC_CONTROL5_MUTEALL; else reg &= ~WM8580_DAC_CONTROL5_MUTEALL; - snd_soc_write(codec, WM8580_DAC_CONTROL5, reg); + snd_soc_component_write(component, WM8580_DAC_CONTROL5, reg); return 0; } -static int wm8580_set_bias_level(struct snd_soc_codec *codec, +static int wm8580_set_bias_level(struct snd_soc_component *component, enum snd_soc_bias_level level) { switch (level) { @@ -830,20 +830,20 @@ static int wm8580_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) { /* Power up and get individual control of the DACs */ - snd_soc_update_bits(codec, WM8580_PWRDN1, + snd_soc_component_update_bits(component, WM8580_PWRDN1, WM8580_PWRDN1_PWDN | WM8580_PWRDN1_ALLDACPD, 0); /* Make VMID high impedance */ - snd_soc_update_bits(codec, WM8580_ADC_CONTROL1, + snd_soc_component_update_bits(component, WM8580_ADC_CONTROL1, 0x100, 0); } break; case SND_SOC_BIAS_OFF: - snd_soc_update_bits(codec, WM8580_PWRDN1, + snd_soc_component_update_bits(component, WM8580_PWRDN1, WM8580_PWRDN1_PWDN, WM8580_PWRDN1_PWDN); break; } @@ -853,8 +853,8 @@ static int wm8580_set_bias_level(struct snd_soc_codec *codec, static int wm8580_playback_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - struct snd_soc_codec *codec = dai->codec; - struct wm8580_priv *wm8580 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct wm8580_priv *wm8580 = snd_soc_component_get_drvdata(component); return snd_pcm_hw_constraint_minmax(substream->runtime, SNDRV_PCM_HW_PARAM_CHANNELS, 1, wm8580->drvdata->num_dacs * 2); @@ -907,15 +907,15 @@ static struct snd_soc_dai_driver wm8580_dai[] = { }, }; -static int wm8580_probe(struct snd_soc_codec *codec) +static int wm8580_probe(struct snd_soc_component *component) { - struct wm8580_priv *wm8580 = snd_soc_codec_get_drvdata(codec); - struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); + struct wm8580_priv *wm8580 = snd_soc_component_get_drvdata(component); + struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); int ret = 0; switch (wm8580->drvdata->num_dacs) { case 4: - snd_soc_add_codec_controls(codec, wm8581_snd_controls, + snd_soc_add_component_controls(component, wm8581_snd_controls, ARRAY_SIZE(wm8581_snd_controls)); snd_soc_dapm_new_controls(dapm, wm8581_dapm_widgets, ARRAY_SIZE(wm8581_dapm_widgets)); @@ -929,14 +929,14 @@ static int wm8580_probe(struct snd_soc_codec *codec) ret = regulator_bulk_enable(ARRAY_SIZE(wm8580->supplies), wm8580->supplies); if (ret != 0) { - dev_err(codec->dev, "Failed to enable supplies: %d\n", ret); + dev_err(component->dev, "Failed to enable supplies: %d\n", ret); goto err_regulator_get; } /* Get the codec into a known state */ - ret = snd_soc_write(codec, WM8580_RESET, 0); + ret = snd_soc_component_write(component, WM8580_RESET, 0); if (ret != 0) { - dev_err(codec->dev, "Failed to reset codec: %d\n", ret); + dev_err(component->dev, "Failed to reset component: %d\n", ret); goto err_regulator_enable; } @@ -949,28 +949,27 @@ static int wm8580_probe(struct snd_soc_codec *codec) } /* power down chip */ -static int wm8580_remove(struct snd_soc_codec *codec) +static void wm8580_remove(struct snd_soc_component *component) { - struct wm8580_priv *wm8580 = snd_soc_codec_get_drvdata(codec); + struct wm8580_priv *wm8580 = snd_soc_component_get_drvdata(component); regulator_bulk_disable(ARRAY_SIZE(wm8580->supplies), wm8580->supplies); - - return 0; } -static const struct snd_soc_codec_driver soc_codec_dev_wm8580 = { - .probe = wm8580_probe, - .remove = wm8580_remove, - .set_bias_level = wm8580_set_bias_level, - - .component_driver = { - .controls = wm8580_snd_controls, - .num_controls = ARRAY_SIZE(wm8580_snd_controls), - .dapm_widgets = wm8580_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(wm8580_dapm_widgets), - .dapm_routes = wm8580_dapm_routes, - .num_dapm_routes = ARRAY_SIZE(wm8580_dapm_routes), - }, +static const struct snd_soc_component_driver soc_component_dev_wm8580 = { + .probe = wm8580_probe, + .remove = wm8580_remove, + .set_bias_level = wm8580_set_bias_level, + .controls = wm8580_snd_controls, + .num_controls = ARRAY_SIZE(wm8580_snd_controls), + .dapm_widgets = wm8580_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(wm8580_dapm_widgets), + .dapm_routes = wm8580_dapm_routes, + .num_dapm_routes = ARRAY_SIZE(wm8580_dapm_routes), + .idle_bias_on = 1, + .use_pmdown_time = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, }; static const struct regmap_config wm8580_regmap = { @@ -1037,18 +1036,12 @@ static int wm8580_i2c_probe(struct i2c_client *i2c, return -EINVAL; } - ret = snd_soc_register_codec(&i2c->dev, - &soc_codec_dev_wm8580, wm8580_dai, ARRAY_SIZE(wm8580_dai)); + ret = devm_snd_soc_register_component(&i2c->dev, + &soc_component_dev_wm8580, wm8580_dai, ARRAY_SIZE(wm8580_dai)); return ret; } -static int wm8580_i2c_remove(struct i2c_client *client) -{ - snd_soc_unregister_codec(&client->dev); - return 0; -} - static const struct i2c_device_id wm8580_i2c_id[] = { { "wm8580", (kernel_ulong_t)&wm8580_data }, { "wm8581", (kernel_ulong_t)&wm8581_data }, @@ -1062,7 +1055,6 @@ static struct i2c_driver wm8580_i2c_driver = { .of_match_table = wm8580_of_match, }, .probe = wm8580_i2c_probe, - .remove = wm8580_i2c_remove, .id_table = wm8580_i2c_id, };