Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp1181564lqt; Sat, 20 Apr 2024 04:23:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWVGSxNmcsXcT2ZBGndeiEHZcPSNxz05VJWCSmOqqlDhm+/mf0WHgQ0biuTWtzgXhS17GtFM188DJaZFlsH/kmwo7tHdnKX7JH1eUCFUQ== X-Google-Smtp-Source: AGHT+IGH4O1Mjz6amLqIj76x+h9IHP2d+CLScY/cmpLbC81t1r4bQueMjUC2XhWZFNcjtlvB30tp X-Received: by 2002:ad4:444c:0:b0:6a0:6306:caa1 with SMTP id l12-20020ad4444c000000b006a06306caa1mr2748710qvt.14.1713612237651; Sat, 20 Apr 2024 04:23:57 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id jm11-20020ad45ecb000000b0069b75b86337si6004699qvb.255.2024.04.20.04.23.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Apr 2024 04:23:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152248-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@solidrn.onmicrosoft.com header.s=selector1-solidrn-onmicrosoft-com header.b=FTb0cmBG; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-152248-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152248-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=solid-run.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 55F451C20DFA for ; Sat, 20 Apr 2024 11:23:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DCCC73F8ED; Sat, 20 Apr 2024 11:23:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=solidrn.onmicrosoft.com header.i=@solidrn.onmicrosoft.com header.b="FTb0cmBG" Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2138.outbound.protection.outlook.com [40.107.20.138]) (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 1B6CD383A9; Sat, 20 Apr 2024 11:23:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.138 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713612196; cv=fail; b=i6XMO6JFFb6oRLmUXMMrFEsmNWHP9DgXwPpk3MErRmayIfP+IwlgPfSBTZQ4sNZraT1kyGCX7VunG2ggcmBAK0z1yhSJlcqYmkEMkiFGQf4z4zlT6LeEV6WzgSfKoIpapx9H1ILoMniGif5SkipIWt4U9nl2hwBtPnB+vdO1U7E= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713612196; c=relaxed/simple; bh=FOsSHF9Sb+4GwiYHI3dstzCiSYA2cpTrl0HbCkVLbWk=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=jlpwl6KpC8nxoL5Jc2v22rB7EIuYpP+po6xn7x+2P494KzsUPWQ+n3A9qPKAJmTZyfTnECYhy8+3b8+JK5heMBh95hDK1Xc1L7vLLPx+XE+gcf0WoMx5C2pEzpWXBkyH5LZG72pLhgEQKnT5+1bnTKtu3VAIRHgJJRqVtOpKqfc= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=solid-run.com; spf=pass smtp.mailfrom=solid-run.com; dkim=pass (1024-bit key) header.d=solidrn.onmicrosoft.com header.i=@solidrn.onmicrosoft.com header.b=FTb0cmBG; arc=fail smtp.client-ip=40.107.20.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=solid-run.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=solid-run.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FzEkFJMTIOk5j71MFZl5dugpZEIVmESOwVSDngLMGWzdzpGr0ihyVWVUUZi4lX4mXfIPWC4qMXfW1Xra5C0QgrxFpkmdwkfGd9vqnVA/8KWKZ0VbOtSernrVEFSgzLalfsdaplbiRcZbQ6bq5s4Yo769LHDCCUTIjI9q9wrCCQ4FZZLWQd+9CuQC8rtpZPMF2BETD+mvjcpvMKjzO4Vg72ckVKiP9o6MN0rX64R9Ph/E2qP/VvsN+sD1CgmON0LcUCLPYVemX+csrLRuXUKDW1ffhr83yxYNLak28y+J86Z/HkSY2y3OeefYhA16aB7YnLNvHuP82vkmJ0zN99OvZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Vh0X3VbLkcxkQr3MsxBzuzXI3LwXJ76XQtAmp5TTwVU=; b=SK8yio28Qr5gFWCUSS1OBds12m8eb53OVWSOAJN80qN1tD5ZZGkA1t6NmzLspEC9BfJkwHMhHhm6OGHqDnl11XtFctOdb98XJvhUM4mAZi89atfGFJJg+404y6McKrwMw8V+jeQh7iHiA+Hf+phnk0JOz2t8JE1Ph9jaSreHnRMScYJLE7ASwpHvA3HanCqrLDEFHr3MpLdbEHlzsCrC4MRvEz/B3d7/uH0Shbq1Rg1YTYSg1VyPvXYrg+7XoSdmvLTTAUnk5G9BJkUY0LvwK9qyZyzQ2CVURxONHbe1RRr29Qh/gL+2qgxFAj6+cVzF3rY8md4zHyUky//E+S3oQg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=solid-run.com; dmarc=pass action=none header.from=solid-run.com; dkim=pass header.d=solid-run.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=solidrn.onmicrosoft.com; s=selector1-solidrn-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Vh0X3VbLkcxkQr3MsxBzuzXI3LwXJ76XQtAmp5TTwVU=; b=FTb0cmBGKloNray8dXERHR+gF9GJN4/+7wVu88e3HhlCrH56HQbLzIwrgHMdLD93Ll3dnegI9KBX6jQSVsNNX1BkEo4YxU/cZo10PagOmVjw/fiQdtc2bPTUFxVX8G/bbXMX8GkqwhxsCWfLO9lJ25Q0tXhA4WCu2z2nk/5lGJM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=solid-run.com; Received: from AM9PR04MB7586.eurprd04.prod.outlook.com (2603:10a6:20b:2d5::17) by AM9PR04MB7588.eurprd04.prod.outlook.com (2603:10a6:20b:2dd::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Sat, 20 Apr 2024 11:23:09 +0000 Received: from AM9PR04MB7586.eurprd04.prod.outlook.com ([fe80::c04e:8a97:516c:5529]) by AM9PR04MB7586.eurprd04.prod.outlook.com ([fe80::c04e:8a97:516c:5529%7]) with mapi id 15.20.7472.044; Sat, 20 Apr 2024 11:23:09 +0000 From: Josua Mayer Date: Sat, 20 Apr 2024 13:23:01 +0200 Subject: [PATCH net-next v2 2/2] net: phy: adin: add support for setting link-status-pin polarity Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240420-adin-pin-polarity-v2-2-bf9714da7648@solid-run.com> References: <20240420-adin-pin-polarity-v2-0-bf9714da7648@solid-run.com> In-Reply-To: <20240420-adin-pin-polarity-v2-0-bf9714da7648@solid-run.com> To: Michael Hennerich , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alexandru Tachici , Andrew Lunn , Heiner Kallweit , Russell King Cc: Jon Nettleton , Yazan Shhady , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Josua Mayer X-Mailer: b4 0.12.4 X-ClientProxiedBy: FR0P281CA0109.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a8::9) To AM9PR04MB7586.eurprd04.prod.outlook.com (2603:10a6:20b:2d5::17) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR04MB7586:EE_|AM9PR04MB7588:EE_ X-MS-Office365-Filtering-Correlation-Id: 034ee085-5dd0-43b8-c5c9-08dc612c4133 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: =?utf-8?B?VUYrQzRGRHUwVGFOK013SEhFTVNYWVEwWnlQZnpIaEJWa2NzdkU5dWROMnNq?= =?utf-8?B?aFdKSU9QVTYwSUwwcXFDTTlabkJ0aGV2b1VEdVh2ZUpzcmNlVWhpTmgrK0hX?= =?utf-8?B?dmNOMlhQa0NsNHRhV0kxV2lJOXRVQVQ3RkpQVzROcmh1VTh4SUZWek82czA3?= =?utf-8?B?MFJmODBkMGcyUWNXZTdjL2Vmb0dtTEw5Sk93YWZiWjVJK3hSV0lTd2Q0aTRp?= =?utf-8?B?bnp4cVk3MGpaakdvYkhudT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M1ZoSkxQK1VUeXpKUWpQdThnTUorZUh3S0hZWmk1?= =?utf-8?B?ZVgyeTFORFhrOHZ0MHZ3MWZNQTNxMkR2MmZabnZ5THhhck0rVEJuV0tZa2ZC?= =?utf-8?B?MXdHcHdXc2V2NzRmcUlqT2d0ZVY4K0kzUElMbkd0d001a2VNRzRiMC9EcC9v?= =?utf-8?B?T2Nwc01Zd0lNNGJDZkhTZ3ltaWlxMXc3eURXdU9DMHpDcWkzd2J0RTVjWkJY?= =?utf-8?B?eFA3RzAzT0h5UjdEWElMKzlRVEFBaVNhL2c5cXU2cnFXZnlJQTFxSzFaOWVm?= =?utf-8?B?dGk3Mm1HMnJzanZzcERvcVM2eUJFeEg0RytOTmxMaFU4Z1p1bWJXU2ltT3ZH?= =?utf-8?B?ZlBKc0U5Z01vS2xoc21pUm5IR091azREakdjVmEwajJ1YmFEcWdZK01IdE9S?= =?utf-8?B?VFl1dFBDL2F5eGRXN3pITWl4Ky9QU2hwRVdhT3VBU1Qzd0JrZTBjaTRQTk9Z?= =?utf-8?B?anFLSGJWUXZvaExBNFdLb3NEZ2FyWTZ6Q1F3bFlYdjZTU3Z6c2ljTW9CejVx?= =?utf-8?B?K0NIczNjdGJoMmwyN0xTbXRpNUE2QjdCL0F3am1FS0NmbzJudGlrUzdsMXBM?= =?utf-8?B?OEh0citTaGtEcFRYeVR6Z2pSYTBVM05UVkw5anMyUTdLTmVsRDhiMHRuTkw2?= =?utf-8?B?VWFvMVdjMnp1SldKdytDUT09?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR04MB7586.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(52116005)(7416005)(376005)(38350700005)(921011);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?d2JaV3NBbE5KdnhuRXA4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3BLbmY1YVdzZUVYODAwOFpRdlNVSUdx?= =?utf-8?B?a3ptUS9FTkFjZUhtQnREdXg0Y3ZkVDdLN2JOa1A3L1NNYWR0U1l1d3Vpd1dm?= =?utf-8?B?dE4xZ1g4T1lmelpjUzFUU29kdTVmRkkyNExBekJsTVp1WXlQVGRDQ015UEVQ?= =?utf-8?B?QUhQdVZ4ejd4MEx0eDhSd0ptenl1U0ZvV3JNYmNCZ01ERWVpblRhblFXaTFk?= =?utf-8?B?UXdlYmxXemhwRHUyOHhBNkJlQ2huSXVVM2FSbnVSWjJvbDdTb3FQNmtqMUZS?= =?utf-8?B?aUJHbXdpMjFiUEZydVN3VDRzaE85V0lPeFMrbWlBRlp0ZThBRkRJQ1ZhTHVZ?= =?utf-8?Q?KfvPjv5q7i0Y91njJ1Bg+ZAld?= X-OriginatorOrg: solid-run.com X-MS-Exchange-CrossTenant-Network-Message-Id: 034ee085-5dd0-43b8-c5c9-08dc612c4133 X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB7586.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2024 11:23:08.1284 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a4a8aaf3-fd27-4e27-add2-604707ce5b82 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Ue5glX+Q2IEpZsTtLwJiwlC/TSe7mbx8wn7r0GyhiNH22NGLWoSmdSS2CTbn8DCnb/5V5YZ79A3iGDfffNYQOg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB7588 ADIN1300/1200 support software control over pin polarity for LINK_ST (link-status) pin. Configure the polarity during config_init based on device-tree property. Polarity is only set if specified in device-tree, otherwise the phy defaults to active-high during reset. Signed-off-by: Josua Mayer --- drivers/net/phy/adin.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/net/phy/adin.c b/drivers/net/phy/adin.c index 2e1a46e121d9..a533932afcb8 100644 --- a/drivers/net/phy/adin.c +++ b/drivers/net/phy/adin.c @@ -158,6 +158,9 @@ #define ADIN1300_RMII_20_BITS 0x0004 #define ADIN1300_RMII_24_BITS 0x0005 +#define ADIN1300_GE_LNK_STAT_INV_EN_REG 0xff3c +#define ADIN1300_GE_LNK_STAT_INV_EN BIT(0) + /** * struct adin_cfg_reg_map - map a config value to aregister value * @cfg: value in device configuration @@ -522,6 +525,28 @@ static int adin_config_clk_out(struct phy_device *phydev) ADIN1300_GE_CLK_CFG_MASK, sel); } +static int adin_config_link_status_pin_polarity(struct phy_device *phydev) +{ + struct device *dev = &phydev->mdio.dev; + int ret; + u32 val; + + if (!device_property_present(dev, "adi,link-st-polarity")) + return 0; + + ret = device_property_read_u32(dev, "adi,link-st-polarity", &val); + if (ret) { + return ret; + } else if (val > 1) { + phydev_err(phydev, "invalid adi,link-st-polarity\n"); + return -EINVAL; + } + + return phy_modify_mmd(phydev, MDIO_MMD_VEND1, + ADIN1300_GE_LNK_STAT_INV_EN_REG, + ADIN1300_GE_LNK_STAT_INV_EN, val); +} + static int adin_config_init(struct phy_device *phydev) { int rc; @@ -548,6 +573,10 @@ static int adin_config_init(struct phy_device *phydev) if (rc < 0) return rc; + rc = adin_config_link_status_pin_polarity(phydev); + if (rc < 0) + return rc; + phydev_dbg(phydev, "PHY is using mode '%s'\n", phy_modes(phydev->interface)); -- 2.35.3