From patchwork Tue Aug 6 04:58:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13754403 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011038.outbound.protection.outlook.com [52.101.125.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D51BA35; Tue, 6 Aug 2024 04:58:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.38 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722920306; cv=fail; b=QLyQfVmFFTFRKfR/xcv8Q+ClA2q6mj7REE9QopK2nWio7poiTAzBH2j8svNb0nr9ny2RCprt4l4gdd5UF6Ru0Ti+xXgYYkA0zodGTNCjdk4NTc2mTOdbshfrDHLCG/F6GLRFobP7FCRptrbUR1yBvZqRyD6HjaZmt8VGDVc8F/w= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722920306; c=relaxed/simple; bh=wgKCQoCCQK9LvzMaEq/RknIDe6lX8u502wjLwmzn6S8=; h=Message-ID:To:Content-Type:From:Subject:In-Reply-To:References: Date:MIME-Version; b=n4iFDHAeH6F5i9p8BlwNaFZjpq6a4hDK2vSwYKrjC2f05F4F+dCrLTk3VGnfsmn21sKKR6IygbbWl53ReuxQN3HJtBML3DOgPAKr7sotkkyHkkUulnVp2nJ4EBMWjPqj0pJJ9faSmuUw+WMa7tMj9yOJn4bKRYmpVLZUWksNQ9o= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=NO2+0XIQ; arc=fail smtp.client-ip=52.101.125.38 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="NO2+0XIQ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PnexMjVng8HVxgZiUrYKnJdyPkC3lOaV+yBtUvYtwMQ5wtGd8QzDLzo3I4N2HsKp2FxF7a9Jyb61NtDSmM+hkB5EoSraRp+F4+htwWEkUYuM/oo68ccWeWOu1hdV9Qn6GQyvDyx1fwpPH0ccCWU+t6g+nPD2uIUPw12TvA2XEI3v1A7USQJMGGny7+ODYNJB/GRCcfAFykmvDqiQxN+P32oGFOpxSLhz23V49LJlHGSgHwsMyuhf3MbJkqmqb2HhwzAdaZg3wZJUiQfjbbAJTiMRRjTkB4Tgg2mFQZuEff9ZvS4GLBg/bsYemo7hRAZhrQqkx+rt0qDchvZzCGwxLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=/ePXdTA+EB3d7vLEAvRAo9e1gOVehdylHGSLVMS6Dik=; b=pU8gGLFVcU0CuhOKuEUK48XlGxpZXLDinwc0EeueWSUcUCpUwMs1co3sF2HI2YLr5jJhAjVAWo2iEkp9mdSdBEtfnwjmFV89FQmOIPYIOf4hlH1p4xIJex/GCiSZH3z1cEwbiywHSN9wVCNp5acjkcHbhdA73D2fggNArs/EKq2u+c674HxrXQfQLskaftNqGIKNCJ3vdE9a5gAV6NqnjQCSYhrtGWgHU29u6pVU1d5EjNFBVV7n9mXom0bjdJyBgvymsNYWBcpaV+o5FmDfAnB5vyKs/ajkPci1a8WHFx+5V4ZKM1hjYuisx3spQp+ZAXo1tFLmxuQM3LBnKf0w4Q== 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=/ePXdTA+EB3d7vLEAvRAo9e1gOVehdylHGSLVMS6Dik=; b=NO2+0XIQYKu557XK/m8Ekkzhm4Sf4nViWxoyIUrJgKOJjg8ywq3WhkesS1AmQlemwCkXqcmmSc5OtZ7eb/sPpYkOBJyyAFhQB939vuCiNve/IN6+gEhKM11g0PKhA1mlAw7i5YwcCtgELzvzkI9qE5X5mGfQs92B3YZOS6VFfYc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYWPR01MB10409.jpnprd01.prod.outlook.com (2603:1096:400:24d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.24; Tue, 6 Aug 2024 04:58:19 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7828.023; Tue, 6 Aug 2024 04:58:19 +0000 Message-ID: <87le1aw8lw.wl-kuninori.morimoto.gx@renesas.com> To: Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , , , , , , , , Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , , , , , , , From: Kuninori Morimoto Subject: [PATCH 1/9] of: property: add of_graph_get_next_port() In-Reply-To: <87mslqw8mj.wl-kuninori.morimoto.gx@renesas.com> References: <87mslqw8mj.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 6 Aug 2024 04:58:19 +0000 X-ClientProxiedBy: TYCP301CA0029.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:381::15) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYWPR01MB10409:EE_ X-MS-Office365-Filtering-Correlation-Id: 8aec0ea6-261f-4bcd-ce22-08dcb5d4641b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|366016|376014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: p51tJ97sEnOj3jZ0jt1v3uQKGE8eIUQkvrTGeAwSn/iHFW7Ap9tfQ7tx9FsdQ4xXc9UaFbBNfFIIV3b6XwpiorobjfcdxZSVZhXSlzZDXr1d+wdCz5GdCw4IiTqFs+1tkSoZIhWriOnW+lhmZktD6kXipFrhLLb/UZ5NewmBDXxoxJybwxRYudgra4p5iCm5TUAHsXM/QUm3yfYllOnwIAq7oaB+o8Qfjb177xvCu4rk63NuB8UrKh52lSAV0He/QWt6uDm6ccipkQ/rDrpW/n9WYn3m+u9kAdEGJIuvWl09kIJ9RkXIVMSPfR9V//Aok4cpU/pH/GiHu1iTRgQaIygZW2VVAfj6K+YQ/++sz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l+lHjO/E= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(366016)(376014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6zpliLo/KM5jO2OWopwU+ZoYmh5GvE5+VCZ9HNcgdLDAnrXs9QsyJs+NI+xMe5RIJ5Txa3GlGLtGfjpAX1pSn6J75Si0M0si7gdN27Y00CLphmcDxszZn/kGqPqI8bzpHudh3sy7xlTHp5Kq8C8u0MyhcYjTSj3csnYfLHo59Y8eKZxItGVlG2Gtzbzc7Mn8MOl73BfdZC0QZcoUxKsL1QNrxtCkVXde3dm5/ZEt6eoTOoRUkDdFs+COfSIhknUi5/oIf1okHxqJ7J0uS4oZBbl6fsB/T5DjAVLgmQJLLFjCqBzX0FBbKW0DKzPhLqmi92lIzP51LwrGILxLdid/77KNzID2S4YPkNNPqAmQ1O+Wb1b7owE0cNmRtNj+uQ7/71t86/UA0X5kSmTN6E0SgxTGI6yOK/ajIGT9a+zVBoTkZ8ZhOcE7kfR4quGyqI0bHIUGZCivHTsLHUa6SrzbOzFjuP/V8G5VRdK6zK69Y9t+7K4vi9iOq+h3fVUDfWh/44GeMqAirlKjhXgTscDqXWcxC5Nyzyv+59oXX2r0xpVdDgOycVvZuyJ7DWYVFJoHQQHYVXz6gn2nIFVeEEsUIw1CLUjYeZOnwlkPqoXom8lynZAbLmcuQb60VBCxDNLeRaQdLojyFNWaKbdlxB2GylxC+AYKBOiz5OiAalqifQBT+vmMfAlnJcVspmNYE7sZlN7ukIdPqQ/fFky0zSz80SIWVaU3+SKzET/esCNnqbzlOjdvpmQGF2gqjLxGeQet9cWW1Xez/+Ojz/wIgDbd0l12gKXdwl1cyLFv2w9AS6oLeB05kImt6TQmDq4UjJtVIh6UFgNesr5tW74OVW6OeJuWkNweKV8/sZ4ImJUR0hI39CgJk3SK/wU3NsFMAbobbZ/nsj+e6wC3cm4WgOqg5hNRDYJhtlVoz0YUkAXL4kb/wjZ1y/oDmfCORz57AkM3S1klvJMECT95SkvECK8kc93ZxXO5uhYNhVqp455MwmgHwUDiQGHEc3kvR8yBlEttc7e73hd74leU+UmDM87Aduio0MIEFKtPUP5v4V6sZXZf02pt/WOIPTILS8W6NXBzB0XBNgihcwgAJu6Eg3Xzx/juq99W6YPc4vBbIGlfOQIdNtzocX9bMy2otHAQ4UgubUk2cZLivVRCsw1ogXFGI3XcNWe3Fdf1wGjMfEH4HzQE1c5z5mnZHBI2J9TEtIuqvHE4HN2wBC6ph/Kjqkop6wCWpsAUMoNryPHm32MsF6zZAz7r2SiRPLi4Ge5dUPS4UtwhipUIn6e+r/lsXxGz7KWecL6SQsPpLTGVXkcZWNuIfinHJSYnKapGLlKIVIswuSHt8BpOg0ml0+U5jdKtuUI55OU4xZr7fRqmAC0iPiooIfIPrHt6yN5kq90wtzwLGYCmkQ7lDHapH4VtfGq4X3WRrmJMw+WGkeXGfvozPMnDOwtODeVAoK7g9lf6OuzEs/DcvYv8Cuqqv/rrEqDXSbKnTqHx1P51Bi7qXMBCYJeNkoyNDSbjbh38Kv3iTr/1AZdnH7XjBeWqxY2LeEgKDCGQIfRKHw4iBcI4Oo/eC6K5JxVKrHmVJUAbjVMWgiL5DNbH4X6Hh9rQdpIJYlolupav/CdfF8RFwJ1GpqNsOak= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8aec0ea6-261f-4bcd-ce22-08dcb5d4641b X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2024 04:58:19.8004 (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: eXZYxVkL4az1bh+lqFdOetBGUWNxAhtKCbtLSGZM1nC22WnAEik1iQXNCS+uun2ivj6f1s+3AgTh46F6YX+8bxADLNEB1bxgTrwct0ni2LE3rEiuUB1UcWH04OHBFV7O X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB10409 We have endpoint base functions - of_graph_get_next_device_endpoint() - of_graph_get_device_endpoint_count() - for_each_of_graph_device_endpoint() Here, for_each_of_graph_device_endpoint() loop finds each endpoints ports { port@0 { (1) endpoint {...}; }; port@1 { (2) endpoint {...}; }; ... }; In above case, it finds endpoint as (1) -> (2) -> ... Basically, user/driver knows which port is used for what, but not in all cases. For example on flexible/generic driver case, how many ports are used is not fixed. For example Sound Generic Card driver which is used from many venders can't know how many ports are used. Because the driver is very flexible/generic, it is impossible to know how many ports are used, it depends on each vender SoC and/or its used board. And more, the port can have multi endpoints. For example Generic Sound Card case, it supports many type of connection between CPU / Codec, and some of them uses multi endpoint in one port. Then, Generic Sound Card want to handle each connection via "port" instead of "endpoint". But, it is very difficult to handle each "port" via for_each_of_graph_device_endpoint(). Getting "port" by using of_get_parent() from "endpoint" doesn't work. see below. ports { port@0 { (1) endpoint@0 {...}; (2) endpoint@1 {...}; }; port@1 { (3) endpoint {...}; }; ... }; In the same time, same reason, we want to handle "ports" same as "port". node { => ports@0 { port@0 { endpoint@0 {...}; endpoint@1 {...}; ... }; port@1 { endpoint@0 {...}; endpoint@1 {...}; ... }; ... }; => ports@1 { ... }; }; Add "ports" / "port" base functions. For above case, we can use for_each_of_graph_ports(node, ports) { for_each_of_graph_port(ports, port) { ... } } This loop works in case of "node" doesn't have "ports" also. Signed-off-by: Kuninori Morimoto --- drivers/of/property.c | 86 ++++++++++++++++++++++++++++++++++++++++ include/linux/of_graph.h | 47 ++++++++++++++++++++++ 2 files changed, 133 insertions(+) diff --git a/drivers/of/property.c b/drivers/of/property.c index 164d77cb9445..3b2d09c0376a 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -625,8 +625,76 @@ struct device_node *of_graph_get_port_by_id(struct device_node *parent, u32 id) } EXPORT_SYMBOL(of_graph_get_port_by_id); +/** + * of_graph_get_next_ports() - get next ports node. + * @parent: pointer to the parent device node + * @ports: current ports node, or NULL to get first + * + * Return: A 'ports' node pointer with refcount incremented. Refcount + * of the passed @prev node is decremented. + */ +struct device_node *of_graph_get_next_ports(struct device_node *parent, + struct device_node *ports) +{ + if (!parent) + return NULL; + + if (!ports) { + ports = of_get_child_by_name(parent, "ports"); + + /* use parent as its ports of this device if it not exist */ + if (!ports) { + ports = parent; + of_node_get(ports); + } + + return ports; + } + + do { + ports = of_get_next_child(parent, ports); + if (!ports) + break; + } while (!of_node_name_eq(ports, "ports")); + + return ports; +} +EXPORT_SYMBOL(of_graph_get_next_ports); + +/** + * of_graph_get_next_port() - get next port node. + * @parent: pointer to the parent device node + * @port: current port node, or NULL to get first + * + * Return: A 'port' node pointer with refcount incremented. Refcount + * of the passed @prev node is decremented. + */ +struct device_node *of_graph_get_next_port(struct device_node *parent, + struct device_node *port) +{ + if (!parent) + return NULL; + + if (!port) { + struct device_node *ports __free(device_node) = + of_graph_get_next_ports(parent, NULL); + + return of_get_child_by_name(ports, "port"); + } + + do { + port = of_get_next_child(parent, port); + if (!port) + break; + } while (!of_node_name_eq(port, "port")); + + return port; +} +EXPORT_SYMBOL(of_graph_get_next_port); + /** * of_graph_get_next_endpoint() - get next endpoint node + * * @parent: pointer to the parent device node * @prev: previous endpoint node, or NULL to get first * @@ -823,6 +891,24 @@ unsigned int of_graph_get_endpoint_count(const struct device_node *np) } EXPORT_SYMBOL(of_graph_get_endpoint_count); +/** + * of_graph_get_port_count() - get count of port + * @np: pointer to the parent device node + * + * Return: count of port of this device node + */ +unsigned int of_graph_get_port_count(struct device_node *np) +{ + struct device_node *port = NULL; + int num = 0; + + for_each_of_graph_port(np, port) + num++; + + return num; +} +EXPORT_SYMBOL(of_graph_get_port_count); + /** * of_graph_get_remote_node() - get remote parent device_node for given port/endpoint * @node: pointer to parent device_node containing graph port/endpoint diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h index a4bea62bfa29..30169b50b042 100644 --- a/include/linux/of_graph.h +++ b/include/linux/of_graph.h @@ -37,14 +37,42 @@ struct of_endpoint { for (child = of_graph_get_next_endpoint(parent, NULL); child != NULL; \ child = of_graph_get_next_endpoint(parent, child)) +/** + * for_each_of_graph_ports - iterate over every ports in a device node + * @parent: parent device node containing ports + * @child: loop variable pointing to the current ports node + * + * When breaking out of the loop, of_node_put(child) has to be called manually. + */ +#define for_each_of_graph_ports(parent, child) \ + for (child = of_graph_get_next_ports(parent, NULL); child != NULL; \ + child = of_graph_get_next_ports(parent, child)) + +/** + * for_each_of_graph_port - iterate over every port in a device or ports node + * @parent: parent device or ports node containing port + * @child: loop variable pointing to the current port node + * + * When breaking out of the loop, of_node_put(child) has to be called manually. + */ +#define for_each_of_graph_port(parent, child) \ + for (child = of_graph_get_next_port(parent, NULL); child != NULL; \ + child = of_graph_get_next_port(parent, child)) + #ifdef CONFIG_OF bool of_graph_is_present(const struct device_node *node); int of_graph_parse_endpoint(const struct device_node *node, struct of_endpoint *endpoint); + unsigned int of_graph_get_endpoint_count(const struct device_node *np); +unsigned int of_graph_get_port_count(struct device_node *np); struct device_node *of_graph_get_port_by_id(struct device_node *node, u32 id); struct device_node *of_graph_get_next_endpoint(const struct device_node *parent, struct device_node *previous); +struct device_node *of_graph_get_next_ports(struct device_node *parent, + struct device_node *ports); +struct device_node *of_graph_get_next_port(struct device_node *parent, + struct device_node *port); struct device_node *of_graph_get_endpoint_by_regs( const struct device_node *parent, int port_reg, int reg); struct device_node *of_graph_get_remote_endpoint( @@ -73,6 +101,11 @@ static inline unsigned int of_graph_get_endpoint_count(const struct device_node return 0; } +static inline unsigned int of_graph_get_port_count(struct device_node *np) +{ + return 0; +} + static inline struct device_node *of_graph_get_port_by_id( struct device_node *node, u32 id) { @@ -86,6 +119,20 @@ static inline struct device_node *of_graph_get_next_endpoint( return NULL; } +static inline struct device_node *of_graph_get_next_ports( + struct device_node *parent, + struct device_node *previous) +{ + return NULL; +} + +static inline struct device_node *of_graph_get_next_port( + struct device_node *parent, + struct device_node *previous) +{ + return NULL; +} + static inline struct device_node *of_graph_get_endpoint_by_regs( const struct device_node *parent, int port_reg, int reg) { From patchwork Tue Aug 6 04:58:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13754404 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011041.outbound.protection.outlook.com [52.101.125.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 17FD7A35; Tue, 6 Aug 2024 04:58:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722920314; cv=fail; b=YkQ9fdL6PPD3phMrTOb3wccNL72OxrTik/iqNz3Vekf8cqQdrCagJHR2kaeGFk2Kxn0Y0sAKDPdMBhjVrDexze0whVkHJWsNim3zGT6f3/NOwqm1eFra2+rIy5Yfu6gQr/CV7MRCF3XXk9t5OvoZTCGKAbsbt4w7b2kVGRAIOso= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722920314; c=relaxed/simple; bh=whk7ASKxrpr8hluGdiOcFG+MfmiJ9XPez+OfkN6cE/Y=; h=Message-ID:To:In-Reply-To:References:Content-Type:From:Subject: Date:MIME-Version; b=cx3zz3I6GZc/VPnUJ7F/p4lDLtWR6BHfH7bSW3YEN5m6S44GVMw+wdvmtaXodUm8leL2/IbO1nbzQiX6eu7RECFzxvsRKxc3Vh3ZsT3PklII+vA1Kk3HuaPiqEsMEP3spRW995Z5P630raDbCziinsF+DC9XyRkhxwfwAcCf5zM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=JehxJfl9; arc=fail smtp.client-ip=52.101.125.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="JehxJfl9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=klsja21M0A3l11cMkkxILdhjHjSzBrfUuBwmoR6G9LqoyIusVmErZoNLlWzBDO5xhFIhr8BnLkT3Eqdcu6K2ZOa/1s02dKIkKLX4LbLzQtKgGxKeksdSa9J8O1LvHk9aLGELmv3enPaC1nC3TNDJWMcUbasYiZgS+RgfSDDvyWu4bfJB8j/oPJi0E64qPBArFGg69rw1ueUqoz80FXjGg44huftYnyXFK73ySz3NzxrynnSP6ry4/sye0rnBQ4YXE+8y7qR6vv8cs5LLkkPxAbs3asTgB5aXfbZQFIitXoricF5sE1LJYD71296XCo12LANOXqeerzNt0so1peTH8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=7p6eoE6N+1xmYecGXR25d8woQupOR2IiFBY9GkbC3CQ=; b=j/BxEyjzjLezYKwHRJMzlkIp46VLwRbPsCNOAQXYdIwmv0DpPpeL/Cx2jqEkp1d+cfbkGk5NS6fHHiSm7ckJ2jYAunqlcosYKThjiY93K6jahZQSUpbBiUf12T1VF45SvGYTPxa2zATMTN2GHt4icDIl9Ow+5FwqeldUvDGs7FLaM4yEUjV67nfREv9s2zkuox6jX+FLhBQkT0/JzbCzwWmjRm8qSFaNeycFVm2tESZnMnG/GGEhf+6UVg2U/9FqfoA9Kk4q5lb9u6ohOXqQVrzg0ssILmYh+vFOFychiQfOQssG6mNUMUDOOHWsxAkQMBcnVE4HPDYnhSlVkXfMwA== 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=7p6eoE6N+1xmYecGXR25d8woQupOR2IiFBY9GkbC3CQ=; b=JehxJfl9XXUUCSH75ha6VJmRwBlnYfvGIb3fCFB84kO7RBNvrGjPxYxlwXVeh9DR5/W9YzkVZCTRXdF/lnYMJ2i8Xynj9D26TEFeH5A4vXgMqKMYQYvkKELC3dNcEOoCztHlDO7bMCBJj4pai44VdpJHtsiRPMZAPcYz22nFQe0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYWPR01MB10409.jpnprd01.prod.outlook.com (2603:1096:400:24d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.24; Tue, 6 Aug 2024 04:58:29 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7828.023; Tue, 6 Aug 2024 04:58:29 +0000 Message-ID: <87jzguw8ln.wl-kuninori.morimoto.gx@renesas.com> To: Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , , , , , , , , Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , , , , , , , In-Reply-To: <87mslqw8mj.wl-kuninori.morimoto.gx@renesas.com> References: <87mslqw8mj.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 2/9] of: property: add of_graph_get_next_port_endpoint() Date: Tue, 6 Aug 2024 04:58:29 +0000 X-ClientProxiedBy: TY2PR02CA0029.apcprd02.prod.outlook.com (2603:1096:404:a6::17) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYWPR01MB10409:EE_ X-MS-Office365-Filtering-Correlation-Id: 66e36304-b05c-499b-96dc-08dcb5d469da X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|366016|376014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: SMgHLhdbIPkOiu4zFfOh//J8alWCI1DBA9UhGNtgdepQejmKWiryup0PNQwKNvTkP7MJR2n+MQyMNnbkFszPp6MHB86yn+ObyzE5XqGqKbo/99UtFPx4rtI1SBakhacZj36Ci7zRUQbzC9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yG3xwd9EzH7jL4+lP0h/nigkF4HqXR5eSH3e8tpwS+dnmXpguyXb2iuHnBL+OAa7NVIVwV8E+Y//pdCUI3vgdUAx+5X1xbLRXmmDo+B8/nG35Gnd55U+dRhVbd+13c9P4d67beTDpjsZTNdV7oKYV+rWa3iNMIeQu0iWZAg5uW5Cs5QU16UXK9r7LwGrLH4BH3/915r4GvlgdcjjGYq1pxLJdSPEVq6yf2DRzMvW+7S1CvgO/w= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(366016)(376014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 996hjRTKvpcB/bds9g74VaRmCQNqgYDh0GKt8TgkGpetLJkUhsE6GOQhZKJZY3xBaq8i0v5me8nwLwiPgX75+g/GIgWumtWdfB9jCXDQG35ms4bMolh1ipC9Jk4/rOi/XNISRb6kIGD5WWGWThSUKAPRXBVqRHhYTMXq0YiWMqenmaG/V5Aw0GM6gwvU8OIA3x7AlpPgaf1ngGglnNEsdAq0s6XuVKpnySUyaoQzn3iEymtl/awAXGjs4oXFvaGTgFNCZG+8aUY1iIxjK5OPdrq+L5GjKdjG4UfGWT1Al9x4Wnm4gIUe8n84a2n+RR5l+C2ToXcz569mHNkA9nqWPJvpUCnSg06+YCJTaY9aSRntJTcz/QCQh9bIBgOtJJIHcXkxAr2VCPf2lEWUiDMqTmjAW/Dxy92H+mWBMpICWDcDZZ61WTYjVxpCokqd87OQyZeOaGLG6Ga9+ZdgsC8lLYIWVRX3PhNjUaaNVLRj6Xr1uIo/p+elPzt2rjnKSFwGOH+IrpQ0GRlUaL0ssiXM9TCMPoPOBUqS6zVzor8mspAdw2X18Q6CHIxqs0AB9CRx97CTtnkr+jV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-Network-Message-Id: 66e36304-b05c-499b-96dc-08dcb5d469da X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2024 04:58:29.4257 (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: GNErPKKWFJ18kvCaD4BlJjL0fr3ZiUQXX1fH+lHtxSu3J9bN8s+/oRFN5vTbAQGauE9zuPNXMN5uaGIXzSDI/EvUJ9YVYkxOuFKe4O4XbRZglCyfLxtcOOZFAgeOvwqx X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB10409 We already have of_graph_get_next_endpoint(), but it is not intuitive to use. (X) node { (Y) ports { port@0 { endpoint { remote-endpoint = ...; };}; (A1) port@1 { endpoint { remote-endpoint = ...; }; (A2) endpoint { remote-endpoint = ...; };}; (B) port@2 { endpoint { remote-endpoint = ...; };}; }; }; For example, if I want to handle port@1's 2 endpoints (= A1, A2), I want to use like below A1 = of_graph_get_next_endpoint(port1, NULL); A2 = of_graph_get_next_endpoint(port1, A1); But 1st one will be error, because of_graph_get_next_endpoint() requested "parent" means "node" (X) or "ports" (Y), not "port". Below are OK /* These will be node/ports/port@0/endpoint */ of_graph_get_next_endpoint(node, NULL); of_graph_get_next_endpoint(ports, NULL); In other words, we can't handle A1/A2 directly via of_graph_get_next_endpoint() so far. There is another non intuitive behavior on of_graph_get_next_endpoint(). In case of if I could get A1 pointer for some way, and if I want to handle port@1 things, I would like use it like below /* * "ep" is now A1, and handle port1 things here, * but we don't know how many endpoints port1 has. * * Because "ep" is non NULL, we can use port1 * as of_graph_get_next_endpoint(port1, xxx) */ do { /* do something for port1 specific things here */ } while (ep = of_graph_get_next_endpoint(port1, ep)) But it also not worked as I expected. I expect it will be A1 -> A2 -> NULL, but it will be A1 -> A2 -> B, because of_graph_get_next_endpoint() will fetch "endpoint" beyond the "port". It is not useful on generic driver like Generic Sound Card. It uses of_get_next_child() instead for now, but it is not intuitive. And it doesn't check node name (= "endpoint"). To handle endpoint more intuitive, create of_graph_get_next_port_endpoint() of_graph_get_next_port_endpoint(port1, NULL); // A1 of_graph_get_next_port_endpoint(port1, A1); // A2 of_graph_get_next_port_endpoint(port1, A2); // NULL Signed-off-by: Kuninori Morimoto --- drivers/of/property.c | 22 ++++++++++++++++++++++ include/linux/of_graph.h | 20 ++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/drivers/of/property.c b/drivers/of/property.c index 3b2d09c0376a..de56795a7362 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -692,6 +692,28 @@ struct device_node *of_graph_get_next_port(struct device_node *parent, } EXPORT_SYMBOL(of_graph_get_next_port); +/** + * of_graph_get_next_port_endpoint() - get next endpoint node in port. + * If it reached to end of the port, it will return NULL. + * @port: pointer to the target port node + * @endpoint: current endpoint node, or NULL to get first + * + * Return: An 'endpoint' node pointer with refcount incremented. Refcount + * of the passed @prev node is decremented. + */ +struct device_node *of_graph_get_next_port_endpoint(const struct device_node *port, + struct device_node *endpoint) +{ + do { + endpoint = of_get_next_child(port, endpoint); + if (!endpoint) + break; + } while (!of_node_name_eq(endpoint, "endpoint")); + + return endpoint; +} +EXPORT_SYMBOL(of_graph_get_next_port_endpoint); + /** * of_graph_get_next_endpoint() - get next endpoint node * diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h index 30169b50b042..8b4777938c5e 100644 --- a/include/linux/of_graph.h +++ b/include/linux/of_graph.h @@ -59,6 +59,17 @@ struct of_endpoint { for (child = of_graph_get_next_port(parent, NULL); child != NULL; \ child = of_graph_get_next_port(parent, child)) +/** + * for_each_of_graph_port_endpoint - iterate over every endpoint in a port node + * @parent: parent device or ports node + * @child: loop variable pointing to the current endpoint node + * + * When breaking out of the loop, of_node_put(child) has to be called manually. + */ +#define for_each_of_graph_port_endpoint(parent, child) \ + for (child = of_graph_get_next_port_endpoint(parent, NULL); child != NULL; \ + child = of_graph_get_next_port_endpoint(parent, child)) + #ifdef CONFIG_OF bool of_graph_is_present(const struct device_node *node); int of_graph_parse_endpoint(const struct device_node *node, @@ -73,6 +84,8 @@ struct device_node *of_graph_get_next_ports(struct device_node *parent, struct device_node *ports); struct device_node *of_graph_get_next_port(struct device_node *parent, struct device_node *port); +struct device_node *of_graph_get_next_port_endpoint(const struct device_node *port, + struct device_node *prev); struct device_node *of_graph_get_endpoint_by_regs( const struct device_node *parent, int port_reg, int reg); struct device_node *of_graph_get_remote_endpoint( @@ -133,6 +146,13 @@ static inline struct device_node *of_graph_get_next_port( return NULL; } +static inline struct device_node *of_graph_get_next_port_endpoint( + const struct device_node *parent, + struct device_node *previous) +{ + return NULL; +} + static inline struct device_node *of_graph_get_endpoint_by_regs( const struct device_node *parent, int port_reg, int reg) { From patchwork Tue Aug 6 04:58:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13754405 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011066.outbound.protection.outlook.com [52.101.125.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65D7EA35; Tue, 6 Aug 2024 04:58:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.66 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722920318; cv=fail; b=XUCTgoKgy0C+zmMJsuoagm4Q7L1IuYrzxGtoNxs6jweuSGAzc3bIvwKfr8QajNyMdpENnCRzjbF8wOusAdixifLpytIPMMQ3UIrP56G9klZFgepN9dLl2vkLIy5sGijCe7Y2DqF9ympfszN0Eq/bvhqQdYjqB6xUAU0WbYlWwYo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722920318; c=relaxed/simple; bh=j2eZFHMzlfi16vJm3aoAG2pWohWFqoK23SmMxHUcQLk=; h=Message-ID:To:In-Reply-To:References:Content-Type:From:Subject: Date:MIME-Version; b=pPJBv9/e4IXe6URVPp77zija0iP5XJIQNH0EYtW3uP5edP8LNi1VUT0F6TcySAMu1T/kxd8QtdeTnhscKpzxu2jFrfqy4bP4yf4kqE8m5IY5pYsj7lLr5gFwAwyZPUbxVQbtE0Oi83hyjgwi0yaDSxioXx8a/hv4CaQ/K74Dw04= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=QNHSCQZf; arc=fail smtp.client-ip=52.101.125.66 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="QNHSCQZf" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ICcMRJEt42+BpjxrPBxJflgT4wKE+9QvlyRVrf7fxrp4uDYOGuu/18tq3D3dBdgFjlr14lIOLVQZF0hmZrd47ZD+MuXdJDi7JZu329VwpoushE6T3pbU64PmZcDjKwKYliVG0Ew0jf7MGP/AaVNWu6SdaQnxvio0Mfo+ne1BuLfjROcMrjeUsOQiuAyzPvu6HQ9cvW7FgQiBRUkfiHfy42obJMZiJbITqGE/jSz0vpkviXOweyAwbmFo1rHL6Ik55BKOB4ztdR8Gj5tvDcBUSvEwBk5qypr5QsERsvbOAepYzvVzp9T/vX8ZJ/ZGIKf7LGBdWqUK8fzpBgiq/i4kFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=uGlg0CkyULW8ujQcwtS7IKQWgI1PLv32S0wuLSWvm9s=; b=n0L/oYjBwSAAuYeCWS7EXhrH8H9SGWy6Ya+wcVlzai4xKpDryWaF6kLlIsjipXM3sTIQeAczl4V8CPvEe0Rifb+eHmBKSIwtUqYXajdRqOgLpi6xvrjsHpHxjHFmXmJf1yJJjzU/KyJ8MNt6qHH+3tJaXTpxkVS17fKrVl6N1Umi/c3kmE20fX/HgX1W2LFLviQfUuqUfr7rmMXTe2j/HDHQ9uLz+ZuyjEDIrNL8Qz+3opP0+oPuSrhCyej2skSHFmqtbD+mk6xu7LoupS0K0ziFr17s707CL7iJpp52BsDtMdyy2WUWO8/kEZkNFq259GPmQegjJKHnX2UpI3mT5g== 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=uGlg0CkyULW8ujQcwtS7IKQWgI1PLv32S0wuLSWvm9s=; b=QNHSCQZfGcvxdp7sal+mfvLP/XVzXAXtMIvufz2bJEulqKUug+NG0vcZAENCJ+aGlCY+1TZMBRR3B1WFAU1zx7eEnNl8CfpVdg9tLfItvOVxHlieWbdnAOAF5n7uSEZbJfKAlHVIAOM/F1/UPkabSl2tRLKAbGU49epIRmnqJfg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYWPR01MB10409.jpnprd01.prod.outlook.com (2603:1096:400:24d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.24; Tue, 6 Aug 2024 04:58:34 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7828.023; Tue, 6 Aug 2024 04:58:34 +0000 Message-ID: <87ikwew8li.wl-kuninori.morimoto.gx@renesas.com> To: Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , , , , , , , , Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , , , , , , , In-Reply-To: <87mslqw8mj.wl-kuninori.morimoto.gx@renesas.com> References: <87mslqw8mj.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 3/9] ASoC: test-component: use new of_graph functions Date: Tue, 6 Aug 2024 04:58:33 +0000 X-ClientProxiedBy: TY2PR04CA0023.apcprd04.prod.outlook.com (2603:1096:404:f6::35) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYWPR01MB10409:EE_ X-MS-Office365-Filtering-Correlation-Id: 6b2d3f5e-bf9d-4288-9760-08dcb5d46c9c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|366016|376014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: UbUJurPE9Wpkoogtrk7AhQG5msuhNSXhxrZ3fX+F8e8fHhNqoNYSymLb03lOkBbYmFtFd+72qACH5Ur1Y1nHYbe/daHbfV4LYXFrt/ic7ftVsJ5sHqCPCoWvlfrS/LsQIb94E4Vn7Rkhs4EZ9t8GwJnHrZqs/wIpFZy6SBodXmuWPR+sfx7ZYA//ff9PLte3JhipkcAqi6zPdiK3bttkL2Lxc68qcfxVn/A1qL1AlgYCYmTY6OZk27BKLe30SfNUQ0SbnHqmFFUy3UIrcOv6ahlOMZw9DVh3yOnW4f8QueMG4PR4xWkuRtWeMdPTgZyZYtYpv3KVKa3Ge/0/ofV7JM2LC6GX/oZfX53PscURR2n+YFVehWoIlXSqeOum78MpkKKKKhZLQZeHUlhYrLGl7om96134SbeG1WABQlZ7nultGHdOkj3pYNpkoo07uEsTXajVns01Iwshk2jrCWab+rc+d2mB2k37KoaBkOBD5gXlEJdqasBpZ1J/u9p70fbU71lDhm6czn72s1BGkupowfo1CbO/sWuOnpGCXgbsQN9j0ZwD4345eqLjag1p6KXtYuPhDEwagarqzrQ6h0CI4vhRlliFaaj/L1XBfVL5zdQt5wy74bQIMlUiSoZ2Swyz6izgsprQgtwmlgZ53ZpfVS7zjQZh8iLfbdZNkkqqCJllmcaIz9ZYp5AeDEXewcnPkfbyItxolE+VwNuoa/I9VoLAiHyGpxr8WVR7U/VrSw9aSaZuE09fcsWIH0zESnUIBYOEfa8RsBWg20//k+0EfnIRIuYRAeieeZhCd9KQTu15Xr0fUJksVNw++1euUVSVBW1vnT7FJITjAca3v47L9T90wL0hc3HI9+8ms1rlIIbA+C7TxrNIKe/6Ip6SHFkIKKiw+1Svg1u5NMTtacU/2p4dzxIlPE2dvxGlg1pMib6Yue2oksJghEqkKTyVfVwRnUuKYmiuxQF9SVzI6ljzupwXmHUoGCukziantIeZKabeP0eqJDhhKIAwhnzDcKTeZQio3/ft0TKTgL/zxU6LmUPpmnrYjsKxPSYBYuG96CyafS1tZIGESMs7w5+qIF5GhMfnCcWlgg2dnf0tsigBuBEL4g7QtJC2sG3Yk9m2zDTwNGOeNUuEWFldJ+zhv0hCFwLPN1ZYKv7oBGaA+ZQqc5vQg6EH+LvURn7YZH75KnRtEiLK5o6+BffPgAiwTDkXOrVBRGoD8fySlVXqshoCtR4S+tYIVeHmPWwLAMouMRJE9obiBS+nda8fCJQzn/nMGAhicIOm/2tBC1XtvSoH8Q39ZsABebQrqybHh6Y8liMk+R+FarPcdS7oVKHZbKj0Gsk0fFrpw0ma2wqwH29lbDZGPpeFY4AXMAwS/jqZJ5tyiOlb9Hrn71eQsN4LEXKFuQWKSkT2ywBbgBcWJr+6Zu+yJ5uZJBLq50UrL7h0dsM= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(366016)(376014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HAktsz3sk80k7QicCxXbqRqKLcJnYgFB43z8J02ND6qpTYXHbyWmqraYX+CxPlddaTnInntXk/qt+EVfx5roE1zzC4wmaQKIeOC87MYJaQErr9quGRnpFFOVx/cWpR35z1CYE30LeUOr87FUGxmU47Ro2POXx4bnt4FwGoMW2CMYnU4OGEEtYxIoH8hR8vmLM4xG1jk056zXKUKHj/MlOOAF2WYmgQ2wAgG30w0bYpQIJckhTYdKdPaQnI5Mu4ixqNyFCKRIP5x3YYk3n5zb8d7Rb1CSpEZKtVBVR+qoLi+aTfKa7TQ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Q0kC0371wa0ZnVwurHDgd8pGCzTHe6MRiaQY3HLf2StWc2zDqeLJZrLg/QdEuT30AdXOKyigwdcwuzAB5k+fF2edGHFzs0HJPyt5khZPgrXJ79O/Dl0hJGUlum8+mA9YZFBBPJFo+R2f0AnTmMNjDDVnP3m2VfwEjSDQ5RAvmNw2fLyAfxZ/7S4d4CiphHM4vLkJwNx3az9L2ub6jYaQeSs0gA4p9Vfbdl0MldA16T2Mup6z68knngWJRPHJiBZOJQR0= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b2d3f5e-bf9d-4288-9760-08dcb5d46c9c X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2024 04:58:34.0671 (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: pukEHgKHAj+CIhsMwiQQXGtgfagVXU27YTMdP0y3K2wxIICkAia/WRy+nr1U+th7GroWn9s+oGPF5zgks9Y/DjZkSk2C5QD9bD0DpfyT5A3Ie/GAdcee/ZqqRcFdeEFb X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB10409 Current test-component.c is using for_each_endpoint_of_node() for parsing, but it should use "port" base loop instead of "endpoint", because properties are "port" base, instead of "endpoint". Signed-off-by: Kuninori Morimoto --- sound/soc/generic/test-component.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/generic/test-component.c b/sound/soc/generic/test-component.c index e9e5e235a8a6..6f75da9f86e6 100644 --- a/sound/soc/generic/test-component.c +++ b/sound/soc/generic/test-component.c @@ -600,7 +600,7 @@ static int test_driver_probe(struct platform_device *pdev) } i = 0; - for_each_endpoint_of_node(node, ep) { + for_each_of_graph_port(node, ep) { snprintf(dname[i].name, TEST_NAME_LEN, "%s.%d", node->name, i); ddriv[i].name = dname[i].name; From patchwork Tue Aug 6 04:58:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13754406 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010056.outbound.protection.outlook.com [52.101.229.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3315BA35; Tue, 6 Aug 2024 04:58:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.56 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722920323; cv=fail; b=j+Z13M7ij1/ycS1GnaiHeWAy4g70G/aAz4njuIc7o/IjsIsn2MN8ifA1fiwftNdPnwwNN0KNFT2FAUb7yn/5IiNPYiY60cCzwdNbiICM/Lx9c3gp0Jk9b0EepkePao/eHI9OMKtZn3Harqsk5KALowu0HkC3OIHrennwXWvW0Hs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722920323; c=relaxed/simple; bh=OEwjjOw/XzmaELXlZKAlA2lhcinnbaURYJbPLAilV8k=; h=Message-ID:To:In-Reply-To:References:Content-Type:From:Subject: Date:MIME-Version; b=panJvbfh4ICTvU4yADQkzXAygvtqSGbpLPlzMhXEAehVjvjApvLCsauwJJWv+8Z8UwyTNjlQNlBlRtbBbpMqna7QSZioz5g/+fU4htGNHVEptx3RlO7+TgpHCJXGvQd/q3IEys/PVC5uEQwPKUF3u07rofyBRztruOBbTVlefwA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=LGV9dpt8; arc=fail smtp.client-ip=52.101.229.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="LGV9dpt8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dSlY8SA0DU+enZq9GiRzGz9GfTfs08Y/zFrAxZ7OYeJ72SQB6DORhsOGHps2uVYc7Xd8iF8zFUn4VqXLt0sKzhQpxX3SALcfMrzHK+9xKCZ2Y2t6t/QWmsHwbXKieImq5iH1LNhALoOoEJRtPPnb6EvztAb+EgNhXwhkMfZyX22DviewbzoNov5BzAGR9WYgsoaEmatY/T+3oEjfRCXDzhxIv9sFiY/z2EhILD9g1v2+2RnbIdid+ri1dvuXE5ddVAPDzaRsZftvHICaRyJFYKhIgzpnFBN6VTb/yncxqBn7FeTOR3MOAkS8gywp3uCA7R+FJKODAv3KHPl8dmks2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=UGGX+Q3luKrdwPd/jnIYOtaxjjFA+XQ3cahzrZILqSU=; b=dvymjYHlW22CUqB6V74U+3dbzsnnx17nfAloNRe7TQi3kpqh7LmqrjGLNhXAlJM/NvkREWKNO2W+t+uXxCxHqLhUJgKEfm90CCLQzWvmjlsFOteFPxFjnj+xg75JGGw0PLp/RFibmppIQyA6Tb7CDCG3jjIsSiq1WXPJvKD61GWanawvIO6P3klo+kFqyJx925HSZJ6NQPoTFF7qFEqhTejOHe/L0wA7auKAZqZwTLFK/jYR1Ol5ZvQNmPpA5W3z+m/sIu+SeT4beblfkOeSEWIhyksB5OhRLhZsGO1dWseK1NO8qXHQlJVuysoVLoZWkaFCWLHSsCvot5gmnutRew== 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=UGGX+Q3luKrdwPd/jnIYOtaxjjFA+XQ3cahzrZILqSU=; b=LGV9dpt8g9IPFcTYBN6d4WvQcxl6S5CzMZWe0rdeC2dmm+H69weIn1DHo3F1KZuZktxr5q4Q6xN2Yw1FX0pqu1uXDl/PYD1i00tdfY4bgHTKUyLISnv1GyjnL8E9Cj5h828FSLe1XkOnAtPKAb608HWhwW+WaOSgHUxI5KZr200= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYWPR01MB10409.jpnprd01.prod.outlook.com (2603:1096:400:24d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.24; Tue, 6 Aug 2024 04:58:38 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7828.023; Tue, 6 Aug 2024 04:58:38 +0000 Message-ID: <87h6byw8le.wl-kuninori.morimoto.gx@renesas.com> To: Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , , , , , , , , Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , , , , , , , In-Reply-To: <87mslqw8mj.wl-kuninori.morimoto.gx@renesas.com> References: <87mslqw8mj.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 4/9] ASoC: rcar_snd: use new of_graph functions Date: Tue, 6 Aug 2024 04:58:38 +0000 X-ClientProxiedBy: TYBP286CA0013.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:ce::25) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYWPR01MB10409:EE_ X-MS-Office365-Filtering-Correlation-Id: 7b291b25-6394-4d73-e733-08dcb5d46f49 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|366016|376014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: rzApNqoHy/1NVOdpNHhxJKnOHdpnZiSZVSbZjacEcU4kIhBaosBOLnjBTM5l3/Il0MSxspqz2f4nbDxGwUbPwr6wSbBtKappxZRv2hJPhpM4Eoa9+rn7wPi4LLKA154Mqw95cJgToTXBy5AP8MavXM0+KGotuXLc/pObbKdcV0EVWcq5Cj70t2edbmr/HRnSs+5sdtN4k5TMaosYTd7mlc3FcmkNhNy5/XWOxEx2ExvUKiJ99dP6kqGFJ6bwRIuI0gtffoHc7Tk13kzMGmOlKxueZkaaE8BOauLNNqKr18Yp3iQNjQSYK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qaUMNAEzM7d0Pb29/hwi0jMkqdbsnQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(366016)(376014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3DRH8cZrglQxsiP6im3SxXaNI2/oVa5rb3EOVNBHUwiU5e5fKgKks69GEluLsHZPwBA3KYq/r6tvmsDKUxhq76ivqbPDzGXJkcQlPofUoGefJtHSyr95F+oLOTho3RlU3xb2qKnR2W2rPUctYM+7p/NIFGfXxRdO4/dR308FJ1qKeAjlPttddQahyi1ATfh1/wtHcc/iXBOkOAwK2+F+YVRNDUsrZFIxNOFWUWBXnlRxMwRjJaXWzDbe+s7Bjgm8N612COnbklq+UWoLG1roWn7JunKBOBjWVK63VRYHCr9ER0Ke8EldQrLiRwaeSya28yN+5uw0VOwhu2Ai7zfHh6Ej38XC+/mYhJIlgzhD8/ElseTBcEBV/92UdiKb5B5oSqyUEMLXSFidgZaY/j6GoUHdP03XN0kK9y1Nlfe0Dvu4QbejTY4E3djNi+K1+PzYBDgUv5aPujt64jX9oW50NWFO5Ob/pUy319XBBAk0Q7jF2KP4/LrkXCgS63ktnXDb/KdW1bVW/1Am4Y0L6fnEZM+7G0zhZwIIvC3Y1Igm6e9CXaQR1XdWnmrA99ogQTMyYLTU5d2hhyvpjx4sLFCDYyLt87/lMF26Sq4aEXyjDxeCGSynwsb6TESYPCX+MxlErF1K8e2E0Q1J6aL76dZnnpMFAZ9eqbLYZJIj7GuH1QUJDsydGvfSzfHtZj86Cp5G3jf1801bsoM9EBVXtkZ/+lQyTpKjMqbqXLdpIGiBBS0s4DwsRG3JKsrxSWmfCDwU8tShXgxAfMpn5gqol3g7MkJkyJdoEGp7+q5jyMP74vh9Fzt+6eRSif/PJdeAiHLTygRSyxAib4ILy5+/UistuP10ImUAe6OhYrJkWbmR+9tvCPJy/q+cOTDP2nBwLeCGHNfqITaLBNzm7iX2oZyUxgbU0eyM2LSBjH2YwMuDC8eSXkFYgCKgZzVk3svrP3vjHHSeNbI4ONQ3wG78oGqKYe98gRrf2kHJWxs7nVr945xiINItonuiJ+m5knDQl3Cfu3gx9VGG7LgfpvyAXzgxevPNRVTSYma1JTn/6C0WX/BZZB9pys75qzZZzGGfmFSQVCL+Bja7u40JTNQLuUmlC+SEvG01Qv6gWUUDWPg6wwaqQYt6iGXiOD2qNUwY1fo7Cam18i/qbXFv5XQxlJksMWieVTGdoaAFVDAcHw6YX9H8u/DxfIvNEyJGHNDUuexTy9bCEP6r0vX9eX/IjZ3XcBsijrTopT3PQcFwzDp4Whlox4PY+KsGHgRZLzGSfLSAFkxbkBFlUHCjIBcou0qZ/zX6N6egmo9RnseUulIkhW4zYyAXg4aTCnB1n4j2mEgokTM4y7ZSMrDhcqbv2utUWBKzBf5xLcBhrtKrrP9+skstuDdZLh9txj19RxUSpguEZUBH5iU1yyAUXt7DYWZ/8yYGwfeijAqo3fnZastBJQ+gvR8h42lI272Xn+l3XNvzkozVs2g6wtSRbu59sl+i6Utr1VpcqCnorC5DUbaDabJXd4kO6lX0MKqRNgYDIbHp6/IlT7g0O32IBVpQaZC8NaLKY8Bx0uYakEHfHM2l8y1iO6sdAyMnBdRZCCXRBSfldjEe7Cn9v8alEA/edaeKulJILePXiWVdaiKQrxBskrM= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7b291b25-6394-4d73-e733-08dcb5d46f49 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2024 04:58:38.5465 (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: e3pzmX4J5AgQ+XOjsfEzThoXLY/QfI9qMH185izZWMm7sWYGmE23yQXMWtIfvGSmaLZh5C6VHpQmJCmE7Bjkt4xi4su80a9TpEaPSjXbCCHBXmtqyBgv67KWegkhbLls X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB10409 Now we can use new port related functions for port parsing. Use it. Signed-off-by: Kuninori Morimoto Acked-by: Mark Brown --- sound/soc/sh/rcar/core.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 63b3c8bf0fde..eb146cf836eb 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -1294,11 +1294,8 @@ static int rsnd_dai_of_node(struct rsnd_priv *priv, int *is_graph) /* * Audio-Graph-Card */ - for_each_child_of_node(np, ports) { - if (!of_node_name_eq(ports, "ports") && - !of_node_name_eq(ports, "port")) - continue; - priv->component_dais[i] = of_graph_get_endpoint_count(ports); + for_each_of_graph_ports(np, ports) { + priv->component_dais[i] = of_graph_get_port_count(ports); nr += priv->component_dais[i]; i++; if (i >= RSND_MAX_COMPONENT) { @@ -1506,10 +1503,7 @@ static int rsnd_dai_probe(struct rsnd_priv *priv) struct device_node *ports; struct device_node *dai_np; - for_each_child_of_node(np, ports) { - if (!of_node_name_eq(ports, "ports") && - !of_node_name_eq(ports, "port")) - continue; + for_each_of_graph_ports(np, ports) { for_each_endpoint_of_node(ports, dai_np) { __rsnd_dai_probe(priv, dai_np, dai_np, 0, dai_i); if (!rsnd_is_gen1(priv) && !rsnd_is_gen2(priv)) { From patchwork Tue Aug 6 04:58:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13754407 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010042.outbound.protection.outlook.com [52.101.228.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 594681BB686; Tue, 6 Aug 2024 04:58:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.42 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722920327; cv=fail; b=UOvQv7MbsmP7F89tctzDJNe0K5zNAU4ZeGHV2NTSp5Hjlub7eIbkhFg8gBLm6T41SAzdAbJciVaAw1Gd5ZvJANXJm4Rl1qPHDYTTnFRwUufC+x3vJPo/J9xQrMvbTWzXpTje01I3CHM9ZKADbxQ2CUjMeV4QNaxHlkFZl6qEhQY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722920327; c=relaxed/simple; bh=MQ2WeK98nOet58yCEJtPWGKoyTq6zy0jhczxwhs4kSw=; h=Message-ID:To:In-Reply-To:References:Content-Type:From:Subject: Date:MIME-Version; b=saBp8FKUtBNhDFgz8nbYG9t2g4udNwMlwYZdMBoWGdCbLpm2/PiqjErzgUBeN+UyrRRfNwW1DeJjUF9UKxS8P5McDu3c8255VSJFzzPtUfGEDDatLe2mVUduH7gR+6gpMHqIcY96M8+ZFBV1s+tkrzHR1+BfbAx8yMSLD/9tIHY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=T4ps4g5Z; arc=fail smtp.client-ip=52.101.228.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="T4ps4g5Z" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tDlA7xyYKoK4wDYmUMRY5vHDcWZ4vhEG7xq3avHME0C4hF4FcffV5pM9mM0gT7D/kJ1Ca3+sCUPfRmL0HI8PmJ4cEKrItlV9HADeGdiIXx78uKFszJGL2byPMwvl/akmDkVCfi2yuttXZl4ose4mmRdSb5rsdL/5yn0e9k7/H/e5Sx/OcViPQx59KQuDiPWfh6CEYd44+8+Ka9PKlghck+r4SDjWhnuJCAknwI33Ucn4TsiTj/HypRi8lWfuNil2BE7dZfwT9xktvrj3e2fkfhgMxq4g7S4qcWzKsEQ1KXduD1/jD9WF3WU2H42NC2Ir9trlsK4XjD8wIXMon8IuXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=z0PPNhmLMToUGTc1xc0ZLEjyUCHOkhsP/J1V+F62KzQ=; b=T/1fzZogAwbz7LZB+YnEAKtCEnQi7VnjRdW+YUvFzmxkEe3F4oNQeJFAbJK2RiPTZAzptljOcFbNSdhH8Pg3smrHiN7IRLoaWhp1ZCl9AKrQoy073w/cnmm5UTyG7P3NmYHh3xpTX/htSwVEk04H0IIa+pxvwztCc/aUhjnjZRLZbkDjWQq/pC0b6XtsK1p+J6G0TYTe6+TZTJZEinHamuFEyMOZX6OLwguiF28cKTH+3i7zycyBb2GcdsCUNTnEJRgxIVlwzhcTnba63uppHiL1kKJEBurbRZxHx7J+D8m7YlLiVAUqgmhqcy1gwIbAKSg21wfaKqD3F5OhZp4ayA== 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=z0PPNhmLMToUGTc1xc0ZLEjyUCHOkhsP/J1V+F62KzQ=; b=T4ps4g5Z2z1p0JBasStQDLbyrtqv4Q/VGTMCiGMxeugoyxyXNxod7Zkf/+NETwXJit1t5tjfz0S80DEhov5kZm/qqWK9MoCvws3ZsPTF+77VJk2sfx5tkWYsnNbvdhnxELVRsJQRp2gu0s25rOTI8RW6uhpJfLSQV4lGtIwtvBI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYWPR01MB10409.jpnprd01.prod.outlook.com (2603:1096:400:24d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.24; Tue, 6 Aug 2024 04:58:42 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7828.023; Tue, 6 Aug 2024 04:58:42 +0000 Message-ID: <87frriw8l9.wl-kuninori.morimoto.gx@renesas.com> To: Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , , , , , , , , Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , , , , , , , In-Reply-To: <87mslqw8mj.wl-kuninori.morimoto.gx@renesas.com> References: <87mslqw8mj.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 5/9] ASoC: audio-graph-card: use new of_graph functions Date: Tue, 6 Aug 2024 04:58:42 +0000 X-ClientProxiedBy: TYCPR01CA0200.jpnprd01.prod.outlook.com (2603:1096:405:7a::7) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYWPR01MB10409:EE_ X-MS-Office365-Filtering-Correlation-Id: 753066bc-f524-4c9a-3312-08dcb5d471bb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|366016|376014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: NwdG2q4amh9huDOBkJ7auHmnfodumPxGcq0d4G2Pc33Nj1Wrc15DAXptSGCOaHmS3mbVvxkzw+gBLry0bO642da3bneRsagjNc+RNlOUmEHhP00590PYFMJykazsFl7irRDry+YYjhxBVQrN8jeLvLx+3HzbGJhaVgbmHbmkaKobNqMuMh91Q5hB35YPFSd+EUhHUOq85HVatk73hnsvlc8NX/r44Mhssy3Zri7r+rN9qqNsFfmJ5XDwAv0mfYgqOCkqUbjcTyI931uCYwFyIKMRw/5zbtP5Bu5TCmiJWRuGyoBfGUKbVBMxfdR94WvwQEz7oNHXtRCx/8cQ9LvmbX95lgdHdDVfiBrl7k1OdggXJNXe5HKZ3QaWK54Ikz/XKGx3Nq204HHM1KqKSBvbVWTSNmWrYru6CBiF5Md4/kLFlv8q0oz8XmVNnkCXdynmHsuozDh9Aln5sAi/xzx8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ook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(366016)(376014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CoSAtgRwamX9dF+FR9245QuzRCW6FL/DkQuychuLzLnhSuTZuhYSfVGFtgxUR2S245aTMxBDHcbX34JZSVJ8uNf6yliUAqSWQ9C4FDFIglTUkREK5uP3pDYdiRdfTIabEcIoKhPqUx0/kHqSpXZGGgAvbH0iEdvDUGmHuctnVgGWRalI8LG9xs4lMFRg/R5Yas/NI22zfKmnmry1bboRq4eSEviN+HBxRxCLQ3H9l5rGdLtkGtfjtndhA3N4aMab1Xdi7DY4ydWMcNYT62UdvmpcKOUnN8aVc8vt/7KZuefOB9cOMHK8WLWzysOYhFVbaxs+bhu/RiAPfttfkd87w/d8xlzwmwBD0X5B+prBU7LjnFcuDIy7dupMd+EByAAGVWowaJkDNxH6cdiKxx4m4AULKqi7lfLtMJKS/EugG1qywzpUQXWXzwQR1OJLrVgQ1NMQmNSHG/4lk8IVUrj/bKgEvXBB15qdHkS2KxWltoD42yGlFUb3MyI6xcnI+BcTMzNcSAIRtrb1L1rNWS3r6zubqE+k49mRB4PsmH+IKQXg195UDhhJxKAauZw90Jp8hOX51vaBwBn4wQNaiIabOAVToEQUizbd3AdXwWAZ6gAK9YcrmuBHZhZEex2wgY9RcoGLViM1yrBU7vuZd8aK7ZVZmJFOxLE1C1yvAQZ46DE4tW4ig23jVzU+gdeJQm3RjBPIRgfGbRnRVWs299719Ko+kWdj9suNtpCc9v/V/jHDksIsdQPtXSO2he0B8oS2j4J1Ik9M1qZIXUPwVFN5PejgqBuxRkVXT0YvMxg4vAhXPflvUq+pZoyvFBqwjUvtZ2aAegBiMathRG2jzVXDw319FBmpOAuEKND2Whp4L3g/JlvdFrpX5mDjeL0tDu5xEKbzfaiJRLfx/HnqF345qUVcmuWQSYoAkBUzhssgA5bZaqJa8R1Zwty8j1dALIsGMLLvbFD/cgFRCi8Q44qLaSRMWwyrm5nLhuz/nDw+MRqms+/rS8QOFy/95I5JZTDbgH6691UmMP4FrwlZrPkUbgtKyH31UHwqTvUj7GjvS7ZWxCXr9y/hDQfBPTHA0TwgPsV3irWXDDxMyT47sR1EuLkFlG9eZXja+UKc0zAbFNi1DtKVea5c8vSTLHJYVFBS2jAxQ90kn349gyp6ALDOJxCRAopFvZWzU2zLTlDO06mwCaZDim1j8Imw77bCu263I1jekyyx/40GCfuHGeAL+IteZwuEeCRNr34m3Ly5DcXF6wucQq5DqTRDu2DZHmxkpXZd82kzXI2FwooHAeiqYXJkzqC1pNa/6C52A09lHQkOybFOj4pwOxIv/yzWFpEoPPQkzBEeoqGAbSmuI+HNrp5oZ8nAX1PtmX3GDoFwvgU9FUWYkYu8W2+kpl9QkK9uOriMEqcAyjfn2Mhvieh1MBK9Dynbi9wvRmUGWf+SvWJl9LbD4nUuINcA6sCIJjgpo2sbx22WPmho9id2z3pLQLfNs27OJx4dX0Glo406iLkx1p905GqnVJnwGIkOnCRpcNWEbHq33MQiLNu9jJA+X+dS9kDNFjGB7Bc0l/EzY6e6vmFSlzUV85GZMueXqLeUmV3Vj/HYKr2V22wX1qTuww3c4TnnHC23z/c9zkeb6T0= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 753066bc-f524-4c9a-3312-08dcb5d471bb X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2024 04:58:42.6359 (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: alQWY8uZDp8LYBk7Hewat1fXFvtDktv3MOgrrerbZggelaBI5i2TKkWtVp78V9KpDi0iEO7kd/GtqHStPVV1RFw+SRCRRJhC2KgpjSlngjHUJDGF4LAlGxlA3CBvBOzh X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB10409 Now we can use new port related functions for port parsing. Use it. Signed-off-by: Kuninori Morimoto Acked-by: Mark Brown --- sound/soc/generic/audio-graph-card.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 3425fbbcbd7e..040c271e13c6 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -376,10 +376,7 @@ static int __graph_for_each_link(struct simple_util_priv *priv, cpu_ep = NULL; /* loop for all CPU endpoint */ - while (1) { - cpu_ep = of_get_next_child(cpu_port, cpu_ep); - if (!cpu_ep) - break; + for_each_of_graph_port_endpoint(cpu_port, cpu_ep) { /* get codec */ codec_ep = of_graph_get_remote_endpoint(cpu_ep); From patchwork Tue Aug 6 04:58:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13754408 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011038.outbound.protection.outlook.com [52.101.125.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D01E1BB686; Tue, 6 Aug 2024 04:58:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.38 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722920331; cv=fail; b=INfEhhV+iFt54E6csIerCNLt5H7vX+mpM6SdBQi9fohEFHhtnzONJvRYKvtfMqpY43bucZwZTzVDKo77oa0Y+MkWaxeKkzb+VHADBYb4BbxcwEysiKgcw+LFxxLTVCZVQXe7xYacO6oBGy6kr5q7wanKWLRlo+Fv5rmHOpKNR1w= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722920331; c=relaxed/simple; bh=Jpyd2sABwD6y0Ge7HAK9+6+aL68kXmkBCwDQ/qp2ctQ=; h=Message-ID:To:In-Reply-To:References:Content-Type:From:Subject: Date:MIME-Version; b=B0HlIVHneK08vgj2MaWK+VtzmXjISid4GNuZI2A0cvER2KoHbshngy20FwLNC1I805l8OqgWSN0Ryc+X8fEGfQdr6qYzztKBWkRCExlASQJWmvMa062flEHTIO5NzT4r2pAsXimkFDfQycKkiK3+ru12FjGJQFwFIO0V/LPa4Pc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=pIuzppeR; arc=fail smtp.client-ip=52.101.125.38 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="pIuzppeR" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AKYwB64VlEtCa66veKklIGoZITxsJBvQP6CwwG2tlzkplqSu6xsDkXL6VzQ9qhX+x7iDWsQ2tDd/QMsNfBcySMioL88vid9THt9l1CwUxXW+AUbF5ihtKIOlQzAneuQuORe7BFtsDhcThHVjoKG3svnjlZzhCT36jkOM73Es6ZCJrtyaLAv3Hio1ui+EDcYvdQehwfnkKpLAPxTGO1MmgDYRi5ZIiRiiggyJdZG/0A32Du2Mdpz/2OTPebFiYdc5FkO3bLqnxCPvLhih4fL2vTQFPnptvf13epjG//IqDI6V6Vrk3lX/YgF1AIYFiMYyjLJqcAgATYLbAu62bjmUPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=C6vhNpqKxKB/lCSNHdn73b8TlT9nVKAcgSe0Mpx3IFw=; b=C21NtZHjK2gVq4qt1Uk+qM5VXcKGRgkxdwWjfBdz9xnH/IynE4unZa9dNyuBrgPTTq8zslxGYEQd25gTUH+tCxdXg+8o7M4onHtMVpiKNQopMmA57Msc5abkWkFkEXftP4NfyxslYxMRZGCe8DKtIXl/y1Mg1w1ZyYj2sOHQn8L9FsK7pNN3OrmVbUC6SY0gqEQN2231sJr00ytbeM2RK/VD6UE+OI58Bo7hJn9NgWD9u+enSio4Al6PT/TEMpa6bD/ZlNCW6immDrke7Id770Yc7RMnQ0Pnzy33MW3ofAn/EenmJni0UWFmF7VpcEMauMKSvDfUi1Urv9cQ0v9MLA== 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=C6vhNpqKxKB/lCSNHdn73b8TlT9nVKAcgSe0Mpx3IFw=; b=pIuzppeRDh+rVhiHkd0tJxEuTGLvhxm2EnPFVXxajjEnEqwLuSdM3kufZgPVNS65PGe+shJ+9Pn3b5lCreGcQtVEJX0vFk1qXx+RjHtFz+sAaq7PX9SDmtFcOph+gBLsld6YZ9/OguAPxLwc33CXO5X46Epp5HE4RY5Kp0GpMuY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYWPR01MB10409.jpnprd01.prod.outlook.com (2603:1096:400:24d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.24; Tue, 6 Aug 2024 04:58:46 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7828.023; Tue, 6 Aug 2024 04:58:46 +0000 Message-ID: <87ed72w8l5.wl-kuninori.morimoto.gx@renesas.com> To: Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , , , , , , , , Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , , , , , , , In-Reply-To: <87mslqw8mj.wl-kuninori.morimoto.gx@renesas.com> References: <87mslqw8mj.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 6/9] ASoC: audio-graph-card2: use new of_graph functions Date: Tue, 6 Aug 2024 04:58:46 +0000 X-ClientProxiedBy: TYCPR01CA0210.jpnprd01.prod.outlook.com (2603:1096:405:7a::9) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYWPR01MB10409:EE_ X-MS-Office365-Filtering-Correlation-Id: 7fdc0338-5770-406c-144e-08dcb5d47436 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|366016|376014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: 5Zhg3s3yekk6KWB9tcNoOuPuZ08ig9TUnzxwKkgr9mRAdHV0d3xpT7VWuACY+rQVG0hg9u4Okwx68/9DR/nMo/ZLajH9e7Db4I/jTPFOZFfL76KSteD4O7yY03cS/ghrqOZI90Jyx8LIhpEVuMoyeH/Gbj/P7P6J0XtMhK1iWYvmEugWRFb8rpW8jSZXsR6jOIIBKDSwc15yACRGJoeLaAQgoz2In8JIRW9YTUAOEbHaQS9YnRWoTc+HHB+B3I0TVQYIwT1eSlHkDzi7c3mrrenoK3IV8owXwhViyn/bJe7MIFRahzN799LD/k8krX/MS/qRgSM0ZoVhfK6ZEVx+rXQCkTJsts67ERYacrpk/Ofh7UY+sWAifg/IudRPSwG6a2iFjVwdHixPJfDNe2PbhCOrUm7GAXQRDeRH5TgCec6rJvmGPzHRMvSiOQJ/LS6hoaf6a7CvGJ9UTqRF3k9v5I86F8ehnxDaBqe/ijc2blDBPJBNqXqmH6CY+33EeO0KIDMFAqx1eL5sOTeTglUC+HITZG82hrGYkrs08y2HCCu8LIwYNCwbjVgQysoJvQAdd+tgPEclqgf5HLmKX1xND/0VQFlr0U3aLccdqOxYKWpUDG0rbLhzFIMoa26puRMtw+y03WyaWA9ReZHb6hcJWX+KDAzdGRili6lYjYrtq5S1LPHnHS/9BCSrZsuH7EnIi0fGwkozjZenGl/2gb3Jh94cOsq4nB9INl8IO3WBmysJVk5NrVDOmFog/vlB3XZWCIikuuwCo3uSD9ohUNV2D3yu4lyhkDfenmDRfxajI/zyAH6iMBSVxVeLqvMNVDdAfMpVS/paRjll94Aef0uic/i2sFWXU/LJsDZUwlgSmJYvIgDNY7ovjahPtLrgIXNqJAgyZz8uu25CJyQ/ih0A3KFp8lUpIlYL6TL87pP6LhBCxljQn5ubus9eW+EFv7+HZpE9CsLcLgTfREuAW3Pj5g27WqVV/yj4jQPk7CfTbV9VPQEXE7aJYsWfB7Ire25mzMONWGJDN0blBT5jvAcFP3pTtvr3W7rW3H4f4PgnVMQE4HgWZ53Zdp908iKjPDGAvcFTFCKsIH2uOIgbsge4mxyEO5sKQ4gbLL+Fcencv7c3rhPwHyaaDyh9m1Ngk6w2u5VEqlmuhjhCDAh3oPxvPpLU8Nnt8QQmNLAZwltm90bi4cRQjiNH+tL8c2f2i2cooWjceRoTeQYW4+iz3sehvM1x7lopzPGB4NQVUxzGBePYFAMjnj7PPsW0A4ckiIxHDWDUUNIzTzwUR92tj7R8qpoPrh1al3/Ls1b+FcM/XYKoHfEeGzdCtK2T5pMkKRGd90G6N5w/cUR4cvi0sp6Y8q5aXRPBgx6WjpGybtIxN0B7xxMqmUGEZqe+0xqOVfYCDF4ki1FCzwrnHhSijr7R9OTMZzTB5MpJcZuBvQHz6LU= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(366016)(376014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3ANPHsE3E+im0BEnvDYp/LTM/lnBxVMPLxbZI6yrhgrYNBdPaHmwAvVUX1ya6Yeq5cETWOuXfoFmr3x94KcLMVdk3r8LUyOGzy1AFDu/BuzVxMFB9JtZwskZQ5nNdHjz02x63AVJxkNDYH8YMa6r3hLOQPCRXPzPDkAMyzhCIndCVYLiDWjANHbP8ZKMmukh3rEkYl9f+BOD0qGgMSCUCll3vbe6GxR90LI5R6VplgslYSXxc4DIQ1xZwaA3cB2PAwly6duOjp6bktx8xSK3EDCz5LSarf0SSxkviPNTRO/dm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H3YhCQ3UDIgF7+b6ZhuI9DBiWV3VpfZfL9xDOm8OR/4HmLxunEuxBp0LrEb14oFAGPJmoFpWdjXjRyOxvC4aQLry7pSidyYSIJWpBMcGwSaV6NBKhJ3B1BzTcx9UYJP0Cn4k8XCMC4nx23a+k7eHWF9+vK9+/7o66RH9PsCmQavpEDWvg9lyvqn+1enRpJCQKzI8LinmEsEqkQwDof+/wpcFi8HKe5kVZipQF5KdlRuc03ZQFDC9QU= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7fdc0338-5770-406c-144e-08dcb5d47436 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2024 04:58:46.8013 (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: 7bjDyqxpZeETSzPKBPCuIh6My0BwovrHAgmiWGWVDWO6gdkU69nzpYxNQSgjJJtACJ6er0LGxwUG7IXio0WndbTcfUa9x17xYJu+wck1mo4i+qTNu+j/navJ6wzxRC0o X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB10409 Now we can use new port related functions for port parsing. Use it. Signed-off-by: Kuninori Morimoto Acked-by: Mark Brown --- sound/soc/generic/audio-graph-card2.c | 111 ++++++++++++-------------- 1 file changed, 49 insertions(+), 62 deletions(-) diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c index 56f7f946882e..e8ea201dbca3 100644 --- a/sound/soc/generic/audio-graph-card2.c +++ b/sound/soc/generic/audio-graph-card2.c @@ -234,8 +234,6 @@ enum graph_type { #define GRAPH_NODENAME_DPCM "dpcm" #define GRAPH_NODENAME_C2C "codec2codec" -#define port_to_endpoint(port) of_get_child_by_name(port, "endpoint") - #define ep_to_port(ep) of_get_parent(ep) static struct device_node *port_to_ports(struct device_node *port) { @@ -351,14 +349,9 @@ static struct device_node *graph_get_next_multi_ep(struct device_node **port) * port@1 { rep1 }; * }; */ - do { - *port = of_get_next_child(ports, *port); - if (!*port) - break; - } while (!of_node_name_eq(*port, "port")); - + *port = of_graph_get_next_port(ports, *port); if (*port) { - ep = port_to_endpoint(*port); + ep = of_graph_get_next_port_endpoint(*port, NULL); rep = of_graph_get_remote_endpoint(ep); } @@ -530,67 +523,70 @@ static int graph_parse_node_multi_nm(struct snd_soc_dai_link *dai_link, * }; * }; */ - struct device_node *mcpu_ep = port_to_endpoint(mcpu_port); - struct device_node *mcpu_ep_n = mcpu_ep; - struct device_node *mcpu_port_top = of_get_next_child(port_to_ports(mcpu_port), NULL); - struct device_node *mcpu_ep_top = port_to_endpoint(mcpu_port_top); + struct device_node *mcpu_ep_n; + struct device_node *mcpu_ep = of_graph_get_next_port_endpoint(mcpu_port, NULL); + struct device_node *mcpu_ports = port_to_ports(mcpu_port); + struct device_node *mcpu_port_top = of_graph_get_next_port(mcpu_ports, NULL); + struct device_node *mcpu_ep_top = of_graph_get_next_port_endpoint(mcpu_port_top, NULL); struct device_node *mcodec_ep_top = of_graph_get_remote_endpoint(mcpu_ep_top); struct device_node *mcodec_port_top = ep_to_port(mcodec_ep_top); struct device_node *mcodec_ports = port_to_ports(mcodec_port_top); int nm_max = max(dai_link->num_cpus, dai_link->num_codecs); - int ret = -EINVAL; + int ret = 0; - if (cpu_idx > dai_link->num_cpus) + if (cpu_idx > dai_link->num_cpus) { + ret = -EINVAL; goto mcpu_err; + } - while (1) { + for_each_of_graph_port_endpoint(mcpu_port, mcpu_ep_n) { struct device_node *mcodec_ep_n; struct device_node *mcodec_port_i; struct device_node *mcodec_port; int codec_idx; - if (*nm_idx > nm_max) - break; + /* ignore 1st ep which is for element */ + if (mcpu_ep_n == mcpu_ep) + continue; - mcpu_ep_n = of_get_next_child(mcpu_port, mcpu_ep_n); - if (!mcpu_ep_n) { - ret = 0; + if (*nm_idx > nm_max) break; - } mcodec_ep_n = of_graph_get_remote_endpoint(mcpu_ep_n); mcodec_port = ep_to_port(mcodec_ep_n); - if (mcodec_ports != port_to_ports(mcodec_port)) + if (mcodec_ports != port_to_ports(mcodec_port)) { + ret = -EINVAL; goto mcpu_err; + } codec_idx = 0; - mcodec_port_i = of_get_next_child(mcodec_ports, NULL); - while (1) { - if (codec_idx > dai_link->num_codecs) - goto mcodec_err; - - mcodec_port_i = of_get_next_child(mcodec_ports, mcodec_port_i); + ret = -EINVAL; + for_each_of_graph_port(mcodec_ports, mcodec_port_i) { - if (!mcodec_port_i) - goto mcodec_err; + /* ignore 1st port which is for pair connection */ + if (mcodec_port_top == mcodec_port_i) + continue; - if (mcodec_port_i == mcodec_port) + if (codec_idx > dai_link->num_codecs) break; + if (mcodec_port_i == mcodec_port) { + dai_link->ch_maps[*nm_idx].cpu = cpu_idx; + dai_link->ch_maps[*nm_idx].codec = codec_idx; + + (*nm_idx)++; + ret = 0; + break; + } codec_idx++; } - - dai_link->ch_maps[*nm_idx].cpu = cpu_idx; - dai_link->ch_maps[*nm_idx].codec = codec_idx; - - (*nm_idx)++; - of_node_put(mcodec_port_i); -mcodec_err: of_node_put(mcodec_port); of_node_put(mcpu_ep_n); of_node_put(mcodec_ep_n); + if (ret < 0) + break; } mcpu_err: of_node_put(mcpu_ep); @@ -674,7 +670,7 @@ static int graph_parse_node_single(struct simple_util_priv *priv, struct device_node *port, struct link_info *li, int is_cpu) { - struct device_node *ep = port_to_endpoint(port); + struct device_node *ep = of_graph_get_next_port_endpoint(port, NULL); int ret = __graph_parse_node(priv, gtype, ep, li, is_cpu, 0); of_node_put(ep); @@ -769,7 +765,7 @@ static void graph_link_init(struct simple_util_priv *priv, of_node_put(port_cpu); port_cpu = ep_to_port(ep_cpu); } else { - ep_cpu = port_to_endpoint(port_cpu); + ep_cpu = of_graph_get_next_port_endpoint(port_cpu, NULL); } ports_cpu = port_to_ports(port_cpu); @@ -779,7 +775,7 @@ static void graph_link_init(struct simple_util_priv *priv, of_node_put(port_cpu); port_codec = ep_to_port(ep_codec); } else { - ep_codec = port_to_endpoint(port_codec); + ep_codec = of_graph_get_next_port_endpoint(port_codec, NULL); } ports_codec = port_to_ports(port_codec); @@ -850,7 +846,7 @@ int audio_graph2_link_normal(struct simple_util_priv *priv, struct link_info *li) { struct device_node *cpu_port = lnk; - struct device_node *cpu_ep = port_to_endpoint(cpu_port); + struct device_node *cpu_ep = of_graph_get_next_port_endpoint(cpu_port, NULL); struct device_node *codec_port = of_graph_get_remote_port(cpu_ep); int ret; @@ -883,7 +879,7 @@ int audio_graph2_link_dpcm(struct simple_util_priv *priv, struct device_node *lnk, struct link_info *li) { - struct device_node *ep = port_to_endpoint(lnk); + struct device_node *ep = of_graph_get_next_port_endpoint(lnk, NULL); struct device_node *rep = of_graph_get_remote_endpoint(ep); struct device_node *cpu_port = NULL; struct device_node *codec_port = NULL; @@ -1009,7 +1005,7 @@ int audio_graph2_link_c2c(struct simple_util_priv *priv, of_node_get(lnk); port0 = lnk; ports = port_to_ports(port0); - port1 = of_get_next_child(ports, lnk); + port1 = of_graph_get_next_port(ports, port0); /* * Card2 can use original Codec2Codec settings if DT has. @@ -1039,8 +1035,8 @@ int audio_graph2_link_c2c(struct simple_util_priv *priv, dai_link->num_c2c_params = 1; } - ep0 = port_to_endpoint(port0); - ep1 = port_to_endpoint(port1); + ep0 = of_graph_get_next_port_endpoint(port0, NULL); + ep1 = of_graph_get_next_port_endpoint(port1, NULL); codec0_port = of_graph_get_remote_port(ep0); codec1_port = of_graph_get_remote_port(ep1); @@ -1141,21 +1137,12 @@ static int graph_counter(struct device_node *lnk) */ if (graph_lnk_is_multi(lnk)) { struct device_node *ports = port_to_ports(lnk); - struct device_node *port = NULL; - int cnt = 0; /* * CPU/Codec = N:M case has many endpoints. * We can't use of_graph_get_endpoint_count() here */ - while(1) { - port = of_get_next_child(ports, port); - if (!port) - break; - cnt++; - } - - return cnt - 1; + return of_graph_get_port_count(ports) - 1; } /* * Single CPU / Codec @@ -1169,7 +1156,7 @@ static int graph_count_normal(struct simple_util_priv *priv, struct link_info *li) { struct device_node *cpu_port = lnk; - struct device_node *cpu_ep = port_to_endpoint(cpu_port); + struct device_node *cpu_ep = of_graph_get_next_port_endpoint(cpu_port, NULL); struct device_node *codec_port = of_graph_get_remote_port(cpu_ep); /* @@ -1197,7 +1184,7 @@ static int graph_count_dpcm(struct simple_util_priv *priv, struct device_node *lnk, struct link_info *li) { - struct device_node *ep = port_to_endpoint(lnk); + struct device_node *ep = of_graph_get_next_port_endpoint(lnk, NULL); struct device_node *rport = of_graph_get_remote_port(ep); /* @@ -1239,9 +1226,9 @@ static int graph_count_c2c(struct simple_util_priv *priv, { struct device_node *ports = port_to_ports(lnk); struct device_node *port0 = lnk; - struct device_node *port1 = of_get_next_child(ports, of_node_get(lnk)); - struct device_node *ep0 = port_to_endpoint(port0); - struct device_node *ep1 = port_to_endpoint(port1); + struct device_node *port1 = of_graph_get_next_port(ports, of_node_get(port0)); + struct device_node *ep0 = of_graph_get_next_port_endpoint(port0, NULL); + struct device_node *ep1 = of_graph_get_next_port_endpoint(port1, NULL); struct device_node *codec0 = of_graph_get_remote_port(ep0); struct device_node *codec1 = of_graph_get_remote_port(ep1); From patchwork Tue Aug 6 04:58:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13754409 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011016.outbound.protection.outlook.com [52.101.125.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54CE71BB686; Tue, 6 Aug 2024 04:58:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.16 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722920335; cv=fail; b=Hl/0FRqBOMxsF8TwbLZVKzXq6c56jgeodfOyJh6GTwafkPnO/orlh5t5LON7cyAGUdx9cMfU1YRGt+1Ya0ik272DfwX0ErU7jO8d+Zthi4dWhjxiDXlo9dOdtyI9/NLR1BwlYA5om+zACnIbg8D4ChWcR0OvfEoXHVKgk7NiHn0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722920335; c=relaxed/simple; bh=vekqv2V7YzpI9gHp/WX52II03uCK4weM4+cpAVHPCIE=; h=Message-ID:To:In-Reply-To:References:Content-Type:From:Subject: Date:MIME-Version; b=FtG4nZoOCEfPZEtxJ0wTr2mZAIHL0UvGVHnj44WQ28T1IGCp1iEj5dxfZROzZPiRD18CE2fAZovnnVWBylKvY6w7LhhPQWHvjJIScrgGaQvkibyPeBib49rjRkgY+g++ttQ40Y+aKQR5IQ0sa9KMw07v1WkfRH6Fi3QxdUWaJRM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=MY4oXVAe; arc=fail smtp.client-ip=52.101.125.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="MY4oXVAe" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=I+hlpF2Whx4BSXwQpBWB8cMeFKJY6KI7/VJG9ok25M1cv+SQ8Vz1WVrAl45UeIGNBBxUjwOSz9TBTUIa+Sx74Mu54N8UG3LS4bXFG/CFZ6L53Ky9WSW3y8hpgKU4ihezZh9LCSMOsnWRkNWgoYXTajMKEfsYqNMjsBJjBc35SrvCm6NfP4MysEvYD+2P8vzMjHSBtLxPAClyUpl6ihekHUS7r/zCo+Jrka8pGNUSNDtFIfeDbWKdd/qIS/8AMQ7G3L5wv02HFD0jzqt5quOHzPvwqzwg/pxm4zWSbxXi9jUymZlqKvZP41YObh7QeqrI4FsgYBe/aZN7/Vy/DAoM8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=uB6Fu7dPk96brYTuEHSz083xYrEd9Rz2uuKrvB+9cHA=; b=UhoGSRjbhV9uw55yL9ycAlNQ/U4Vl32aZRrNL1iFNzFpJim215n29gc76LBH0lDa/M1zhAgrl2hlOUpw92NiNjdz40sdJtvb0y3LYsUwAFkmg0+olyDTXYCMxNP2T6DNs5N+YfYUGu4QbkMPCenzoUTFaCtZO1iYjApWCQeWOnGjCBohgCvBnHCz1/5xJmuURXJGPm7HETI5VQzN5kzOSndwGLzsZqUUvR4lip9A4Eu64n4Dtpq5aXOi1Vkra3jTqbxJQelysYNeCkNgxl6WjfcrjgFN9iJmagkVeeuFoKACJon9qSJHclpikcMVduM1mielhVndG0HfYp8RjZGW3g== 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=uB6Fu7dPk96brYTuEHSz083xYrEd9Rz2uuKrvB+9cHA=; b=MY4oXVAe0Cx2aWgpEXOzsdBBJWyB6JvP+XwVt2qQI2kCswN/5D0o0hRN26GFC+fz7oPQqLLXiO/sfj4TxXlSx438xedQhw9oVJD4B/P+dNLz5uV7UUZa0qQUAbx7M0WjG6CXvffgrTlW3uPhweRTDkJpupePnNLbS99/eI7RM+k= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYWPR01MB10409.jpnprd01.prod.outlook.com (2603:1096:400:24d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.24; Tue, 6 Aug 2024 04:58:50 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7828.023; Tue, 6 Aug 2024 04:58:50 +0000 Message-ID: <87cymmw8l1.wl-kuninori.morimoto.gx@renesas.com> To: Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , , , , , , , , Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , , , , , , , In-Reply-To: <87mslqw8mj.wl-kuninori.morimoto.gx@renesas.com> References: <87mslqw8mj.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 7/9] gpu: drm: omapdrm: use new of_graph functions Date: Tue, 6 Aug 2024 04:58:50 +0000 X-ClientProxiedBy: TYCP286CA0193.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:382::6) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYWPR01MB10409:EE_ X-MS-Office365-Filtering-Correlation-Id: ca0de283-a24d-4d42-ae07-08dcb5d476a4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|366016|376014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: cJV2fvZV7lucPTRO9kMYSw0PvSeuC3a2govN1jyn3mMKVevyS6tnaqQOFT8ekRMeBhu9k0OzExXwZHS32Op+ZWmHgOLHhHxgkAfo8zTrA0T7wZCiQuMcJeOHXrmB8FwYITNl5g1FBHNOgBesi6DLtIaITFdUHPE3cF7+NvAmtyUhLov+ER0BQLDvpgtERozG/fFPGPoIdCpN5YxB0SzimaoFLvMTY4/2RkPWhzK0KiUMZNLVdqsBPcoGppqq4cEfJLJea0D4Kge9jiQcHhMxyGj6WnY0+4lin4X/VLXQsYptVuU8P3MkdyWWMJW6qa1VizaYavzMTmWuzIL3sGw6JW7zS1Lg/tY9mN0mP7dmmAJtupwulf4ixd/Ha8KTqXsmmU7/x0IZbeutUuBJdIRucoSk+N27OoekWvpWoNURApdEGdPHaHtkvbsF+YSDxLEyW/M/O4bSft4OCcxJ42dZxCaZtV8qsFpL4dtE43f9hUCBwKv9Nr+QZ0x5n8VdRCtL+lByUChuE8qw2YnSmsKAX19T/DkXB+AK/t9F7uDYCHcXaAIZY8N9dFB84sfMIwhK+W7OCNtyRWEIvj9S8Sh7QwIHW1KnGWquQayrpNoy8/0dZ72X/mlSXnRQrrKWaGYOCfnGfMftX/Yvy7SFldmJx5RF7P2qdvDp9wTi5C7WK3UBe2c1mOLz5KibUcq/JB8Pj+fP001behabfc0czYh0nWmhMXE3i0ejo676NTJhoO1f1Js03mQK9AqBaNayXrc1jw83YLgtTHUgBH4cmdZGI7OSoGM1BPGXe7biBg+jCy35mfugvceJYv0GDrjkAdNKKfkozub5qR8eGn8mPwzBwhPR7awvrWWSX9oA3gnO3pQs27oLU3Fz8ji/nS7mGligrXPqynGxSIWg3qWBc/gT+PmEpTceoP2GJsKeousK13GLSb9VPfKR6lxjJl9OQKZgcxOVsSXYihIijx6hWKGlRDfqLk6976No2fF4IJQcl6nAGbjpI0BlVjJtjb33aVqiKrAxudelK1xE4HjFF8Eon281NFjTgOuu/pVbbN2OrGojNUOK05u69Qfcu9odTi/H/RSfTeNYLoQ+kOhXhPrt+fju9b+aiV7sBoNfLbcQkgswAlprv29vAcN88Ee+rxrKnIREH9/hgqMathqZND5q6qENM/US0YZ++H/JYrJou1qbNl4NQ9rKpmbUWeHWa8Brsg55SYAxkxlwhFy1n/zHO88yS8BToJQd/sWUwAq7ABWbqLKnK+h7GhV8n8EaL5yNkJZ94QqDGMXxwoFkSrD5JDmmrQE3d4kbZZjnxXSLPZuDg0J0axKmUTq8pvIWzJ2IXGDmB1ZxThjoyyaOc3AqmPaKrGkWaRBJqzXwos6bTTULcBC2cnMvOjQg+txK7lnohZdL/ga9KWuy0bH/s/gsuaZsdxAp13Im6i6h38GlF/4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(366016)(376014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JfvUkosohhGTUXMWi1GHDum/ZsVIbr7OO4DBKyw0M0SdQKGyvpZkGuKA+iuu7Lj8z/4RMOZdvcMDX6tmUQITAmGkdMY/iB7Zs5SzUxqaUwI4YjCUBeyPX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gTFEmD5L0daB/Tr3NOCWw3ZbxDrDfsBgEoZ/P3gTqsAbMGEZ4YjpSR7cRmxISKoyvQgYsB+1R5qzu58WbI27fBUukRSmJLA2Kzir8gSIeFGZh6ixCqOMJzL9AzT9BXrlPGmc9LiV9740qC8BqaydnQK/SeWoQ91gy+/dvb6bYePrbfI1OJyNJgJTkHWy6cbo7YiEu8zv/o1i15jGV35ddOS9o5pP54JXxy90u7rX7GAAvOVs/ev1DenCDmUdackJAmv4CsnxafdlkduIbbhYJ/4SMSb1OhgbyqoPr/k8wckfVjVdEkqDmT/lujkDsZzfCzb4KNgiiIhFeqIh51neLqzp/PkC495kc8Ro3CEdzqXtobuokbar1qpE6HZz88u3tt8bNqcT0gfpSgp+u6qWhi7j/WnBO+7WGfK1FPaMoksNuCGCx2bp4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: ca0de283-a24d-4d42-ae07-08dcb5d476a4 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2024 04:58:50.8855 (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: Ay8Knu3mb3NTIFKenCG+shWcq91vOt2lJpWjSPvFjasN2h5sxQ6DbHnIz+4V700UB23+BWR8B7imUQ6lUQvqtt7UwyHVX14h1yxEv0u94vIJk2WrkYDYfWKv7V6o3b4R X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB10409 Now we can use new port related functions for port parsing. Use it. Signed-off-by: Kuninori Morimoto Reviewed-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/dss/dpi.c | 3 ++- drivers/gpu/drm/omapdrm/dss/sdi.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c b/drivers/gpu/drm/omapdrm/dss/dpi.c index 030f997eccd0..b17e77f700dd 100644 --- a/drivers/gpu/drm/omapdrm/dss/dpi.c +++ b/drivers/gpu/drm/omapdrm/dss/dpi.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -709,7 +710,7 @@ int dpi_init_port(struct dss_device *dss, struct platform_device *pdev, if (!dpi) return -ENOMEM; - ep = of_get_next_child(port, NULL); + ep = of_graph_get_next_port_endpoint(port, NULL); if (!ep) return 0; diff --git a/drivers/gpu/drm/omapdrm/dss/sdi.c b/drivers/gpu/drm/omapdrm/dss/sdi.c index 91eaae3b9481..f9ae358e8e52 100644 --- a/drivers/gpu/drm/omapdrm/dss/sdi.c +++ b/drivers/gpu/drm/omapdrm/dss/sdi.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -346,7 +347,7 @@ int sdi_init_port(struct dss_device *dss, struct platform_device *pdev, if (!sdi) return -ENOMEM; - ep = of_get_next_child(port, NULL); + ep = of_graph_get_next_port_endpoint(port, NULL); if (!ep) { r = 0; goto err_free; From patchwork Tue Aug 6 04:58:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13754410 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011056.outbound.protection.outlook.com [52.101.125.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49C2B1BB686; Tue, 6 Aug 2024 04:58:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.56 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722920339; cv=fail; b=ZHpuPUtmr5M8PGw2S4I3dIRaTLO5qHh7LfedyxkCzs/L2m7foshfR1VfA8fPEUUuF42WZX1wPkMR92z8hkbr0iwbyVJ98mIxLBb730dsI6C6Mn2ltdyyCE/Hesy8BqIbe+xdMlZAQEDyxdXzDnY9DAS13OV9diykAV2k3Q79ACA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722920339; c=relaxed/simple; bh=mg8aPdjfj8RwMfSnBel27b47brMcpDU/JeJn8rTtrvc=; h=Message-ID:To:In-Reply-To:References:Content-Type:From:Subject: Date:MIME-Version; b=SNCnBGWUkT5MXS4gXfgoG9u3ucDM2oKPP6NESFv7gpf9UeEkUHRNZm801I2YtyhV3ES6+lPGRpLmj4vay+t1VaRWi/u9y/pNdotz98BSYAQPSM1F1W+U8wWE0GQdNze+l/Qz9S+y5VrPaZW6nbRqxBimNVAb1gR/+agJqq2mVtM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=i+ZeQ5Q8; arc=fail smtp.client-ip=52.101.125.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="i+ZeQ5Q8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gmZGJ64Lvyv+XEXFozhyZPLtFf/gNaIQQ9QdZnRKU3kElRYcEwTdPPOsoqw6Vnu0qxpNzw/iepM2VF8d9UhiYydhLoJj630DxdSw5ljPoFPyACNRDupXGn6YskaQx23PJUQcmor2WbZOX4HXbnx0jldsynhFB0tSMs5e66ZibeOmWsvOnXjSSUdx+H5WGMSru8m+EnfgKrYJZIWuEXWF3B/GUiO6X80FWY/9tgAC52a1UiAcYksW7lHzCfYw5koIUSOhzYmsdENUdQmjMT1N/t3UrTsHGEs0tQJ5f6YCNJiEDVLU9BB3CO8FXRC6BvNBbr+X1kY/4askHjGcmQyw8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=bqpCLsY1CmrUuWtVZbk0ujoYsWif8tltOD/VUVSoA/Y=; b=c7GOsj8dUgRmdmd56C79/X3ADenboE6NOnHk5PtjqnAO3IM0xE1W+5nYEAZFI6OXye6sgF3J66EmKfPwxODkF8ldw4DfbtZBkscMkSutdCRSQWwr74Or0Rawu+oJES2BcTPfKOG7UdtoztvmzVzj9YUN7rm82KsksMErUMzxc0yCwO6IVvdkDkyEE9LQOnhZY0qfDpB2aLyvMyVvD6wsTw8UUT360quGhwpelCvZ2X4jrMgy1M09KSUFgiKtw/yCifFKmF994HHXPZL1Ww3AABxEgiJaEW7T8sJyNzgju2B1c/S5m/qxkuaq2Lh0DFf8NPTajnphbgnYVSotAg9QDQ== 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=bqpCLsY1CmrUuWtVZbk0ujoYsWif8tltOD/VUVSoA/Y=; b=i+ZeQ5Q8n0le8pJ2Y6hdLEb9y/6+C9LsA4Kd8i/VFginYCebIet9aRkIVpaxJk9MbJbVyJ5S4UGtDDQHC+eKnUpXsDAkyoVXhO1Pe9xZX+88poQnqs75P7YPbzGQRxU72RmZlbztqf2zaVpokhjAAa+od3Vk6esnLEyBEIw110E= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYWPR01MB10409.jpnprd01.prod.outlook.com (2603:1096:400:24d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.24; Tue, 6 Aug 2024 04:58:54 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7828.023; Tue, 6 Aug 2024 04:58:54 +0000 Message-ID: <87bk26w8kx.wl-kuninori.morimoto.gx@renesas.com> To: Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , , , , , , , , Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , , , , , , , In-Reply-To: <87mslqw8mj.wl-kuninori.morimoto.gx@renesas.com> References: <87mslqw8mj.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 8/9] fbdev: omapfb: use new of_graph functions Date: Tue, 6 Aug 2024 04:58:54 +0000 X-ClientProxiedBy: TYCP286CA0117.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:29c::15) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYWPR01MB10409:EE_ X-MS-Office365-Filtering-Correlation-Id: 452ceb44-3f49-4691-d361-08dcb5d478de X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|366016|376014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: 5YFaQKb499fBCqUQrfEo19uSd0NgZgdsy19A2tLdS4C+207p+ds+uYl0p8V9lmwwyNu+vh3EQynXsosG//AktMzwjwdodMZjn0iIYS2hceCvULCHi2ZsHnKTCWitamMs5Rc9NmO6XFSS95EPxYW1Vo8Ug4/Afgfeidqo6qaOuQJcH0EMmcSc5Y31YcGETI8dcgnUnE0sA6w7CWIzApyeKhYHWaPBOPgxZlxhUBbbI1dD8oAYxnK7c5dIeEskpceIqG205AxIv+KNR6wUgC/QUnmlu/7E+e+AU59I3ajx8gacekMKlgZDGHgbEqlGGkE9lDypPMMp8KJbKFfc35HYuUuljTc65Xyk1d48oDL09ID0doNu7hVVzlCe2h09fCQO6DkA8Op84dlZuJ8sqWdrTQBpHrws7zFdtAFNSQ/r9n+q31dm9LYSsPMHc8MdbrGeHnSCyBsIHE0dhJuURkcGU6D+G0tD/rS6xGhksOvLImPCucYccwB/macTxULPg+awpSWnORwi9sLWjP7IBgJGz1glhO/QDOB6nOGOmc55hZol+RXzQjwOcsehHRWIKbc0IVHrrjrtw3ypv0eYNL1KEgNWFZUdOXEREzIJskqb9jFXzfmKSWAYm0XrhSJIzdaXTOOn3EypWtAbvYOpMyeGtxiEmUrsoGFaQpkWGurb2l2HEeG9FKHRy8y2TugLyGuOHTlIJ+6ClQKadBEEf/tPLHjarb6Xw3PISm4FFFU925QpsJVc3Vby1+xQLeZ0vvMRsxKAI+cnWSafYfGxtpKp+AaAVmJI0miSeDo5499v+Cus7e05vQzLEbqZ8Oybh/gZGxGzqmub0mDB5gW5rtjGoNuq+X2YJcIxvWlGslIuVvMxGC/l3ows/Gm1pPTcLmVB2ue67VobExck+vshGVrJx4ScmYj8PJyZr2wZvXZIK1k0fOOLjg1J8w5JoNci+rR7he8H9J9cnEKHh4kVzOq2ouoSsIz7dogcLaa1+q0zJFogRZg+NLlyRaeK5V/WQ5PcieSuvbJ4NIwX/DcA3l75fqnOXdfrJBA8jtjOJd5jnbAqtBF+T+L4Z6JOulCueKn5dtREgA+18GaKqWH3nHBnPwPGffWtt4hdkiAlSeZdi8OkPaOUo9ZUuOWFf4PV75hilM4Grz97PoRosV131tDhPEssCOz3nIPsXKG+nnynXVn5DCk9r8avwqRXoclvN7syyTB81QM4FJPUgh6R2yVoG/IeX/cUbUgqcncf1R4SVutOxg8t/zvRf79YhJSq+YW4DtN1d8oynfklsmSDk2CkfrMj76M2j5OP0UNlFf/KFfoelKCin5UFU0v+4oqrra5a2eQlzXUcBY7d//1cJRjqXDYuQuooohTflsYtXoLYtAw+KkZ6/bqe1a03IxcsPiV8bvgB+rJrdTl/kae+y6iiwUcmkyPI4xF4r1XbmVtChwI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(366016)(376014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DNWq83VbUMboEgqRd6uVBO53107Z1V01pf3D+sxLDFgqY/OYLyCeANJySjcMmzagLTszhdhpnJhzim5+N4UelE1n2ke/qv39md6/uJhrHNvL2344d5xtBs5KrF2Qt0X5naZUxnOOpRjTw7fUbwM42aEc7tHcSAioVSXZUkPnGp3d9vufShz4o17ShfLv3urMeJ8iel593eZS69/JQTraievOBu/UA8qbNSXWXAdfn78MJdjdefhGK8hs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RrjyCKh+nj8IxSutPySoVQmDnlbCJB+psl4ZrKfN6W098CF07f84RQmyFrfGK2/fcjq7dSs5MzntOYjBKfDKTAy9Yh7y3Ni4MEWjogGxuAAnITvTKfslE+3J4QjFqIhMRYLDUvk2oRWXBn2P4Ig6TUGIsIVVaUdxIS0DXEsyKXyAYpzTu9LWuWWOyJTAzUHCvKWsV1GTy3cAmq0yeDUCXhvW6utbS6t97U4ymTR1J0+yG2y2u20dbWc7f1Rwt7GYEVlsahY3itWG1cPBw8SpZZc6QpkzIA2AQ1xSumwhgBTSga3jMHcF4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 452ceb44-3f49-4691-d361-08dcb5d478de X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2024 04:58:54.6409 (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: aS7tIn8lrawtEp0GdisW5BzeSLvSA1cVZjXJaWMmqAZB7gjxvCj3ptG9Mr0JkFo1qYeeKml5UJK8wRb5ITTznQHDrtsK+kYC8APF6esSUO9I/ZsEeQ24IXpEdMYIuKU1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB10409 Now we can use new port related functions for port parsing. Use it. Signed-off-by: Kuninori Morimoto --- drivers/video/fbdev/omap2/omapfb/dss/dpi.c | 3 +- drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 66 ------------------- drivers/video/fbdev/omap2/omapfb/dss/dss.c | 9 +-- drivers/video/fbdev/omap2/omapfb/dss/sdi.c | 3 +- include/video/omapfb_dss.h | 8 --- 5 files changed, 9 insertions(+), 80 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dpi.c b/drivers/video/fbdev/omap2/omapfb/dss/dpi.c index 7c1b7d89389a..395b1139a5ae 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dpi.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dpi.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -845,7 +846,7 @@ int dpi_init_port(struct platform_device *pdev, struct device_node *port) if (!dpi) return -ENOMEM; - ep = omapdss_of_get_next_endpoint(port, NULL); + ep = of_graph_get_next_port_endpoint(port, NULL); if (!ep) return 0; diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c index 4040e247e026..efb7d2e4ce85 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c @@ -15,72 +15,6 @@ #include "dss.h" -struct device_node * -omapdss_of_get_next_port(const struct device_node *parent, - struct device_node *prev) -{ - struct device_node *port = NULL; - - if (!parent) - return NULL; - - if (!prev) { - struct device_node *ports; - /* - * It's the first call, we have to find a port subnode - * within this node or within an optional 'ports' node. - */ - ports = of_get_child_by_name(parent, "ports"); - if (ports) - parent = ports; - - port = of_get_child_by_name(parent, "port"); - - /* release the 'ports' node */ - of_node_put(ports); - } else { - struct device_node *ports; - - ports = of_get_parent(prev); - if (!ports) - return NULL; - - do { - port = of_get_next_child(ports, prev); - if (!port) { - of_node_put(ports); - return NULL; - } - prev = port; - } while (!of_node_name_eq(port, "port")); - - of_node_put(ports); - } - - return port; -} -EXPORT_SYMBOL_GPL(omapdss_of_get_next_port); - -struct device_node * -omapdss_of_get_next_endpoint(const struct device_node *parent, - struct device_node *prev) -{ - struct device_node *ep = NULL; - - if (!parent) - return NULL; - - do { - ep = of_get_next_child(parent, prev); - if (!ep) - return NULL; - prev = ep; - } while (!of_node_name_eq(ep, "endpoint")); - - return ep; -} -EXPORT_SYMBOL_GPL(omapdss_of_get_next_endpoint); - struct device_node *dss_of_port_get_parent_device(struct device_node *port) { struct device_node *np; diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss.c b/drivers/video/fbdev/omap2/omapfb/dss/dss.c index d814e4baa4b3..5cab317011ee 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dss.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -922,7 +923,7 @@ static int dss_init_ports(struct platform_device *pdev) if (parent == NULL) return 0; - port = omapdss_of_get_next_port(parent, NULL); + port = of_graph_get_next_port(parent, NULL); if (!port) return 0; @@ -953,7 +954,7 @@ static int dss_init_ports(struct platform_device *pdev) break; } } while (!ret && - (port = omapdss_of_get_next_port(parent, port)) != NULL); + (port = of_graph_get_next_port(parent, port)) != NULL); if (ret) dss_uninit_ports(pdev); @@ -969,7 +970,7 @@ static void dss_uninit_ports(struct platform_device *pdev) if (parent == NULL) return; - port = omapdss_of_get_next_port(parent, NULL); + port = of_graph_get_next_port(parent, NULL); if (!port) return; @@ -1000,7 +1001,7 @@ static void dss_uninit_ports(struct platform_device *pdev) default: break; } - } while ((port = omapdss_of_get_next_port(parent, port)) != NULL); + } while ((port = of_graph_get_next_port(parent, port)) != NULL); } static int dss_video_pll_probe(struct platform_device *pdev) diff --git a/drivers/video/fbdev/omap2/omapfb/dss/sdi.c b/drivers/video/fbdev/omap2/omapfb/dss/sdi.c index d527931b2b16..22a6243d7abf 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/sdi.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/sdi.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include