From patchwork Mon Jan 29 04:15: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: 10189099 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 7CAFD60375 for ; Mon, 29 Jan 2018 04:41:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A97F287E7 for ; Mon, 29 Jan 2018 04:41:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 693B62880A; Mon, 29 Jan 2018 04:41:25 +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 2C355287E7 for ; Mon, 29 Jan 2018 04:41:23 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 323B1267BFD; Mon, 29 Jan 2018 05:26:40 +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 EECAC267BF3; Mon, 29 Jan 2018 05:26:34 +0100 (CET) Received: from relmlie1.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa0.perex.cz (Postfix) with ESMTP id 507282678CE for ; Mon, 29 Jan 2018 05:16:01 +0100 (CET) Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie1.idc.renesas.com with ESMTP; 29 Jan 2018 13:15:59 +0900 Received: from relmlii1.idc.renesas.com (relmlii1.idc.renesas.com [10.200.68.65]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id E58F7646C6; Mon, 29 Jan 2018 13:15:59 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.46,429,1511794800"; d="scan'208";a="269595086" Received: from mail-hk2apc01lp0214.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.214]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 29 Jan 2018 13:15: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=ziJLuixpYTLq3E1OHQSV4bzzw3ei+1My5/zWKrVCbZk=; b=Rh+wqtjQwIyge12++TUm3CI3TU68wtlqV2BSgvGzQh6D+WC3xEn8ZeH/7BtxZd8rRPNZQ1wtrqR+fcu/pML5yukXQQcEXafR+TEUr9q6UC0VGJqGDNGFfH6YeU94EM8ua0kVE3/i5r0eDlStgtz7nCEZo0AX23RWwSDqltaNNH8= 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 SG2PR0601MB1886.apcprd06.prod.outlook.com (2603:1096:3:9::19) 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:15:57 +0000 Message-ID: <87wp01xpwa.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:15:57 +0000 X-Originating-IP: [211.11.155.138] X-ClientProxiedBy: TY1PR01CA0180.jpnprd01.prod.outlook.com (2603:1096:402::32) To SG2PR0601MB1886.apcprd06.prod.outlook.com (2603:1096:3:9::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: fa61bfcd-83ce-4424-900e-08d566ceff35 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:SG2PR0601MB1886; X-Microsoft-Exchange-Diagnostics: 1; SG2PR0601MB1886; 3:lCXkRLLgRfTK5eYOhs5I2N2kl4mjDJBN5xQtu7Ulsus4pvRaimSHWCS/VXQ+0bJ8I2dY/VAXDkxQI/oG/LMfgixm2Ra5kYJpUdacbY4wP7hysngQHW4KK0N47YwaxrQSU6SZ4LjPw1g4NubM4/CEiSLGKPTq7/j6KzVSpQSSVEGJPakVZI9i+sjHApdncolvqCToZSt89OkoeroawLzY8i3Fin98D8DY8dJCEqbOvI5ZGrkePxazXwE9momvbbco; 25:qzEL4tLF28MdHHrtr8B0sXNu4vCTdd6nuTwLxXild7Tr0JVA+JXIYunbd88JFrjKjETwDAz1fagS1DjgCJbqZYhpd2XVlqsVwpnr9xGFnXJRt/J5pPT3ccgsvnelFszmYMbVixv9HzBu9y3FuRsfW7nwQSAKVoEVPgEzsZD7X80iEKHAUNxdbJykLPdLYkoZJBK69C88/HyQR5Z8BZZEJbK4Jf4GoFOJddZwrPqgrjDCBJQhSSMLgmDG2pQbto1Lv0ZeYnWlaCTo31t0sP8n54Z4pVWyor2zWXd2GAqGgRPnSoDsUiwLRYYvdHFkbsrAWHX8IlTpJdlMAgZbCEEHEQ==; 31:rDTRh62PKbDRAIHnFabG1NQkKQgUZpByL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zLJ2cgxzKf1iZ8Ct5uHfze X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231101)(944501161)(93006095)(93001095)(6055026)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011); SRVR:SG2PR0601MB1886; BCL:0; PCL:0; RULEID:; SRVR:SG2PR0601MB1886; X-Forefront-PRVS: 0567A15835 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(376002)(39380400002)(346002)(39860400002)(396003)(366004)(189003)(199004)(86362001)(7696005)(59450400001)(68736007)(16586007)(47776003)(316002)(23726003)(5660300001)(97736004)(7736002)(3846002)(6116002)(6916009)(2950100002)(305945005)(69596002)(478600001)(58126008)(83506002)(50466002)(386003)(76176011)(52116002)(81166006)(105586002)(25786009)(106356001)(4326008)(53936002)(8676002)(6486002)(66066001)(26005)(53416004)(16526019)(36756003)(186003)(2906002)(8936002)(81156014)(21314002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR0601MB1886; 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; SG2PR0601MB1886; 23:6UGBCiCSXW0qk8boJtnLUts+uF+ZT7Qx7w4uuGS?= =?us-ascii?Q?+BQCHDKr8mjwcDTGGS4x1y3FuyjEhgq0XOjbv6N7tnEMKttBzPp4sBOYr0ly?= =?us-ascii?Q?+rFD8N9DulD1qcgcIsc9ilpcEP4zuLLDcnalVvsRelsUiv4RT35OvBPTyI6M?= =?us-ascii?Q?Bc53Vg+kyWzW83zaPyALAj2wxXWV6bz6EWlGf5gyfRfa1p3CvHUAe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xd7jh6pIK9a4S/dFX4Pve3 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SG2PR0601MB1886; 20:UnuMJkHx6srquWDFobxSxiQ0zWixelFHa/0sxduGGuf1x7+CkKWObG7JxoD6TJdjPsTZJZrIgvdVQzw3qFGMLVFZk290l/BZG3GkomdvueWq/JNTuAhdcj9V058WozzlZDww1ZhI2GF0bid5OinvLxZa6bVTXfqbb0uc3opRwKQ= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2018 04:15:57.0352 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fa61bfcd-83ce-4424-900e-08d566ceff35 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR0601MB1886 Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 114/186] ASoC: cx20442: 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/cx20442.c | 89 +++++++++++++++++++++------------------------- sound/soc/omap/ams-delta.c | 20 +++++------ 2 files changed, 51 insertions(+), 58 deletions(-) diff --git a/sound/soc/codecs/cx20442.c b/sound/soc/codecs/cx20442.c index 95bb10b..07dd33b0 100644 --- a/sound/soc/codecs/cx20442.c +++ b/sound/soc/codecs/cx20442.c @@ -89,10 +89,10 @@ struct cx20442_priv { {"ADC", NULL, "Input Mixer"}, }; -static unsigned int cx20442_read_reg_cache(struct snd_soc_codec *codec, +static unsigned int cx20442_read_reg_cache(struct snd_soc_component *component, unsigned int reg) { - struct cx20442_priv *cx20442 = snd_soc_codec_get_drvdata(codec); + struct cx20442_priv *cx20442 = snd_soc_component_get_drvdata(component); if (reg >= 1) return -EINVAL; @@ -153,10 +153,10 @@ static int cx20442_pm_to_v253_vsp(u8 value) return (value & (1 << CX20442_AGC)) ? -EINVAL : 0; } -static int cx20442_write(struct snd_soc_codec *codec, unsigned int reg, +static int cx20442_write(struct snd_soc_component *component, unsigned int reg, unsigned int value) { - struct cx20442_priv *cx20442 = snd_soc_codec_get_drvdata(codec); + struct cx20442_priv *cx20442 = snd_soc_component_get_drvdata(component); int vls, vsp, old, len; char buf[18]; @@ -193,7 +193,7 @@ static int cx20442_write(struct snd_soc_codec *codec, unsigned int reg, if (unlikely(len > (ARRAY_SIZE(buf) - 1))) return -ENOMEM; - dev_dbg(codec->dev, "%s: %s\n", __func__, buf); + dev_dbg(component->dev, "%s: %s\n", __func__, buf); if (cx20442->tty->ops->write(cx20442->tty, buf, len) != len) return -EIO; @@ -240,19 +240,19 @@ static int v253_open(struct tty_struct *tty) /* Line discipline .close() */ static void v253_close(struct tty_struct *tty) { - struct snd_soc_codec *codec = tty->disc_data; + struct snd_soc_component *component = tty->disc_data; struct cx20442_priv *cx20442; tty->disc_data = NULL; - if (!codec) + if (!component) return; - cx20442 = snd_soc_codec_get_drvdata(codec); + cx20442 = snd_soc_component_get_drvdata(component); /* Prevent the codec driver from further accessing the modem */ cx20442->tty = NULL; - codec->component.card->pop_time = 0; + component->card->pop_time = 0; } /* Line discipline .hangup() */ @@ -266,20 +266,20 @@ static int v253_hangup(struct tty_struct *tty) static void v253_receive(struct tty_struct *tty, const unsigned char *cp, char *fp, int count) { - struct snd_soc_codec *codec = tty->disc_data; + struct snd_soc_component *component = tty->disc_data; struct cx20442_priv *cx20442; - if (!codec) + if (!component) return; - cx20442 = snd_soc_codec_get_drvdata(codec); + cx20442 = snd_soc_component_get_drvdata(component); if (!cx20442->tty) { /* First modem response, complete setup procedure */ /* Set up codec driver access to modem controls */ cx20442->tty = tty; - codec->component.card->pop_time = 1; + component->card->pop_time = 1; } } @@ -323,15 +323,15 @@ struct tty_ldisc_ops v253_ops = { }, }; -static int cx20442_set_bias_level(struct snd_soc_codec *codec, +static int cx20442_set_bias_level(struct snd_soc_component *component, enum snd_soc_bias_level level) { - struct cx20442_priv *cx20442 = snd_soc_codec_get_drvdata(codec); + struct cx20442_priv *cx20442 = snd_soc_component_get_drvdata(component); int err = 0; switch (level) { case SND_SOC_BIAS_PREPARE: - if (snd_soc_codec_get_bias_level(codec) != SND_SOC_BIAS_STANDBY) + if (snd_soc_component_get_bias_level(component) != SND_SOC_BIAS_STANDBY) break; if (IS_ERR(cx20442->por)) err = PTR_ERR(cx20442->por); @@ -339,7 +339,7 @@ static int cx20442_set_bias_level(struct snd_soc_codec *codec, err = regulator_enable(cx20442->por); break; case SND_SOC_BIAS_STANDBY: - if (snd_soc_codec_get_bias_level(codec) != SND_SOC_BIAS_PREPARE) + if (snd_soc_component_get_bias_level(component) != SND_SOC_BIAS_PREPARE) break; if (IS_ERR(cx20442->por)) err = PTR_ERR(cx20442->por); @@ -353,7 +353,7 @@ static int cx20442_set_bias_level(struct snd_soc_codec *codec, return err; } -static int cx20442_codec_probe(struct snd_soc_codec *codec) +static int cx20442_component_probe(struct snd_soc_component *component) { struct cx20442_priv *cx20442; @@ -361,21 +361,21 @@ static int cx20442_codec_probe(struct snd_soc_codec *codec) if (cx20442 == NULL) return -ENOMEM; - cx20442->por = regulator_get(codec->dev, "POR"); + cx20442->por = regulator_get(component->dev, "POR"); if (IS_ERR(cx20442->por)) - dev_warn(codec->dev, "failed to get the regulator"); + dev_warn(component->dev, "failed to get the regulator"); cx20442->tty = NULL; - snd_soc_codec_set_drvdata(codec, cx20442); - codec->component.card->pop_time = 0; + snd_soc_component_set_drvdata(component, cx20442); + component->card->pop_time = 0; return 0; } /* power down chip */ -static int cx20442_codec_remove(struct snd_soc_codec *codec) +static void cx20442_component_remove(struct snd_soc_component *component) { - struct cx20442_priv *cx20442 = snd_soc_codec_get_drvdata(codec); + struct cx20442_priv *cx20442 = snd_soc_component_get_drvdata(component); if (cx20442->tty) { struct tty_struct *tty = cx20442->tty; @@ -387,36 +387,30 @@ static int cx20442_codec_remove(struct snd_soc_codec *codec) regulator_put(cx20442->por); } - snd_soc_codec_set_drvdata(codec, NULL); + snd_soc_component_set_drvdata(component, NULL); kfree(cx20442); - return 0; } -static const struct snd_soc_codec_driver cx20442_codec_dev = { - .probe = cx20442_codec_probe, - .remove = cx20442_codec_remove, - .set_bias_level = cx20442_set_bias_level, - .read = cx20442_read_reg_cache, - .write = cx20442_write, - - .component_driver = { - .dapm_widgets = cx20442_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(cx20442_dapm_widgets), - .dapm_routes = cx20442_audio_map, - .num_dapm_routes = ARRAY_SIZE(cx20442_audio_map), - }, +static const struct snd_soc_component_driver cx20442_component_dev = { + .probe = cx20442_component_probe, + .remove = cx20442_component_remove, + .set_bias_level = cx20442_set_bias_level, + .read = cx20442_read_reg_cache, + .write = cx20442_write, + .dapm_widgets = cx20442_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(cx20442_dapm_widgets), + .dapm_routes = cx20442_audio_map, + .num_dapm_routes = ARRAY_SIZE(cx20442_audio_map), + .idle_bias_on = 1, + .use_pmdown_time = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, }; static int cx20442_platform_probe(struct platform_device *pdev) { - return snd_soc_register_codec(&pdev->dev, - &cx20442_codec_dev, &cx20442_dai, 1); -} - -static int cx20442_platform_remove(struct platform_device *pdev) -{ - snd_soc_unregister_codec(&pdev->dev); - return 0; + return devm_snd_soc_register_component(&pdev->dev, + &cx20442_component_dev, &cx20442_dai, 1); } static struct platform_driver cx20442_platform_driver = { @@ -424,7 +418,6 @@ static int cx20442_platform_remove(struct platform_device *pdev) .name = "cx20442-codec", }, .probe = cx20442_platform_probe, - .remove = cx20442_platform_remove, }; module_platform_driver(cx20442_platform_driver); diff --git a/sound/soc/omap/ams-delta.c b/sound/soc/omap/ams-delta.c index cb72c1e..77a30f0 100644 --- a/sound/soc/omap/ams-delta.c +++ b/sound/soc/omap/ams-delta.c @@ -93,7 +93,7 @@ * Used for passing a codec structure pointer * from the board initialization code to the tty line discipline. */ -static struct snd_soc_codec *cx20442_codec; +static struct snd_soc_component *cx20442_codec; static int ams_delta_set_audio_mode(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) @@ -105,7 +105,7 @@ static int ams_delta_set_audio_mode(struct snd_kcontrol *kcontrol, int pin, changed = 0; /* Refuse any mode changes if we are not able to control the codec. */ - if (!cx20442_codec->component.card->pop_time) + if (!cx20442_codec->card->pop_time) return -EUNATCH; if (ucontrol->value.enumerated.item[0] >= control->items) @@ -300,15 +300,15 @@ static int cx81801_open(struct tty_struct *tty) /* Line discipline .close() */ static void cx81801_close(struct tty_struct *tty) { - struct snd_soc_codec *codec = tty->disc_data; - struct snd_soc_dapm_context *dapm = &codec->component.card->dapm; + struct snd_soc_component *component = tty->disc_data; + struct snd_soc_dapm_context *dapm = &component->card->dapm; del_timer_sync(&cx81801_timer); /* Prevent the hook switch from further changing the DAPM pins */ INIT_LIST_HEAD(&ams_delta_hook_switch.pins); - if (!codec) + if (!component) return; v253_ops.close(tty); @@ -338,14 +338,14 @@ static int cx81801_hangup(struct tty_struct *tty) static void cx81801_receive(struct tty_struct *tty, const unsigned char *cp, char *fp, int count) { - struct snd_soc_codec *codec = tty->disc_data; + struct snd_soc_component *component = tty->disc_data; const unsigned char *c; int apply, ret; - if (!codec) + if (!component) return; - if (!codec->component.card->pop_time) { + if (!component->card->pop_time) { /* First modem response, complete setup procedure */ /* Initialize timer used for config pulse generation */ @@ -358,7 +358,7 @@ static void cx81801_receive(struct tty_struct *tty, ARRAY_SIZE(ams_delta_hook_switch_pins), ams_delta_hook_switch_pins); if (ret) - dev_warn(codec->dev, + dev_warn(component->dev, "Failed to link hook switch to DAPM pins, " "will continue with hook switch unlinked.\n"); @@ -467,7 +467,7 @@ static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd) /* Codec is ready, now add/activate board specific controls */ /* Store a pointer to the codec structure for tty ldisc use */ - cx20442_codec = rtd->codec; + cx20442_codec = rtd->codec_dai->component; /* Set up digital mute if not provided by the codec */ if (!codec_dai->driver->ops) {