From patchwork Mon Jan 29 04:45:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10189245 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 57B9C60388 for ; Mon, 29 Jan 2018 05:07:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45C132876C for ; Mon, 29 Jan 2018 05:07:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3549D28786; Mon, 29 Jan 2018 05:07:36 +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 19F8D2876C for ; Mon, 29 Jan 2018 05:07:35 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 18B5026847E; Mon, 29 Jan 2018 06:07:14 +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 ABE60268475; Mon, 29 Jan 2018 06:07:10 +0100 (CET) Received: from relmlie2.idc.renesas.com (relmlor3.renesas.com [210.160.252.173]) by alsa0.perex.cz (Postfix) with ESMTP id B40992680B0 for ; Mon, 29 Jan 2018 05:45:48 +0100 (CET) Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie2.idc.renesas.com with ESMTP; 29 Jan 2018 13:45:47 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id C7662775A9; Mon, 29 Jan 2018 13:45:46 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.46,429,1511794800"; d="scan'208";a="270918444" Received: from mail-sg2apc01lp0240.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.240]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 29 Jan 2018 13:45:45 +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=QZ4NaR0nOi5pe2LCj+NdWzpkdzlXkzpbeXYOlb7KTsM=; b=OwKORqK+7SsPDka686nYqaGuJLDCp7jrXV9azNraY7jIGHDf2eGxiiSZUduvm0bFKzeFehv4/LMNZo223dKm5Qj8aI0ZtYHkh0baOiEt1PleoGq95LBLpIzj4wV76J2hUgm0ZQDwc26Te2SDoDgBx3GsyrlGDJcV1ghWX1x3q+s= 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 PS1PR0601MB1884.apcprd06.prod.outlook.com (2603:1096:803:8::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Mon, 29 Jan 2018 04:45:43 +0000 Message-ID: <878tchuvdr.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: <87inbl5q6q.wl%kuninori.morimoto.gx@renesas.com> References: <87607l8k9i.wl%kuninori.morimoto.gx@renesas.com> <87inbl5q6q.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Mon, 29 Jan 2018 04:45:43 +0000 X-Originating-IP: [211.11.155.138] X-ClientProxiedBy: OSAPR01CA0022.jpnprd01.prod.outlook.com (2603:1096:603:2a::34) To PS1PR0601MB1884.apcprd06.prod.outlook.com (2603:1096:803:8::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9c205afe-cde1-4fb5-6044-08d566d327fb X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:PS1PR0601MB1884; X-Microsoft-Exchange-Diagnostics: 1; PS1PR0601MB1884; 3:gDtFGZDHM4RoF5sDfoOblbZgtiTAhF3EDU6Lnj+q+mqyxxqo5S54EK+bik+LuNK8WirFHFLMj/8mcyw3ZnOqTcAF9GUU4cexdIWMJn0tivxsPo/SxnchXLm0OcISyaUdQLkbhRqdG2wY6Y3IQLUfpK03pHynLrouuEowqOl+khmrcgoWWtELV389tM+c9C9TKs/Xg3ueG3qJx/IAw5UA7LFhKg1afg99CNWyzJY253GVcN9kdmWRRQmEQmCrVmdV; 25:uDXGQjX9D/pypb+eeeUPgb+ku/xHlHSXgFfJ6CYoTgg8WMcCgdfbz10cKpS4EDRDGAfZzoDPNMPUG0RZMluZf1HUli8UG5k/mXQQKyjKeOEUUnSu9M2IVWi8i/5L9+V/M/RwtYyBKIaZ33SL6l88WoNId4O6ypKnvDPyehovbFwYVFnNXzW4n1+ALJw9IZnXpw5y/VyuE7n0YctWFPXJCNDOwtYv5ecfAJHUoVfrsFqgrfdd0Pvd08ZA4qQa+4+UkLOH4h+qLWmoWk7MpdxxISXQLx78errVVJJS1JmJy3AOTjzYUOxfxJIEZG96e0+xWiwJG585cctGJrCkI+vHXA==; 31:lmKdCl3aNppIuzIn7KC8SJEoFvh7IjyTEd2xH0ru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NjdIDCpFbBC1mJITcLDI9qqZVYb X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231101)(944501161)(6055026)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123564045)(20161123562045)(6072148)(201708071742011); SRVR:PS1PR0601MB1884; BCL:0; PCL:0; RULEID:; SRVR:PS1PR0601MB1884; X-Forefront-PRVS: 0567A15835 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(366004)(376002)(39380400002)(346002)(39860400002)(396003)(189003)(199004)(7696005)(68736007)(52116002)(53416004)(36756003)(76176011)(2906002)(16526019)(86362001)(186003)(5660300001)(6486002)(26005)(53936002)(97736004)(7736002)(2950100002)(16586007)(58126008)(8676002)(105586002)(81156014)(478600001)(305945005)(59450400001)(50466002)(25786009)(386003)(106356001)(81166006)(6916009)(4326008)(47776003)(23726003)(8936002)(6116002)(83506002)(3846002)(316002)(66066001)(69596002)(21314002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:PS1PR0601MB1884; 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; PS1PR0601MB1884; 23:+uJUXFDDE3WHrYtc+K8hWA6Ze1ClWjM+1eN59gJ?= =?us-ascii?Q?6oRL9U/aZnPTY1X+tpheSftiJ0Io84A16gU+ptt01jJe2I/kJ0fXtEVDO6WS?= =?us-ascii?Q?xBHlG5B9ZTSAS9giNxhcHhNoFmiipIGyCV2jyNjiUcQTxIN0qKv3RpjZbHCb?= =?us-ascii?Q?FsbWo+UH4Fz85eS4h7AZRDTMxNRhynsdtHvU4fvQbMULIfBlRB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JkRV0hlTFpUauxSaZ5C SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; PS1PR0601MB1884; 20:jx6vQ9DofpyD5uSeVucVIP7JjUjafYORp6KMYle+vWxgm/SQ8hbk9d59VtSJhNC+KQiVQXBlwVV1YOXpqN68fVdEdJQijPWwq0JZ3VMxe0Nes+zY0EUT+X5oHeQ5NuyTYvgHO9UsGhtmTJ8wLhLQNeRvv5rN8K4AnKCmQe/7QOY= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2018 04:45:43.3805 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9c205afe-cde1-4fb5-6044-08d566d327fb X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS1PR0601MB1884 Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 181/186] ASoC: uda134x: 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 -> .use_pmdown_time = 1 - -> .endianness = 1 - -> .non_legacy_dai_naming = 1 Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/uda134x.c | 78 +++++++++++++++++++++------------------------- 1 file changed, 36 insertions(+), 42 deletions(-) diff --git a/sound/soc/codecs/uda134x.c b/sound/soc/codecs/uda134x.c index 77c9cc4..3c935a9 100644 --- a/sound/soc/codecs/uda134x.c +++ b/sound/soc/codecs/uda134x.c @@ -110,9 +110,9 @@ static int uda134x_regmap_write(void *context, unsigned int reg, return 0; } -static inline void uda134x_reset(struct snd_soc_codec *codec) +static inline void uda134x_reset(struct snd_soc_component *component) { - struct uda134x_priv *uda134x = snd_soc_codec_get_drvdata(codec); + struct uda134x_priv *uda134x = snd_soc_component_get_drvdata(component); unsigned int mask = 1<<6; regmap_update_bits(uda134x->regmap, UDA134X_STATUS0, mask, mask); @@ -122,7 +122,7 @@ static inline void uda134x_reset(struct snd_soc_codec *codec) static int uda134x_mute(struct snd_soc_dai *dai, int mute) { - struct uda134x_priv *uda134x = snd_soc_codec_get_drvdata(dai->codec); + struct uda134x_priv *uda134x = snd_soc_component_get_drvdata(dai->component); unsigned int mask = 1<<2; unsigned int val; @@ -139,8 +139,8 @@ static int uda134x_mute(struct snd_soc_dai *dai, int mute) static int uda134x_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - struct snd_soc_codec *codec = dai->codec; - struct uda134x_priv *uda134x = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct uda134x_priv *uda134x = snd_soc_component_get_drvdata(component); struct snd_pcm_runtime *master_runtime; if (uda134x->master_substream) { @@ -168,8 +168,8 @@ static int uda134x_startup(struct snd_pcm_substream *substream, static void uda134x_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - struct snd_soc_codec *codec = dai->codec; - struct uda134x_priv *uda134x = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct uda134x_priv *uda134x = snd_soc_component_get_drvdata(component); if (uda134x->master_substream == substream) uda134x->master_substream = uda134x->slave_substream; @@ -181,8 +181,8 @@ static int uda134x_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 uda134x_priv *uda134x = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct uda134x_priv *uda134x = snd_soc_component_get_drvdata(component); unsigned int hw_params = 0; if (substream == uda134x->slave_substream) { @@ -248,8 +248,8 @@ static int uda134x_hw_params(struct snd_pcm_substream *substream, static int uda134x_set_dai_sysclk(struct snd_soc_dai *codec_dai, int clk_id, unsigned int freq, int dir) { - struct snd_soc_codec *codec = codec_dai->codec; - struct uda134x_priv *uda134x = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = codec_dai->component; + struct uda134x_priv *uda134x = snd_soc_component_get_drvdata(component); pr_debug("%s clk_id: %d, freq: %u, dir: %d\n", __func__, clk_id, freq, dir); @@ -270,8 +270,8 @@ static int uda134x_set_dai_sysclk(struct snd_soc_dai *codec_dai, static int uda134x_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) { - struct snd_soc_codec *codec = codec_dai->codec; - struct uda134x_priv *uda134x = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = codec_dai->component; + struct uda134x_priv *uda134x = snd_soc_component_get_drvdata(component); pr_debug("%s fmt: %08X\n", __func__, fmt); @@ -294,10 +294,10 @@ static int uda134x_set_dai_fmt(struct snd_soc_dai *codec_dai, return 0; } -static int uda134x_set_bias_level(struct snd_soc_codec *codec, +static int uda134x_set_bias_level(struct snd_soc_component *component, enum snd_soc_bias_level level) { - struct uda134x_priv *uda134x = snd_soc_codec_get_drvdata(codec); + struct uda134x_priv *uda134x = snd_soc_component_get_drvdata(component); struct uda134x_platform_data *pd = uda134x->pd; pr_debug("%s bias level %d\n", __func__, level); @@ -446,10 +446,10 @@ static int uda134x_set_bias_level(struct snd_soc_codec *codec, .ops = &uda134x_dai_ops, }; -static int uda134x_soc_probe(struct snd_soc_codec *codec) +static int uda134x_soc_probe(struct snd_soc_component *component) { - struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); - struct uda134x_priv *uda134x = snd_soc_codec_get_drvdata(codec); + struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); + struct uda134x_priv *uda134x = snd_soc_component_get_drvdata(component); struct uda134x_platform_data *pd = uda134x->pd; const struct snd_soc_dapm_widget *widgets; unsigned num_widgets; @@ -473,7 +473,7 @@ static int uda134x_soc_probe(struct snd_soc_codec *codec) if (pd->power) pd->power(1); - uda134x_reset(codec); + uda134x_reset(component); if (pd->model == UDA134X_UDA1341) { widgets = uda1341_dapm_widgets; @@ -493,15 +493,15 @@ static int uda134x_soc_probe(struct snd_soc_codec *codec) switch (pd->model) { case UDA134X_UDA1340: case UDA134X_UDA1344: - ret = snd_soc_add_codec_controls(codec, uda1340_snd_controls, + ret = snd_soc_add_component_controls(component, uda1340_snd_controls, ARRAY_SIZE(uda1340_snd_controls)); break; case UDA134X_UDA1341: - ret = snd_soc_add_codec_controls(codec, uda1341_snd_controls, + ret = snd_soc_add_component_controls(component, uda1341_snd_controls, ARRAY_SIZE(uda1341_snd_controls)); break; case UDA134X_UDA1345: - ret = snd_soc_add_codec_controls(codec, uda1345_snd_controls, + ret = snd_soc_add_component_controls(component, uda1345_snd_controls, ARRAY_SIZE(uda1345_snd_controls)); break; default: @@ -518,17 +518,18 @@ static int uda134x_soc_probe(struct snd_soc_codec *codec) return 0; } -static const struct snd_soc_codec_driver soc_codec_dev_uda134x = { - .probe = uda134x_soc_probe, - .set_bias_level = uda134x_set_bias_level, - .suspend_bias_off = true, - - .component_driver = { - .dapm_widgets = uda134x_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(uda134x_dapm_widgets), - .dapm_routes = uda134x_dapm_routes, - .num_dapm_routes = ARRAY_SIZE(uda134x_dapm_routes), - }, +static const struct snd_soc_component_driver soc_component_dev_uda134x = { + .probe = uda134x_soc_probe, + .set_bias_level = uda134x_set_bias_level, + .dapm_widgets = uda134x_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(uda134x_dapm_widgets), + .dapm_routes = uda134x_dapm_routes, + .num_dapm_routes = ARRAY_SIZE(uda134x_dapm_routes), + .suspend_bias_off = 1, + .idle_bias_on = 1, + .use_pmdown_time = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, }; static const struct regmap_config uda134x_regmap_config = { @@ -571,14 +572,8 @@ static int uda134x_codec_probe(struct platform_device *pdev) if (IS_ERR(uda134x->regmap)) return PTR_ERR(uda134x->regmap); - return snd_soc_register_codec(&pdev->dev, - &soc_codec_dev_uda134x, &uda134x_dai, 1); -} - -static int uda134x_codec_remove(struct platform_device *pdev) -{ - snd_soc_unregister_codec(&pdev->dev); - return 0; + return devm_snd_soc_register_component(&pdev->dev, + &soc_component_dev_uda134x, &uda134x_dai, 1); } static struct platform_driver uda134x_codec_driver = { @@ -586,7 +581,6 @@ static int uda134x_codec_remove(struct platform_device *pdev) .name = "uda134x-codec", }, .probe = uda134x_codec_probe, - .remove = uda134x_codec_remove, }; module_platform_driver(uda134x_codec_driver);