From patchwork Fri Jan 12 01:45:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10159439 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 3F165601A1 for ; Fri, 12 Jan 2018 02:42:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 26F48287B6 for ; Fri, 12 Jan 2018 02:42:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1BA0628975; Fri, 12 Jan 2018 02:42:28 +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 EE35D287B6 for ; Fri, 12 Jan 2018 02:42:26 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 40AE7268289; Fri, 12 Jan 2018 03:37:26 +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 9A5762682EE; Fri, 12 Jan 2018 03:37:24 +0100 (CET) Received: from relmlie2.idc.renesas.com (relmlor3.renesas.com [210.160.252.173]) by alsa0.perex.cz (Postfix) with ESMTP id 9AC522680E7 for ; Fri, 12 Jan 2018 02:45:41 +0100 (CET) Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie2.idc.renesas.com with ESMTP; 12 Jan 2018 10:45:40 +0900 Received: from relmlii1.idc.renesas.com (relmlii1.idc.renesas.com [10.200.68.65]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 12C3571855; Fri, 12 Jan 2018 10:45:40 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.46,346,1511794800"; d="scan'208";a="268010936" Received: from mail-sg2apc01lp0243.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.243]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 12 Jan 2018 10:45:39 +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=kNbp4p+EZhqrYX01Q+am6pVT3zfRIXqMocKSlnFYE+Y=; b=RjEwo6c9p+t1WqjUPKC7CC+MOm+x4rKgJAdR+f4znx1623xlmgVuMbqQDOnB9/IKt1Zc/Cd2cQcBO2yV968fw4r1a94xpdlNG5nb4aF3Nf2E9bdx7HG7Ly8P4rf+Jqt7dlgsHfJG+yW2KKQRKDmTXC1xY4ZUSA4cwpF1HDEigKY= Received: from morimoto-PC.renesas.com (211.11.155.138) by KL1PR0601MB1880.apcprd06.prod.outlook.com (2603:1096:802:8::16) 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:45:37 +0000 Message-ID: <8760877sw3.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:45:37 +0000 X-Originating-IP: [211.11.155.138] X-ClientProxiedBy: OS2PR01CA0101.jpnprd01.prod.outlook.com (2603:1096:602:1::19) To KL1PR0601MB1880.apcprd06.prod.outlook.com (2603:1096:802:8::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2f802410-0b59-4cab-4df3-08d5595e2e1e X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020074)(4652020)(5600026)(4604075)(48565401081)(2017052603307)(7153060)(7193020); SRVR:KL1PR0601MB1880; X-Microsoft-Exchange-Diagnostics: 1; KL1PR0601MB1880; 3:+A2jVchZIJrb70kMjsTIAiCJA4ADg4JOoDFZCyTfRIBbTCFZrqXktq5nV8Eb8AD8FCz1uDGziwhha6eFXiIWljCa0qwTck9FPtL8G20mPzUfgiHm5oZD82nP4hV33nH9az+ZUcFRtDj9t1a1SvGUngGWrP1VTXXBlhjN/BqU8Z+1GSG6eptqpUMRsnqDw+Nd5r7vI16CULcSa8UEyAN2x8fF319wWk+SF5MiJNRW7wlQ+6UacXmR0b0nL5kWPhvm; 25:NDPzxCobkf8Alz+92UCZR3tvS1pblkyATa9fjURvS2koWOfmwMiIHZrzQt6uHpxZD74aNyWNfYgLv4RcRBoMAqoVqNbueNazKPfUHkttuVBhK4RIOgPJPeq/MzKK28sr2IMlZ5+1LNd9OgG5K0d4/HPvIb1E3XLYE1NDSKwj5Zzb+DzWSo5Vr0Tw/+RpU8NxOB1l+djsYsW5X42rLuKABSxu5whdChJIci3/VEG+futwXK95TEiP/+d5YJY7/mmk0eUOHq+74Xjyss2EOWLZGVbqRCWp1QCrSUuzWiK7Qnp2K52bcClwJYPKk+3S2ZpcWksn0sr3ImV0u4gur3/Cgw==; 31:1yVLLxBKfWPotQUjN/vwR5Q76l+oTdSnWOZ9Z4epPq/4VfRQIiNY9p9HHAekjRb1Jf09frelnjV8CaJLDWrF8kffLf2OVStqkMNcNFUbrgV/WU2F5OXH+nwdTdqLLPyzCD1H81EEHX/YZp4feum5PSm/BEozm50S/xcsnqUuujW5isL7b8QB+HwSObWVKTyreCicRlTmx9qsj3Y1HDyEiWqAww1Eo/EgkQ05T12HD2g= X-MS-TrafficTypeDiagnostic: KL1PR0601MB1880: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; X-Microsoft-Exchange-Diagnostics: 1; KL1PR0601MB1880; 20:VooaYnE+Lis2Vatxbo45nDo2V/4g5XRMXLMty0YjNBBi+isOeyz74GjivAj42YTkTciD6Ud0lSDpLTD1X0o4yb+0GpAWIMmLGl/I4Ivi+FftGzaMR1bphMZ/CpQaKuZb5FWiV3nQr55Es1K8JWFuGqIIfSKTPicdOFjxjEwU1S+UdLlLFtHqGN9In+tloLL5rkkv+OqFtWjIxNf0Dex9J8zZYo2MigqoEHdZHQk6Itn2TdK+RvceJZTDHVjGgzBlovSymbixX6vTsnY2eaN1zWE0t/3othNt54/MFD8FG09YvNsdaLcAWMdGKy1jHhvKGbKDnbQ4HvQoLjBwmJirQuGHuWbFPHXiqVvd0kZ4URFRMUQFsUR79zm+MOMoFwyaqn/l0RbUSbea97hMTOS+jzHeG6q8KV2gO8eoEdO4vw0d2GixbjdBMPqm/zOczUoubMwDESKLVBawTa51XTubFKEEKpv9PiDL4G0QsdrhWBQSoxJfZ0sgVsST4YT7dGlH; 4:n/VIzO+Y1aLjuU1B61HhgPrisdkyyIf8mIB3pLSttLt2ukto/uB3ZEhSTLfZjZqvOL6ITLFu0rEmWroXfUkdJTVUU+gVaF7Ht2Nqj2TxXfxNx9MwtOq6jGqdyX5HB5XLwE7AKYu8pxKOTh0mAfjzzXaokWO/CGX+jEJwigGqyRtsh+ApW/C9WEVh3azIpaaco2poMatVUx1KKhWwsr6zxQeUBeIepMdDkXav3OENC2f+q2383+nMlqvjXIEAvfUeQAZLa7RDOGZ7lDLPMIVtXLXI1i+r0gJ6t6Eu1zSRrAsZKKQVhNlYSpkowx0RDL7Q 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)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:KL1PR0601MB1880; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:KL1PR0601MB1880; X-Forefront-PRVS: 0550778858 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(39380400002)(396003)(39860400002)(376002)(346002)(366004)(199004)(189003)(6116002)(106356001)(5660300001)(3846002)(81166006)(8936002)(47776003)(81156014)(68736007)(23726003)(36756003)(6916009)(2950100002)(8676002)(53936002)(76176011)(66066001)(53416004)(4326008)(25786009)(6486002)(58126008)(386003)(16586007)(50466002)(54906003)(97736004)(16526018)(105586002)(83506002)(52116002)(2906002)(7696005)(7736002)(305945005)(86362001)(478600001)(69596002)(316002)(21314002)(32563001)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:KL1PR0601MB1880; 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; KL1PR0601MB1880; 23:zJ0TlVCloCtAcSiimMeoTbLxRQa6F5wKgrkfRgm?= =?us-ascii?Q?BRuWbSZG1breGaiFNIg+VBpiB0c360PXFiFqQgbSTx9ZVIClzFe9N9F+XE0G?= =?us-ascii?Q?jfBouOShaQ1bD5A4OWU2xFC66DPwroILOumsUrwCHZrKMx3gJGPp8ZmvluyE?= =?us-ascii?Q?O8lyqXDmDWqOkan2pTDXduhR9wdkuEjmeb8umzZieN+CM3910hI3gLhvHRgY?= =?us-ascii?Q?kyz9tJ7izuKGUXpogHMbnqj9U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Diagnostics: 1; KL1PR0601MB1880; 20:SNxFzs5WO2TAMzyH3fvi3FfPT0+N/ZKcPE7nNVgVqSenQ3J2BW1KzpRd6T5Qi4qis9p5gGCyhoC9wsRtiY0Dj3+JekhG9bA9RXAY4j5dXO+H1doIp2n721mHVhR/VDtqAff9Jm+qeScitlBNLKlwvjhaGx1IibhVfrkl+CjU2+0= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2018 01:45:37.3016 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2f802410-0b59-4cab-4df3-08d5595e2e1e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0601MB1880 Cc: Linux-ALSA , Simon Subject: [alsa-devel] [PATCH 129/187] ASoC: sun4i: 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/sunxi/sun4i-codec.c | 71 ++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c index 8862816..cf246b1 100644 --- a/sound/soc/sunxi/sun4i-codec.c +++ b/sound/soc/sunxi/sun4i-codec.c @@ -792,15 +792,17 @@ static void sun4i_codec_shutdown(struct snd_pcm_substream *substream, { "Mic1", NULL, "VMIC" }, }; -static const struct snd_soc_codec_driver sun4i_codec_codec = { - .component_driver = { - .controls = sun4i_codec_controls, - .num_controls = ARRAY_SIZE(sun4i_codec_controls), - .dapm_widgets = sun4i_codec_codec_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(sun4i_codec_codec_dapm_widgets), - .dapm_routes = sun4i_codec_codec_dapm_routes, - .num_dapm_routes = ARRAY_SIZE(sun4i_codec_codec_dapm_routes), - }, +static const struct snd_soc_component_driver sun4i_codec_codec = { + .controls = sun4i_codec_controls, + .num_controls = ARRAY_SIZE(sun4i_codec_controls), + .dapm_widgets = sun4i_codec_codec_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(sun4i_codec_codec_dapm_widgets), + .dapm_routes = sun4i_codec_codec_dapm_routes, + .num_dapm_routes = ARRAY_SIZE(sun4i_codec_codec_dapm_routes), + .idle_bias_on = 1, + .pmdown_time = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, }; /*** sun6i Codec ***/ @@ -1098,15 +1100,17 @@ static const DECLARE_TLV_DB_RANGE(sun6i_codec_mic_gain_scale, { "Right ADC", NULL, "Right ADC Mixer" }, }; -static const struct snd_soc_codec_driver sun6i_codec_codec = { - .component_driver = { - .controls = sun6i_codec_codec_widgets, - .num_controls = ARRAY_SIZE(sun6i_codec_codec_widgets), - .dapm_widgets = sun6i_codec_codec_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(sun6i_codec_codec_dapm_widgets), - .dapm_routes = sun6i_codec_codec_dapm_routes, - .num_dapm_routes = ARRAY_SIZE(sun6i_codec_codec_dapm_routes), - }, +static const struct snd_soc_component_driver sun6i_codec_codec = { + .controls = sun6i_codec_codec_widgets, + .num_controls = ARRAY_SIZE(sun6i_codec_codec_widgets), + .dapm_widgets = sun6i_codec_codec_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(sun6i_codec_codec_dapm_widgets), + .dapm_routes = sun6i_codec_codec_dapm_routes, + .num_dapm_routes = ARRAY_SIZE(sun6i_codec_codec_dapm_routes), + .idle_bias_on = 1, + .pmdown_time = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, }; /* sun8i A23 codec */ @@ -1126,13 +1130,15 @@ static const DECLARE_TLV_DB_RANGE(sun6i_codec_mic_gain_scale, }; -static const struct snd_soc_codec_driver sun8i_a23_codec_codec = { - .component_driver = { - .controls = sun8i_a23_codec_codec_controls, - .num_controls = ARRAY_SIZE(sun8i_a23_codec_codec_controls), - .dapm_widgets = sun8i_a23_codec_codec_widgets, - .num_dapm_widgets = ARRAY_SIZE(sun8i_a23_codec_codec_widgets), - }, +static const struct snd_soc_component_driver sun8i_a23_codec_codec = { + .controls = sun8i_a23_codec_codec_controls, + .num_controls = ARRAY_SIZE(sun8i_a23_codec_codec_controls), + .dapm_widgets = sun8i_a23_codec_codec_widgets, + .num_dapm_widgets = ARRAY_SIZE(sun8i_a23_codec_codec_widgets), + .idle_bias_on = 1, + .pmdown_time = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, }; static const struct snd_soc_component_driver sun4i_codec_component = { @@ -1450,7 +1456,7 @@ static struct snd_soc_card *sun8i_v3s_codec_create_card(struct device *dev) struct sun4i_codec_quirks { const struct regmap_config *regmap_config; - const struct snd_soc_codec_driver *codec; + const struct snd_soc_component_driver *codec; struct snd_soc_card * (*create_card)(struct device *dev); struct reg_field reg_adc_fifoc; /* used for regmap_field */ unsigned int reg_dac_txdata; /* TX FIFO offset for DMA config */ @@ -1657,7 +1663,7 @@ static int sun4i_codec_probe(struct platform_device *pdev) scodec->capture_dma_data.maxburst = 8; scodec->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; - ret = snd_soc_register_codec(&pdev->dev, quirks->codec, + ret = devm_snd_soc_register_component(&pdev->dev, quirks->codec, &sun4i_codec_dai, 1); if (ret) { dev_err(&pdev->dev, "Failed to register our codec\n"); @@ -1669,20 +1675,20 @@ static int sun4i_codec_probe(struct platform_device *pdev) &dummy_cpu_dai, 1); if (ret) { dev_err(&pdev->dev, "Failed to register our DAI\n"); - goto err_unregister_codec; + goto err_assert_reset; } ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0); if (ret) { dev_err(&pdev->dev, "Failed to register against DMAEngine\n"); - goto err_unregister_codec; + goto err_assert_reset; } card = quirks->create_card(&pdev->dev); if (IS_ERR(card)) { ret = PTR_ERR(card); dev_err(&pdev->dev, "Failed to create our card\n"); - goto err_unregister_codec; + goto err_assert_reset; } snd_soc_card_set_drvdata(card, scodec); @@ -1690,13 +1696,11 @@ static int sun4i_codec_probe(struct platform_device *pdev) ret = snd_soc_register_card(card); if (ret) { dev_err(&pdev->dev, "Failed to register our card\n"); - goto err_unregister_codec; + goto err_assert_reset; } return 0; -err_unregister_codec: - snd_soc_unregister_codec(&pdev->dev); err_assert_reset: if (scodec->rst) reset_control_assert(scodec->rst); @@ -1711,7 +1715,6 @@ static int sun4i_codec_remove(struct platform_device *pdev) struct sun4i_codec *scodec = snd_soc_card_get_drvdata(card); snd_soc_unregister_card(card); - snd_soc_unregister_codec(&pdev->dev); if (scodec->rst) reset_control_assert(scodec->rst); clk_disable_unprepare(scodec->clk_apb);