From patchwork Mon Apr 27 13:24:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Calvin Johnson X-Patchwork-Id: 11512095 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 801641392 for ; Mon, 27 Apr 2020 13:25:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5C157206D4 for ; Mon, 27 Apr 2020 13:25:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BeZ9KA8d"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="g81MXDu/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5C157206D4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AIq4F9Jvnnw14fWw9DRTrT0/qG8ET6XRZEnXoEICvpk=; b=BeZ9KA8dalo39z x1lWwgEI9qcOHmDCfC+WjbsCZ89zoUHZNzZ2DWgt330xYsRJanRVzYr9tfcKhW+xdNW1+1DlPEdGo IyPx/I0dD+ernDScUmIQ1AaEbqooBlNWIAMY9hKtF/dOy2L6Lb1+yrUHUtQ1JnApFf5x0lgBpL9GF /gfkh0FJ1g/7uKG+5XlsQ4U6Hj9MFYl2hqfoqbx12Ub+QkPrWeOBvNNyPgB7+dc9VD49Tvg8OKXHM 0jF2HEYTPf7ZqM7U0yA95MSh2wvh8D4Ksk4eSzX8UuDZ+CiFkUQZoWi91H9jPkDtruL1hUmglUKnw 9btouHo9Cyl4WUWeP/UQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jT3lM-0001BH-It; Mon, 27 Apr 2020 13:25:32 +0000 Received: from mail-db8eur05on2082.outbound.protection.outlook.com ([40.107.20.82] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jT3kx-0006pw-KT for linux-arm-kernel@lists.infradead.org; Mon, 27 Apr 2020 13:25:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i0mPGm73q7rCzSNTYachJASrnCwGcq4D4hSnuEn1xHZkEStJicIQhJaJ53o/4tddwqfuRNGlyo3JJ4EB97+L9iTJV5J9C4pCIARHdY/0DUtJSWlaV5P0x9coojhkLjhqv1hLTfMY5Qh86Q1/fBSrlKLtJtG911OPJJH0z97Rm7TfRkd7GlDx4zU7YbvGLhVIXY6XaYOujO8c5TevQ67HP+hPelYtzZfTMbLyl67uINIAZlxNOzYu4svuboJ/pydQTNiYRbXIDxiwvgq4gd8rk0zS2olHIfrogihG2hECrA8TOiK/sNP5uN0FtD5ONcGX7/cqDRDfWo7O9oCj7vP6Kw== 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=vnMRBwu8UR5Opgep8jRbOmTx74QnbzjDrTcD8h0is2k=; b=c5D9VZIVzc97035BEY+GmXOi+YklQDHk1SAUQGZF8eGOwMxm4no1Lw+TSHccoobv80YTgliR8cx28812w2WFqnyRZ/+k7kit//cxIVckOQSWVLOIftfWBUpb44f3k7LffWqUoxgVsZY4SYnFDYPfLN/O0kBzSoOTNmnjDKcObwP3Q5p+mlfgsZP39+JyKjAuc/XLZWz+Jw/oyI0H3akHb5mwKqVE+MKbDlcdP3r7gvNdw4QS+BcRqia0w7M1jBsP4PeY1WGyVBC4Yri3AkwL/uNUFekKnrk0wccwJO1fRQX+lahL+WWbRQfknaUCXNO6D0OThIeSNbUEwE7sQk/VZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vnMRBwu8UR5Opgep8jRbOmTx74QnbzjDrTcD8h0is2k=; b=g81MXDu/AdUxB5xXfrhoAQzo2D2IyD/CCnbOGE5Uc1c1RsDZnLLBLXD3qT4qPis/KYTHk4TOnC24TpPpJbe2CvlKr8v+JLVjJcNuCgzf5eycgM6M9SaYjIYxNKLMK0qcrjRAwkB2FthlPB6FJ44PUkUQMV2L3V1ddmTUmE0vUGo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=calvin.johnson@oss.nxp.com; Received: from AM0PR04MB5636.eurprd04.prod.outlook.com (2603:10a6:208:130::22) by AM0PR04MB6867.eurprd04.prod.outlook.com (2603:10a6:208:182::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13; Mon, 27 Apr 2020 13:25:06 +0000 Received: from AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::c4fe:d4a4:f0e1:a75b]) by AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::c4fe:d4a4:f0e1:a75b%4]) with mapi id 15.20.2937.020; Mon, 27 Apr 2020 13:25:06 +0000 From: Calvin Johnson To: linux.cj@gmail.com, Jeremy Linton , Andrew Lunn , Andy Shevchenko , Florian Fainelli , Russell King - ARM Linux admin , Cristi Sovaiala , Florin Laurentiu Chiculita , Ioana Ciornei , Madalin Bucur , Greg Kroah-Hartman , Heikki Krogerus Subject: [net-next PATCH v2 1/3] device property: Introduce phy related fwnode functions Date: Mon, 27 Apr 2020 18:54:07 +0530 Message-Id: <20200427132409.23664-2-calvin.johnson@oss.nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200427132409.23664-1-calvin.johnson@oss.nxp.com> References: <20200427132409.23664-1-calvin.johnson@oss.nxp.com> X-ClientProxiedBy: SG2PR04CA0191.apcprd04.prod.outlook.com (2603:1096:4:14::29) To AM0PR04MB5636.eurprd04.prod.outlook.com (2603:10a6:208:130::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03152.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR04CA0191.apcprd04.prod.outlook.com (2603:1096:4:14::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Mon, 27 Apr 2020 13:25:00 +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: 449c59f3-201a-4834-6e02-08d7eaae66a7 X-MS-TrafficTypeDiagnostic: AM0PR04MB6867:|AM0PR04MB6867: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1417; X-Forefront-PRVS: 0386B406AA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR04MB5636.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(346002)(376002)(396003)(366004)(136003)(39860400002)(86362001)(8936002)(44832011)(2906002)(478600001)(66476007)(81156014)(66556008)(5660300002)(1076003)(66946007)(8676002)(26005)(7416002)(6506007)(2616005)(956004)(6512007)(4326008)(16526019)(110136005)(52116002)(6486002)(186003)(316002)(1006002)(54906003)(55236004)(110426005)(921003); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: L+CAYz0/MkMIEKFFhUTWf6NhhacDyWdRRlgEBI+BHBcOOoW1cWgxWDij4tMqxlXsU0otMKBRxi99MM0cq9CGeBEIQ2Nz3T0h0Eg3xeyMe2eqsWxyAHpXYnuO/CtxvRaaeI2KoY29Jc0oyf9/t54WPLC8kTpy7BXoM6/TMI+yBF+h/zEIyPcqGPAv9Q/asxcErAKhuIdx1ujnHc39zXVw4ouHBybJ3PjvCgEY3VL5XJ2ffojTvampO709yi0KXrzb8Eo9mCr5FXUof6kk15ZVA96LxrZOnFYV+NPqq/CZ1vakSdiud6aha6fW9WqUDIizV2iRslI5HsCbLVTj4EXv8eT11iOEE7R6qaguVx0gnw4OPfaRMT5lDxKgtioMHc3v9uTqGjRmFtXmUDhrKK2bnuk8LLZtDjrY1d07gF3Y9wjLlHPFXwwTIaGeTczbQrbBcFkusH6q92f4jUsyTr2wj9LBmMzRcr0l4TE6ODtbcCHZ0fXj9nUuqm1Tn0JW8aYpmA/W6pD1Wt1dEj4Xj7VbRQ== X-MS-Exchange-AntiSpam-MessageData: OIYWAU6BgPJhqV1HnG/4Rg5o8xH0oJ/fiZ5aKd2YzSCnzETSvdbq0a7W59/VN2hyTnAMeZRWAplOa4G2cN8nN1Vej4xclkptMVufGNEeW2e6wqe2pHLip87Hrd9V1XttEpP+FL3Fe2M2R5OoTGwQ4WcSuwan3dRbFxMphBJunS22Q/8WJZOAWt97Vo27kUWQhtXpIA30KMQBZa+jVNzgtIUS7av5aAsdqjgzjRS4uir1EMTmpTDH9Mt2ZFydhiY6rS6foCZsV36qy0VGuwamk5GA+EC1ij/W2oEAzVt+PutQlFtJNWWbNeUeeKHn2Fzeepd71lpzRRQ4dMJMbEsWCKw0Vd6CSKOiwM7RHsd4fygd3XLZHKqpJN7qwG5qLw43jL6xmu2YxK0ll3rbVZfAcAxpppCN4BpowS4z/Bl7G1cVTfW9SlmY//dRmxHS7AZ1HR8zkl1OAF23P22rBp1yyS5MXnrfE1N+gin8EDJbpfELWvhH23uI/wn7SssWv0xd6rvzhJFWknKU1ICqFN37KyFnUgHgCRHHCvtCQ16tZP6N8juS4RXckI2LIzTw5mReb5tmMydpsf0PBAbzyZl4ZitHT9xwcDcB6VktxuWv0ziYTGmWdftdHlJz8C5nJFnu79RJxISroWms2FZjnVNfI03cJmbUep+UVeFhZk3J3eBqglKJT/hfUVgwjD8uKEQdGJLC+en46/VKRKrYK3Sc6FcafojVsQPEYYqLf4nb78Z4xclGtH1R895tT0v5N4mhEPHvapXR/yQy7zr/olzS8qg6zxty8hC2MeNuCLpiNGs= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 449c59f3-201a-4834-6e02-08d7eaae66a7 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2020 13:25:06.5671 (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: lxREwOepyP+OGDqOTVfur3df4h469s+l3PeVuWYn1UF65elOSjpveF+i+xjKIr6QYndqDORcFL//WaRgYYjzKg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6867 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200427_062507_699938_20F5999D X-CRM114-Status: GOOD ( 11.84 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [40.107.20.82 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.20.82 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Rajesh V . Bikkina" , netdev@vger.kernel.org, Pankaj Bansal , linux-kernel@vger.kernel.org, Calvin Johnson , Heiner Kallweit , Diana Madalina Craciun , linux-acpi@vger.kernel.org, Makarand Pawagi , Varun Sethi , Marcin Wojtas , "David S. Miller" , linux-arm-kernel@lists.infradead.org, Laurentiu Tudor Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Define fwnode_phy_find_device() to iterate an mdiobus and find the phy device of the provided phy fwnode. Additionally define device_phy_find_device() to find phy device of provided device. Define fwnode_get_phy_node() to get phy_node using named reference. Signed-off-by: Calvin Johnson --- Changes in v2: move phy code from base/property.c to net/phy/phy_device.c replace acpi & of code to get phy-handle with fwnode_find_reference drivers/net/phy/phy_device.c | 55 ++++++++++++++++++++++++++++++++++++ include/linux/phy.h | 3 ++ 2 files changed, 58 insertions(+) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 7e1ddd5745d2..a2f3dbba8a3c 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -31,6 +31,7 @@ #include #include #include +#include MODULE_DESCRIPTION("PHY library"); MODULE_AUTHOR("Andy Fleming"); @@ -2436,6 +2437,60 @@ static bool phy_drv_supports_irq(struct phy_driver *phydrv) return phydrv->config_intr && phydrv->ack_interrupt; } +/** + * fwnode_phy_find_device - Find phy_device on the mdiobus for the provided + * phy_fwnode. + * @phy_fwnode: Pointer to the phy's fwnode. + * + * If successful, returns a pointer to the phy_device with the embedded + * struct device refcount incremented by one, or NULL on failure. + */ +struct phy_device *fwnode_phy_find_device(struct fwnode_handle *phy_fwnode) +{ + struct device *d; + struct mdio_device *mdiodev; + + if (!phy_fwnode) + return NULL; + + d = bus_find_device_by_fwnode(&mdio_bus_type, phy_fwnode); + if (d) { + mdiodev = to_mdio_device(d); + if (mdiodev->flags & MDIO_DEVICE_FLAG_PHY) + return to_phy_device(d); + put_device(d); + } + + return NULL; +} +EXPORT_SYMBOL(fwnode_phy_find_device); + +/** + * device_phy_find_device - For the given device, get the phy_device + * @dev: Pointer to the given device + * + * If successful, returns a pointer to the phy_device with the embedded + * struct device refcount incremented by one, or NULL on failure. + */ +struct phy_device *device_phy_find_device(struct device *dev) +{ + return fwnode_phy_find_device(dev_fwnode(dev)); +} +EXPORT_SYMBOL_GPL(device_phy_find_device); + +/** + * fwnode_get_phy_node - Get the phy_node using the named reference. + * @fwnode: Pointer to fwnode from which phy_node has to be obtained. + * + * Returns pointer to the phy fwnode, or ERR_PTR. Caller is responsible to + * call fwnode_handle_put() on the returned phy fwnode pointer. + */ +struct fwnode_handle *fwnode_get_phy_node(struct fwnode_handle *fwnode) +{ + return fwnode_find_reference(fwnode, "phy-handle", 0); +} +EXPORT_SYMBOL_GPL(fwnode_get_phy_node); + /** * phy_probe - probe and init a PHY device * @dev: device to probe and init diff --git a/include/linux/phy.h b/include/linux/phy.h index e2bfb9240587..f0450ef2dc9b 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -1328,6 +1328,9 @@ void phy_set_asym_pause(struct phy_device *phydev, bool rx, bool tx); bool phy_validate_pause(struct phy_device *phydev, struct ethtool_pauseparam *pp); void phy_get_pause(struct phy_device *phydev, bool *tx_pause, bool *rx_pause); +struct phy_device *fwnode_phy_find_device(struct fwnode_handle *phy_fwnode); +struct phy_device *device_phy_find_device(struct device *dev); +struct fwnode_handle *fwnode_get_phy_node(struct fwnode_handle *fwnode); void phy_resolve_pause(unsigned long *local_adv, unsigned long *partner_adv, bool *tx_pause, bool *rx_pause); From patchwork Mon Apr 27 13:24:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Calvin Johnson X-Patchwork-Id: 11512105 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AE7131575 for ; Mon, 27 Apr 2020 13:25:53 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8BBD8206D4 for ; Mon, 27 Apr 2020 13:25:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Fva/aSJR"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="XWvq5ans" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8BBD8206D4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Tsun7+9RkNSf3qrUdcvIV1AhE1JbxKMttKK8FiUTN94=; b=Fva/aSJRdF2vXd uDXzn6qoOlD7XqbKdHpzPhC97FY9LnQ4R4CEQ0Dz4zq4yXn0uNkq/jv85tUsGalfDLcjMdqtPVqmQ gJ6hc0I1sSgwcSkmSd8arOpPANlMwTQbGFP2dCyfBODgMlCPjyfQOLK3whZzcjx9E1hJY6EL3fSXu YK+zS5iul2y2ian/h1Knnu7II00gjPtT/5kKdXYJeg3b9HaAdkYMiPI+Y0VE1KcjOFmr5++l4ugkt yI30b+5bJXZZF7zbqmeDq51vhdhova4UafbrU6N7nzTtAPRUE9gq52WFsBCUB4svf4DCpFiE4sF0o L+FLH3zfwRtKmbvVVZfA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jT3ld-0001Qz-Iu; Mon, 27 Apr 2020 13:25:49 +0000 Received: from mail-db8eur05on2042.outbound.protection.outlook.com ([40.107.20.42] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jT3l5-0000KP-Jv for linux-arm-kernel@lists.infradead.org; Mon, 27 Apr 2020 13:25:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M76lILtfYtk6O6SQkRQAdWGocm7zyWUzqfUuLqYCqQ9OwVp5SKrWhfPf1Pk9pDFn6qJfZSaLeU8MamPRTtdSqwYGvkbc/YvU+0bzMGsP5pB3cw6kyPWZ5PlQgdvbU8oXvPzHRLXhWt2BMXQuzjhZubhHfv0GXsw/Yd2Gwl5tjLzN/V+KiEFt2E7Dyus+qppNbqYHeGayA6K1Sk61kF1a+hUvSmZMt6hMAWADeTJ2rSzP6UcJOO6U7Een/vK+xE5YV/RAz/jPA7IonlqF2iZpf72NdyS9Oah1hSrfwMLVqNI5r4D8qzglVbQs1sKqdXx0uhqXZ6PHVOsEeznccdUxPA== 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=bwPSdZd0MfMChaSmn/JHPM8/4ao/rPU5B7SkAWZayvk=; b=U39dRTTRNy34VZw0FeWRSSWL09JjtgZ3hWsLeLVpAmORVGUehrsj6Qk8F7M9SnKLWww6jahpWVcBdpJx8ZLc05+l0Hr57Lj1wwtgRbv8Xzq5/flLB08QkCHnreNsNwfwQZj8LC964LsqdwS3dmhgOuvU/BC6Ts4hmz91c5sFfaIvLjvw3GxKMV4TdJQ/RsGFRPDBJ94EWCElo8tk/vYAq5i2oXgFYHEz9SIUk1veJ2/2qzOAVyPVVDFkCmagpXLzyk342LyZdC24vJhg9WbU77Mbej0HUCbSWxCsuD+ww1sEhEHKZnaSeorLg4rVQqxlZ5oqQQ0pDQP2iS4b0GvPsw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bwPSdZd0MfMChaSmn/JHPM8/4ao/rPU5B7SkAWZayvk=; b=XWvq5ans2WukDAIhO9hlqfTWp/Ygd0Md4ea/BoUEnJwWJYGD8CAUdZrJOJXepBSoYBV/ZK/d1O5pd2MtZvh49s1hNHtN5T/LtquSwyt51klnjWJcZEDgIhX7hgJSjspQJcpIY9fC/M/qgEsSaZBRJJ8hTvWk3V2msl/WEeprYtQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=calvin.johnson@oss.nxp.com; Received: from AM0PR04MB5636.eurprd04.prod.outlook.com (2603:10a6:208:130::22) by AM0PR04MB6867.eurprd04.prod.outlook.com (2603:10a6:208:182::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13; Mon, 27 Apr 2020 13:25:12 +0000 Received: from AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::c4fe:d4a4:f0e1:a75b]) by AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::c4fe:d4a4:f0e1:a75b%4]) with mapi id 15.20.2937.020; Mon, 27 Apr 2020 13:25:12 +0000 From: Calvin Johnson To: linux.cj@gmail.com, Jeremy Linton , Andrew Lunn , Andy Shevchenko , Florian Fainelli , Russell King - ARM Linux admin , Cristi Sovaiala , Florin Laurentiu Chiculita , Ioana Ciornei , Madalin Bucur , Greg Kroah-Hartman , Heikki Krogerus Subject: [net-next PATCH v2 2/3] net: phy: alphabetically sort header includes Date: Mon, 27 Apr 2020 18:54:08 +0530 Message-Id: <20200427132409.23664-3-calvin.johnson@oss.nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200427132409.23664-1-calvin.johnson@oss.nxp.com> References: <20200427132409.23664-1-calvin.johnson@oss.nxp.com> X-ClientProxiedBy: SG2PR04CA0191.apcprd04.prod.outlook.com (2603:1096:4:14::29) To AM0PR04MB5636.eurprd04.prod.outlook.com (2603:10a6:208:130::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03152.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR04CA0191.apcprd04.prod.outlook.com (2603:1096:4:14::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Mon, 27 Apr 2020 13:25:06 +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: 0d7ae5fd-62ab-45a1-3d8b-08d7eaae6a52 X-MS-TrafficTypeDiagnostic: AM0PR04MB6867:|AM0PR04MB6867: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1051; X-Forefront-PRVS: 0386B406AA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR04MB5636.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(346002)(376002)(396003)(366004)(136003)(39860400002)(86362001)(8936002)(44832011)(2906002)(478600001)(66476007)(81156014)(66556008)(5660300002)(1076003)(66946007)(8676002)(26005)(7416002)(6506007)(2616005)(956004)(6512007)(4326008)(16526019)(110136005)(52116002)(6486002)(186003)(316002)(1006002)(54906003)(55236004)(110426005)(921003); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DURloPMU0Qd5rakIPpGcb0PW5OWYaAYgicXXM8GWbZ5FCG74GyhVD+iXHPvgxIZMYHEURDMIMnUy73OXSLoDDoj2FVEsvDNz7KkGNzYatqhyumLLuJZo4AGCU9FP8hhu8wVxhc1Dy7Kc+uGi7lOCPYLnVacEgjgbF4NV62kMXP848bDyxomBPn87YK3lnFGRjcWrHwvEjJGIiZW4I8eYcx5Aqp6RpgCLedditcj7f6Up++fBjoYnvbG4nb3dJezmdMKsSi53/JFi4K/zriFQJeqj+XMEAYSaThAx1poC+LJI5sbslNZ8N0sYZbYdQTh7XKL06Ee/ovtzpZQxavwciTn84VfIzLLihj90Xy2WZIhLzwAhLbj7p4B7wMkkVzsJeJ0dckQxHJCXC5gVrb54G1hEE66x9Sj0OSA6hOOqyXQeeNnYs03u6bC4MJbDbTmIT+qs0ZsG7J77Tn7XA2ZpyopHfyRrCpNIH8Y2lBcLCzQQL2ljyc9FlsqtVBOXbr3dW7dh1solYDNKwbws/E/BEA== X-MS-Exchange-AntiSpam-MessageData: ORm5IyRD9IQ1F08ln/8I08YPuWouUF8fAIZNMs0acul5Js+DEp/s/aOWAOSRRIxSXyERa//M/BNuOUK70dNzYibG4NgetyYSDP466OwyQ6BFx347R6iLwmAHwflF4q+0tcso6wLg/MDTSILk+AY6mF34vVHOhiQ6gx/nKFTNJysnLIY9IdKphx4jt+TuwL+q0ZfUaOkNy0THE82+oXHdjR/85AZQT+AwhYmMvBXcBXIyiRrLVxdrNe/euBIejOwUOh6lcn5ZaB+jkQac/Q4kY3x0adu4Zfr+HU60RfUuuuGbOsI8WFIkk6P+4XAxwUf32xMrPewWGCOUL8qgT+dVEL54gmAyMI0Pst8d/vF35tZxc4Z0eHDaQqejm2qMbh57h+EomaXelpzALKgw47VG/iK6IkOTzlxVrsUSf+Q20vmJOn5+6FclufBYX/NXRRWRO30vklt5ArpvSItchXsAoA7U8EPhr3L6YKCTCHbq8DwgVQIZn/t12EgrANuLPl+9o/fQPC7OJ602qGTPAqWXNV9QDqHVrWpSaE0bg3O1aXmM3lDTSMhC/bQt+8R43uBYet9t0ycCFAs1GQtX5FuUvCFJPI9cNYUl9ovbzgCukEeT+MX0dm0fYVWSO5GInbZSTtLLnYDzSxhnrOMHik1hwcAC1AiNbzmLofDgltLSPq7HqRh3Wl85f3ICfP57BBkKVm+AYHgH8W7r3TfyE0odilaCVTlZ1GOkvmVx9M2w6CgNFGjKiejrsvW8oi3PV4xb3XIrJbTDRen7r9AlqmwIz63CogAUwHDlKtX7Bvpfe5g= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0d7ae5fd-62ab-45a1-3d8b-08d7eaae6a52 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2020 13:25:12.6987 (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: EoDpEEElx7rKWSWu0/S9ljq9JZOsLL55pk7Sos2FsGsSKCdtFrZKIo5S6YGCx113wMjb5o97dlGyaREh8LQ1VA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6867 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200427_062515_760743_2F825C50 X-CRM114-Status: UNSURE ( 8.66 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [40.107.20.42 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.20.42 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Rajesh V . Bikkina" , netdev@vger.kernel.org, Pankaj Bansal , linux-kernel@vger.kernel.org, Calvin Johnson , Heiner Kallweit , Diana Madalina Craciun , linux-acpi@vger.kernel.org, Makarand Pawagi , Varun Sethi , Marcin Wojtas , "David S. Miller" , linux-arm-kernel@lists.infradead.org, Laurentiu Tudor Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Header includes are not sorted. Alphabetically sort them. Signed-off-by: Calvin Johnson --- Changes in v2: None drivers/net/phy/phy_device.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index a2f3dbba8a3c..b8326bfc7c2a 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -9,29 +9,29 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -#include -#include -#include -#include -#include -#include -#include +#include #include -#include +#include #include -#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include -#include -#include +#include #include #include +#include #include -#include -#include +#include +#include +#include #include -#include +#include MODULE_DESCRIPTION("PHY library"); MODULE_AUTHOR("Andy Fleming"); From patchwork Mon Apr 27 13:24:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Calvin Johnson X-Patchwork-Id: 11512107 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 281D41575 for ; Mon, 27 Apr 2020 13:26:16 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D4DFF206D4 for ; Mon, 27 Apr 2020 13:26:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BXQWlKBh"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="T/sxI6U8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D4DFF206D4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TA2Cm78qJu0p+2N7+7Kq0lh0DmRXZ/Ay+sW4HcBea4s=; b=BXQWlKBhaiHQE5 k/187oW9Ha84/o2CIxZUpT/B6UsUG8/v5Vw0h7kuUmTOxYYfeZfEGSx1OeFmqpg+tCUNdVbl/tI0z vfFKmxZF0acQRD1gq0ljhJLRNZzDt77ohrgyX40XdKUp5rLN+MzJ+tWEBmpXtoopwrWV/zNCvJOwJ qFCAqwPqXOyzp/LZnfrhmRS97tYIuhOY5nqJHcqA4LH3bMmNJLmS39CduYFT8bSJGQ8EZXymly/p8 aUC3Hf2+ZWWCA+6F+EuxXmWGlZDZ31y5oKRmNgdEWUfIzfPLHYTpPJwSwRbusxtTS9yPR9rFdXmIT Bl0W/DWG66KwFxVdHLjA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jT3lz-0001k7-Jf; Mon, 27 Apr 2020 13:26:11 +0000 Received: from mail-db8eur05on2088.outbound.protection.outlook.com ([40.107.20.88] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jT3lB-00012m-Dc for linux-arm-kernel@lists.infradead.org; Mon, 27 Apr 2020 13:25:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H6AW5Rbur9wMTA5/vl+494E/WOH5z8iu1cJdiURpGWRlhPMolJ/8MVAnddW6FvOd51qLzRIieLSxUgmOZSl2tq+UrSHdOgwfo1d1rtayb7XHYPNsRT8Xz77ZgwdcU4qEFqbqWVw+fGBMm0KZmYKa0ZNbLwADSGwMAISsNInUXpH/TQ15RANgs8Qw93TQP0WhJSCbmtnj2baRpA5rctTI34a4g2KORj4+XxZ9GKiDoyrZzbO3u3w5bmj6gj4j+ISDhMJSCK5U7sCqzbylQV2Zi2gCL7MU06HQtVkiHWzZ1cXfuamM8lEgiUKuK28eQu41DVyyYTD+OYX72ywVVpKNOQ== 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=Smyu2QabomlLWNqAG8Ri/BK1/sj7FPm9Ho7QY16gSTo=; b=R8A7YDVI/4UGBSZ7Nh8fiZkgH0/t1u5XwJqNHBdsjtJRxhh3IN5Mm0iL7nqZ2qOxJMCLP00DVRLUnuwt/2CJj5fna28B7S1RQ4CceM2EWQXMzoYvE7/tQ8r9do08KaCoWZpWmMzhkZ52t6ZufjUhFAmjPJxMMapM4Z8f7pAESAVUWsETdQRrJlqzUnGXVZHZwB9vZcVDL3sk0FNScA0iJ+2uGCSaGPCv6QTxSgxXbx3CLBxtwf7Aptad9kJKO9bmatUIGp7rHRK6E4tydW53yRwVWocGTC6jtnnd3uCJHCffwoXgEaGIcTkV99Q2oSLpZhbUoT49avMAwgFGk6eZ3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Smyu2QabomlLWNqAG8Ri/BK1/sj7FPm9Ho7QY16gSTo=; b=T/sxI6U8iTJFq5kePfcu/1JoHXT6YohG0Lz6dg98DLR6tK95y0l6BHZGXd8C3iuZulnG2wvmWD4FIRqWUHjMhlitV1YTILbVYdZvErjX4qgOx7WyiKyTC01r4K7qxfsagG5uU/A3qx1Gvfs4XFYCPWGD1tB2YHtFaqQA6w6qe2o= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=calvin.johnson@oss.nxp.com; Received: from AM0PR04MB5636.eurprd04.prod.outlook.com (2603:10a6:208:130::22) by AM0PR04MB6867.eurprd04.prod.outlook.com (2603:10a6:208:182::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13; Mon, 27 Apr 2020 13:25:18 +0000 Received: from AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::c4fe:d4a4:f0e1:a75b]) by AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::c4fe:d4a4:f0e1:a75b%4]) with mapi id 15.20.2937.020; Mon, 27 Apr 2020 13:25:18 +0000 From: Calvin Johnson To: linux.cj@gmail.com, Jeremy Linton , Andrew Lunn , Andy Shevchenko , Florian Fainelli , Russell King - ARM Linux admin , Cristi Sovaiala , Florin Laurentiu Chiculita , Ioana Ciornei , Madalin Bucur , Greg Kroah-Hartman , Heikki Krogerus Subject: [net-next PATCH v2 3/3] phylink: Introduce phylink_fwnode_phy_connect() Date: Mon, 27 Apr 2020 18:54:09 +0530 Message-Id: <20200427132409.23664-4-calvin.johnson@oss.nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200427132409.23664-1-calvin.johnson@oss.nxp.com> References: <20200427132409.23664-1-calvin.johnson@oss.nxp.com> X-ClientProxiedBy: SG2PR04CA0191.apcprd04.prod.outlook.com (2603:1096:4:14::29) To AM0PR04MB5636.eurprd04.prod.outlook.com (2603:10a6:208:130::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03152.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR04CA0191.apcprd04.prod.outlook.com (2603:1096:4:14::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Mon, 27 Apr 2020 13:25:13 +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: d757c344-9949-46bb-b21b-08d7eaae6df9 X-MS-TrafficTypeDiagnostic: AM0PR04MB6867:|AM0PR04MB6867: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2399; X-Forefront-PRVS: 0386B406AA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR04MB5636.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(346002)(376002)(396003)(366004)(136003)(39860400002)(86362001)(8936002)(44832011)(2906002)(478600001)(66476007)(81156014)(66556008)(5660300002)(1076003)(66946007)(8676002)(26005)(7416002)(6506007)(2616005)(956004)(6512007)(4326008)(16526019)(110136005)(52116002)(6486002)(186003)(6666004)(316002)(1006002)(54906003)(55236004)(110426005)(921003); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tcZ5J0LKf3JjBcGqfhuVFgy+roLgkwJwRtL2YfCwbAhrRAMk8UxheMzFbHEE6fcc9SGvDm/AFGUuybPsMkx/JsOqcmZSi25l87BPADx/I1RVMurb3U/sHvJBMwnbnzOKDb+ZQ9/AdXCDG05ih4QFxKdohH1lr8uCLtUCnv8oUyGsYXKiY19FOJ+eWisgVEg4aVj+I9xeoNEKEofuDMBhrJjgRmhtCukH+AUcvaP/Y5AFdIFvt/yUfhVvN8TznS6XK1CAcJTx2TQQcJMv5+1SAJAs+XcfxPsGxWPCrb2NYD7MM3Sd78xXgXpZdp+fcrEHoFJeRqegVE4NGFvd/Qv/8uolLOlIx1c/dTyYu+y/W46jPrRaPSb+zOyaz+v0n3wbENuTCaoC2jqoWI5qUdsM8iC9H9AG/jXwxsU1vZ0aCeMkts88xW7QKVgSc7GNuLyN2pPvF8UCMJQ0F8bKP8BjbREpgu2UoG9/TImVuzZwMuwE/3A7op8z/Ntf42pQly7TNLRAhc6Ju+zcUFsJBipSaA== X-MS-Exchange-AntiSpam-MessageData: cryWS9kb44KTNLxKSaIkQ4fL0o9e06RE2XdtzBxv/ItTiA4TE36oDZ0smCV8hFI3ZIs85oFUd0BBo46UV5tAk7NCz65ZrpCUZpTsnpSDa35p1wgkM7g9IApI0iM6aM4Cu9WfTC2taSyPhUVvFP2sJbgWxXHsdTifxnWXVS6HXeM9Ntij6xVYfS8KGjZH4G1C87z6PF5CYaEXSBcEQ6QqqjaY/UYjMqI2d3H6khBUJtKEen5JjTtm7HV3pfcXRcQEKbt3K4KkEJ/awqNLzxILbkjFxk/hnUOjkDxjY1ILlN9xTUwA+teYf3HCMlnD1JfETAwFs/nvRhJd+HTCl98+MJaaJa4Cs76oTgb2hCTTnFMuFPJk+h33DFRD2bJetFfmZ0BU8m2nnrXhNEa3YyJ3HSWaaNfX4JsLFsL0WMbzmfhEp706uGYIvBWuw7OVuUxgsYl13lhn1glQkIhkJLBa3ta6dyekiHU0WA5GNcgNZj4fXQuW4YqQgVpbV9nrvI8KHWZj0aXhdaUGZZGeT7hwIdl4D2BOA0Z1z4n/j63T+UMOQMlhb/WuvDAr3IxuQcrJXB6EnWhGLwbTwcjQdAzH1z4Y4yw6PH8fmwmsUIM2fgYCzBxdAzAtlaJq/eYdMhjNAAvNudigELCctKfsGSZ+nYQ5CpsD41/2hVxykAKCP4uhawapWdiGhhF51LS2Y6Y9ruuI+07qQnaDCITjaX+migPahbkAMsX6UXTHipAA2XpCYxjxVQ1NorUPK0qesxRGz7H1rHi+kod+LvDb6r7nYAbGJ6EOtwkehfE+3t5quB0= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d757c344-9949-46bb-b21b-08d7eaae6df9 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2020 13:25:18.8043 (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: wIP2sQqOmPMRcyGdMTNUVhL9i+FMG7/RCEJoHfMB8U9U0USRcpuwURhECdRsNPvCB0ERmgoNXB2P/k2ccsY+3A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6867 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200427_062521_483553_D326DA46 X-CRM114-Status: GOOD ( 11.78 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [40.107.20.88 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.20.88 listed in wl.mailspike.net] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Rajesh V . Bikkina" , netdev@vger.kernel.org, Pankaj Bansal , linux-kernel@vger.kernel.org, Calvin Johnson , Heiner Kallweit , Diana Madalina Craciun , linux-acpi@vger.kernel.org, Makarand Pawagi , Varun Sethi , Marcin Wojtas , "David S. Miller" , linux-arm-kernel@lists.infradead.org, Laurentiu Tudor Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Define phylink_fwnode_phy_connect() to connect phy specified by a fwnode to a phylink instance. Additionally, phylink_device_phy_connect() is defined to connect phy specified by a device to a phylink instance. Signed-off-by: Calvin Johnson --- Changes in v2: replace of_ and acpi_ code with generic fwnode to get phy-handle. drivers/net/phy/phylink.c | 68 +++++++++++++++++++++++++++++++++++++++ include/linux/phylink.h | 6 ++++ 2 files changed, 74 insertions(+) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 0f23bec431c1..5eab1eadded7 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -961,6 +961,74 @@ int phylink_connect_phy(struct phylink *pl, struct phy_device *phy) } EXPORT_SYMBOL_GPL(phylink_connect_phy); +/** + * phylink_fwnode_phy_connect() - connect the PHY specified in the fwnode. + * @pl: a pointer to a &struct phylink returned from phylink_create() + * @fwnode: a pointer to a &struct fwnode_handle. + * @flags: PHY-specific flags to communicate to the PHY device driver + * + * Connect the phy specified @fwnode to the phylink instance specified + * by @pl. Actions specified in phylink_connect_phy() will be + * performed. + * + * Returns 0 on success or a negative errno. + */ +int phylink_fwnode_phy_connect(struct phylink *pl, + struct fwnode_handle *fwnode, + u32 flags) +{ + struct fwnode_handle *phy_fwnode; + struct phy_device *phy_dev; + int ret = 0; + + /* Fixed links and 802.3z are handled without needing a PHY */ + if (pl->cfg_link_an_mode == MLO_AN_FIXED || + (pl->cfg_link_an_mode == MLO_AN_INBAND && + phy_interface_mode_is_8023z(pl->link_interface))) + return 0; + + phy_fwnode = fwnode_get_phy_node(fwnode); + if ((IS_ERR_OR_NULL(phy_fwnode)) && (pl->cfg_link_an_mode == MLO_AN_PHY)) + return -ENODEV; + + phy_dev = fwnode_phy_find_device(phy_fwnode); + fwnode_handle_put(phy_fwnode); + if (!phy_dev) + return -ENODEV; + + ret = phy_attach_direct(pl->netdev, phy_dev, flags, + pl->link_interface); + if (ret) + return ret; + + ret = phylink_bringup_phy(pl, phy_dev, pl->link_config.interface); + if (ret) + phy_detach(phy_dev); + + return ret; +} +EXPORT_SYMBOL_GPL(phylink_fwnode_phy_connect); + +/** + * phylink_device_phy_connect() - connect the PHY specified by the device. + * @pl: a pointer to a &struct phylink returned from phylink_create() + * @dev: a pointer to a &struct device. + * @flags: PHY-specific flags to communicate to the PHY device driver + * + * Connect the phy specified by the device to the phylink instance specified + * by @pl. Actions specified in phylink_connect_phy() will be + * performed. + * + * Returns 0 on success or a negative errno. + */ +int phylink_device_phy_connect(struct phylink *pl, + struct device *dev, + u32 flags) +{ + return phylink_fwnode_phy_connect(pl, dev_fwnode(dev), flags); +} +EXPORT_SYMBOL_GPL(phylink_device_phy_connect); + /** * phylink_of_phy_connect() - connect the PHY specified in the DT mode. * @pl: a pointer to a &struct phylink returned from phylink_create() diff --git a/include/linux/phylink.h b/include/linux/phylink.h index cc5b452a184e..c2bd0ee9dd9c 100644 --- a/include/linux/phylink.h +++ b/include/linux/phylink.h @@ -367,6 +367,12 @@ void phylink_add_pcs(struct phylink *, const struct phylink_pcs_ops *ops); void phylink_destroy(struct phylink *); int phylink_connect_phy(struct phylink *, struct phy_device *); +int phylink_fwnode_phy_connect(struct phylink *pl, + struct fwnode_handle *fwnode, + u32 flags); +int phylink_device_phy_connect(struct phylink *pl, + struct device *dev, + u32 flags); int phylink_of_phy_connect(struct phylink *, struct device_node *, u32 flags); void phylink_disconnect_phy(struct phylink *);