From patchwork Thu May 10 23:16:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Burton X-Patchwork-Id: 911609 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=mips.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40hq1C6BqFz9s1p for ; Fri, 11 May 2018 09:19:11 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750818AbeEJXTJ (ORCPT ); Thu, 10 May 2018 19:19:09 -0400 Received: from 9pmail.ess.barracuda.com ([64.235.154.211]:56074 "EHLO 9pmail.ess.barracuda.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750746AbeEJXTI (ORCPT ); Thu, 10 May 2018 19:19:08 -0400 Received: from mipsdag02.mipstec.com (mail2.mips.com [12.201.5.32]) by mx1403.ess.rzc.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=NO); Thu, 10 May 2018 23:17:32 +0000 Received: from mipsdag02.mipstec.com (10.20.40.47) by mipsdag02.mipstec.com (10.20.40.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2; Thu, 10 May 2018 16:17:27 -0700 Received: from pburton-laptop.mipstec.com (10.20.1.18) by mipsdag02.mipstec.com (10.20.40.47) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Thu, 10 May 2018 16:17:27 -0700 From: Paul Burton To: CC: , "David S . Miller" , Andrew Lunn , Paul Burton Subject: [PATCH v6 1/6] net: phy: at803x: Export at803x_debug_reg_mask() Date: Thu, 10 May 2018 16:16:52 -0700 Message-ID: <20180510231657.28503-2-paul.burton@mips.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180510231657.28503-1-paul.burton@mips.com> References: <20180510231657.28503-1-paul.burton@mips.com> MIME-Version: 1.0 X-BESS-ID: 1525994252-321459-1940-21342-1 X-BESS-VER: 2018.6-r1805011734 X-BESS-Apparent-Source-IP: 12.201.5.32 X-BESS-Outbound-Spam-Score: 0.50 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.192889 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.50 BSF_RULE7568M META: Custom Rule 7568M 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.50 using account:ESS59374 scores of KILL_LEVEL=7.0 tests=BSF_RULE7568M, BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Andrew Lunn On some boards, this PHY has a problem when it hibernates. Export this function to a board can register a PHY fixup to disable hibernation. Signed-off-by: Andrew Lunn Signed-off-by: Paul Burton Cc: David S. Miller Cc: linux-mips@linux-mips.org Cc: netdev@vger.kernel.org --- Changes in v6: - New patch. Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None drivers/net/phy/at803x.c | 5 +++-- include/linux/at803x_phy.h | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 include/linux/at803x_phy.h diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c index 411cf1072bae..5aede5708abf 100644 --- a/drivers/net/phy/at803x.c +++ b/drivers/net/phy/at803x.c @@ -18,6 +18,7 @@ #include #include #include +#include #define AT803X_INTR_ENABLE 0x12 #define AT803X_INTR_ENABLE_AUTONEG_ERR BIT(15) @@ -93,8 +94,8 @@ static int at803x_debug_reg_read(struct phy_device *phydev, u16 reg) return phy_read(phydev, AT803X_DEBUG_DATA); } -static int at803x_debug_reg_mask(struct phy_device *phydev, u16 reg, - u16 clear, u16 set) +int at803x_debug_reg_mask(struct phy_device *phydev, u16 reg, + u16 clear, u16 set) { u16 val; int ret; diff --git a/include/linux/at803x_phy.h b/include/linux/at803x_phy.h new file mode 100644 index 000000000000..2460c17d56ec --- /dev/null +++ b/include/linux/at803x_phy.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _AT803X_PHY_H +#define _PHY_AT803X_PHY + +#define ATH8030_PHY_ID 0x004dd076 +#define ATH8031_PHY_ID 0x004dd074 +#define ATH8035_PHY_ID 0x004dd072 +#define AT803X_PHY_ID_MASK 0xffffffef + +#define AT8031_HIBERNATE 0x0B +#define AT8031_PS_HIB_EN 0x8000 /* Hibernate enable */ + +int at803x_debug_reg_mask(struct phy_device *phydev, u16 reg, + u16 clear, u16 set); + +#endif /* _AT803X_PHY_H */