From patchwork Sat May 5 01:50:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 49295 Received: from vger.kernel.org ([209.132.180.67]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fEmM0-0004iY-T4; Sat, 05 May 2018 01:51:17 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751809AbeEEBvB (ORCPT + 1 other); Fri, 4 May 2018 21:51:01 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:47912 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751736AbeEEBvA (ORCPT ); Fri, 4 May 2018 21:51:00 -0400 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=AsApawtoYNdASu9nmiDPuyRn5ZhlhEXwi+PfHhVgzWc=; b=KNES4wkii2DL qlmisFOAbYlBAc6UNJcHSatJTGm90U8yMnjg4Cqr4QkZRv+St/MJ0EQldGC9GHw9Ym8oyu/wEYrYf Y9eOdxaSUigLukqPNCtmwnQUKY3VYUn5WNQo/HmDtHj19qNTsUzU7BbY+Wi7vvB6r18t7mRj3xQej hHxjk=; Received: from [211.55.52.15] (helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fEmLc-0006Ww-9O; Sat, 05 May 2018 01:50:52 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id 5225644007A; Sat, 5 May 2018 02:50:49 +0100 (BST) From: Mark Brown To: Kuninori Morimoto Cc: Tim Harvey , Tim Harvey , Mauro Carvalho Chehab , Mark Brown , Mark Brown , Tim Harvey , Mauro Carvalho Chehab , Linux-ALSA , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, alsa-devel@alsa-project.org Subject: Applied "media: i2c: tda1997: replace codec to component" to the asoc tree In-Reply-To: <87in94lwmq.wl%kuninori.morimoto.gx@renesas.com> Message-Id: <20180505015049.5225644007A@finisterre.ee.mobilebroadband> Date: Sat, 5 May 2018 02:50:49 +0100 (BST) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The patch media: i2c: tda1997: 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 2d8102cc9a27577ffa4335aaaed4a26060688de2 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 23 Apr 2018 02:10:26 +0000 Subject: [PATCH] media: i2c: tda1997: 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 Tested-by: Tim Harvey Acked-by: Tim Harvey Acked-by: Mauro Carvalho Chehab Signed-off-by: Mark Brown --- drivers/media/i2c/tda1997x.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/media/i2c/tda1997x.c b/drivers/media/i2c/tda1997x.c index 3021913c28fa..33d7fcf541fc 100644 --- a/drivers/media/i2c/tda1997x.c +++ b/drivers/media/i2c/tda1997x.c @@ -2444,7 +2444,7 @@ static int tda1997x_pcm_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct tda1997x_state *state = snd_soc_dai_get_drvdata(dai); - struct snd_soc_codec *codec = dai->codec; + struct snd_soc_component *component = dai->component; struct snd_pcm_runtime *rtd = substream->runtime; int rate, err; @@ -2452,11 +2452,11 @@ static int tda1997x_pcm_startup(struct snd_pcm_substream *substream, err = snd_pcm_hw_constraint_minmax(rtd, SNDRV_PCM_HW_PARAM_RATE, rate, rate); if (err < 0) { - dev_err(codec->dev, "failed to constrain samplerate to %dHz\n", + dev_err(component->dev, "failed to constrain samplerate to %dHz\n", rate); return err; } - dev_info(codec->dev, "set samplerate constraint to %dHz\n", rate); + dev_info(component->dev, "set samplerate constraint to %dHz\n", rate); return 0; } @@ -2479,20 +2479,22 @@ static struct snd_soc_dai_driver tda1997x_audio_dai = { .ops = &tda1997x_dai_ops, }; -static int tda1997x_codec_probe(struct snd_soc_codec *codec) +static int tda1997x_codec_probe(struct snd_soc_component *component) { return 0; } -static int tda1997x_codec_remove(struct snd_soc_codec *codec) +static void tda1997x_codec_remove(struct snd_soc_component *component) { - return 0; } -static struct snd_soc_codec_driver tda1997x_codec_driver = { - .probe = tda1997x_codec_probe, - .remove = tda1997x_codec_remove, - .reg_word_size = sizeof(u16), +static struct snd_soc_component_driver tda1997x_codec_driver = { + .probe = tda1997x_codec_probe, + .remove = tda1997x_codec_remove, + .idle_bias_on = 1, + .use_pmdown_time = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, }; static int tda1997x_probe(struct i2c_client *client, @@ -2737,7 +2739,7 @@ static int tda1997x_probe(struct i2c_client *client, else formats = SNDRV_PCM_FMTBIT_S16_LE; tda1997x_audio_dai.capture.formats = formats; - ret = snd_soc_register_codec(&state->client->dev, + ret = devm_snd_soc_register_component(&state->client->dev, &tda1997x_codec_driver, &tda1997x_audio_dai, 1); if (ret) { @@ -2782,7 +2784,6 @@ static int tda1997x_remove(struct i2c_client *client) struct tda1997x_platform_data *pdata = &state->pdata; if (pdata->audout_format) { - snd_soc_unregister_codec(&client->dev); mutex_destroy(&state->audio_lock); }