From: Paul Burton <paul.burton@mips.com>
To: <netdev@vger.kernel.org>
Cc: <linux-mips@linux-mips.org>,
"David S . Miller" <davem@davemloft.net>,
Andrew Lunn <andrew@lunn.ch>, Paul Burton <paul.burton@mips.com>
Subject: [PATCH v6 1/6] net: phy: at803x: Export at803x_debug_reg_mask()
Date: Thu, 10 May 2018 16:16:52 -0700 [thread overview]
Message-ID: <20180510231657.28503-2-paul.burton@mips.com> (raw)
In-Reply-To: <20180510231657.28503-1-paul.burton@mips.com>
From: Andrew Lunn <andrew@lunn.ch>
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 <andrew@lunn.ch>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: David S. Miller <davem@davemloft.net>
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 <linux/etherdevice.h>
#include <linux/of_gpio.h>
#include <linux/gpio/consumer.h>
+#include <linux/at803x_phy.h>
#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 */
--
2.17.0
next prev parent reply other threads:[~2018-05-10 23:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-10 23:16 [PATCH v6 0/6] net: pch_gbe: MIPS support Paul Burton
2018-05-10 23:16 ` Paul Burton [this message]
2018-05-11 0:26 ` [PATCH v6 1/6] net: phy: at803x: Export at803x_debug_reg_mask() Andrew Lunn
2018-05-11 18:25 ` Paul Burton
2018-05-11 18:38 ` Paul Burton
2018-05-11 19:24 ` Andrew Lunn
2018-05-11 22:22 ` Paul Burton
2018-05-12 21:37 ` Andrew Lunn
2018-05-10 23:16 ` [PATCH v6 2/6] net: ethernet: pch_gbe: Convert to mdiobus and phylib Paul Burton
2018-05-10 23:16 ` [PATCH v6 3/6] net: pch_gbe: Support DeviceTree for MDIO/PHY description Paul Burton
2018-05-10 23:16 ` [PATCH v6 4/6] ptp: pch: Allow build on MIPS platforms Paul Burton
2018-05-10 23:16 ` [PATCH v6 5/6] net: pch_gbe: " Paul Burton
2018-05-10 23:16 ` [PATCH v6 6/6] MIPS: Boston: Adjust DT for pch_gbe PHY support Paul Burton
2018-05-11 0:28 ` Andrew Lunn
2018-05-11 0:35 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180510231657.28503-2-paul.burton@mips.com \
--to=paul.burton@mips.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=linux-mips@linux-mips.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).