From patchwork Thu Feb 18 08:17:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 8347181 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-renesas-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9559D9F38B for ; Thu, 18 Feb 2016 08:17:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E424620386 for ; Thu, 18 Feb 2016 08:17:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 27F6F20384 for ; Thu, 18 Feb 2016 08:17:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425114AbcBRIR5 (ORCPT ); Thu, 18 Feb 2016 03:17:57 -0500 Received: from relmlor4.renesas.com ([210.160.252.174]:48943 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1425120AbcBRIR4 (ORCPT ); Thu, 18 Feb 2016 03:17:56 -0500 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie3.idc.renesas.com with ESMTP; 18 Feb 2016 17:17:54 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id E77B648E2A; Thu, 18 Feb 2016 17:17:54 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id D721A1806F; Thu, 18 Feb 2016 17:17:54 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id C83941800A; Thu, 18 Feb 2016 17:17:54 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac3.idc.renesas.com with ESMTP id TAF09524; Thu, 18 Feb 2016 17:17:54 +0900 X-IronPort-AV: E=Sophos;i="5.22,464,1449500400"; d="scan'";a="204626237" Received: from mail-sg2apc01lp0244.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.244]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 18 Feb 2016 17:17:53 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=mH95wSgRYw3V6imULFJN50aRccoViPI2CCXI2GRynwI=; b=DDJl289fQQWbZ2yPxj5jrCRg2rFITtSvO4H3/3XpNAgvSSNfKFgEn9ke8sBYWzImHgtKhfsYy9HNA+L6U9jiUMQUk1skrcBOTqxml+hdwrAKzc0VOPCUUpnrvF6IuaKsa+hmlaq07675v5Jtr6mEaD47NKKiGV7I9UwjDOIgP3c= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.144) by HKXPR06MB1014.apcprd06.prod.outlook.com (10.161.178.156) with Microsoft SMTP Server (TLS) id 15.1.409.15; Thu, 18 Feb 2016 08:17:52 +0000 Message-ID: <87h9h6tozy.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 08/11] ASoC: rsnd: Parent SSI attach is not needed if not clock master User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown CC: Linux-ALSA , Liam Girdwood , Simon , In-Reply-To: <87si0qtp8x.wl%kuninori.morimoto.gx@renesas.com> References: <87si0qtp8x.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Thu, 18 Feb 2016 08:17:52 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS2PR01CA0049.jpnprd01.prod.outlook.com (25.164.161.159) To HKXPR06MB1014.apcprd06.prod.outlook.com (25.161.178.156) X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1014; 2:0sQ786lg3Nq7tHg+sOrEvRCxINckY+mF6eqrhjnrw5Za2a1CrQLM97r6pv1rqPd64MCjHF/XDF+faiAzRKsOmSJLtqutjfSHH9WZoCvTq75qnaBhtsF1If7BLf4t4PxWQNZa7om830CmBdK7swPktQ==; 3:tlNtMZVa/2INxhhh3IIcvMCsxE3Q5uKlMebqkDyf1NpgbRPN1iS0V/NgSfT3v+iE+Ml63tFcA3ax1HiTKyb/vI/YTOreTW/iOVgmKXr6RAu2mCpql0+0QU7hzdlzYXTK; 25:MpS40ILB07t8ppWNjxnPYETRxt97qkRELL9PSIAokLg7pFhzNA/uSQC0OmydibyzHyCxGwUjwlH2IPH7YdcIDbs+ULtNWycz4c9ac6+TZCSZvgNMw1Obz+B1JxoqTaEgyiAQ4o4B0/3P5bjkuOdUlw3dfbs+7LaD+t4JHUp55/Pb8TCh5IoxyOCibLYGHNjloC8AX5e6SPTG9a2mmp0QrGNEVSLGS9LOz2Mi1Agoamju5aO/jHJU68ly4Yx/P1uluHQr+fMomQYZSCM3k+B3nvWm741vK8nj0wAKdE8c7DnnXVODo7OFCP8SIe8OWi1C X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HKXPR06MB1014; X-MS-Office365-Filtering-Correlation-Id: 315e10eb-a258-47ae-8ce0-08d3383bff40 X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1014; 20:ATXK74lRlh4mjLtMzU7qw62X53dBgxLPNLKgKKU1OGoAujj/+Ob2CkoCLUJWPSVkb2TllExBKYVVIMVzcBSbBR9sEqeoF59y09+xRqc0Ozq2wZGvtydZ8z+ZTZob1ZQPdnlMsGWfGPe/Fwyq6MQjhVMBCDMp4wSMY408vLSP6Su8uKkasHyyjSsoU3yVxwYMiJMW+BfvuRARO6JB95IBkvp032brPDbCwNb7KrQqw4C5HXtjbm4kQTzOZN6XAC5x/TfpZeCdqkcWaakekzNXLz4f4FnOvK4/NDprZyLIHvzY2KnergHW1nmvoWTKuApjpwFAureYpnywGgh4r6AtkItvK1aORMTp/hyvVCe8vQmqNcOy7uTh6Rrtm2LPbjDNZWECBfuRNnbDCtylGB23kYb6hEtpJEYcNVebsD8lVfoKZw1zrk0SkResnjvnUngNp2gCJLQ4cOVAK91zmvO4vHiaJSaevWAimMQ9Jt1Dos1lCPqYbm3nrFjd0X2kMaE9; 4:eqEb8l0R5gYyWf/vsC8Rg8sUUZu84BqxZBxH58oZlkLsUvnjkML/SEiaIvn7834OPTtc3/WeIpGX+jxlDaFDZorg4/t6XZ/qDqbYaLBrI0A4ogXPx+psTJf1NoLY3O+OXUnv6THH787/7KLQ9VyTxZSiHt5sx5ZrS8JoE29xvVxzbepVwmwDYqNi+vP5vt/DH7Wfg1YAYDhshoKH+y++gXZDjHTKFTNYDo6r97FiTz8dCQwPI9KZ8cDl9V/29RqnZR7WtRyUMYmN80OeDb2DkCvLv0wCTrGweO9r/V9MgntpsVQ0vcpg1BQClLHMtZJG9ZqNvC6WxOXl8G6COwkQUvKIdl/W9xljw+FF3n8DgXRLxInVAEqOLNb6KtLrDOcV X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:HKXPR06MB1014; BCL:0; PCL:0; RULEID:; SRVR:HKXPR06MB1014; X-Forefront-PRVS: 085634EFF4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(586003)(3846002)(53416004)(76176999)(50986999)(50466002)(189998001)(92566002)(5890100001)(575784001)(4326007)(5004730100002)(46406003)(5001960100002)(122386002)(77096005)(2906002)(40100003)(2950100001)(86362001)(33646002)(110136002)(42186005)(19580405001)(36756003)(19580395003)(83506001)(47776003)(5008740100001)(1096002)(4001350100001)(229853001)(23726003)(87976001); DIR:OUT; SFP:1102; SCL:1; SRVR:HKXPR06MB1014; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HKXPR06MB1014; 23:JnnH5k2feHCUVqy1wL1K040JZjMJD7aSIV/gmiFHJ?= =?us-ascii?Q?EIfpzLWrA6xKt3ny37RpYxdnZM4bujdVr/pgtZFGxI5z6HLH6O1Pm4p8A20F?= =?us-ascii?Q?/BN+FZjOqTkzbh2bnMEAtZXoRYfO9iFBeUHaCmGuwgZiMVZZewTmjHkN4Rys?= =?us-ascii?Q?PZpUtMZIE54Dy44KlvU/Am0AT7+UHk9Bymn2xUEmuP5VH8M525JEVlMKxk/l?= =?us-ascii?Q?98J89WZ9y3rz/kEZRl9GHADOTCmeaGIBa033iXbaZe/s0kl3iopiUm9jjBdg?= =?us-ascii?Q?lNKJdhBaJRIepM3tOgL7ANXPOA0gARx7ygjw8M1XD41DhQRtyBKApAeO5msK?= =?us-ascii?Q?xMZ/C1Jaef/XMREJ6reUP8VyFelBKmOOgPBn3UPXTGRPA7i+RYWb3Cv4/vGv?= =?us-ascii?Q?8qssltARsQMMKUQl2bmv7xan+u969fFPoLt0VCeHc5wVktubdCBHFBklTHvv?= =?us-ascii?Q?pl3HELxSahf5B5SAgejyooau1eenvpjwB7lgnNCza2CHh6H+zcGQj771Dl+K?= =?us-ascii?Q?JDmCMw7uvMms3nABZnPS0df5t2DkXknV1v7bzVPGs6DlO7yOnDg+uDjvPqmV?= =?us-ascii?Q?fDVjUS+HpqCvlanHGianEbqlSseuBX13FJl7lfLWqrF2RBBVVNQe4WH3T+Ck?= =?us-ascii?Q?zhJx4Hcj2kw/AJk1cBj/A/gWzFJoGYObYKUCDtKp7jrJ3XV9RZ1hpE101fjo?= =?us-ascii?Q?l64Yt85GHkUGSEVXPsVi8yERmdeTDx3kLPeb9SiK5LIeHONh2xLFrEvuOIYL?= =?us-ascii?Q?eSUSNQXeTCuM8VVTGjSDGQrlgOoKYx/RAKwOpO/TNDNsyk2ovOStouUA2g+G?= =?us-ascii?Q?P/1LETsE0vQlzKLlbU6qD1cQGLonsSownT/qtJZJr9YoBXwvUWXrqDvk6p33?= =?us-ascii?Q?1zPwxfbdFirV8qQuMx/dc0fOqgVM0Tqu3A4X6pV3BdGklpird7aeYTFSNnHd?= =?us-ascii?Q?wNtoS3DpeRH+3cljmF5xARzpCTLpZJejXBf+EN6uYsY09vJkjmurKTTsBW5y?= =?us-ascii?Q?jg=3D?= X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB1014; 5:jqqxE+4aOAgh+Z383G4qLFtPh8FqhOIj8VTDTUm+TgaHdoztR1NzHsmZcXDOTrtA5fwwqnubxg0RqQibKPVLPUEuzzsLhBFk+YgO6piP9+jaVkAsA72o8vyJ1qnS0AcnG/ZlBKi0tR9e1m6I0v5rGQ==; 24:cOMI6JwJedGzldCcKGoW1yAnwjfGuo6VYnaSkfsi/16Ie+Mf07yNyls/RMdgo/TELYrwfxN8Bag/ppD0vpc+xEPxR0W7z3b+X+KOd8Yp9rA=; 20:x4ZGAbaS+mdZQofS1mxtaM3og0vkTpmHAwShvpwAmrBl7MZi2FF+VQcXJp1EDxTGYmwmu2A5KBvdeCPuSMyqQsSLXTNsOZgLLHYLz+TpZh6Tit6lkZEsHUw1XJL/j/3YI4B/NxwpNeIGq7jjZOsrRgdGfJX+WI1uXPN7MCCvOe0= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Feb 2016 08:17:52.0549 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKXPR06MB1014 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto Parent SSI is needed if it is PIN sharing and clock master, otherwise, not needed. But, whether clockk master is judged on .set_fmt, thus, it can't call rsnd_ssi_parent_attach() on .probe. Now, .pcm_new will be called after .set_fmt, so this patch reuses it at this point. Signed-off-by: Kuninori Morimoto --- sound/soc/sh/rcar/ssi.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index 1205872..b5c6f0c 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -545,12 +545,17 @@ static irqreturn_t rsnd_ssi_interrupt(int irq, void *data) * SSI PIO */ static void rsnd_ssi_parent_attach(struct rsnd_mod *mod, - struct rsnd_dai_stream *io, - struct rsnd_priv *priv) + struct rsnd_dai_stream *io) { + struct rsnd_dai *rdai = rsnd_io_to_rdai(io); + struct rsnd_priv *priv = rsnd_mod_to_priv(mod); + if (!__rsnd_ssi_is_pin_sharing(mod)) return; + if (!rsnd_rdai_is_clk_master(rdai)) + return; + switch (rsnd_mod_id(mod)) { case 1: case 2: @@ -565,6 +570,20 @@ static void rsnd_ssi_parent_attach(struct rsnd_mod *mod, } } +static int rsnd_ssi_pcm_new(struct rsnd_mod *mod, + struct rsnd_dai_stream *io, + struct snd_soc_pcm_runtime *rtd) +{ + /* + * rsnd_rdai_is_clk_master() will be enabled after set_fmt, + * and, pcm_new will be called after it. + * This function reuse pcm_new at this point. + */ + rsnd_ssi_parent_attach(mod, io); + + return 0; +} + static int rsnd_ssi_common_probe(struct rsnd_mod *mod, struct rsnd_dai_stream *io, struct rsnd_priv *priv) @@ -580,7 +599,10 @@ static int rsnd_ssi_common_probe(struct rsnd_mod *mod, if (rsnd_ssi_is_multi_slave(mod, io)) return 0; - rsnd_ssi_parent_attach(mod, io, priv); + /* + * It can't judge ssi parent at this point + * see rsnd_ssi_pcm_new() + */ ret = rsnd_ssiu_attach(io, mod); if (ret < 0) @@ -602,6 +624,7 @@ static struct rsnd_mod_ops rsnd_ssi_pio_ops = { .start = rsnd_ssi_start, .stop = rsnd_ssi_stop, .irq = rsnd_ssi_irq, + .pcm_new = rsnd_ssi_pcm_new, .hw_params = rsnd_ssi_hw_params, }; @@ -691,6 +714,7 @@ static struct rsnd_mod_ops rsnd_ssi_dma_ops = { .start = rsnd_ssi_start, .stop = rsnd_ssi_stop, .irq = rsnd_ssi_irq, + .pcm_new = rsnd_ssi_pcm_new, .fallback = rsnd_ssi_fallback, .hw_params = rsnd_ssi_hw_params, };