Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp837107pxb; Thu, 17 Feb 2022 16:11:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJw3okKLUbTYYYTWACRYdnSZPeQYrS7ngCxuMIZtk2GHDaaWFxN7SP7LoSCNnqY4jfekQL49 X-Received: by 2002:a63:6782:0:b0:342:7457:69a4 with SMTP id b124-20020a636782000000b00342745769a4mr4227226pgc.410.1645143119172; Thu, 17 Feb 2022 16:11:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645143119; cv=none; d=google.com; s=arc-20160816; b=Swzx9ijk2mjswlajjPs7PISwrDFGB/UiW1O7VshEQ17FGACLCZUFf3f3sxdhWcJXaa 169HFRkgeXYVYUTJKBMFjYREwpKbfYi2VONxKWsMrsHqL8OXL/swwFqamoX4cI0Jts1d TUoBBDC+3t8AilSjXF0Fv2M13yFWqd4d3Y3pyTts9KU35gesED4E/Io23Ppm5w68IZ6B cms50Ss53dCAVLdKCTQt3AuSWdyYHcNxY7APSdfGb8Oc/Ldg2FYVNEDFiOPF5B1YdId+ UPZyYdH1lkPxEgR9hRs+ZJknOd7KHsg7KWVLK340+KcNH+hid972rkj64Vw10XCq9O0s nSyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=hbRL+GXRFDweLRaYt0Z5YOa4T9eSAOcGOHkpzVK4Cn4=; b=nu0AhChQOY5mo62B6pZ97PTmGAK4XMnS7o3Z0V/ImvDNT4TxBBhGG0Eudf685hmcyv 75jO7pXSg48cwTdSCffkRFfkCMwPp4FdhLJnaEw+5xEqX9YMM7mdnrq2ISOM7+4UjQ4e fQ+WYMutX+bTgYIEOzhK15LPocW/8gARpnB/aMMhna+Lpx1PaKygrMlEDMzDpzcPzMIj Y/tSRcW0u9JUjYOlMsJS3CrhhwRfoMtjNDAX5gS1mGwY6hVtup0ftOTa1igZRoCDwzIH vbD46PU/KF75NcqmsoyyetrCMUOaidkTtdmYy487l6sWM5DBNUpmGM6NZwSw6ht/P5VH OCwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b="Isa/yu2W"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id oc18si2325941pjb.135.2022.02.17.16.11.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 16:11:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b="Isa/yu2W"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 024D9342E9F; Thu, 17 Feb 2022 15:37:33 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240540AbiBQMwU (ORCPT + 99 others); Thu, 17 Feb 2022 07:52:20 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:59120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240554AbiBQMwS (ORCPT ); Thu, 17 Feb 2022 07:52:18 -0500 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DF9711A30; Thu, 17 Feb 2022 04:52:03 -0800 (PST) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 21HCNFEV030051; Thu, 17 Feb 2022 06:51:52 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=PODMain02222019; bh=hbRL+GXRFDweLRaYt0Z5YOa4T9eSAOcGOHkpzVK4Cn4=; b=Isa/yu2W8XnNGKd+4kFtY2O7KAfNckBrerQ+EWIDJTc8NfO7sIgvTUjrO3lUQTNFPKL9 P5wKX8+ECBmE9L+a/ZcNhv0hQdNK/I/xK/69zOkxXI1BWj+xHB3EK9PutC835YRqj6OO RUevkZAWVNeqT4fuuTW//FItD7Q/4v8stE/Vosw+JViyX/RvSKxJyKx7FO84AeFrU4lE DbU7t59cHeeVqu7NhCFGbffUvRhwpkTLuxVKtmtRKicL3W52GKrM8B1C7k1tc7bpODdP 0KT/R2Ydc1VCd/1OeGDcSqX/o/u9/UlPjPdwxiORA2dsDvszToWPogFoIk+SXGFzXS0w tA== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3e8nyda699-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 17 Feb 2022 06:51:52 -0600 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Thu, 17 Feb 2022 12:51:51 +0000 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.2375.18 via Frontend Transport; Thu, 17 Feb 2022 12:51:51 +0000 Received: from [10.0.2.15] (AUSNPC0LSNW1.ad.cirrus.com [198.61.64.199]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id AE88146B; Thu, 17 Feb 2022 12:51:50 +0000 (UTC) Subject: Re: [PATCH 2/2] ASoC: audio_graph_card2: Add support for variable slot widths To: Kuninori Morimoto CC: , , , , , References: <20220216171408.265605-1-rf@opensource.cirrus.com> <20220216171408.265605-3-rf@opensource.cirrus.com> <87a6eq49yq.wl-kuninori.morimoto.gx@renesas.com> From: Richard Fitzgerald Message-ID: <0ba5f63c-44a4-1949-60dd-f5debd706caa@opensource.cirrus.com> Date: Thu, 17 Feb 2022 12:51:50 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <87a6eq49yq.wl-kuninori.morimoto.gx@renesas.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: COEC_n5rfu52TJYRPUMDIj3hJP3bf618 X-Proofpoint-ORIG-GUID: COEC_n5rfu52TJYRPUMDIj3hJP3bf618 X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17/02/2022 00:23, Kuninori Morimoto wrote: > > Hi Richard > > Thank you for your patch. > One comment from me. > >> struct asoc_simple_dai { >> const char *name; >> unsigned int sysclk; >> @@ -26,6 +31,9 @@ struct asoc_simple_dai { >> unsigned int rx_slot_mask; >> struct clk *clk; >> bool clk_fixed; >> + struct asoc_simple_tdm_width_map *tdm_width_map; >> + int n_tdm_widths; >> + struct snd_soc_dai *dai; >> }; > (snip) (snip) > (snip) >> @@ -386,6 +479,8 @@ static int asoc_simple_init_dai(struct snd_soc_dai *dai, >> if (!simple_dai) >> return 0; >> >> + simple_dai->dai = dai; > > Indeed the relationship between asoc_simple_dai and snd_soc_dai are > very mystery, and current utils is using confusable naming. > We want to have some better solution about there. > > Having snd_soc_dai pointer inside asoc_simple_dai itself is not bad idea. > But we can get snd_soc_dai pointer without it. > > Please check asoc_simple_dai_init(). > Not tested, but we can replace the code like this ? > > => struct snd_soc_dai *dai; > > for_each_prop_dai_codec(props, i, pdai) { > => dai = asoc_rtd_to_codec(rtd, i); > ret = asoc_simple_set_tdm(dai, pdai, params); > if (ret < 0) > return ret; > } > > I first thought about doing it like that. But I was not sure whether it is safe to assume [i] is the same entry for both arrays. If it is ok, then I can use that and do not need to add the snd_soc_dai * to struct asoc_simple_dai. I will look at this and send a V2 set if it is ok.