From patchwork Fri Jan 12 01:33:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10159343 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 7070A602D8 for ; Fri, 12 Jan 2018 02:23:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 56CDD28938 for ; Fri, 12 Jan 2018 02:23:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B721289E7; Fri, 12 Jan 2018 02:23:01 +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 2303628938 for ; Fri, 12 Jan 2018 02:23:00 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id EEB14267E3C; Fri, 12 Jan 2018 03:22:58 +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 68296267E68; Fri, 12 Jan 2018 03:22:57 +0100 (CET) Received: from relmlie1.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa0.perex.cz (Postfix) with ESMTP id 61562267B77 for ; Fri, 12 Jan 2018 02:34:01 +0100 (CET) Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie1.idc.renesas.com with ESMTP; 12 Jan 2018 10:33:59 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id E09636D855; Fri, 12 Jan 2018 10:33:59 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.46,346,1511794800"; d="scan'208";a="269309851" Received: from mail-pu1apc01lp0023.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.23]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-GCM-SHA384; 12 Jan 2018 10:33:59 +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=4hNnabnsWaZhTJbkRILHeyZX0WK3jhKtY7zqZzjyAxw=; b=gBoMtepzA2BpGOkmKHA1g25gXbaiXBzjC9fu/2h+qO+4pTr20ggn3xhmm2l0jkFNwzG+K9Ma411jic4neBqNJK2MZHe0R2JRCAO4uK6w+O8pCHoVmgZZ0naEONoRIfhAwiI/QdTtbvTNQj8OLTLYBNXFBJapBv/USvPvLC4x59Y= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.138) by SG2PR0601MB1887.apcprd06.prod.outlook.com (2603:1096:3:9::20) 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:33:57 +0000 Message-ID: <87po6f97zx.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:33:57 +0000 X-Originating-IP: [211.11.155.138] X-ClientProxiedBy: KAXPR01CA0026.jpnprd01.prod.outlook.com (2603:1096:402:1a::12) To SG2PR0601MB1887.apcprd06.prod.outlook.com (2603:1096:3:9::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5de79ad4-9eca-4118-23a4-08d5595c8d17 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020074)(4652020)(5600026)(4604075)(48565401081)(2017052603307)(7153060)(7193020); SRVR:SG2PR0601MB1887; X-Microsoft-Exchange-Diagnostics: 1; SG2PR0601MB1887; 3:MaX3Inhjts22LMKcsN58SOra051SCxUaCA15BZj3jOADWhOgWA2vP7tSL0CaDFVC1YPNG9IXLEZ6ntlsX+908v33Yl460Ss6H30DWiBTBtZJMlQfvhreRZzdhqBtow//aVR7YbNBLuID9y+KhvEZal8d6SvzhMmNX5Hn2oYExmEVFzCq9MJyY0IiWdv8gBVg57EQZdfVSsMO0STAs4Qt3BmgrBktjCezLgY7ivoBf+wcK+GxknpwFWtWXkzA7dpu; 25:SQU8g8z+QNy8qYiT4yrxVKxa5S/scvT6coofNI/c/3DjrnC+rQSXi4IZdsyDBhgH20QCvKCM125wWUwUww6zECLdmTxmRzcuYx2kOtTmHEgo+Bs2YX2hbd2PfYcs20vcFJs++objG+HpostNzhYuJRUQeH0nX92i0tBV1YEnJTuoYZDOVf+QeaLbsSdlHW3P+3q7cZNVCMm/sWGfWxlBT6nFmgLdIVY5ymK7BWXEnEetVl3Pb+IemjLQ5J3om2lKeIfuJee/UBtD/eEMpD1og+E8veDBypeOTV1cwVNLt/x42LTYL+yl4c/mzq55EGQdMhh3ZmTgk6xgZImTPBciew==; 31:zSfBjf/2nLTj2yy+PN5mgCrehyeV+6oE5vuzI1wMfo9bKtIiu+KCpp16VAHhRpk2QkmGCyAUIh16X3Q0vR4S7qkja11KWbZAuBmWlycW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am-Report-Test: UriScan:(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3231023)(944501138)(3002001)(6055026)(6041268)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(6072148)(201708071742011); SRVR:SG2PR0601MB1887; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:SG2PR0601MB1887; X-Forefront-PRVS: 0550778858 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(366004)(376002)(39380400002)(346002)(396003)(39860400002)(199004)(189003)(305945005)(5660300001)(68736007)(47776003)(8676002)(16526018)(69596002)(83506002)(16586007)(6116002)(2950100002)(81166006)(25786009)(59450400001)(478600001)(53936002)(58126008)(97736004)(81156014)(54906003)(3846002)(386003)(86362001)(316002)(6486002)(66066001)(50466002)(53416004)(52116002)(6916009)(8936002)(36756003)(106356001)(2906002)(23726003)(76176011)(7736002)(4326008)(105586002)(7696005)(21314002)(16060500001)(357404004); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR0601MB1887; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; SG2PR0601MB1887; 23:i5m5DbhMvnLSkv/VcvMRoDKTsztGvsdPpOYFzoR?= =?us-ascii?Q?tYYE9Qj/c3p3MHJtWMPuX5eplFzodCqtRbxHtn/JfBrJXkrUZcrteVTrnEnE?= =?us-ascii?Q?dYWeuepynqcDd6ePc5xrjjwJFov0R5FTtLJe77AU+pLgvIP1l4ofopOtV7V/?= =?us-ascii?Q?tNfXNfydTJS6oXEYWV/xwBcxJ5JCagoWztS7tp2TR//888aZbBnyIAbc7RHY?= =?us-ascii?Q?M+61wprKHHuNjrClJsO6jRVWrAnWVp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Output: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SG2PR0601MB1887; 20:qlLKPbbNMhL6Nt+BY87dxPakMNI8F1CntvsGc2iMoBfGtqYSWuONF9Juy321IA9ZG3eYvipdC7wllsCqEAblL1yw3rZRujnXonNyTFsVcMPBFI2TuqHeLTRoMUdApzqmNnSLPi0g+l2oxJuG3Jj/z241dEpjq60WTOSwAV57sx0= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2018 01:33:57.7385 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5de79ad4-9eca-4118-23a4-08d5595c8d17 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR0601MB1887 Cc: Linux-ALSA , Simon Subject: [alsa-devel] [PATCH 091/187] ASoC: max9860: 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 = 1 -> .idle_bias_on = 0 .ignore_pmdown_time = 0 -> .pmdown_time = 1 - -> .endianness = 1 - -> .non_legacy_dai_naming = 1 Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/max9860.c | 70 ++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 36 deletions(-) diff --git a/sound/soc/codecs/max9860.c b/sound/soc/codecs/max9860.c index a2dc6a4..c3ae273 100644 --- a/sound/soc/codecs/max9860.c +++ b/sound/soc/codecs/max9860.c @@ -261,8 +261,8 @@ static int max9860_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 max9860_priv *max9860 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct max9860_priv *max9860 = snd_soc_component_get_drvdata(component); u8 master; u8 ifc1a = 0; u8 ifc1b = 0; @@ -270,7 +270,7 @@ static int max9860_hw_params(struct snd_pcm_substream *substream, unsigned long n; int ret; - dev_dbg(codec->dev, "hw_params %u Hz, %u channels\n", + dev_dbg(component->dev, "hw_params %u Hz, %u channels\n", params_rate(params), params_channels(params)); @@ -306,7 +306,7 @@ static int max9860_hw_params(struct snd_pcm_substream *substream, break; case SND_SOC_DAIFMT_DSP_A: if (params_width(params) != 16) { - dev_err(codec->dev, + dev_err(component->dev, "DSP_A works for 16 bits per sample only.\n"); return -EINVAL; } @@ -315,7 +315,7 @@ static int max9860_hw_params(struct snd_pcm_substream *substream, break; case SND_SOC_DAIFMT_DSP_B: if (params_width(params) != 16) { - dev_err(codec->dev, + dev_err(component->dev, "DSP_B works for 16 bits per sample only.\n"); return -EINVAL; } @@ -352,16 +352,16 @@ static int max9860_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } - dev_dbg(codec->dev, "IFC1A %02x\n", ifc1a); + dev_dbg(component->dev, "IFC1A %02x\n", ifc1a); ret = regmap_write(max9860->regmap, MAX9860_IFC1A, ifc1a); if (ret) { - dev_err(codec->dev, "Failed to set IFC1A: %d\n", ret); + dev_err(component->dev, "Failed to set IFC1A: %d\n", ret); return ret; } - dev_dbg(codec->dev, "IFC1B %02x\n", ifc1b); + dev_dbg(component->dev, "IFC1B %02x\n", ifc1b); ret = regmap_write(max9860->regmap, MAX9860_IFC1B, ifc1b); if (ret) { - dev_err(codec->dev, "Failed to set IFC1B: %d\n", ret); + dev_err(component->dev, "Failed to set IFC1B: %d\n", ret); return ret; } @@ -417,33 +417,33 @@ static int max9860_hw_params(struct snd_pcm_substream *substream, } sysclk |= max9860->psclk; - dev_dbg(codec->dev, "SYSCLK %02x\n", sysclk); + dev_dbg(component->dev, "SYSCLK %02x\n", sysclk); ret = regmap_write(max9860->regmap, MAX9860_SYSCLK, sysclk); if (ret) { - dev_err(codec->dev, "Failed to set SYSCLK: %d\n", ret); + dev_err(component->dev, "Failed to set SYSCLK: %d\n", ret); return ret; } - dev_dbg(codec->dev, "N %lu\n", n); + dev_dbg(component->dev, "N %lu\n", n); ret = regmap_write(max9860->regmap, MAX9860_AUDIOCLKHIGH, n >> 8); if (ret) { - dev_err(codec->dev, "Failed to set NHI: %d\n", ret); + dev_err(component->dev, "Failed to set NHI: %d\n", ret); return ret; } ret = regmap_write(max9860->regmap, MAX9860_AUDIOCLKLOW, n & 0xff); if (ret) { - dev_err(codec->dev, "Failed to set NLO: %d\n", ret); + dev_err(component->dev, "Failed to set NLO: %d\n", ret); return ret; } if (!master) { - dev_dbg(codec->dev, "Enable PLL\n"); + dev_dbg(component->dev, "Enable PLL\n"); ret = regmap_update_bits(max9860->regmap, MAX9860_AUDIOCLKHIGH, MAX9860_PLL, MAX9860_PLL); if (ret) { - dev_err(codec->dev, "Failed to enable PLL: %d\n", ret); + dev_err(component->dev, "Failed to enable PLL: %d\n", ret); return ret; } } @@ -453,8 +453,8 @@ static int max9860_hw_params(struct snd_pcm_substream *substream, static int max9860_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) { - struct snd_soc_codec *codec = dai->codec; - struct max9860_priv *max9860 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct max9860_priv *max9860 = snd_soc_component_get_drvdata(component); switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { case SND_SOC_DAIFMT_CBM_CFM: @@ -500,10 +500,10 @@ static int max9860_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) .symmetric_rates = 1, }; -static int max9860_set_bias_level(struct snd_soc_codec *codec, +static int max9860_set_bias_level(struct snd_soc_component *component, enum snd_soc_bias_level level) { - struct max9860_priv *max9860 = dev_get_drvdata(codec->dev); + struct max9860_priv *max9860 = dev_get_drvdata(component->dev); int ret; switch (level) { @@ -515,7 +515,7 @@ static int max9860_set_bias_level(struct snd_soc_codec *codec, ret = regmap_update_bits(max9860->regmap, MAX9860_PWRMAN, MAX9860_SHDN, MAX9860_SHDN); if (ret) { - dev_err(codec->dev, "Failed to remove SHDN: %d\n", ret); + dev_err(component->dev, "Failed to remove SHDN: %d\n", ret); return ret; } break; @@ -524,7 +524,7 @@ static int max9860_set_bias_level(struct snd_soc_codec *codec, ret = regmap_update_bits(max9860->regmap, MAX9860_PWRMAN, MAX9860_SHDN, 0); if (ret) { - dev_err(codec->dev, "Failed to request SHDN: %d\n", + dev_err(component->dev, "Failed to request SHDN: %d\n", ret); return ret; } @@ -534,18 +534,17 @@ static int max9860_set_bias_level(struct snd_soc_codec *codec, return 0; } -static const struct snd_soc_codec_driver max9860_codec_driver = { - .set_bias_level = max9860_set_bias_level, - .idle_bias_off = true, - - .component_driver = { - .controls = max9860_controls, - .num_controls = ARRAY_SIZE(max9860_controls), - .dapm_widgets = max9860_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(max9860_dapm_widgets), - .dapm_routes = max9860_dapm_routes, - .num_dapm_routes = ARRAY_SIZE(max9860_dapm_routes), - }, +static const struct snd_soc_component_driver max9860_component_driver = { + .set_bias_level = max9860_set_bias_level, + .controls = max9860_controls, + .num_controls = ARRAY_SIZE(max9860_controls), + .dapm_widgets = max9860_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(max9860_dapm_widgets), + .dapm_routes = max9860_dapm_routes, + .num_dapm_routes = ARRAY_SIZE(max9860_dapm_routes), + .pmdown_time = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, }; #ifdef CONFIG_PM @@ -698,7 +697,7 @@ static int max9860_probe(struct i2c_client *i2c, pm_runtime_enable(dev); pm_runtime_idle(dev); - ret = snd_soc_register_codec(dev, &max9860_codec_driver, + ret = devm_snd_soc_register_component(dev, &max9860_component_driver, &max9860_dai, 1); if (ret) { dev_err(dev, "Failed to register CODEC: %d\n", ret); @@ -719,7 +718,6 @@ static int max9860_remove(struct i2c_client *i2c) struct device *dev = &i2c->dev; struct max9860_priv *max9860 = dev_get_drvdata(dev); - snd_soc_unregister_codec(dev); pm_runtime_disable(dev); regulator_disable(max9860->dvddio); return 0;