From patchwork Wed Jun 29 00:35:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9204145 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 559156074E for ; Wed, 29 Jun 2016 00:36:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46EB72862C for ; Wed, 29 Jun 2016 00:36:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3BB172862E; Wed, 29 Jun 2016 00:36:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3052B2862C for ; Wed, 29 Jun 2016 00:36:51 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id B5F86265FCF; Wed, 29 Jun 2016 02:36:49 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 32AE9265340; Wed, 29 Jun 2016 02:36:05 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id B9C38265340; Wed, 29 Jun 2016 02:36:03 +0200 (CEST) Received: from relmlie2.idc.renesas.com (relmlor3.renesas.com [210.160.252.173]) by alsa0.perex.cz (Postfix) with ESMTP id 5B856265D33 for ; Wed, 29 Jun 2016 02:35:36 +0200 (CEST) Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie2.idc.renesas.com with ESMTP; 29 Jun 2016 09:35:35 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id C752446FB1; Wed, 29 Jun 2016 09:35:35 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id B4099480A5; Wed, 29 Jun 2016 09:35:35 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id AF2F2480A3; Wed, 29 Jun 2016 09:35:35 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac4.idc.renesas.com with ESMTP id KAL17643; Wed, 29 Jun 2016 09:35:35 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="214456065" Received: from mail-hk2apc01lp0207.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.207]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 29 Jun 2016 09:35:34 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=fAeBEA5Z24nLnNRfYei/TWp1BniOmxnT7BxJX+9NMeA=; b=cdA/6Kmb74ZtaHWnm7Jx0pukgL9ELOf2zWZC7ACThhj1EbLDeIzuc2DwDM1LI/Rnl5+EzPgUMjvkQPFDzrfN1gT+F7Y8rUTUGjDRBnzi5XLQmls6EAkkmJ9gS7eJ+oiYoStRcL0ZnmLb3bb/HnbQLQWQJBaxEmQ6ql9qdehsTBo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.144) by PS1PR06MB1705.apcprd06.prod.outlook.com (10.167.53.15) with Microsoft SMTP Server (TLS) id 15.1.528.16; Wed, 29 Jun 2016 00:35:31 +0000 Message-ID: <87furwg7ny.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") To: Rob Herring , Mark Brown , Mark Brown , Laurent , Guennadi , Grant Likely , Frank Rowand In-Reply-To: <87k2h8g7rr.wl%kuninori.morimoto.gx@renesas.com> References: <87k2h8g7rr.wl%kuninori.morimoto.gx@renesas.com> Date: Wed, 29 Jun 2016 00:35:31 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS2PR01CA0050.jpnprd01.prod.outlook.com (10.164.161.160) To PS1PR06MB1705.apcprd06.prod.outlook.com (10.167.53.15) X-MS-Office365-Filtering-Correlation-Id: 69a3054d-c7fb-4ecd-7d06-08d39fb54788 X-Microsoft-Exchange-Diagnostics: 1; PS1PR06MB1705; 2:KshxYkvT7GTIOAbbg4DMWw5JRTyY2R0foNI32A6h0IayhuVfdgIOD/c7TA/66H03RQlAEOIY2QHkhf7J21RDVxlO0toz0weqVmkxAo1noKkbP3k4OKsKDRlCMFLdAIZKw3dKHXJIG5hAbXY5JvIavmtTLQIkaP/A786uAj7s28rWmm+z45mJnEUtk7HI1ynD; 3:dqh+pIZ0je3iBJW/tLdpA1xfY0ftDhfjdOutWBf8Qs7Uh7iiat9v2qyQ0Lz8kNVm+ZLUnVztpxgBF+LdffFZV6Kr4SCJnxAU2GMuNXW/xzxFcCQ3bjiERfPQeYOm5o1q; 25:OID0qOc2gxu4tbEV5cZS/hUw3dA99yfaBchtUMCuQ3ZpKIlpfiENccX1aTRMyVRe4/Ge6qoFfuDewBkXcbs97aQuPn1iYAMj8umyRn9d4nxjj9d4Q+17UWFO2x/mjgENB6081C0NkJ4A4Pn8uIIVlYkToH2Lpdcg+rZu3ioX9d3PUQ4QSZ+L0GN+Wq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P0KKzmn+0ff48nyPCUZFoyDpIuQPY31rwwOcGMbr9QyuhJEhFZmmgzQl34b+97XCv5Yz5Xu+Pypp6femAu0Z8QuhkKsdp8+REkSPsUC7UB6ILvvHmx0n3MVEIfUqIUVfTOlQ3gDPuPV/Y+pIq2KpqaKWITM+j/xkj+NW6KBO/vaNg4OX0Z2mZdUA40LFrsOHhddYdxZd2UHiZKun3M0oor+SP6nMhypq2w6eiNqP/rE4rIsjev6tJ6ll+I/Dj+w3jDW95/vWFA3fon+v1ng9v0N5Di6mnHm0sD+myrIasLrL50ydQGi82xevi4dZ2rqVbdFAb+KR27nXJPKSqfpVTJJHFPbQdAzI6HHA8HNP7mqxHiuYcr+b1ziRHbsVkhwx3hq/G/pQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:PS1PR06MB1705; BCL:0; PCL:0; RULEID:; SRVR:PS1PR06MB1705; X-Forefront-PRVS: 09888BC01D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(979002)(6009001)(7916002)(199003)(189002)(305945005)(76176999)(3846002)(6116002)(7736002)(54356999)(23726003)(50986999)(586003)(46406003)(81166006)(19580395003)(92566002)(8676002)(68736007)(4326007)(81156014)(2906002)(7846002)(19580405001)(83506001)(8666005)(101416001)(69596002)(105586002)(33646002)(189998001)(50466002)(229853001)(106356001)(47776003)(36756003)(66066001)(53416004)(86362001)(77096005)(42186005)(97736004)(2950100001)(4001350100001)(5001770100001)(7059030)(16060500001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:PS1PR06MB1705; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; PS1PR06MB1705; 23:ynyCnSmlmjJmq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HwwURKR9tDyoDq+D8wNx08FMLQ==; 24:sm9zSDio/GaG8mbfJgbBTf9Hn79nE/QnXliFpv9LR1Z5DuYPTiVRb9flwMGU9O3WfM3mksmxEM+jIvlit5NwQmgQWsO5ZI6QjJRIqRdKGZk=; 7:6HAR+mc/n26ztwLi98AwfBAeztdJNa/HzDCvCI39yU48iJPU0bPKq0grpMuJK/4V+7F3iI20E+LpK1bHg0H0OSUjHMdTLq/9ixZhTXBJ93D/JSnadwzaEENgKu86Z399NXpAaj7rJO+ZDabpP0UOsRVJMRdCTGXYHh1Q89oO6PsRFSQ/tH6YoDJ5/WXHN0DFXS18CnjN0G88bLxzVeEXuIygHmjRf6jGaBc8SDMV6FJvO/w2laPEL51B1PAsl2lv SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; PS1PR06MB1705; 20:8Tbfy/yuQGSSrjNuCLY/bgcOpPaA4BSwMxfCp+QzssGSx7pIgIPJ11R3eHrEefly2j6QzVYQADOkrxaSc+8crxm2clN4mvNfazbpuH+jNrSKAON8zQE9X8vToZbHgB8bfuG/zEVdUp4ylI4KS89YCmfU3giLJPcHLrpAzRlpwoo= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2016 00:35:31.8098 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS1PR06MB1705 Cc: Linux-DT , Linux-ALSA , Linux-Kernel Subject: [alsa-devel] [PATCH v2 3/7] of_graph: add of_graph_port_type_is() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto OF graph indicates each devices connection. But it doesn't support type of each port. For example HDMI case, it has video port and sound port in one device node. In this case, current driver can't handle each port correctly. This patch adds of_graph_port_type_is() for it, and adds of_graph_port_type_is_sound macro Signed-off-by: Kuninori Morimoto --- v1 -> v2 - type_is port only drivers/of/base.c | 14 ++++++++++++++ include/linux/of_graph.h | 8 ++++++++ 2 files changed, 22 insertions(+) diff --git a/drivers/of/base.c b/drivers/of/base.c index 347118e..77c9e34 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -2384,3 +2384,17 @@ struct device_node *of_graph_get_remote_port(const struct device_node *node) return of_get_next_parent(np); } EXPORT_SYMBOL(of_graph_get_remote_port); + +bool of_graph_port_type_is(struct device_node *port, char *type) +{ + const char *prop = NULL; + + of_property_read_string(port, "type", &prop); + + if (prop && + strcmp(prop, type) == 0) + return true; + + return false; +} +EXPORT_SYMBOL(of_graph_port_type_is); diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h index d9d6d9c..0a06441 100644 --- a/include/linux/of_graph.h +++ b/include/linux/of_graph.h @@ -40,9 +40,12 @@ struct of_endpoint { for (child = of_graph_get_next_endpoint(parent, NULL); child != NULL; \ child = of_graph_get_next_endpoint(parent, child)) +#define of_graph_port_type_is_sound(n) of_graph_port_type_is(n, "sound") + #ifdef CONFIG_OF int of_graph_parse_endpoint(const struct device_node *node, struct of_endpoint *endpoint); +bool of_graph_port_type_is(struct device_node *port, char *type); 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); @@ -61,6 +64,11 @@ static inline int of_graph_parse_endpoint(const struct device_node *node, return -ENOSYS; } +static bool of_graph_port_type_is(struct device_node *port, char *type) +{ + return false; +} + static inline struct device_node *of_graph_get_port_by_id( struct device_node *node, u32 id) {