From patchwork Fri Jan 12 01:42:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10159401 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 2EBB0601A1 for ; Fri, 12 Jan 2018 02:38:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1792028709 for ; Fri, 12 Jan 2018 02:38:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0AFE928848; Fri, 12 Jan 2018 02:38:52 +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 EEE3128709 for ; Fri, 12 Jan 2018 02:38:50 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id ACCFC268297; Fri, 12 Jan 2018 03:37:09 +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 CB67D26827D; Fri, 12 Jan 2018 03:37:05 +0100 (CET) Received: from relmlie2.idc.renesas.com (relmlor3.renesas.com [210.160.252.173]) by alsa0.perex.cz (Postfix) with ESMTP id 9ACBC2680D6 for ; Fri, 12 Jan 2018 02:42:12 +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:42:11 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 22E2071609; Fri, 12 Jan 2018 10:42:11 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.46,346,1511794800"; d="scan'208";a="269311110" Received: from mail-sg2apc01lp0244.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.244]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 12 Jan 2018 10:42:10 +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=xljP6YIzj3CD/+GhRce4Kfev2ynbdxjz9lvYxiEPxK8=; b=J8IrsV5WxtCd7hG5/pqt7A+gK5dRREI823tAGwLlxqwfhmVu1ahB0XeZ80vCQs7ah98t075U3smjb3l32pp98W5ijVWkar7Xqsda3yHLcn+5a00ZqyKRlMZbEZgv+zxb0a0X19bNOu3UM4vn/G4zzX+1tgVsKp6RQNY5GUdcCkM= 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.407.7; Fri, 12 Jan 2018 01:42:07 +0000 Message-ID: <87o9lz7t1w.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:42:07 +0000 X-Originating-IP: [211.11.155.138] X-ClientProxiedBy: OS2PR01CA0085.jpnprd01.prod.outlook.com (2603:1096:600:2::45) To PS1PR0601MB1884.apcprd06.prod.outlook.com (2603:1096:803:8::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4c873384-f7c9-422d-499c-08d5595db12a X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020074)(4652020)(5600026)(4604075)(48565401081)(2017052603307)(7153060)(7193020); SRVR:PS1PR0601MB1884; X-Microsoft-Exchange-Diagnostics: 1; PS1PR0601MB1884; 3:8eTeFDnmQYjV5cPJ9+5AI7zJ7mHYTTJOG+pzHVPb0TQUirJm/igp+YWfHErXNkYw8XaHpN1jLydWk8CSyb3MCU/Fqv/SCjvUxqVzAvGwqW8aJVVABl3gE8WUi38We7wDlzFKVXMdek/pZmcnaKygQalWZBLNdB8b+0IkwB0Ahv/usuTycQVT5nKB9+ojZw40AP9tExK+44HwH4Yp82FVhWLfby3TjFMpxa1YM/e2TOSvR3Ihjz0kV1d3Rnlb6zp4; 25:fKnVo7mwcgtgWzNInbPVBLI9LG1smQj3IKfKLh3kP5FG+KWQXj808GqvAD289ezrIAL/AtzHU8Y9zETgI8zQvP4FZS1DqNfmQATTCBnqycZP6hYL8QTtcdCeZarL1JoNxqWmS1Go74uQL/RTDa/D+czQuMzBUVyqO3Doig2JEhfAft1s8nxt7C/bRdfwgQemgObhp06SjbrcCHBHNdREK5OIc0/j/vHfeebDTV3RrbbAork5j/D1rKWOs7zDieDqjIEN27gucfRqH4QJD8VyhHADpEUw7y2F57p9iQ11a9ssx04R0vUn+F/kUSaGbHVebU8AJtS2gttBurv4rVWLNg==; 31:t7ZgJgBbyIqfr5smUKHyrKbIivNBiYwxdvhU9mr7EXbUWfAfNUJcpalnupeHgLkrg0ZKo/qzfKVMXcw1WxuCUBSUgwh1tl2CynhL2WYiJRcuNYN0Pmu+GeVyvVh7QqGUxA5x4FVornM9bWAxnykT+pyHq0JrDIJejrQDne8C+QEp29yThJn7hLvdYOpyKBszI1tvuTn40WWVQvxWr/QQagnAL8WLygPzCfgX9agH/WE= X-MS-TrafficTypeDiagnostic: PS1PR0601MB1884: X-Microsoft-Exchange-Diagnostics: 1; PS1PR0601MB1884; 20:P/VK3fVSfBre/WuOZ/vUiwzUlc/a2CUjp7NJtnmcy1p3/z4jmFLiatRvf+v1hgY15bXF4+I2FC1phVcbTkzhMvw2JdosO3UKhGIEz87dzYvl4MsCb5AoT/O6gvGI+1q5duClhwu7cKP6tEY4SkJpCwwocN9Ce0VwoZ+BrBLLJBLfBJ+5A5R5RmERbCHCCg3hpwDfVK/R1A3++hEZo7zshm1BbME7Avv/3E3SFLAEXYdak4yXJGtvafh80FIOZBasZr0fCoeh6ZMw1zvXVVMdoO2gkIzX55/1YOaIGq4Lt1TTlFu/NyfC7a1n0HSAo53XHvpBNXa6D3XglipIsyMmYBE2TsI2ZIkUo/kdVW3BeJeYm2qImEAzkZPDJB3bmcfnVZZk1RWNPyhcxlr1YlyS7QKuq1IlVgqQw/UGGkwt5A+q+r6t9xotRrc6lYykfJmbwSNsAOqywwUgdkFK94Y+4ZZl2gmBp91p40vtE9Sh8jdJlbd/dgK+qJ6D1yQNag+J; 4:aJF13UpQk9Jyltx33ayMScmryaBL2bb9W5K/emm8c1OuCEMLJl374bl3etXeaur3MYDeaVsghHlogj8WjfFdeqFlITJ2QAYoELDr+PHhbrcueEdUfZnJDXf57gIO5LYSx0eE3sHtbjvHY/9Mdz5GNs9LyeXJmRGdA/dxJEaAVHa/Ox7Gg+LSXsZeoNRQ19P6rRhXVtsJ5Or8GX5eiEG3X6EIzgSqjh3SqrH6AT9575oDlJHd2XKjwlF5Ly4uDzAbXlfDNu8RGSQBeT3QjNbfOKwWOXXc/kKgam2K13f1sbs= 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)(3231023)(944501138)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041268)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:PS1PR0601MB1884; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:PS1PR0601MB1884; X-Forefront-PRVS: 0550778858 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(366004)(39860400002)(346002)(39380400002)(396003)(376002)(189003)(199004)(2906002)(8676002)(81166006)(8936002)(81156014)(6116002)(3846002)(53416004)(478600001)(23726003)(7736002)(6916009)(2950100002)(47776003)(5660300001)(7696005)(52116002)(76176011)(305945005)(386003)(105586002)(16526018)(25786009)(16586007)(316002)(4326008)(54906003)(58126008)(36756003)(68736007)(83506002)(50466002)(69596002)(106356001)(66066001)(86362001)(97736004)(6486002)(53936002)(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:ZUbgdfP6/2vT77orZXDlQU41Tba66nrjyWbkbjv?= =?us-ascii?Q?cSAgRuBPGlj78e0wXtGAfm+1Nq1lP6utwEktIDS79gUXVvNeLioXDK5RaP+X?= =?us-ascii?Q?IaIJCRmBA7ZcLLi7jK5q/zKPXkQBq225rTv7ZQzykjmWrKN1D4ku2qXxLN1K?= =?us-ascii?Q?iuEThE/HT06To4XSPg+jueg5gDY0wwboTn38CTeSbQyGYXNT4wtymjU/ux+2?= =?us-ascii?Q?ByS+e7I68c19SBLpQ/qHFDRc26vc6L24UqcDtPoFe88Iy0NzgJzF+iKtyBE9?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?= X-Microsoft-Exchange-Diagnostics: 1; PS1PR0601MB1884; 6:5T4l6twz6ArfdEVigzLPRV+Wk1NMcbo7Gf7iAopDJqgl5kY7E7PmDIjq+IXqkU9z1Wai0C6ocbIYMJrzFMG0bEpGp5/oXpJlErcE/TrJeH+U8Hj+DpqSQILhrsSK05N8rcgS2hJ45VBVMXWc+y0PcyOkV/2JiKgHqXCb2AzNW3wlwz0RWh1TSE/PfQR4D+3oZnhNOMIrxFhj+w0/pU6ao+nzq9SF4KAdji0lyIppCiBCt3JUMiHXhyIykc1i94LkYxWN/oIIIaooV5zgf1Wmf13bKYQ+/zQ/usH12+r43KjFp1dP+lLuiEReiL2dzT0zzQsyyobG8HJ4EWa58FCo+A==; 5:rYwHYHD94p4tka9z4Gh99l2hE8WC9tPrdOiUx2E95xjqB7R763fflsv4JKghmNylqdZtLYOg1gbXsMXpTT8Ibo0QmmlWLnArunggLrgRzVy0oLDCV0BVwG4UcHrUNuCrdvJi8EjJ/Mj5sBvDQ4jaW+6QEhDUT0s/OdjoyH4hY4Y=; 24:daHUIXmr5OBe3n3xMeYyCt0+o1qiN7QR9WT17+5JHW3ibvwmcFpiZ4SV46knuy8qzL44aqKLpElfkFYhrbtUcDFDeRygtS1eGUx7WF+f2R0=; 7:uvUob/B+6sjWC0OVLJy2oaxKbsw9VkQKgZz0H6HNjKEJQPClYd0j+HydeztihWVCiYweT3sli5hbIQNsujrszyXVk2qdX2cXqOtaF9gtD4w2IDU/tOLbVAmqpOz0T8aXM4zpI+5qO5C8kexmGMymTA9jDW+FDGQ3MIlfBG3hDLmE1zs8RfRA8n2K1PIcM3dqpWUSfbszLvAwqmRyAkDBV/Um4SSmd/LXfELEVm+3g2JRAvsvmVyXMMNwAme7UNWK SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; PS1PR0601MB1884; 20:WZYmJuoxyiZG/Spz23xadS283md7wpG5X1ei8TrULH/xaQFkztcvxtZcM2qAX9jpR/ZQigYgCHmCMVfxpSkmHsYGvS6DBQXdKOOcgiMI2H+L5vc8Di9b1YfPWDbmlVDEbg94+rDU1evl6r7kI68saGoJWp1fkrpDns1oJObsUuM= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2018 01:42:07.8212 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4c873384-f7c9-422d-499c-08d5595db12a 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 , Simon Subject: [alsa-devel] [PATCH 116/187] ASoC: pcm3008: 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/pcm3008.c | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/sound/soc/codecs/pcm3008.c b/sound/soc/codecs/pcm3008.c index e59d8ff..8b800c5 100644 --- a/sound/soc/codecs/pcm3008.c +++ b/sound/soc/codecs/pcm3008.c @@ -32,8 +32,8 @@ static int pcm3008_dac_ev(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { - struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); - struct pcm3008_setup_data *setup = codec->dev->platform_data; + struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); + struct pcm3008_setup_data *setup = component->dev->platform_data; gpio_set_value_cansleep(setup->pdda_pin, SND_SOC_DAPM_EVENT_ON(event)); @@ -45,8 +45,8 @@ static int pcm3008_adc_ev(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { - struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); - struct pcm3008_setup_data *setup = codec->dev->platform_data; + struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); + struct pcm3008_setup_data *setup = component->dev->platform_data; gpio_set_value_cansleep(setup->pdad_pin, SND_SOC_DAPM_EVENT_ON(event)); @@ -98,13 +98,15 @@ static int pcm3008_adc_ev(struct snd_soc_dapm_widget *w, }, }; -static const struct snd_soc_codec_driver soc_codec_dev_pcm3008 = { - .component_driver = { - .dapm_widgets = pcm3008_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(pcm3008_dapm_widgets), - .dapm_routes = pcm3008_dapm_routes, - .num_dapm_routes = ARRAY_SIZE(pcm3008_dapm_routes), - }, +static const struct snd_soc_component_driver soc_component_dev_pcm3008 = { + .dapm_widgets = pcm3008_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(pcm3008_dapm_widgets), + .dapm_routes = pcm3008_dapm_routes, + .num_dapm_routes = ARRAY_SIZE(pcm3008_dapm_routes), + .idle_bias_on = 1, + .pmdown_time = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, }; static int pcm3008_codec_probe(struct platform_device *pdev) @@ -146,22 +148,14 @@ static int pcm3008_codec_probe(struct platform_device *pdev) if (ret != 0) return ret; - return snd_soc_register_codec(&pdev->dev, - &soc_codec_dev_pcm3008, &pcm3008_dai, 1); -} - -static int pcm3008_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_pcm3008, &pcm3008_dai, 1); } MODULE_ALIAS("platform:pcm3008-codec"); static struct platform_driver pcm3008_codec_driver = { .probe = pcm3008_codec_probe, - .remove = pcm3008_codec_remove, .driver = { .name = "pcm3008-codec", },