From patchwork Mon Feb 12 12:44:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 128064 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3201340ljc; Mon, 12 Feb 2018 05:18:19 -0800 (PST) X-Google-Smtp-Source: AH8x225eK+OGdP+dvr3dqLpZjfZovZFbe2zCglOQb/TohaM5Zas7rhl9ITrTOPBGk1hq8SyzKWWW X-Received: by 10.28.220.193 with SMTP id t184mr3780266wmg.126.1518441499202; Mon, 12 Feb 2018 05:18:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518441499; cv=none; d=google.com; s=arc-20160816; b=KXrKDmcwpQM6PE2hAHvPZpTyujzEI753VHmdaRVv4GDNS7bO6u9eSUoGSvlVwfUR6c ENcSo7cA81ZQj/nfMOt7ssjusfRWT3HU1itn4BK5AXuYDO0tFbku7RwZqleuCVTGvavq 2tnIRKg02fDGGZT4+8apWH3wGek6Yk9ro4bVNzPJg8w+zahdRtvBZn2Ykxwu2LMRfrrX ssZGF2CPE4iZdVns3SGyCxi5DCaxL/T2MQuwTrn5WElj0AgT6ddHJZAKvgD4FSvpsB+t mttUS5uobMC3AnGATcnHuqk3aOt3pc+D2TFFEL69mGz2qo8AJLZPrviU01VQrLdjWHUB q9fQ== 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=Gd9kfbUY6F28tuR7YExem3KjODJBelpgk3/TqfEz82k=; b=A1E5qrhdcKz5Dxhlogv5IVZADu7Qo9H8UUBUYso+RaW0vn3/fBUU+R8an3eTLFLJch 8CiIR9m+Ep4hSba0f9OJzgcZeWov7jGp4UbqpYbgwq/UwyTbocDgeCiYpJmgnPDAz0o9 zemj8QbBFKnwnM2ib72+N4qxPBHtJhzVK9i6a3YGDFYDALpA1eGN6+rwdJ0RPJX9xlwf EsPC2L0iK8t42bIaS9Dptf2VeG8BJySscUBq7P6uMQS9beT/1Qwu1CI7uH872ceZrFrX EO2m/HnMosj1D0Uu1LdKN0MZ+pB/T45YLFH2xzYZ1sSxEkObVFKWlZxNcD4jNp2GalGX o71w== 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=jLMAHizj; 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 a19si6503100wra.452.2018.02.12.05.18.18; Mon, 12 Feb 2018 05:18:19 -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=jLMAHizj; 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 DC6BD268688; Mon, 12 Feb 2018 14:17:01 +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 53134268686; Mon, 12 Feb 2018 14:17:00 +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 5B26F267A12 for ; Mon, 12 Feb 2018 13:44:08 +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=oBvibHmthLrU4rQ369TwyzMqG/zlUajmym0P7TZS8JQ=; b=jLMAHizj+WiU R8A8sDoiPNanRjTlYNWoE4bntCmc0r0ZSK+Cy8GvehymFFAwPont6WMQNb2KS1bqAOXubcM1la547 zyEzSLkR1ZYOUj3ahZ7sKQYCTarHkoAsPh6D1lxCr/S2IMb6eAtp64R5/8XxYNzNJAZZvMyWo7BKV +UwQg=; 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 1elDSo-0002OW-GH; Mon, 12 Feb 2018 12:44:06 +0000 Received: from broonie by debutante with local (Exim 4.90) (envelope-from ) id 1elDSo-00057A-2G; Mon, 12 Feb 2018 12:44:06 +0000 From: Mark Brown To: Kuninori Morimoto In-Reply-To: <87efm91fql.wl%kuninori.morimoto.gx@renesas.com> Message-Id: Date: Mon, 12 Feb 2018 12:44:06 +0000 Cc: alsa-devel@alsa-project.org, Mark Brown Subject: [alsa-devel] Applied "ASoC: cs35l34: 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: cs35l34: 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 8a6e7dd6f07d7f537b10b0e61165c06d15dcc1f2 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 29 Jan 2018 03:56:25 +0000 Subject: [PATCH] ASoC: cs35l34: 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/cs35l34.c | 127 ++++++++++++++++++++++----------------------- 1 file changed, 63 insertions(+), 64 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/cs35l34.c b/sound/soc/codecs/cs35l34.c index 0600d5264c4c..5063c05afa27 100644 --- a/sound/soc/codecs/cs35l34.c +++ b/sound/soc/codecs/cs35l34.c @@ -43,7 +43,7 @@ #define CS35L34_START_DELAY 50 struct cs35l34_private { - struct snd_soc_codec *codec; + struct snd_soc_component *component; struct cs35l34_platform_data pdata; struct regmap *regmap; struct regulator_bulk_data core_supplies[2]; @@ -237,8 +237,8 @@ static bool cs35l34_precious_register(struct device *dev, unsigned int reg) static int cs35l34_sdin_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 cs35l34_private *priv = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); + struct cs35l34_private *priv = snd_soc_component_get_drvdata(component); int ret; switch (event) { @@ -250,7 +250,7 @@ static int cs35l34_sdin_event(struct snd_soc_dapm_widget *w, ret = regmap_update_bits(priv->regmap, CS35L34_PWRCTL1, CS35L34_PDN_ALL, 0); if (ret < 0) { - dev_err(codec->dev, "Cannot set Power bits %d\n", ret); + dev_err(component->dev, "Cannot set Power bits %d\n", ret); return ret; } usleep_range(5000, 5100); @@ -272,8 +272,8 @@ static int cs35l34_sdin_event(struct snd_soc_dapm_widget *w, static int cs35l34_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 cs35l34_private *priv = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct cs35l34_private *priv = snd_soc_component_get_drvdata(component); unsigned int reg, bit_pos; int slot, slot_num; @@ -284,7 +284,7 @@ static int cs35l34_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, /* scan rx_mask for aud slot */ slot = ffs(rx_mask) - 1; if (slot >= 0) - snd_soc_update_bits(codec, CS35L34_TDM_RX_CTL_1_AUDIN, + snd_soc_component_update_bits(component, CS35L34_TDM_RX_CTL_1_AUDIN, CS35L34_X_LOC, slot); /* scan tx_mask: vmon(2 slots); imon (2 slots); vpmon (1 slot) @@ -294,10 +294,10 @@ static int cs35l34_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, slot_num = 0; /* disable vpmon/vbstmon: enable later if set in tx_mask */ - snd_soc_update_bits(codec, CS35L34_TDM_TX_CTL_3_VPMON, + snd_soc_component_update_bits(component, CS35L34_TDM_TX_CTL_3_VPMON, CS35L34_X_STATE | CS35L34_X_LOC, CS35L34_X_STATE | CS35L34_X_LOC); - snd_soc_update_bits(codec, CS35L34_TDM_TX_CTL_4_VBSTMON, + snd_soc_component_update_bits(component, CS35L34_TDM_TX_CTL_4_VBSTMON, CS35L34_X_STATE | CS35L34_X_LOC, CS35L34_X_STATE | CS35L34_X_LOC); @@ -305,22 +305,22 @@ static int cs35l34_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, while (slot >= 0) { /* configure VMON_TX_LOC */ if (slot_num == 0) - snd_soc_update_bits(codec, CS35L34_TDM_TX_CTL_1_VMON, + snd_soc_component_update_bits(component, CS35L34_TDM_TX_CTL_1_VMON, CS35L34_X_STATE | CS35L34_X_LOC, slot); /* configure IMON_TX_LOC */ if (slot_num == 4) { - snd_soc_update_bits(codec, CS35L34_TDM_TX_CTL_2_IMON, + snd_soc_component_update_bits(component, CS35L34_TDM_TX_CTL_2_IMON, CS35L34_X_STATE | CS35L34_X_LOC, slot); } /* configure VPMON_TX_LOC */ if (slot_num == 3) { - snd_soc_update_bits(codec, CS35L34_TDM_TX_CTL_3_VPMON, + snd_soc_component_update_bits(component, CS35L34_TDM_TX_CTL_3_VPMON, CS35L34_X_STATE | CS35L34_X_LOC, slot); } /* configure VBSTMON_TX_LOC */ if (slot_num == 7) { - snd_soc_update_bits(codec, + snd_soc_component_update_bits(component, CS35L34_TDM_TX_CTL_4_VBSTMON, CS35L34_X_STATE | CS35L34_X_LOC, slot); } @@ -328,7 +328,7 @@ static int cs35l34_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, /* Enable the relevant tx slot */ reg = CS35L34_TDM_TX_SLOT_EN_4 - (slot/8); bit_pos = slot - ((slot / 8) * (8)); - snd_soc_update_bits(codec, reg, + snd_soc_component_update_bits(component, reg, 1 << bit_pos, 1 << bit_pos); tx_mask &= ~(1 << slot); @@ -342,8 +342,8 @@ static int cs35l34_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, static int cs35l34_main_amp_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 cs35l34_private *priv = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); + struct cs35l34_private *priv = snd_soc_component_get_drvdata(component); switch (event) { case SND_SOC_DAPM_POST_PMU: @@ -382,8 +382,8 @@ static const struct snd_kcontrol_new cs35l34_snd_controls[] = { static int cs35l34_mclk_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 cs35l34_private *priv = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); + struct cs35l34_private *priv = snd_soc_component_get_drvdata(component); int ret, i; unsigned int reg; @@ -524,8 +524,8 @@ static int cs35l34_get_mclk_coeff(int mclk, int srate) static int cs35l34_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) { - struct snd_soc_codec *codec = codec_dai->codec; - struct cs35l34_private *priv = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = codec_dai->component; + struct cs35l34_private *priv = snd_soc_component_get_drvdata(component); switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { case SND_SOC_DAIFMT_CBM_CFM: @@ -546,15 +546,15 @@ static int cs35l34_pcm_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 cs35l34_private *priv = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct cs35l34_private *priv = snd_soc_component_get_drvdata(component); int srate = params_rate(params); int ret; int coeff = cs35l34_get_mclk_coeff(priv->mclk_int, srate); if (coeff < 0) { - dev_err(codec->dev, "ERROR: Invalid mclk %d and/or srate %d\n", + dev_err(component->dev, "ERROR: Invalid mclk %d and/or srate %d\n", priv->mclk_int, srate); return coeff; } @@ -562,7 +562,7 @@ static int cs35l34_pcm_hw_params(struct snd_pcm_substream *substream, ret = regmap_update_bits(priv->regmap, CS35L34_ADSP_CLK_CTL, CS35L34_ADSP_RATE, cs35l34_mclk_coeffs[coeff].adsp_rate); if (ret != 0) - dev_err(codec->dev, "Failed to set clock state %d\n", ret); + dev_err(component->dev, "Failed to set clock state %d\n", ret); return ret; } @@ -590,13 +590,13 @@ static int cs35l34_pcm_startup(struct snd_pcm_substream *substream, static int cs35l34_set_tristate(struct snd_soc_dai *dai, int tristate) { - struct snd_soc_codec *codec = dai->codec; + struct snd_soc_component *component = dai->component; if (tristate) - snd_soc_update_bits(codec, CS35L34_PWRCTL3, + snd_soc_component_update_bits(component, CS35L34_PWRCTL3, CS35L34_PDN_SDOUT, CS35L34_PDN_SDOUT); else - snd_soc_update_bits(codec, CS35L34_PWRCTL3, + snd_soc_component_update_bits(component, CS35L34_PWRCTL3, CS35L34_PDN_SDOUT, 0); return 0; } @@ -604,8 +604,8 @@ static int cs35l34_set_tristate(struct snd_soc_dai *dai, int tristate) static int cs35l34_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int freq, int dir) { - struct snd_soc_codec *codec = dai->codec; - struct cs35l34_private *cs35l34 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct cs35l34_private *cs35l34 = snd_soc_component_get_drvdata(component); unsigned int value; switch (freq) { @@ -634,7 +634,7 @@ static int cs35l34_dai_set_sysclk(struct snd_soc_dai *dai, cs35l34->mclk_int = freq / 2; break; default: - dev_err(codec->dev, "ERROR: Invalid Frequency %d\n", freq); + dev_err(component->dev, "ERROR: Invalid Frequency %d\n", freq); cs35l34->mclk_int = 0; return -EINVAL; } @@ -676,7 +676,7 @@ static struct snd_soc_dai_driver cs35l34_dai = { static int cs35l34_boost_inductor(struct cs35l34_private *cs35l34, unsigned int inductor) { - struct snd_soc_codec *codec = cs35l34->codec; + struct snd_soc_component *component = cs35l34->component; switch (inductor) { case 1000: /* 1 uH */ @@ -708,19 +708,19 @@ static int cs35l34_boost_inductor(struct cs35l34_private *cs35l34, regmap_write(cs35l34->regmap, CS35L34_BST_CONV_SW_FREQ, 3); break; default: - dev_err(codec->dev, "%s Invalid Inductor Value %d uH\n", + dev_err(component->dev, "%s Invalid Inductor Value %d uH\n", __func__, inductor); return -EINVAL; } return 0; } -static int cs35l34_probe(struct snd_soc_codec *codec) +static int cs35l34_probe(struct snd_soc_component *component) { int ret = 0; - struct cs35l34_private *cs35l34 = snd_soc_codec_get_drvdata(codec); + struct cs35l34_private *cs35l34 = snd_soc_component_get_drvdata(component); - pm_runtime_get_sync(codec->dev); + pm_runtime_get_sync(component->dev); /* Set over temperature warning attenuation to 6 dB */ regmap_update_bits(cs35l34->regmap, CS35L34_PROTECT_CTL, @@ -773,23 +773,24 @@ static int cs35l34_probe(struct snd_soc_codec *codec) regmap_update_bits(cs35l34->regmap, CS35L34_ADSP_TDM_CTL, 1, 1); - pm_runtime_put_sync(codec->dev); + pm_runtime_put_sync(component->dev); return ret; } -static const struct snd_soc_codec_driver soc_codec_dev_cs35l34 = { - .probe = cs35l34_probe, - - .component_driver = { - .dapm_widgets = cs35l34_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(cs35l34_dapm_widgets), - .dapm_routes = cs35l34_audio_map, - .num_dapm_routes = ARRAY_SIZE(cs35l34_audio_map), - .controls = cs35l34_snd_controls, - .num_controls = ARRAY_SIZE(cs35l34_snd_controls), - }, +static const struct snd_soc_component_driver soc_component_dev_cs35l34 = { + .probe = cs35l34_probe, + .dapm_widgets = cs35l34_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(cs35l34_dapm_widgets), + .dapm_routes = cs35l34_audio_map, + .num_dapm_routes = ARRAY_SIZE(cs35l34_audio_map), + .controls = cs35l34_snd_controls, + .num_controls = ARRAY_SIZE(cs35l34_snd_controls), + .idle_bias_on = 1, + .use_pmdown_time = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, }; static struct regmap_config cs35l34_regmap = { @@ -864,7 +865,7 @@ static int cs35l34_handle_of_data(struct i2c_client *i2c_client, static irqreturn_t cs35l34_irq_thread(int irq, void *data) { struct cs35l34_private *cs35l34 = data; - struct snd_soc_codec *codec = cs35l34->codec; + struct snd_soc_component *component = cs35l34->component; unsigned int sticky1, sticky2, sticky3, sticky4; unsigned int mask1, mask2, mask3, mask4, current1; @@ -887,11 +888,11 @@ static irqreturn_t cs35l34_irq_thread(int irq, void *data) regmap_read(cs35l34->regmap, CS35L34_INT_STATUS_1, ¤t1); if (sticky1 & CS35L34_CAL_ERR) { - dev_err(codec->dev, "Cal error\n"); + dev_err(component->dev, "Cal error\n"); /* error is no longer asserted; safe to reset */ if (!(current1 & CS35L34_CAL_ERR)) { - dev_dbg(codec->dev, "Cal error release\n"); + dev_dbg(component->dev, "Cal error release\n"); regmap_update_bits(cs35l34->regmap, CS35L34_PROT_RELEASE_CTL, CS35L34_CAL_ERR_RLS, 0); @@ -907,14 +908,14 @@ static irqreturn_t cs35l34_irq_thread(int irq, void *data) } if (sticky1 & CS35L34_ALIVE_ERR) - dev_err(codec->dev, "Alive error\n"); + dev_err(component->dev, "Alive error\n"); if (sticky1 & CS35L34_AMP_SHORT) { - dev_crit(codec->dev, "Amp short error\n"); + dev_crit(component->dev, "Amp short error\n"); /* error is no longer asserted; safe to reset */ if (!(current1 & CS35L34_AMP_SHORT)) { - dev_dbg(codec->dev, + dev_dbg(component->dev, "Amp short error release\n"); regmap_update_bits(cs35l34->regmap, CS35L34_PROT_RELEASE_CTL, @@ -930,11 +931,11 @@ static irqreturn_t cs35l34_irq_thread(int irq, void *data) } if (sticky1 & CS35L34_OTW) { - dev_crit(codec->dev, "Over temperature warning\n"); + dev_crit(component->dev, "Over temperature warning\n"); /* error is no longer asserted; safe to reset */ if (!(current1 & CS35L34_OTW)) { - dev_dbg(codec->dev, + dev_dbg(component->dev, "Over temperature warning release\n"); regmap_update_bits(cs35l34->regmap, CS35L34_PROT_RELEASE_CTL, @@ -950,11 +951,11 @@ static irqreturn_t cs35l34_irq_thread(int irq, void *data) } if (sticky1 & CS35L34_OTE) { - dev_crit(codec->dev, "Over temperature error\n"); + dev_crit(component->dev, "Over temperature error\n"); /* error is no longer asserted; safe to reset */ if (!(current1 & CS35L34_OTE)) { - dev_dbg(codec->dev, + dev_dbg(component->dev, "Over temperature error release\n"); regmap_update_bits(cs35l34->regmap, CS35L34_PROT_RELEASE_CTL, @@ -970,7 +971,7 @@ static irqreturn_t cs35l34_irq_thread(int irq, void *data) } if (sticky3 & CS35L34_BST_HIGH) { - dev_crit(codec->dev, "VBST too high error; powering off!\n"); + dev_crit(component->dev, "VBST too high error; powering off!\n"); regmap_update_bits(cs35l34->regmap, CS35L34_PWRCTL2, CS35L34_PDN_AMP, CS35L34_PDN_AMP); regmap_update_bits(cs35l34->regmap, CS35L34_PWRCTL1, @@ -978,7 +979,7 @@ static irqreturn_t cs35l34_irq_thread(int irq, void *data) } if (sticky3 & CS35L34_LBST_SHORT) { - dev_crit(codec->dev, "LBST short error; powering off!\n"); + dev_crit(component->dev, "LBST short error; powering off!\n"); regmap_update_bits(cs35l34->regmap, CS35L34_PWRCTL2, CS35L34_PDN_AMP, CS35L34_PDN_AMP); regmap_update_bits(cs35l34->regmap, CS35L34_PWRCTL1, @@ -1108,11 +1109,11 @@ static int cs35l34_i2c_probe(struct i2c_client *i2c_client, pm_runtime_set_active(&i2c_client->dev); pm_runtime_enable(&i2c_client->dev); - ret = snd_soc_register_codec(&i2c_client->dev, - &soc_codec_dev_cs35l34, &cs35l34_dai, 1); + ret = devm_snd_soc_register_component(&i2c_client->dev, + &soc_component_dev_cs35l34, &cs35l34_dai, 1); if (ret < 0) { dev_err(&i2c_client->dev, - "%s: Register codec failed\n", __func__); + "%s: Register component failed\n", __func__); goto err_regulator; } @@ -1129,8 +1130,6 @@ static int cs35l34_i2c_remove(struct i2c_client *client) { struct cs35l34_private *cs35l34 = i2c_get_clientdata(client); - snd_soc_unregister_codec(&client->dev); - gpiod_set_value_cansleep(cs35l34->reset_gpio, 0); pm_runtime_disable(&client->dev);