From patchwork Thu Mar 29 05:35:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10314479 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 8D0D1602D6 for ; Thu, 29 Mar 2018 05:36:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D13C2A1B8 for ; Thu, 29 Mar 2018 05:36:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 717512A1DE; Thu, 29 Mar 2018 05:36:07 +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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 06D002A1B8 for ; Thu, 29 Mar 2018 05:36:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750795AbeC2Ffx (ORCPT ); Thu, 29 Mar 2018 01:35:53 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:49744 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750707AbeC2Ffv (ORCPT ); Thu, 29 Mar 2018 01:35:51 -0400 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie2.idc.renesas.com with ESMTP; 29 Mar 2018 14:35:50 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 0ACB983AF5; Thu, 29 Mar 2018 14:35:50 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.48,375,1517842800"; d="scan'208";a="276585867" Received: from mail-os2jpn01lp0151.outbound.protection.outlook.com (HELO JPN01-OS2-obe.outbound.protection.outlook.com) ([23.103.139.151]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 29 Mar 2018 14:35:49 +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=oiNg56UBKb2gSap6IIS/4gpPSWADXjN6A1E6Pdav8xc=; b=DQgs/TksBL7emyI1exUKccr9RFiCRqcm53fn/h1hV2q9J7GaEY5P4/oNTR4tB2VXsK1sNL4JGhcKkZGh0ob/T0a/kDUAh2aTKHTUDbPU/rq5GmYUbFeH56uB45neFFmWl1+s9d6UK1HNTiZU3q2AlSokgUVLOzqWPsOZXxSyItI= 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 OSBPR01MB2071.jpnprd01.prod.outlook.com (2603:1096:603:22::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.609.10; Thu, 29 Mar 2018 05:35:46 +0000 Message-ID: <87370j78fm.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2] media: i2c: wm9090: replace codec to component User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown , Tim Harvey , Mauro Carvalho Chehab Cc: Linux-ALSA , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Thu, 29 Mar 2018 05:35:46 +0000 X-Originating-IP: [211.11.155.138] X-ClientProxiedBy: SG2PR0401CA0021.apcprd04.prod.outlook.com (2603:1096:3:1::31) To OSBPR01MB2071.jpnprd01.prod.outlook.com (2603:1096:603:22::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 8a1c3972-f213-426a-1953-08d59536ecc1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:OSBPR01MB2071; X-Microsoft-Exchange-Diagnostics: 1; OSBPR01MB2071; 3:DVRvjAwK1+btG9hJFe5NNS/o85r2HARJpKA0rUQf5W/VEY2AuL+LguoSwKqTquXyAvzm9hQjQg9OC1kuRdRUQds8lRbEOm+speVdq5k5cEWUuEV1mRJE0xQYdNQWa+KxYnERIFjo3IO3bnRukubzB+pxW4EuZHH14/CuRleQkWn24j99Dlh2+nDr5A3lau8S0Qen1OXmITHDMgt5DvpvtdhqX+4EPdOJQ1w88LmGGmefFVNhyq7Hza8WS7EJFLYK; 25:r1T3MzOP8MY66YOkUV9pvJVkB2RJLb/A9XayAj1rqjsZ1w9Kedm0KG8cN8ponQEIYMOdsaOCGZMpdGvak6VOftVESzY08ma8qZjDAZHZY874WUxeDQG7+BlyFUujLAn+gkmP3+XLxer4tvXgFFLw2GVy7adpYwr7Hwe1xy3IKSKXfxQ2iGuF15pakOhJAytsiwqYsm6KFxZJa0QoqU4qguOs75Khd0F+wlkWNXtWbvQTZ9GypJ/+c+rHwGEcdYx7j4zHP4df+xWrNralW8cIhbTKF8w6sMOD8uxnKCDDy4tFBWlQhsrYYj1R7TmPSoN12+PAHhVmkx6UhQCsLMKbcA==; 31:kHX9eLMUCGlcoDWwDpo82a+PsFGaTrXqcLTHIPgkuBU+Y/cvImVXJQl5RfPINBCyaXEUrZBLfBJ96DgYR1/746P5nouAr09E1jm3PLR652/ssFjfW0FLivsAcH29F1+fvILVWlQjyNpYRoEkTBmAqLNY3jX+EpqyDdIdrop9zlrmAvtv0PZ7yllSlqBklH+fobDUlCKzO9IvqgWDvnqx4PcqC9HGmOISwuIw8kS/oKw= X-MS-TrafficTypeDiagnostic: OSBPR01MB2071: X-Microsoft-Exchange-Diagnostics: 1; OSBPR01MB2071; 20:8S2C2gtKblEpWreybFh2MQH1J09v/Lrex8VskRL6T9pcRPtUEByDkwy18JfNk9dGowC7GH+kvTszmKKHzIqFZR9rQzanoHsXbCvRNJGIlnK+bU38gL6kk0Kua0KaxArP2KO+f92ZtKM9EWyUMmgFcelpdFKWeJ/JelyU4UUXQlMZnSAhUVnHLWBKqtA3fUwmTqEg2B8opPI/JJwGoPG5zwcp5K897xS67MOZck60FI830btKbXqHwL8tUhqeJQxJSprfK+/eIWM7nb6d2u0hQQbgJpHQmIR2M1oX5B4urBrSC9gOoS3jGM3cFcO4W/5C76Cwtbw4i+U4XjX8Ge+Bx6Es7fcfhPValRH+vJhLrVDSCUfDo5a2il+bU5deTjMC+kLReQMVdT+rSThzUeXbCIDifZ2LfsS71hlk5QPXUKgSAG0wjvrtSwDQWCnFJi9D76Vxl/hkIxn4KjjbkD8MD91r2dmOL1lZ5aOQC+gWgUHpim/XbK/o3i6H8AEX4CMI; 4:jpgrp0CQ5TpqBKxDydxtFIx+1r3WEh9lEgKs63UN5AdehsREQ3pqbztOaW9YXIzkJfqWEvfqF1LV5lq78MqRVGOTkrqSrSttyGQB20s/KwRSdcx/O/vS1Sczc7kahzMrjXPfdNPGGpGvo/t/ROjEoun0FWaWL6f6J3UvPZkBTgFFyGOvMIti1Plud7i/AM9p4pJYuPUrZU8angdqQOwh2fXT8jcMONIji9jrCWIRfmJnyQRBdvfee+I4Nb5Ii9G5xX/66mS7eRolR0AWvvfxlGoFTuHN7p4gmJAhsamGZ1Ht8BIOsBaR/bJBsFKEx27L X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231221)(944501327)(52105095)(93006095)(93001095)(6055026)(6041310)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011); SRVR:OSBPR01MB2071; BCL:0; PCL:0; RULEID:; SRVR:OSBPR01MB2071; X-Forefront-PRVS: 0626C21B10 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(366004)(396003)(39380400002)(376002)(39860400002)(346002)(189003)(199004)(186003)(8936002)(16526019)(106356001)(81166006)(81156014)(3846002)(86362001)(105586002)(8676002)(6486002)(6116002)(97736004)(53416004)(316002)(4326008)(26005)(386003)(50466002)(53936002)(47776003)(59450400001)(52116002)(478600001)(66066001)(7736002)(476003)(486005)(2906002)(486005)(956004)(305945005)(7696005)(68736007)(23726003)(69596002)(2616005)(5660300001)(16586007)(25786009)(110136005)(36756003)(58126008)(21314002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:OSBPR01MB2071; 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; OSBPR01MB2071; 23:R0ay1pH5ZSyfDGGQh3eleZNA99gefQU8g9d9mLXHh?= =?us-ascii?Q?z3tMutSR8Ifz9JFyy6NxUbsbDVv/siWa3g6fRuSX+ctELBu/mvmq1lD5kodc?= =?us-ascii?Q?fnQOB9c9pVLqgXZEgSTg5rtb+LcFBJ/cPRIg5YLO1qEk9HD5AZ1VaW+03+N1?= =?us-ascii?Q?YEvDfNic4qc+kMBhug4ecPC5YA1H2Y+PFWTcX1fWTg9W1gicpIZgpATTx9y/?= =?us-ascii?Q?iPfx4zwGMUko9w3z/Kjf1zYSwJOas71JF3EzIpOXB9lmiQasT9VhhMSXEU0F?= =?us-ascii?Q?r3wZvRAV0OQDb/J7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8oe1F6t2ioxfA8y8Z6vuPiw3JiWwww5aOKC?= X-Microsoft-Antispam-Message-Info: XY0G0xB1em0SStWSCgiRTCu79Qt8WIGVtsPkmi+Xl7NrvvfVkZ45aYix5eMQKGEWJ79wo920xlSSNhmMcO2n2W8DpOOhFAOcYNrUwwK3LPNnOu+6rr5n2UVHzXzP4H9OxWqRYePk+ZgEsF5Jb5eFIW48riiVMaZAa+NFBqPLpUsY3oR72Rq4DCMJfRJuNJhS X-Microsoft-Exchange-Diagnostics: 1; OSBPR01MB2071; 6:TQGppSYyrMXWzrgdVziJlN/FyZakWZkHIIKzXZOhG1Yy0zR7gNSysrb29zmK8WwNKUEGPYBFJJUBMk5x8n513ljERqQU+4wJmeXvloXIG9JpQsPGKSk3cCgAaoOW57FvhMyzXbrTZ5efZGNJQEF26t9TahFwKg7SnmpgPjWwPeqcZywUNkcw3brvyBncPmUTWsotWWASWXFSaRZey518CUXx7tgyR8zAIDNcF0jjx6Vp5kq5ws++vZSFXS52aXsSOItm9aKJ167xevOhGLj5MumsYzPjCMBAfGcZIuRTRmwmTc+0KU5KlR1dFAby5ZTX3o/+jqusWp0G13pne/8p1oitBFRIsNG2yGgTw6pvkXhZ2xDZJLuhehWV+hwSMO7i3MgSJFBsO5kQ3EH//FU/mp3Uy4/9AG47ww7/pIDlFH5gpsCe16yu+rla02nc31QbrnXukEFHQQxxb/KlJ4R1uA==; 5:K7oISImCd2v9v8OQ5tOQy/aPJGlRoKYDmDEEcjVI4CI7obVpS1bSCK0+OjqAyvYlakPKvHHD4iNl08MU+cO+Ov2WuRZvJfZcNnkSQCPiINzKTKcTQvTpwRKrgRMfzTRlB7Tire5ASh2uatDGai/uIvKEMZtl6sLukx1lQaaIiEk=; 24:8NpKbFzULYcvdodoptNRq+ejguO1NwcYUIVj7xS1VVpIhEvSgqaS0IqgoFNBa3rmV6fl1HaZr46XTnrrby14YgC50Mx94WF3UhgIMSL+mfI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; OSBPR01MB2071; 7:nQHtCwdvDfOSZwNY4gZiOZzhysXUFCo/HV+Smb/k6UnZEoDl/YglXeAKehxRNk1LLhpVpMcNAzfOJyvleWE5YB30rszcawtvjnDOkmNDRsNoH3wfUmHIF7N+OenNfSFVf6UhXwVim1EyYVPbo9KA0sXiKJZVuX25YCDeYbEtgIpGVJk+B7dZw8KpERBjFryU2jLj3IKHtXUgNYJsfGZzAe6yq2doqTiWq2mXhH5nr/0c46ZQoZmYpisWHveUGCoQ; 20:3h4J6E1yZWZKYo0hEU0z5OOfV3F4JaZrCpSRZDZCXxl909lERaQkdHkU8dKLkrlOwoW6eNcZDQypvGO+4mrIPwLwxEtHuf+Z5tXM2sHybo7L0+NZLyludQYKDNY1PNGUq+hj8rDdPfV8TXhpHzYbNdNiuS+IZTQHZijp2nFbFf8= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2018 05:35:46.1581 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8a1c3972-f213-426a-1953-08d59536ecc1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSBPR01MB2071 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.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 --- v1 -> v2 - fixup .remove return drivers/media/i2c/tda1997x.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/media/i2c/tda1997x.c b/drivers/media/i2c/tda1997x.c index 3021913..2dc4df5 100644 --- a/drivers/media/i2c/tda1997x.c +++ b/drivers/media/i2c/tda1997x.c @@ -2444,7 +2444,7 @@ static int tda1997x_pcm_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct tda1997x_state *state = snd_soc_dai_get_drvdata(dai); - struct snd_soc_codec *codec = dai->codec; + struct snd_soc_component *component = dai->component; struct snd_pcm_runtime *rtd = substream->runtime; int rate, err; @@ -2452,11 +2452,11 @@ static int tda1997x_pcm_startup(struct snd_pcm_substream *substream, err = snd_pcm_hw_constraint_minmax(rtd, SNDRV_PCM_HW_PARAM_RATE, rate, rate); if (err < 0) { - dev_err(codec->dev, "failed to constrain samplerate to %dHz\n", + dev_err(component->dev, "failed to constrain samplerate to %dHz\n", rate); return err; } - dev_info(codec->dev, "set samplerate constraint to %dHz\n", rate); + dev_info(component->dev, "set samplerate constraint to %dHz\n", rate); return 0; } @@ -2479,20 +2479,22 @@ static int tda1997x_pcm_startup(struct snd_pcm_substream *substream, .ops = &tda1997x_dai_ops, }; -static int tda1997x_codec_probe(struct snd_soc_codec *codec) +static int tda1997x_codec_probe(struct snd_soc_component *component) { return 0; } -static int tda1997x_codec_remove(struct snd_soc_codec *codec) +static void tda1997x_codec_remove(struct snd_soc_component *component) { - return 0; } -static struct snd_soc_codec_driver tda1997x_codec_driver = { +static struct snd_soc_component_driver tda1997x_codec_driver = { .probe = tda1997x_codec_probe, .remove = tda1997x_codec_remove, - .reg_word_size = sizeof(u16), + .idle_bias_on = 1, + .use_pmdown_time = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, }; static int tda1997x_probe(struct i2c_client *client, @@ -2737,7 +2739,7 @@ static int tda1997x_probe(struct i2c_client *client, else formats = SNDRV_PCM_FMTBIT_S16_LE; tda1997x_audio_dai.capture.formats = formats; - ret = snd_soc_register_codec(&state->client->dev, + ret = devm_snd_soc_register_component(&state->client->dev, &tda1997x_codec_driver, &tda1997x_audio_dai, 1); if (ret) { @@ -2782,7 +2784,6 @@ static int tda1997x_remove(struct i2c_client *client) struct tda1997x_platform_data *pdata = &state->pdata; if (pdata->audout_format) { - snd_soc_unregister_codec(&client->dev); mutex_destroy(&state->audio_lock); }