From patchwork Fri Sep 1 06:29:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9933545 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 B5B1B6021C for ; Fri, 1 Sep 2017 06:29:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A381D2853F for ; Fri, 1 Sep 2017 06:29:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 95E5128543; Fri, 1 Sep 2017 06:29:54 +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 6ADE12853F for ; Fri, 1 Sep 2017 06:29:53 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 4F79D267625; Fri, 1 Sep 2017 08:29:52 +0200 (CEST) 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 AD1EA267616; Fri, 1 Sep 2017 08:29:50 +0200 (CEST) Received: from relmlie1.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa0.perex.cz (Postfix) with ESMTP id C3B3826761C for ; Fri, 1 Sep 2017 08:29:33 +0200 (CEST) Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie1.idc.renesas.com with ESMTP; 01 Sep 2017 15:29:30 +0900 Received: from relmlii1.idc.renesas.com (relmlii1.idc.renesas.com [10.200.68.65]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 41B6D6C2BC; Fri, 1 Sep 2017 15:29:30 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.41,456,1498489200"; d="scan'208";a="255517146" Received: from mail-hk2apc01lp0216.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.216]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 01 Sep 2017 15:29:29 +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=MBC/hL4ybvdvfT0SYCG//PJYLukAW0zV1ZjCCd03rg8=; b=MDga6Esg6GNFeR9njg4y6JDDH50GwvMMbhVzJSpkAwsc0n3SoVAATftZUTngCnjSBNqkc5wA3yb6LCWVRK047ZuorAEC7rWbwg3llHoFHAxDzfDrQuLTjEMc6C2TW1qfi94S/x0ldSfCfJckDRG3XsQJpkG7nKEJxMNF+BKDsmY= 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 SG2PR0601MB1888.apcprd06.prod.outlook.com (2603:1096:3:9::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Fri, 1 Sep 2017 06:29:27 +0000 Message-ID: <87y3pzj5up.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: <873787kki4.wl%kuninori.morimoto.gx@renesas.com> References: <873787ngjb.wl%kuninori.morimoto.gx@renesas.com> <873787kki4.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Fri, 1 Sep 2017 06:29:27 +0000 X-Originating-IP: [211.11.155.138] X-ClientProxiedBy: SG2PR0401CA0023.apcprd04.prod.outlook.com (2603:1096:3:1::33) To SG2PR0601MB1888.apcprd06.prod.outlook.com (2603:1096:3:9::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5551193c-6e82-46ad-51fc-08d4f102cc0d X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:SG2PR0601MB1888; X-Microsoft-Exchange-Diagnostics: 1; SG2PR0601MB1888; 3:tb7PDii5UbQtGF7UREroorAm+3kSYYMk/hbxEgFYYcu90zkfqbBHgunpWXuKOLehS/ADHD/FPT0osi0/fr5kwTKD4OMeyTAbqW7QkpH5aQCa3dyasOApy6/hhRWwRCfk+jvbIA3QWzBKQwFtrSydyFzIWxxRYA2jZPRXcl1C34v6RCifA+E4/euxaxGBu/x+WpmksWdcISImw0wjx+zM+4kyHJilT9UcAyKk6qD5mjQn3K84/eEZwE+bR/m/wxoY; 25:NABFii60icRPNFlncX7GttdxbJ6QUeZmVOXLv1sdiZ99CpSi7yd3RpTHwGvKAXdiIJBh0BHKtbwPL04pN/P9ZXqUmFdfe2uMYLith89xkknd2r+znGgQ0H/Li0bqNlGTeEfnek7s3Ui9Qt3jG5SVxz3XEjWd2ExilhfRlJ+KquM3Ma0BmK9mDSjllhU8T1aaFrz+8ZnH3jQ//AM/Eh5m2/m0h4qeP15P3Sik3D4tCG4LZbUCO89FkDLWAmHEXeZ+odnZ02imaAd3z2viGpfiy8Zs707Ahvm0X0QhrDaKPNshOMYrmepvy5UWFA21n7ghd05xfsUPVFUWaK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HbPNFlWuAFHbdnuyrtzNJKUFT1gn/1tYBmH9MR4Ki0CSGrqAwhPhIpKPwpfQH/XoiQI= X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(100000703101)(100105400095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(20161123555025)(20161123560025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SG2PR0601MB1888; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SG2PR0601MB1888; X-Forefront-PRVS: 0417A3FFD2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(7370300001)(6009001)(39860400002)(199003)(189002)(2950100002)(54906002)(5660300001)(68736007)(3846002)(47776003)(36756003)(97736004)(69596002)(66066001)(83506001)(23726003)(478600001)(7350300001)(4001350100001)(76176999)(50986999)(305945005)(54356999)(8676002)(105586002)(53936002)(81156014)(81166006)(110136004)(106356001)(101416001)(6116002)(2906002)(86362001)(25786009)(6486002)(6916009)(7736002)(189998001)(4326008)(50466002)(42186005)(53416004)(33646002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR0601MB1888; 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; SG2PR0601MB1888; 23:76KLykt2v9e+IxMrLvC07ZJ8J1XznWAgo+59p1m?= =?us-ascii?Q?JNxm/jLVFVUkXScEVh2XL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VTaSjASBMgVzX81UE2yIltxdbs+XP8vvXrRj1VV1GsT3zJLUivyi5a8GlLYGS7Von1fZCBCklaNTdeWr4jcfhRys5TDgEUL8DgJbcz6g= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SG2PR0601MB1888; 20:7SLUpvMyo0ld+w17cXBJBTHSJgVWZBZOmThpY6TBraysl9eovFVjQ45b7Dgu71Z7vC9Up94ULhCF8L0lsEUwiIVFtdgqHkz1yb1ajl4MlzPDHeK3IPGUZg2q4yWXPUZY+lnmwhCAlGG999wW7yBsmSwrEmNx5ueLG3xD/aiGCAk= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2017 06:29:27.6736 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR0601MB1888 Cc: Linux-ALSA , Lars-Peter Subject: [alsa-devel] [SAMPLE 3/6] ASoC: replace platform to component on intel/atom 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 Now platform can be replaced to component, let's do it. Signed-off-by: Kuninori Morimoto --- sound/soc/intel/atom/sst-atom-controls.c | 36 +++++++++++------------ sound/soc/intel/atom/sst-mfld-platform-compress.c | 4 +-- sound/soc/intel/atom/sst-mfld-platform-pcm.c | 32 ++++++-------------- sound/soc/intel/atom/sst-mfld-platform.h | 4 ++- 4 files changed, 32 insertions(+), 44 deletions(-) diff --git a/sound/soc/intel/atom/sst-atom-controls.c b/sound/soc/intel/atom/sst-atom-controls.c index 0f3604b..3672d36 100644 --- a/sound/soc/intel/atom/sst-atom-controls.c +++ b/sound/soc/intel/atom/sst-atom-controls.c @@ -1414,11 +1414,11 @@ static int sst_fill_module_list(struct snd_kcontrol *kctl, * name. First part of control name contains the pipe name (widget name). */ static int sst_fill_widget_module_info(struct snd_soc_dapm_widget *w, - struct snd_soc_platform *platform) + struct snd_soc_component *component) { struct snd_kcontrol *kctl; int index, ret = 0; - struct snd_card *card = platform->component.card->snd_card; + struct snd_card *card = component->card->snd_card; char *idx; down_read(&card->controls_rwsem); @@ -1468,13 +1468,13 @@ static int sst_fill_widget_module_info(struct snd_soc_dapm_widget *w, /** * sst_fill_linked_widgets - fill the parent pointer for the linked widget */ -static void sst_fill_linked_widgets(struct snd_soc_platform *platform, +static void sst_fill_linked_widgets(struct snd_soc_component *component, struct sst_ids *ids) { struct snd_soc_dapm_widget *w; unsigned int len = strlen(ids->parent_wname); - list_for_each_entry(w, &platform->component.card->widgets, list) { + list_for_each_entry(w, &component->card->widgets, list) { if (!strncmp(ids->parent_wname, w->name, len)) { ids->parent_w = w; break; @@ -1485,41 +1485,41 @@ static void sst_fill_linked_widgets(struct snd_soc_platform *platform, /** * sst_map_modules_to_pipe - fill algo/gains list for all pipes */ -static int sst_map_modules_to_pipe(struct snd_soc_platform *platform) +static int sst_map_modules_to_pipe(struct snd_soc_component *component) { struct snd_soc_dapm_widget *w; int ret = 0; - list_for_each_entry(w, &platform->component.card->widgets, list) { + list_for_each_entry(w, &component->card->widgets, list) { if (is_sst_dapm_widget(w) && (w->priv)) { struct sst_ids *ids = w->priv; - dev_dbg(platform->dev, "widget type=%d name=%s\n", + dev_dbg(component->dev, "widget type=%d name=%s\n", w->id, w->name); INIT_LIST_HEAD(&ids->algo_list); INIT_LIST_HEAD(&ids->gain_list); - ret = sst_fill_widget_module_info(w, platform); + ret = sst_fill_widget_module_info(w, component); if (ret < 0) return ret; /* fill linked widgets */ if (ids->parent_wname != NULL) - sst_fill_linked_widgets(platform, ids); + sst_fill_linked_widgets(component, ids); } } return 0; } -int sst_dsp_init_v2_dpcm(struct snd_soc_platform *platform) +int sst_dsp_init_v2_dpcm(struct snd_soc_component *component) { int i, ret = 0; struct snd_soc_dapm_context *dapm = - snd_soc_component_get_dapm(&platform->component); - struct sst_data *drv = snd_soc_platform_get_drvdata(platform); + snd_soc_component_get_dapm(component); + struct sst_data *drv = snd_soc_component_get_drvdata(component); unsigned int gains = ARRAY_SIZE(sst_gain_controls)/3; - drv->byte_stream = devm_kzalloc(platform->dev, + drv->byte_stream = devm_kzalloc(component->dev, SST_MAX_BIN_BYTES, GFP_KERNEL); if (!drv->byte_stream) return -ENOMEM; @@ -1537,26 +1537,26 @@ int sst_dsp_init_v2_dpcm(struct snd_soc_platform *platform) sst_gains[i].ramp_duration = SST_GAIN_RAMP_DURATION_DEFAULT; } - ret = snd_soc_add_platform_controls(platform, sst_gain_controls, + ret = snd_soc_add_component_controls(component, sst_gain_controls, ARRAY_SIZE(sst_gain_controls)); if (ret) return ret; /* Initialize algo control params */ - ret = sst_algo_control_init(platform->dev); + ret = sst_algo_control_init(component->dev); if (ret) return ret; - ret = snd_soc_add_platform_controls(platform, sst_algo_controls, + ret = snd_soc_add_component_controls(component, sst_algo_controls, ARRAY_SIZE(sst_algo_controls)); if (ret) return ret; - ret = snd_soc_add_platform_controls(platform, sst_slot_controls, + ret = snd_soc_add_component_controls(component, sst_slot_controls, ARRAY_SIZE(sst_slot_controls)); if (ret) return ret; - ret = sst_map_modules_to_pipe(platform); + ret = sst_map_modules_to_pipe(component); return ret; } diff --git a/sound/soc/intel/atom/sst-mfld-platform-compress.c b/sound/soc/intel/atom/sst-mfld-platform-compress.c index 1bead81..79959c9 100644 --- a/sound/soc/intel/atom/sst-mfld-platform-compress.c +++ b/sound/soc/intel/atom/sst-mfld-platform-compress.c @@ -107,8 +107,8 @@ static int sst_platform_compr_set_params(struct snd_compr_stream *cstream, struct snd_sst_params str_params; struct sst_compress_cb cb; struct snd_soc_pcm_runtime *rtd = cstream->private_data; - struct snd_soc_platform *platform = rtd->platform; - struct sst_data *ctx = snd_soc_platform_get_drvdata(platform); + struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, DRV_NAME); + struct sst_data *ctx = snd_soc_component_get_drvdata(component); stream = cstream->runtime->private_data; /* construct fw structure for this*/ diff --git a/sound/soc/intel/atom/sst-mfld-platform-pcm.c b/sound/soc/intel/atom/sst-mfld-platform-pcm.c index 43e7fdd..6c36da5 100644 --- a/sound/soc/intel/atom/sst-mfld-platform-pcm.c +++ b/sound/soc/intel/atom/sst-mfld-platform-pcm.c @@ -697,26 +697,22 @@ static int sst_pcm_new(struct snd_soc_pcm_runtime *rtd) return retval; } -static int sst_soc_probe(struct snd_soc_platform *platform) +static int sst_soc_probe(struct snd_soc_component *component) { - struct sst_data *drv = dev_get_drvdata(platform->dev); + struct sst_data *drv = dev_get_drvdata(component->dev); - drv->soc_card = platform->component.card; - return sst_dsp_init_v2_dpcm(platform); + drv->soc_card = component->card; + return sst_dsp_init_v2_dpcm(component); } -static const struct snd_soc_platform_driver sst_soc_platform_drv = { +static const struct snd_soc_component_driver sst_soc_platform_drv = { + .name = DRV_NAME, .probe = sst_soc_probe, .ops = &sst_platform_ops, .compr_ops = &sst_platform_compr_ops, .pcm_new = sst_pcm_new, }; -static const struct snd_soc_component_driver sst_component = { - .name = "sst", -}; - - static int sst_platform_probe(struct platform_device *pdev) { struct sst_data *drv; @@ -740,26 +736,16 @@ static int sst_platform_probe(struct platform_device *pdev) mutex_init(&drv->lock); dev_set_drvdata(&pdev->dev, drv); - ret = snd_soc_register_platform(&pdev->dev, &sst_soc_platform_drv); - if (ret) { - dev_err(&pdev->dev, "registering soc platform failed\n"); - return ret; - } - - ret = snd_soc_register_component(&pdev->dev, &sst_component, + ret = devm_snd_soc_register_component(&pdev->dev, &sst_soc_platform_drv, sst_platform_dai, ARRAY_SIZE(sst_platform_dai)); - if (ret) { + if (ret) dev_err(&pdev->dev, "registering cpu dais failed\n"); - snd_soc_unregister_platform(&pdev->dev); - } + return ret; } static int sst_platform_remove(struct platform_device *pdev) { - - snd_soc_unregister_component(&pdev->dev); - snd_soc_unregister_platform(&pdev->dev); dev_dbg(&pdev->dev, "sst_platform_remove success\n"); return 0; } diff --git a/sound/soc/intel/atom/sst-mfld-platform.h b/sound/soc/intel/atom/sst-mfld-platform.h index cb32cc7..852521e 100644 --- a/sound/soc/intel/atom/sst-mfld-platform.h +++ b/sound/soc/intel/atom/sst-mfld-platform.h @@ -27,6 +27,8 @@ extern struct sst_device *sst; extern struct snd_compr_ops sst_platform_compr_ops; +#define DRV_NAME "sst" + #define SST_MONO 1 #define SST_STEREO 2 #define SST_MAX_CAP 5 @@ -155,7 +157,7 @@ struct sst_device { struct sst_data; -int sst_dsp_init_v2_dpcm(struct snd_soc_platform *platform); +int sst_dsp_init_v2_dpcm(struct snd_soc_component *component); int sst_send_pipe_gains(struct snd_soc_dai *dai, int stream, int mute); int send_ssp_cmd(struct snd_soc_dai *dai, const char *id, bool enable); int sst_handle_vb_timer(struct snd_soc_dai *dai, bool enable);