Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5060056rwd; Tue, 23 May 2023 17:41:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7L8EW01OtLCu9QZSU/3rRZuBlGOQ9OUZENTbRlomJICgv2Rb+j6DYBcpdkgezSXO525NJl X-Received: by 2002:a17:90b:1e05:b0:253:6b3a:ab1e with SMTP id pg5-20020a17090b1e0500b002536b3aab1emr19548087pjb.6.1684888883046; Tue, 23 May 2023 17:41:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684888883; cv=pass; d=google.com; s=arc-20160816; b=ZirUKw1Cx0VJ+gl6whfK1yC6CnA0+6xElBoBc+kVIREhssfzqNjvPCMQUwcM4VhWX6 i6IHDAPC1DT8lwtCPJYIQtZeliJXZWHu9e2zhyubWvITpeD0TaaXhfudS02EsQTyqF0f ZJunkhRyOqK5L1AFig6YIHHdium9yR/cQuKv66KLpMdiZYh4B7uUodb7DDR5W89Lc48h lF/k9BDH4/wIjil5E9F7s47HVscjzjOE5KfIZmcjcQydUnFy5V+gbFBo7ZJ1Zg89Vsp7 u3SvmzA2M1HRpW8ik7J9aGd86EYfA/UOTz0Iu/BmHQC4lpDry0gmx54iZ+MrE1fWwhzl 9euw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:date:user-agent:references :in-reply-to:subject:cc:to:from:message-id:dkim-signature; bh=9+a1fXH/jM+Re5JmujYU2n2F7xJ54XXaHswvz9ean8Q=; b=v5HDiOZ0HylwIkyQSmM7vrzoXBt1366vrPhLEOzjKKkCh0410udgMBevOarw8miD7b fLutrC604ZjE0Fp7nFfJFA+Up/KNUlQDFh5GAZ3iwQlAovL+UYcpCjvKULpBTwG9zXK6 uaXbimxjzhBcJORkf/xlVwH5nmycG5IQqzc2wekTT9HOWaHpHo/PhI46nH96Gpr+oaUS LMoYvmLanfs6AZ9XqXm9oaI/+wIi0INqY7i3y5TazJS0axlIJ0i5ConLE+QewUjaineP 6+nluja5qoxdZkLm4CVhcFyv82FJ6yVdiJh4gvJNNFK+/UWJKs9NCWLXN/4xz1fOdRul LXuw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@renesas.com header.s=selector1 header.b=W8DrO472; arc=pass (i=1 spf=pass spfdomain=renesas.com dkim=pass dkdomain=renesas.com dmarc=pass fromdomain=renesas.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=renesas.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c14-20020a17090a8d0e00b00255bc974374si264996pjo.167.2023.05.23.17.41.09; Tue, 23 May 2023 17:41:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@renesas.com header.s=selector1 header.b=W8DrO472; arc=pass (i=1 spf=pass spfdomain=renesas.com dkim=pass dkdomain=renesas.com dmarc=pass fromdomain=renesas.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=renesas.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238983AbjEXAJL (ORCPT + 99 others); Tue, 23 May 2023 20:09:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238963AbjEXAJJ (ORCPT ); Tue, 23 May 2023 20:09:09 -0400 Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on2112.outbound.protection.outlook.com [40.107.114.112]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A1DF1A7; Tue, 23 May 2023 17:08:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AEW4e1XJdvH6T9DVfBmXhJV93fEyJmP8omLgX6DUjk5+sf5bv8Tw65qz198RBFV00amxGTRlE3jTSZ+CIgx31zDVep4dp8NnFXstK9FEY9FHImfY/MHyOtpYag6k/xI/pFNqYwoNx4ZlKoGUvkMd5V9FMdN4RFiKSxP/AYpnDnyxWH6fdQoasVKwDF9y5ZqJt+I+Ptz9g3stfceInN7ATSboEHK1yLLWO4bPIR+jSiDDEFANxAL3Q+HA3fEHrJ8UI//0FCDBNbmGr3So/ZFL+fTuTVtm6qDC6NtL19kQAP2bTKOM3G8TdNQGoa6ok/WmyLRFveeedkKUS1I2OKZJuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9+a1fXH/jM+Re5JmujYU2n2F7xJ54XXaHswvz9ean8Q=; b=i0O+F1+SBQl4oUMocRmv0vAPb06Q8aPS5srx1KPjvYQwVfvOj51jr10FEbedDXBywfOuoUB+icHlwozPXrpJAtTX3RHZKnv43TR7K+wKPxNJzVYY2pGJb+3TYshSnPZAaB6t1HEH2JHj5mPSCI9AUlu92o9zDwdTW8MCqr5AeW19KjO0DGmImCDcElH0pA4sIi49E710nbq/pakxTPjSy0rYBxnMufPUGMP6/4EO/oWgJubxTzlDtQlbL9KlBWRBUh/TpTwRMJJKOr5GMYqR9phlK1sbDed8DuxsgPQbOn/Mx9G9YUasYeOHDum0p/YxzHedq+iNDW2YSXRZFPx3OQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9+a1fXH/jM+Re5JmujYU2n2F7xJ54XXaHswvz9ean8Q=; b=W8DrO472UyzDwNI+0bSKUSWz5bwUKZ8iPQwpLDrpMqEtbulPg0TcOv9cE+zXK/Q2hEYO8R72aoh5XqORC2b9jmpnZOTnV9jhozO/YvQsjh3kThf7d/dAmg4m+BWS83d+AKEAJt4M/w0z3PxxtSwHqFYUvcfUDGrvMjc7+/G6DyM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYWPR01MB9662.jpnprd01.prod.outlook.com (2603:1096:400:230::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.14; Wed, 24 May 2023 00:08:50 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::91e7:a94f:9f75:d840]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::91e7:a94f:9f75:d840%6]) with mapi id 15.20.6433.015; Wed, 24 May 2023 00:08:50 +0000 Message-ID: <87mt1u7fql.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Herve Codina Cc: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonathan Cameron , Lars-Peter Clausen , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, Christophe Leroy , Thomas Petazzoni Subject: Re: [PATCH v2 9/9] ASoC: simple-card: Handle additional devices In-Reply-To: <20230523151223.109551-10-herve.codina@bootlin.com> References: <20230523151223.109551-1-herve.codina@bootlin.com> <20230523151223.109551-10-herve.codina@bootlin.com> User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 Content-Type: text/plain; charset=US-ASCII Date: Wed, 24 May 2023 00:08:50 +0000 X-ClientProxiedBy: TYAPR01CA0127.jpnprd01.prod.outlook.com (2603:1096:404:2d::19) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYWPR01MB9662:EE_ X-MS-Office365-Filtering-Correlation-Id: 5dc2cd7b-2052-4e69-293d-08db5beb0da3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tNI+sB0Iim8rRqr+WTtVWYFtZvGsOLN43j9aswC8X8+UI/cqUOlbx/iBoBqGC52d0Z3Cfyt9UNjjtLn0+IaR0PjdDOyOKXlsNBzEH4Hkq0ljLwLjmLYsXFb0z+wVEnlFu8judAxI0ZBM488edGwGpbpovmUqw0gvfJeCxufDb0xa8Wv5yEy6fBF8jvTVcRZrHntwM+5Iwx3pWvqnkeUolUHCmKzchtKb2Z8AJpPTdcB2HeLCVSl7zjr0zFwQDDwni9CxzM402GJ7NWDmPji9jn0hyCx9D4mVxw1XB7j13YznURajJtslBloLVcEtOSaA+4ESn7rBgbK3H2o4+zjYNXEjMQCSf2o3DbzH5t0xqyE4LSWvPnHlDI6WRC//geSJ3IdjblxrmCYz9+U5saxR3Ak9/PzvzFVQXLLeKxNCjLiBus2mrmtGQ8DI1PYxTFIRAXMtvMV4j9SeDyixEm7lKtDJw49yZE9bciH8Sr7V10mvqddiwmePM0Qc9Ex3V8vUBEpt+7gxX1PFLQhbj+BowZFvKQN66NC7l1Rkv4vxqCA9/wQ5hlFZMtuxQyfy/9RfR2TT/m1ixEyUrcUH6123pqe+OSk5uR+Wza5KjzLBTgI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS3PR01MB8426.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(39860400002)(346002)(396003)(136003)(376002)(451199021)(7416002)(8936002)(8676002)(5660300002)(83380400001)(186003)(6512007)(26005)(2616005)(6506007)(86362001)(38350700002)(38100700002)(6486002)(478600001)(66476007)(52116002)(6916009)(966005)(4326008)(66556008)(66946007)(36756003)(54906003)(41300700001)(316002)(2906002)(66899021);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?XnSTsSsIYS1Vy1mxjgx1D7+1muwRLljFdqYY9c51C5Cdn/TCHTLWL0R7yydO?= =?us-ascii?Q?MjIGyj73TcQD1wTDxvuuqcOqy/x3FLesUK07AZLzQuD+yFFOQaHaWxBPGhgG?= =?us-ascii?Q?MmpbBm1Nz5r6eO71UMORzzMa92eTWGdAazP0kvc0ZbqIobGrdPK/3NFQswXZ?= =?us-ascii?Q?zx1JQd8uTK7H1O+Xsm8Z10l79qpWvwmcSfDtCMrfVrSqVYpyOv2ocVi98DYc?= =?us-ascii?Q?t6YOiRhJ4ffx2z4HzTDqx1Dj9uQBJVfPO0VPpiPEqE9pArz53vFGRJtcYWsi?= =?us-ascii?Q?FUAUqQItS1MNFAZE4lhvaGMhzTqSF6wiTWK9ZtmYDr5VoVoLPGh95kMkzSOY?= =?us-ascii?Q?HX6Kxwx9+gyzlJ5B6Jb56GcW++SoWnJ/d4tfY1+di+Vjwa2mZP6OL5f+TARD?= =?us-ascii?Q?7s4ZYUSxkKO+3hoR83r4c05S6ErH9tsagbEysxbDrJHTQhT0o+t2vNZjIXzI?= =?us-ascii?Q?XcvW0ObuCdTjv7DVmugCEvXqVlRJGWMd82Kzd6A4NtqOzbQVddN/Jf+694Cf?= =?us-ascii?Q?sr72dKEt/pll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qF6PEHHSAuhkc?= =?us-ascii?Q?ZagQx6GkqWJssWpsCAAtkJfkJRhGDVIPMm68eVOftqKy//9bphecs2VCfzYv?= =?us-ascii?Q?1D4bkm1SZovI6nrkQQwW1ZuYPiDkiXWgQwi4DRzna1rQviW4lmovBtjU5P8E?= =?us-ascii?Q?A5DwHvyn6EU9IHa2eWtzZfOOoODzqSLzFOl2eoh6lTR+t7v4q2yqD5MUW/1A?= =?us-ascii?Q?eDp+5dxmtAR8GgwiuEv5pRc=3D?= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5dc2cd7b-2052-4e69-293d-08db5beb0da3 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2023 00:08:50.8285 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: dTjhNs5BjB7ttYIzNXRFDc/p/0AZ1euRrC+MJTkVRvOT17t4uS5nSqzIGeXgikttcsMQ1EqUgnBxAleLX22Hk9bSDBrriHR1weduwg3x6Q9zu5jWnNWivXstWlgMi7Z+ X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB9662 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham 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 Hi > An additional-devs subnode can be present in the simple-card top node. > This subnode is used to declared some "virtual" additional devices. > > Create related devices from this subnode and avoid this subnode presence > to interfere with the already supported subnodes analysis. > > Signed-off-by: Herve Codina > --- simple-card is used in many boards, but is old. Adding new feature on audio-graph-card/audio-graph-card2 instead of simple-card is my ideal, but it is OK. simple-card is possible to handle multiple DAI links by using "dai-link" node on 1 Sound Card. see https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/sound/simple-card.yaml?h=v6.4-rc3#n294 Is this "additional-devs" available only one per 1 Card ? If it is possible to use 1 additional-devs per 1 DAI link, I think this patch want to care "dai-link". Or adding temporally NOTE or FIXME message like /* NOTE: it doesn't support dai-link so far */ is good idea. > static int asoc_simple_probe(struct platform_device *pdev) > { > struct asoc_simple_priv *priv; > @@ -688,6 +731,11 @@ static int asoc_simple_probe(struct platform_device *pdev) > return ret; > > if (np && of_device_is_available(np)) { > + ret = simple_populate_aux(priv); > + if (ret < 0) { > + dev_err_probe(dev, ret, "populate aux error\n"); > + goto err; > + } > > ret = simple_parse_of(priv, li); > if (ret < 0) { > -- > 2.40.1 > Calling simple_populate_aux() before calling simple_parse_of() is possible, but looks strange for me. see below > diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c > index 5a5e4ecd0f61..4992ab433d6a 100644 > --- a/sound/soc/generic/simple-card.c > +++ b/sound/soc/generic/simple-card.c (snip) > @@ -359,6 +360,8 @@ static int __simple_for_each_link(struct asoc_simple_priv *priv, > is_top = 1; > } > > + add_devs = of_get_child_by_name(top, PREFIX "additional-devs"); I think better position to call simple_populate_aux() is here. But __simple_for_each_link() will be called multiple times for CPU and for Codec. So maybe you want to calling it under CPU turn. /* NOTE: it doesn't support dai-link so far */ add_devs = of_get_child_by_name(top, PREFIX "additional-devs"); if (add_devs && li->cpu) { ret = simple_populate_aux(priv); ... } Thank you for your help !! Best regards --- Kuninori Morimoto