From patchwork Fri Jan 12 01:38:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10159373 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 A15EF601A1 for ; Fri, 12 Jan 2018 02:32:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8669628957 for ; Fri, 12 Jan 2018 02:32:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7B4EA28975; Fri, 12 Jan 2018 02:32:46 +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=BAD_ENC_HEADER,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 23FEA28957 for ; Fri, 12 Jan 2018 02:32:45 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 03D79267D92; Fri, 12 Jan 2018 03:32:44 +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 08FA0267D93; Fri, 12 Jan 2018 03:32:42 +0100 (CET) Received: from relmlie3.idc.renesas.com (relmlor4.renesas.com [210.160.252.174]) by alsa0.perex.cz (Postfix) with ESMTP id C70BA267FEA for ; Fri, 12 Jan 2018 02:38:25 +0100 (CET) Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie3.idc.renesas.com with ESMTP; 12 Jan 2018 10:38:24 +0900 Received: from relmlii1.idc.renesas.com (relmlii1.idc.renesas.com [10.200.68.65]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 2D1EB6AEB6; Fri, 12 Jan 2018 10:38:24 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.46,346,1511794800"; d="scan'208";a="268009918" Received: from mail-hk2apc01lp0211.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.211]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 12 Jan 2018 10:38:23 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=iNbAont9FIsoKNk71YlHokClyXUtOMMHiTAhRamehBc=; b=goOSswf72m8p6QuJl5RE5tgVBzzcaWyKU9ydZJzC/xkzwRLK1Q/aMvEVL81hzUM64Wp2fyAHNCKvvOeREZLpqrYsoMf3SOwaX4r57YuVOOyjW3xextHw4miS3IrPlyZkGUkQkN+Ax2KIAnqdX1wTU58sLMm6VfIchLdd7pqfpRQ= Received: from morimoto-PC.renesas.com (211.11.155.138) by HK2PR0601MB1875.apcprd06.prod.outlook.com (2603:1096:202:a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Fri, 12 Jan 2018 01:38:22 +0000 Message-ID: <878td397sm.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown In-Reply-To: <87bmhzevk9.wl%kuninori.morimoto.gx@renesas.com> References: <87bmhzevk9.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Fri, 12 Jan 2018 01:38:22 +0000 X-Originating-IP: [211.11.155.138] X-ClientProxiedBy: OSBPR01CA0013.jpnprd01.prod.outlook.com (2603:1096:603::25) To HK2PR0601MB1875.apcprd06.prod.outlook.com (2603:1096:202:a::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ddf8d9e7-e443-4cff-64e9-08d5595d2ae0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020074)(4652020)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:HK2PR0601MB1875; X-Microsoft-Exchange-Diagnostics: 1; HK2PR0601MB1875; 3:hfc6tU42K0/Lb4/NmbEDBX26uhWacSgoq6NWqf23suZR2sdg+HufQXQpYWhr4gFO9epO8upU1cQfhUInSM8mzYcdx91tAbL896fkXbkQuB4HSxl5fRtvbxwFIUxnGpfTRcCTu48RXBAj2fNCb1qlXTxTGKGrZVwJ7/dYbSlFc/NU2jsPwskLyI0IUc6zUgY1UOra9T9trGE4TSGKt2vOQFMCKXkY0KEswlUOAzA0W10DvVnLGjmQvfIy94nHe40/; 25:iDH1bcHKSFm9/HbgAVpxsg1GAgQFcpSaQjRvQD+LeU14Sr47G0v930RifvoEzlwhtpLH5KIQuDCnmUbU3Fe4M1QuX3/2u1N6x4u/jhYLpzCkAMujwik2339iz5yAj83m5odII0RAJqz39X/MYcfPuXsUP8FqQSaOZg87/l5roJs6p4VvBM+LFWYS+JkHsZtJkbgXk7i6blX00djRvGR/6QxpTWQidCMR+xtrCl9qparsIxwKxF9wuCmG+KghKg85X67kpRNIAgIgPbeVOTQn6V77QYVL13ccjcPzJsjpPboxz9AgIz0eiVRNzcI6puDFqAi7+p23rSHVcGJpinhw4A==; 31:zOwXgJ2NS2TqnuRxoIumeeGUt1X1ru+pWs09LjFVjMfPW968jSff8KV3137TdL0Xh24kZCBUbAz3fz6vhQPQ8JCS1I9Qls3nmvbUvWmXfyzRdyIfWz+uQKwluIhGeHfM6osodc6uAVZPs9nxkgfxbijVI3OyXVAXT81WxlyIa5GsXiWhCizXezJpymKw9/CW6QR/xbINvsjGvWO3bomerquF8pljMlY97VnpxZzLVtY= X-MS-TrafficTypeDiagnostic: HK2PR0601MB1875: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; X-Microsoft-Exchange-Diagnostics: 1; HK2PR0601MB1875; 20:KJniGFb8sgCmMiyDqgl+nKy7A+YsybSskUu+6dMb/d8cR+2YGRxDx4EG3MTiRuQd1FPjPCLiEb8P9WWTL1GOgWe95vSnIQFGtD6s1C+YzWMp1RbFsvEXyYhvFeue3Eg5IQVttzPi+E1+ZZ6gazTbIouo/iaxnc5ZZebPrRKMZsI4jCRq0LJi2koNO4rUMTUx8GGFTuOY+eMofzlO4ND58ZVZfKyiacYAQzzYR2GtIZ3vA0zDK9QAWLvJFbJIJo6ol7W9B2GW1GmfA5tYZY5cW3al12GHjinLY3gSk/eiYdpSJI0BQV+FJJNumdI/oqnmwDNMbvKsVubfa+M04ukg5TdYKWNGnEPEsHGAYx4QJb8xOb2oM40I8xPE+R7lylkaZU4z661bG9e/w6xIArGzNCuYaKr6LV2ZcK28q+N5QCa+VXiUHQfHyJLUHyIi1pENfvRWjhHtGLF9+/R8XCeLKLxumkQWm6aTeMtSTCUOT3W/7Qob/pI46WyP01CAepnq; 4:tL5PpxRwJ7vRMKon4I5xK/v5BXzhnChr641xdGRvlQJ+IE69aqwxhC3yKgQvkmgki9uYlJV8j3yKylNDd3t+KO2uhZtHbooqSLZSwsOlJpClp5l3oFiyH85TNKK45x1axGM0VwGE9xVhI4qPuhLkbKrwQHZEZ0682z0+mWUTNyLytea5vPdUiOu9MMDEzqlRRB6mzO+9NJvHSuYb7EefxdklA0v/wV6XTpFKy90KB/wxHsK4ZylpAZUTajxc0V1y/Xdyk4T6vtmsXD/oxwNKk9N2pU9XCaeXiezs6yQW2tdCfBjdhzYN5wSiNACwJLM5 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231023)(944501138)(10201501046)(3002001)(6055026)(6041268)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011); SRVR:HK2PR0601MB1875; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:HK2PR0601MB1875; X-Forefront-PRVS: 0550778858 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(39860400002)(366004)(396003)(346002)(376002)(39380400002)(189003)(199004)(6486002)(81156014)(25786009)(81166006)(69596002)(4326008)(8676002)(575784001)(86362001)(7736002)(47776003)(305945005)(58126008)(316002)(54906003)(97736004)(16586007)(16526018)(478600001)(53936002)(66066001)(59450400001)(386003)(83506002)(2950100002)(6916009)(106356001)(105586002)(53416004)(76176011)(6116002)(3846002)(52116002)(5660300001)(23726003)(36756003)(2906002)(50466002)(8936002)(7696005)(68736007)(21314002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR0601MB1875; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: renesas.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HK2PR0601MB1875; 23:HUEwX6fPemvYQHRdj/fYoF69lA5hxY7oBar+ZNt?= =?us-ascii?Q?MLOYyiDy6BkNNpJWt49bEA05oVCUexGHGydTwMTb4opj7ZTYc3auTH+deTSd?= =?us-ascii?Q?SruLelKDOlVz7ojSDD2j2lcG2K9tfTAHoPy74++V+T1rOu4uEkUXxTTqj2Gi?= =?us-ascii?Q?egX/kYvs8nzk7u2OTmnztUvTp1c6MMwACr1IIP8gX0VOG5g3I4Xu62zz49aJ?= =?us-ascii?Q?J7I4XmDWtPO7SgaXkCQhqpAZbXhzQgp4E0hh7yWc9OwUE518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amDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HK2PR0601MB1875; 20:67qPkZ4SoFhpG5/Ax0KMoiIU0vOBBu6hPkT7Z1hPLK1MlCzk1bHv9V8eyKdys2qQBsYoeMx7O2CKsNl61GildbAoHwhSnorlC9XD4ZfMkebzzoRRjZnBBsZMtXwQtBLdnZydWAg0KAcx+dQL+vy+q+WA/IRVi2ooaCtJeVP2kmU= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2018 01:38:22.3035 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ddf8d9e7-e443-4cff-64e9-08d5595d2ae0 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR0601MB1875 Cc: Linux-ALSA , Simon Subject: [alsa-devel] [PATCH 102/187] ASoC: adav80x: replace codec to component 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto 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 -> .pmdown_time = 1 - -> .endianness = 1 - -> .non_legacy_dai_naming = 1 Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/adav801.c | 7 --- sound/soc/codecs/adav803.c | 7 --- sound/soc/codecs/adav80x.c | 130 ++++++++++++++++++++++----------------------- 3 files changed, 65 insertions(+), 79 deletions(-) diff --git a/sound/soc/codecs/adav801.c b/sound/soc/codecs/adav801.c index 055f122..d82f79d 100644 --- a/sound/soc/codecs/adav801.c +++ b/sound/soc/codecs/adav801.c @@ -30,18 +30,11 @@ static int adav80x_spi_probe(struct spi_device *spi) return adav80x_bus_probe(&spi->dev, devm_regmap_init_spi(spi, &config)); } -static int adav80x_spi_remove(struct spi_device *spi) -{ - snd_soc_unregister_codec(&spi->dev); - return 0; -} - static struct spi_driver adav80x_spi_driver = { .driver = { .name = "adav801", }, .probe = adav80x_spi_probe, - .remove = adav80x_spi_remove, .id_table = adav80x_spi_id, }; module_spi_driver(adav80x_spi_driver); diff --git a/sound/soc/codecs/adav803.c b/sound/soc/codecs/adav803.c index 52881fa..deb14bc 100644 --- a/sound/soc/codecs/adav803.c +++ b/sound/soc/codecs/adav803.c @@ -27,18 +27,11 @@ static int adav803_probe(struct i2c_client *client, devm_regmap_init_i2c(client, &adav80x_regmap_config)); } -static int adav803_remove(struct i2c_client *client) -{ - snd_soc_unregister_codec(&client->dev); - return 0; -} - static struct i2c_driver adav803_driver = { .driver = { .name = "adav803", }, .probe = adav803_probe, - .remove = adav803_remove, .id_table = adav803_id, }; module_i2c_driver(adav803_driver); diff --git a/sound/soc/codecs/adav80x.c b/sound/soc/codecs/adav80x.c index da7ca81..fb79f0e 100644 --- a/sound/soc/codecs/adav80x.c +++ b/sound/soc/codecs/adav80x.c @@ -212,8 +212,8 @@ struct adav80x { static int adav80x_dapm_sysclk_check(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 adav80x *adav80x = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); + struct adav80x *adav80x = snd_soc_component_get_drvdata(component); const char *clk; switch (adav80x->clk_src) { @@ -236,8 +236,8 @@ static int adav80x_dapm_sysclk_check(struct snd_soc_dapm_widget *source, static int adav80x_dapm_pll_check(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 adav80x *adav80x = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); + struct adav80x *adav80x = snd_soc_component_get_drvdata(component); return adav80x->pll_src == ADAV80X_PLL_SRC_XTAL; } @@ -281,9 +281,9 @@ static int adav80x_dapm_pll_check(struct snd_soc_dapm_widget *source, { "AIFAUXIN", NULL, "SYSCLK" }, }; -static int adav80x_set_deemph(struct snd_soc_codec *codec) +static int adav80x_set_deemph(struct snd_soc_component *component) { - struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec); + struct adav80x *adav80x = snd_soc_component_get_drvdata(component); unsigned int val; if (adav80x->deemph) { @@ -315,8 +315,8 @@ static int adav80x_set_deemph(struct snd_soc_codec *codec) static int adav80x_put_deemph(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); - struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); + struct adav80x *adav80x = snd_soc_component_get_drvdata(component); unsigned int deemph = ucontrol->value.integer.value[0]; if (deemph > 1) @@ -324,14 +324,14 @@ static int adav80x_put_deemph(struct snd_kcontrol *kcontrol, adav80x->deemph = deemph; - return adav80x_set_deemph(codec); + return adav80x_set_deemph(component); } static int adav80x_get_deemph(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); - struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); + struct adav80x *adav80x = snd_soc_component_get_drvdata(component); ucontrol->value.integer.value[0] = adav80x->deemph; return 0; @@ -365,8 +365,8 @@ static int adav80x_get_deemph(struct snd_kcontrol *kcontrol, static int adav80x_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) { - struct snd_soc_codec *codec = dai->codec; - struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct adav80x *adav80x = snd_soc_component_get_drvdata(component); unsigned int capture = 0x00; unsigned int playback = 0x00; @@ -415,10 +415,10 @@ static int adav80x_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) return 0; } -static int adav80x_set_adc_clock(struct snd_soc_codec *codec, +static int adav80x_set_adc_clock(struct snd_soc_component *component, unsigned int sample_rate) { - struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec); + struct adav80x *adav80x = snd_soc_component_get_drvdata(component); unsigned int val; if (sample_rate <= 48000) @@ -432,10 +432,10 @@ static int adav80x_set_adc_clock(struct snd_soc_codec *codec, return 0; } -static int adav80x_set_dac_clock(struct snd_soc_codec *codec, +static int adav80x_set_dac_clock(struct snd_soc_component *component, unsigned int sample_rate) { - struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec); + struct adav80x *adav80x = snd_soc_component_get_drvdata(component); unsigned int val; if (sample_rate <= 48000) @@ -450,10 +450,10 @@ static int adav80x_set_dac_clock(struct snd_soc_codec *codec, return 0; } -static int adav80x_set_capture_pcm_format(struct snd_soc_codec *codec, +static int adav80x_set_capture_pcm_format(struct snd_soc_component *component, struct snd_soc_dai *dai, struct snd_pcm_hw_params *params) { - struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec); + struct adav80x *adav80x = snd_soc_component_get_drvdata(component); unsigned int val; switch (params_width(params)) { @@ -479,10 +479,10 @@ static int adav80x_set_capture_pcm_format(struct snd_soc_codec *codec, return 0; } -static int adav80x_set_playback_pcm_format(struct snd_soc_codec *codec, +static int adav80x_set_playback_pcm_format(struct snd_soc_component *component, struct snd_soc_dai *dai, struct snd_pcm_hw_params *params) { - struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec); + struct adav80x *adav80x = snd_soc_component_get_drvdata(component); unsigned int val; if (adav80x->dai_fmt[dai->id] != SND_SOC_DAIFMT_RIGHT_J) @@ -514,32 +514,32 @@ static int adav80x_set_playback_pcm_format(struct snd_soc_codec *codec, static int adav80x_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 adav80x *adav80x = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct adav80x *adav80x = snd_soc_component_get_drvdata(component); unsigned int rate = params_rate(params); if (rate * 256 != adav80x->sysclk) return -EINVAL; if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { - adav80x_set_playback_pcm_format(codec, dai, params); - adav80x_set_dac_clock(codec, rate); + adav80x_set_playback_pcm_format(component, dai, params); + adav80x_set_dac_clock(component, rate); } else { - adav80x_set_capture_pcm_format(codec, dai, params); - adav80x_set_adc_clock(codec, rate); + adav80x_set_capture_pcm_format(component, dai, params); + adav80x_set_adc_clock(component, rate); } adav80x->rate = rate; - adav80x_set_deemph(codec); + adav80x_set_deemph(component); return 0; } -static int adav80x_set_sysclk(struct snd_soc_codec *codec, +static int adav80x_set_sysclk(struct snd_soc_component *component, int clk_id, int source, unsigned int freq, int dir) { - struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec); - struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); + struct adav80x *adav80x = snd_soc_component_get_drvdata(component); + struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); if (dir == SND_SOC_CLOCK_IN) { switch (clk_id) { @@ -619,11 +619,11 @@ static int adav80x_set_sysclk(struct snd_soc_codec *codec, return 0; } -static int adav80x_set_pll(struct snd_soc_codec *codec, int pll_id, +static int adav80x_set_pll(struct snd_soc_component *component, int pll_id, int source, unsigned int freq_in, unsigned int freq_out) { - struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); - struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec); + struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); + struct adav80x *adav80x = snd_soc_component_get_drvdata(component); unsigned int pll_ctrl1 = 0; unsigned int pll_ctrl2 = 0; unsigned int pll_src; @@ -694,10 +694,10 @@ static int adav80x_set_pll(struct snd_soc_codec *codec, int pll_id, return 0; } -static int adav80x_set_bias_level(struct snd_soc_codec *codec, +static int adav80x_set_bias_level(struct snd_soc_component *component, enum snd_soc_bias_level level) { - struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec); + struct adav80x *adav80x = snd_soc_component_get_drvdata(component); unsigned int mask = ADAV80X_DAC_CTRL1_PD; switch (level) { @@ -722,10 +722,10 @@ static int adav80x_set_bias_level(struct snd_soc_codec *codec, static int adav80x_dai_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - struct snd_soc_codec *codec = dai->codec; - struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct adav80x *adav80x = snd_soc_component_get_drvdata(component); - if (!snd_soc_codec_is_active(codec) || !adav80x->rate) + if (!snd_soc_component_is_active(component) || !adav80x->rate) return 0; return snd_pcm_hw_constraint_single(substream->runtime, @@ -735,10 +735,10 @@ static int adav80x_dai_startup(struct snd_pcm_substream *substream, static void adav80x_dai_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - struct snd_soc_codec *codec = dai->codec; - struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct adav80x *adav80x = snd_soc_component_get_drvdata(component); - if (!snd_soc_codec_is_active(codec)) + if (!snd_soc_component_is_active(component)) adav80x->rate = 0; } @@ -799,10 +799,10 @@ static void adav80x_dai_shutdown(struct snd_pcm_substream *substream, }, }; -static int adav80x_probe(struct snd_soc_codec *codec) +static int adav80x_probe(struct snd_soc_component *component) { - struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); - struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec); + struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); + struct adav80x *adav80x = snd_soc_component_get_drvdata(component); /* Force PLLs on for SYSCLK output */ snd_soc_dapm_force_enable_pin(dapm, "PLL1"); @@ -816,32 +816,32 @@ static int adav80x_probe(struct snd_soc_codec *codec) return 0; } -static int adav80x_resume(struct snd_soc_codec *codec) +static int adav80x_resume(struct snd_soc_component *component) { - struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec); + struct adav80x *adav80x = snd_soc_component_get_drvdata(component); regcache_sync(adav80x->regmap); return 0; } -static const struct snd_soc_codec_driver adav80x_codec_driver = { - .probe = adav80x_probe, - .resume = adav80x_resume, - .set_bias_level = adav80x_set_bias_level, - .suspend_bias_off = true, - - .set_pll = adav80x_set_pll, - .set_sysclk = adav80x_set_sysclk, - - .component_driver = { - .controls = adav80x_controls, - .num_controls = ARRAY_SIZE(adav80x_controls), - .dapm_widgets = adav80x_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(adav80x_dapm_widgets), - .dapm_routes = adav80x_dapm_routes, - .num_dapm_routes = ARRAY_SIZE(adav80x_dapm_routes), - }, +static const struct snd_soc_component_driver adav80x_component_driver = { + .probe = adav80x_probe, + .resume = adav80x_resume, + .set_bias_level = adav80x_set_bias_level, + .set_pll = adav80x_set_pll, + .set_sysclk = adav80x_set_sysclk, + .controls = adav80x_controls, + .num_controls = ARRAY_SIZE(adav80x_controls), + .dapm_widgets = adav80x_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(adav80x_dapm_widgets), + .dapm_routes = adav80x_dapm_routes, + .num_dapm_routes = ARRAY_SIZE(adav80x_dapm_routes), + .suspend_bias_off = 1, + .idle_bias_on = 1, + .pmdown_time = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, }; int adav80x_bus_probe(struct device *dev, struct regmap *regmap) @@ -858,7 +858,7 @@ int adav80x_bus_probe(struct device *dev, struct regmap *regmap) dev_set_drvdata(dev, adav80x); adav80x->regmap = regmap; - return snd_soc_register_codec(dev, &adav80x_codec_driver, + return devm_snd_soc_register_component(dev, &adav80x_component_driver, adav80x_dais, ARRAY_SIZE(adav80x_dais)); } EXPORT_SYMBOL_GPL(adav80x_bus_probe);