From patchwork Fri Apr 6 05:44:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10325667 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 3473E60208 for ; Fri, 6 Apr 2018 05:44:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23B512941C for ; Fri, 6 Apr 2018 05:44:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 14F812945F; Fri, 6 Apr 2018 05:44:46 +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 9DAEB2941C for ; Fri, 6 Apr 2018 05:44:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751896AbeDFFob (ORCPT ); Fri, 6 Apr 2018 01:44:31 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:22633 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751749AbeDFFoa (ORCPT ); Fri, 6 Apr 2018 01:44:30 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie1.idc.renesas.com with ESMTP; 06 Apr 2018 14:44:28 +0900 Received: from relmlii1.idc.renesas.com (relmlii1.idc.renesas.com [10.200.68.65]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id BE4C07B25D; Fri, 6 Apr 2018 14:44:28 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.48,414,1517842800"; d="scan'208";a="275995039" Received: from mail-ty1jpn01lp0179.outbound.protection.outlook.com (HELO JPN01-TY1-obe.outbound.protection.outlook.com) ([23.103.139.179]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 06 Apr 2018 14:44:28 +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=L6n5nhFqeiPPM2VmbPNJE9aX4H2+pvVGg4o03p+Ea6k=; b=HwRI/r3SlPBmsxqj0UYOqHeWjaLobreZRqo8iNnP3H8Au5MfRG5VUBY7/RLWAXGQXXbgyY06lmHRA4j/B07t3bx5U+GwWKQdRu6pYIDSq6cNfTmnOnkyxZ1N6GT90w/cMNPYspjVR2Z/bmXugUj5sm2xusXBXRt6Zgk+U89YYE8= 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 OSAPR01MB2065.jpnprd01.prod.outlook.com (2603:1096:603:18::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.653.12; Fri, 6 Apr 2018 05:44:25 +0000 Message-ID: <87in94lwmq.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3] media: i2c: tda1997: 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: Fri, 6 Apr 2018 05:44:25 +0000 X-Originating-IP: [211.11.155.138] X-ClientProxiedBy: HK2PR02CA0166.apcprd02.prod.outlook.com (2603:1096:201:1f::26) To OSAPR01MB2065.jpnprd01.prod.outlook.com (2603:1096:603:18::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 101fc375-6373-49c0-b5d1-08d59b81756b X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:OSAPR01MB2065; X-Microsoft-Exchange-Diagnostics: 1; OSAPR01MB2065; 3:wlTpq4+8Vwoc39L9YDukPgqCNkmK1LU4CBaYnfHra0eLMiKOb/cc3BU5sUcuSw2S4osh86O6qyNapwsakBxRFQWs5ufQheFH039bQjuUFm2BdK5ajZUDNuM8r0C79BJXd18GwDwnqxWr4ldfDIVzTKimaVooTvOx4aagof59exTGt4rDqpDBzcTb4oMKWx+CX4tsjmYxTCYLe2eSTt2Dix2ke9GWePbcfAxMuxEUQk538ec982cszZNOKYxj/+3T; 25:GkGCXtXgrKrm6x9bAfdgQWDLU3poIyrb3p4uoR3SzyTfHq18dVBo1/KVLtHeUuDeMJyECv0SChEldyDLyjPEVPcPPLOuWI4T8sr9tDN7bfplBNCPxqYcy86caNiIFH7GQyZjfaMCE+DzgsGrCj1oJWoMsZLCiQtbBUUHEcV31HrnnCxkUxDum8PUckddcHSnDUJEFR8pE2Gtd6IV6cGoGErTchvdPct8+st16S+YOz2QL1v7uwruUDAXEA+TErbwsxjwNYPUoiKEsk/qUbJEPyCXkmGKfpf430l+bQIXbsYhCPOeszapDDPN06eerb2Od1tbjCU9SIyVXYQQFGKWRw==; 31:yA2UadE3cCvMGLCcdvLaTsLD3te3ecUAJks1B45c2/D20sQDLPemE84F9R9mJHJI7rIzwxw63AxPjf53QDyqfB3jNhnR70ypzi7X6u4ZsI4P2zX7ro3RIa1AZPmQECIpHIRi/1swD0+h8frKdxNOAcwtELr8oLheXpAfCS2aI3lrijBihmWsxhnJEAnwvxLNfJ+i0I3rj/8bAP/saketPLO4SeXFLAq6hzwr8lDAbDo= X-MS-TrafficTypeDiagnostic: OSAPR01MB2065: X-Microsoft-Exchange-Diagnostics: 1; OSAPR01MB2065; 20:FJ70QL5obG5Jl1Z4h9MTHf0FoowV/vlOKghK8URHW4pZ3O/pVMXKiBIBUXtL+9A8CzLIXXqH8YQuM559eO6aUoJvL8nHbgqMhIQpIV6RJrqlLUt37X28gb/WBcjeFOs8u82SFW/yjakILc/aE06ijUvxwWQrbnZghMUqnZgJT9zqDsMAdADg+PT85HYAdsmf1U0Md2OHs1aNPl16EDi6JhgAOiOuDSH2/wQntRxvGsxd6SKMfnpJRP2jz3YE1gBQd5EvswH93GPxxbShduOv1IFfzELXRqcfNJffebtFfOaTWGqrf3XD159So28nehikTN1zqQ+Vh0LaA+oFCt9a2VdzQ6CX1emk5UI3Z5QzDSTE/R6UVd7QYhKgNtkox9YCaJWmOlQt1GsTWdmmJIuPatLjZIFr2ZFCecDhrPTJOI7bko4/MNc+OKk31rOmaio0fzDmZ/UAhTOz/EUQg1niQhCZrKcJhKxXzsoLolMPPbBRbbMdKqP0TsQhAEz+R0Pq; 4:m7JlGWNUg3LV6Cdtw9xxBD8ojWakwjv/vqkFTIZUOcy8zjC1n1G3xq37gapXwuE9BHGXqzH4Gg35PNeC1hnDGu/B709Mwbw6setBs3V51wmrRVOsjLPawYD9lr6s4v8QTRh7LyIctCw3CcZVG8UTYZke7C6MMMMCNYafdBA4NvLFmbu+qMMrJNiVORE3z7LTL8Gu/X6p6FIgRRmWS+HfszhV1iZHbyZ469s9dRc32CXf4MJDVOIZuV4D/j9GbHfYy1zZSA0HTKANQp+ELeSIcRQFl23Ya3wSPeJbOI35yNeIsC8NPs/OcrFcTrSC9zg/ 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)(10201501046)(3231221)(944501327)(52105095)(93006095)(93001095)(3002001)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:OSAPR01MB2065; BCL:0; PCL:0; RULEID:; SRVR:OSAPR01MB2065; X-Forefront-PRVS: 0634F37BFF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(39380400002)(346002)(366004)(376002)(396003)(39850400004)(199004)(189003)(476003)(6116002)(81166006)(305945005)(81156014)(8936002)(2616005)(956004)(69596002)(16526019)(186003)(16586007)(58126008)(5660300001)(53936002)(106356001)(8676002)(486006)(4326008)(26005)(68736007)(66066001)(6486002)(53416004)(97736004)(105586002)(25786009)(2906002)(7696005)(23726003)(52116002)(59450400001)(386003)(50466002)(86362001)(110136005)(36756003)(478600001)(7736002)(316002)(3846002)(47776003)(21314002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:OSAPR01MB2065; H:morimoto-PC.renesas.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: renesas.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; OSAPR01MB2065; 23:Le5NNXXCyhG9TtfNos3cnqNCFHy5KIsCfgakOlZTz?= =?us-ascii?Q?dwcrULifvQ/Dyp8xgkQneww8+/89oWHe4UyeeGPa62y4w4zHp7cCS1Ge3JwZ?= =?us-ascii?Q?QoDjtCoI5pPvzaSV7bcQ/wYcooI+qDF+8xDHtFQ/qauI/nTj3BEh2yH329qh?= =?us-ascii?Q?ggb1HoiKbQelpyqzieDwxLUtPsX6JgImDj1LohjQSDdQOqi39hUc/mxOFx6v?= =?us-ascii?Q?vw7QIgGu0c1K+rNh/FkuGYfUundKUKDewORYXMqcgz1IZW0Vmj6jSXsLMwVj?= =?us-ascii?Q?BNX3lstJ+GL/130FLpaSVaNo/k4Tx8GGTn8LZfwOOJWJf+g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?= X-Microsoft-Antispam-Message-Info: uUuv2dbDZlnWnyqsmD8FH67y9+z/EXIrAjlXHKIgILIt4b2UcStdMAzuhwIzixd8qZfFehdZw+z0P16LbYquVIfYegXu3Z3vYMTibGMbrNik4XfknFlY30yGlXx2MR14KjMJrL1jUO75IxJsxmVsREm/bSQKUQmW+TSrSLN2YoPN++iaeI9se73CMQFe69ZB X-Microsoft-Exchange-Diagnostics: 1; OSAPR01MB2065; 6:izqoqKq0EQReH6GVmywGTJ0YhU4RDwvfdufxsaBq/3oj0EgYbgGaI2RnGfnQKNlf5uRS8W1f8WpPIAoKEGRE05xu629Z26rIBtYlGra4+7wUsp86/3erO3OEDTKBzapQdA5uz0nnjUa0HjPymweVho8EFJ5cbQGoACVFycOqzFGqTx0ChzmqMa8NUMAB8bnZNoXDVbv3l/QUJf+u9ZB2L2sDZXQyjNVoVRXPuUqCdAoBUUKeVh9QpiXGCUXW5QsP4rcncPyB5mhxgO2i0EfYy8MRF3BigBojz7BpR4/HAOzE3t76WDzbiOGvr/3ZmSPKVUMBWCaQPPLKkENuv8y+xorxUdlU9OE5caiNhb2qfo7aQX+7yH1bARW5krRj2g6UZ5Ii9AnTPHBcSwbZ6HVEOp0ELPKuHe9rzNL/59mfxXRSGmIhbo+KbZQGZHNDKQMEEK5PCtxXKAYDIaGRPdwMKQ==; 5:ndv5w+XdMJo+dZ+JYKfyveiZU9nQpjkCYeOwUvbelPqzSbTegS7ZXMBQONNm117ZkpeNM/gE0JFTCA4KAeXbi6y/Go4m6JGqVbIiQ5W3PO40Og6MarCc8BnQjDPvKrqYmX1+I7qhjLgBNJBOcye93ZoovUpS+gXiznT2ECdF7cc=; 24:F64Aj1jvRY7iTVj0at1CfXaIurlrexXiIeEZa3vgokauGWLQ8pXKIPy5GP7oZofBA/XO2VC8nq22KmfoM+AeTeqGEsOCt6aZ53M3HsMx3i4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; OSAPR01MB2065; 7:PdR6V2R2NfyfeoGyyig7I0/J5BhBYX35Myn5R1Jn4mu1czFOxnwfwylxKyYXLQ8qjM30oQXN2W+q1qJmE0YbBnskMb3/PAMrawYbUkpWD4yPq+EhPM2s5vDgdeXJvxrH4i/NyzTEhqRPLwnshDqMOMXz9vJZCayI4RMBg04Qk4LG7iabflxFcipx1QFrsEy2zx0OanKdb6ttI19T2pZIRjgqpsboIBn1Q3CqAgKILsm2F/7JKrNEUnHIl0umavAY; 20:DPMj0Rlqw4+oywfbdt8MrTrnE7a6r9CH8k/uXL/5PHfEy8z/oDFGAGhirBW4zsjzWsd127JaHkgySK6r0N4Pjo/AoKzOGgiWdDtiLHjzs1dMttIF3muruOt2buE1omYb8PD5KrE8WiYIJHMk2fDwuU5CcjAaHLovDYE4FTm8BFI= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Apr 2018 05:44:25.5872 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 101fc375-6373-49c0-b5d1-08d59b81756b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSAPR01MB2065 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 --- Tim, Mauro This replace patch is needed for ALSA SoC, otherwise it can't probe anymore. Mark, I think it needs your acked-by ? v2 -> v3 - fixup driver name (= tda1997) drivers/media/i2c/tda1997x.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/media/i2c/tda1997x.c b/drivers/media/i2c/tda1997x.c index 3021913..33d7fcf 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 = { - .probe = tda1997x_codec_probe, - .remove = tda1997x_codec_remove, - .reg_word_size = sizeof(u16), +static struct snd_soc_component_driver tda1997x_codec_driver = { + .probe = tda1997x_codec_probe, + .remove = tda1997x_codec_remove, + .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); }