Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp765049ybl; Fri, 31 Jan 2020 07:37:30 -0800 (PST) X-Google-Smtp-Source: APXvYqyRPV74jBbE4ukbyvwHKpS8pFCpwvcTV0fnURlFtShP4/Yo/qWHgSiO64NeEyHWf9tsY1qE X-Received: by 2002:a54:4716:: with SMTP id k22mr6792381oik.39.1580485049938; Fri, 31 Jan 2020 07:37:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1580485049; cv=pass; d=google.com; s=arc-20160816; b=qnOD5iNM9l7lLna5El/w7JDFiGtmhMslUhRtXljiIRHjzUcw6IzDsKjkCTJMYSz1Nv g1UnLpNs/zUUbyEPeeJL0GrB1CjjUQfI6gFleM+p17ZXS79DIvfqfxDqJ2kP+tuICF1S coXJi0Ul1deaFF1vYjm6l/ICB0PgI7UM73niEG4q03ChFM4opuBJKYdAGp7QlglMbXNc 5zLEtafmovKhI0bb5BcI6/j0thC3ZZFMH0cQJ20Z3NDjlKV6V2vvVmrnNMC2Tb6VAu7t 22izS+l9hWXjPIhPgooR2cG2xf6oXnWmcMZE2pNEO6ClOyoRg5BMdKpu2OsgyhJXCUdU AWTA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=re6a6RR+cw7cCgi01mPnO80wlQ7+YuLOYVtWXBc+khk=; b=HOp4VvGr+p5h6vP/RJ465fXy/B5E88tHIh4SN9GeWikWza1mfK2mqHwN6C/yRFVncX rPfleyXHbqf6Y0rMmTMUUpKri2ZdZd4xu32CmOxBKMK+duByQd9V3unzLy8OsqeJenTY 0AjMopTv62uZOPu3kAzH/0/wl91oVtr1LE8i/MXw1RIsQ3Pzmi247VYoOa8lNxuJatuE dZa3j7jLyx9IAYzEMEiSPa9EHnnCK/wRofQ34S2UYQKU2rg+7PXb0tj5/6sRp586IQBo gBqUfHSAlw+cWJU8qYwt4KB7f52+7SivwxxiYSuksG6XhgplwKiJsl/OzSLMcuwlCO8S Vfpg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=PAh2phsB; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x26si4732629otk.325.2020.01.31.07.37.18; Fri, 31 Jan 2020 07:37:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=PAh2phsB; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729294AbgAaPfv (ORCPT + 99 others); Fri, 31 Jan 2020 10:35:51 -0500 Received: from mail-eopbgr150078.outbound.protection.outlook.com ([40.107.15.78]:48709 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728922AbgAaPfu (ORCPT ); Fri, 31 Jan 2020 10:35:50 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iAyyS8PfHBM06OldkNOA/b4rRMht+JIxWPK8Z0rAzNC6xDdwgbxryek553ns7m4jH6HYMsMLJHnbCu3Ks5kKOgRFJp5ooQyw9YI0Y4OA1DZJgjbn3toEDvOW0CZKiFspAPK6K2wp6W922olE4S85EB5sm8tU5BZE07Q/E5lkGoP2BIgBDvs9VW5oldIn9nSw9+Yjt+GRy45Jh+7nMIRfLWqWS8YcjGg80XqMfGqNohui41EIS3LAiGDCQB19HSpsCHzIyFsHU4NMULIy+pVUli7lK76nqN/CPwVkoldyfQ/kS0qHVRo55K8gBIGe6WYaPM4dXBpbefBXi9KYasTyjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=re6a6RR+cw7cCgi01mPnO80wlQ7+YuLOYVtWXBc+khk=; b=E48D7hiXHGoCp9qID7gJPlZe6rB3yWvkeDTc4lAIcqvEoUXvNJH68SPrK/H2zrC7y2e4hOtpLIDumtiqqnUxzZp20kBCIDBbJpUYu/9B5wZzEOegcDoSuA7Be8KZt97bMjYX4zC13nuZn3B7vtWxTWdD42n0XL+3YfSnTFZc6XrpjmF/nz4yXxTKvONwnBVXhzjl+E+L7qWN1Ng9hZuBxdsHT2wwrxxisQeu6/xWQiJjXzQ0q/H2MfLdrthZRzI0lQLLSPPakS0yQi3ahbVbRgg7gpIjIrscaO39gv7OujXNGK4QDe1YlLvwIQ9u9jTo04KgWZKtA0c77DjZLHlgHQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=re6a6RR+cw7cCgi01mPnO80wlQ7+YuLOYVtWXBc+khk=; b=PAh2phsBGGh3HGsXBbzVeN3tf3FBFPbulGiM/htG4dfMebOj9GFLYTRubla0nCHxhiXh103DTUEo1nQI8nli6b7zbQUr6C429aqkweTfNz+Wd6NdMedbi4OSS8R0bIXXPuUPRiMISfuuWUCuLmHGYxALTUMWd7yfGI9fNwRYi+A= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=calvin.johnson@nxp.com; Received: from DB8PR04MB5643.eurprd04.prod.outlook.com (20.179.10.153) by DB8PR04MB6730.eurprd04.prod.outlook.com (20.179.249.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2665.22; Fri, 31 Jan 2020 15:35:47 +0000 Received: from DB8PR04MB5643.eurprd04.prod.outlook.com ([fe80::e1be:98ef:d81c:1eef]) by DB8PR04MB5643.eurprd04.prod.outlook.com ([fe80::e1be:98ef:d81c:1eef%2]) with mapi id 15.20.2686.025; Fri, 31 Jan 2020 15:35:47 +0000 From: Calvin Johnson To: linux.cj@gmail.com, Jon Nettleton , linux@armlinux.org.uk, Makarand Pawagi , cristian.sovaiala@nxp.com, laurentiu.tudor@nxp.com, ioana.ciornei@nxp.com, V.Sethi@nxp.com, pankaj.bansal@nxp.com, "Rajesh V . Bikkina" Cc: Calvin Johnson , Andy Shevchenko , Dmitry Torokhov , Greg Kroah-Hartman , Heikki Krogerus , "Rafael J. Wysocki" , Sakari Ailus , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: [PATCH v1 5/7] device property: Introduce fwnode_phy_is_fixed_link() Date: Fri, 31 Jan 2020 21:04:38 +0530 Message-Id: <20200131153440.20870-6-calvin.johnson@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200131153440.20870-1-calvin.johnson@nxp.com> References: <20200131153440.20870-1-calvin.johnson@nxp.com> Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0061.apcprd02.prod.outlook.com (2603:1096:4:54::25) To DB8PR04MB5643.eurprd04.prod.outlook.com (2603:10a6:10:aa::25) MIME-Version: 1.0 Received: from lsv03152.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR02CA0061.apcprd02.prod.outlook.com (2603:1096:4:54::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2686.29 via Frontend Transport; Fri, 31 Jan 2020 15:35:42 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [14.142.151.118] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 414395cf-fb5c-4645-e3cc-08d7a6633e0d X-MS-TrafficTypeDiagnostic: DB8PR04MB6730:|DB8PR04MB6730: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:635; X-Forefront-PRVS: 029976C540 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4636009)(39860400002)(396003)(346002)(136003)(366004)(376002)(189003)(199004)(52116002)(7696005)(1006002)(66556008)(66476007)(2906002)(66946007)(8676002)(110136005)(55236004)(8936002)(26005)(81156014)(81166006)(316002)(6666004)(478600001)(54906003)(7416002)(1076003)(36756003)(6636002)(6486002)(186003)(16526019)(5660300002)(956004)(86362001)(44832011)(2616005)(4326008)(110426005)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB8PR04MB6730;H:DB8PR04MB5643.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DmvI3ze++uKVQ5gAQu7Gdy2AgISX17bSa9Pjy/jynREEje3Dd0uNWqbnOxgYiWf66OYrW7AkCfEX3Su7sXPAgnps4wHHfWtpBxVFVDOx9r3W9vgxmJyzl+D2/lKa10mQar57uWYACaPuXsJ6S/T2nz7aJhzuZxiUtCuCCchFLA6AhPycCEFO4ffIcje4bsRpSfVYNzuU65UNHH/rQZHbJTKYLLSHBoE5iHyOsH0AyCyOZvDyPTyPK/BBpdKCLKQdu66a1dhTptmXQn3Peqpb9bVbRLOlv4em0ucB1XBxn8kpd43Ug36KNerND0h0k5ZTHnuCdIShNNJ7ZMUM+8khcVvn2BRp5hD1OuNa5gfIhB9fAZwEmbfrR70BebiHL38fr0dq948tNq16WBDWLKjS0ngeSnc1Anolb1paBzEc/WxeQTZx+S8eQ+SJV0xdXYNxYLlmACtMQdm37HEm8XLMiW2QjARp+synf2d+ASdbVlBHceXsk2T7hA8Ac1Kj4VoA04mOAEhNX59AvtNbitRxNpGWVSmPCUwjC+z/9ZyTFxs= X-MS-Exchange-AntiSpam-MessageData: iv7mJrQbz6/fZguqU0pYwthY1cpAcWze3cp5NrUpoGMVLx/Zxa+nTawXSiG/cJkVLMDgM9SFceO5M6yBf2EDZK5EoDFshqF4hshzUZLvtBpIUhz5xIf+TD+aOCaieyuI/fp6EbbciLCR9MRfM+LKIQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 414395cf-fb5c-4645-e3cc-08d7a6633e0d X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2020 15:35:47.1054 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: e5yqWqdPAeh8eFbgzsZMnnhGRhl7xiJX2C85ecsygfXClAcAq/o2Xfx/eh4jnMo/IB9DpYqPDQDAJ8fXp5qlSQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6730 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Calvin Johnson Introduce fwnode_phy_is_fixed_link() function that an Ethernet driver can call on its PHY phandle to find out whether it's a fixed link PHY or not. Signed-off-by: Calvin Johnson --- drivers/base/property.c | 21 +++++++++++++++++++++ include/linux/property.h | 1 + 2 files changed, 22 insertions(+) diff --git a/drivers/base/property.c b/drivers/base/property.c index fdb79033d58f..a0f69fae82cd 100644 --- a/drivers/base/property.c +++ b/drivers/base/property.c @@ -827,6 +827,27 @@ enum dev_dma_attr device_get_dma_attr(struct device *dev) } EXPORT_SYMBOL_GPL(device_get_dma_attr); +/* + * fwnode_phy_is_fixed_link() + */ +bool fwnode_phy_is_fixed_link(struct fwnode_handle *fwnode) +{ + struct fwnode_handle *fixed_node; + int len, err; + const char *managed; + + fixed_node = fwnode_get_named_child_node(fwnode, "fixed-link"); + if (fixed_node) + return fixed_node; + + err = fwnode_property_read_string(fixed_node, "managed", &managed); + if (err == 0 && strcmp(managed, "auto") != 0) + return true; + + return false; +} +EXPORT_SYMBOL(fwnode_phy_is_fixed_link); + /** * fwnode_get_phy_mode - Get phy mode for given firmware node * @fwnode: Pointer to the given node diff --git a/include/linux/property.h b/include/linux/property.h index 1998f502d2ed..ba89fcf091c8 100644 --- a/include/linux/property.h +++ b/include/linux/property.h @@ -333,6 +333,7 @@ int device_get_phy_mode(struct device *dev); void *device_get_mac_address(struct device *dev, char *addr, int alen); +bool fwnode_phy_is_fixed_link(struct fwnode_handle *fwnode); int fwnode_get_phy_mode(struct fwnode_handle *fwnode, phy_interface_t *interface); void *fwnode_get_mac_address(struct fwnode_handle *fwnode, -- 2.17.1