national.c (d0034a7a4ac7fae708146ac0059b9c47a1543f0d) national.c (1953feb022154e19c5953988fd3dd65ebc769dc9)
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * drivers/net/phy/national.c
4 *
5 * Driver for National Semiconductor PHYs
6 *
7 * Author: Stuart Menefy <stuart.menefy@st.com>
8 * Maintainer: Giuseppe Cavallaro <peppe.cavallaro@st.com>

--- 54 unchanged lines hidden (view full) ---

63
64static int ns_ack_interrupt(struct phy_device *phydev)
65{
66 int ret = phy_read(phydev, DP83865_INT_STATUS);
67 if (ret < 0)
68 return ret;
69
70 /* Clear the interrupt status bit by writing a “1”
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * drivers/net/phy/national.c
4 *
5 * Driver for National Semiconductor PHYs
6 *
7 * Author: Stuart Menefy <stuart.menefy@st.com>
8 * Maintainer: Giuseppe Cavallaro <peppe.cavallaro@st.com>

--- 54 unchanged lines hidden (view full) ---

63
64static int ns_ack_interrupt(struct phy_device *phydev)
65{
66 int ret = phy_read(phydev, DP83865_INT_STATUS);
67 if (ret < 0)
68 return ret;
69
70 /* Clear the interrupt status bit by writing a “1”
71 * to the corresponding bit in INT_CLEAR (2:0 are reserved) */
71 * to the corresponding bit in INT_CLEAR (2:0 are reserved)
72 */
72 ret = phy_write(phydev, DP83865_INT_CLEAR, ret & ~0x7);
73
74 return ret;
75}
76
77static irqreturn_t ns_handle_interrupt(struct phy_device *phydev)
78{
79 int irq_status;

--- 65 unchanged lines hidden (view full) ---

145 pr_debug("10BASE-T HDX loopback %s\n",
146 (ns_exp_read(phydev, 0x1c0) & lb_dis) ? "off" : "on");
147}
148
149static int ns_config_init(struct phy_device *phydev)
150{
151 ns_giga_speed_fallback(phydev, ALL_FALLBACK_ON);
152 /* In the latest MAC or switches design, the 10 Mbps loopback
73 ret = phy_write(phydev, DP83865_INT_CLEAR, ret & ~0x7);
74
75 return ret;
76}
77
78static irqreturn_t ns_handle_interrupt(struct phy_device *phydev)
79{
80 int irq_status;

--- 65 unchanged lines hidden (view full) ---

146 pr_debug("10BASE-T HDX loopback %s\n",
147 (ns_exp_read(phydev, 0x1c0) & lb_dis) ? "off" : "on");
148}
149
150static int ns_config_init(struct phy_device *phydev)
151{
152 ns_giga_speed_fallback(phydev, ALL_FALLBACK_ON);
153 /* In the latest MAC or switches design, the 10 Mbps loopback
153 is desired to be turned off. */
154 * is desired to be turned off.
155 */
154 ns_10_base_t_hdx_loopack(phydev, hdx_loopback_off);
155 return ns_ack_interrupt(phydev);
156}
157
158static struct phy_driver dp83865_driver[] = { {
159 .phy_id = DP83865_PHY_ID,
160 .phy_id_mask = 0xfffffff0,
161 .name = "NatSemi DP83865",

--- 18 unchanged lines hidden ---
156 ns_10_base_t_hdx_loopack(phydev, hdx_loopback_off);
157 return ns_ack_interrupt(phydev);
158}
159
160static struct phy_driver dp83865_driver[] = { {
161 .phy_id = DP83865_PHY_ID,
162 .phy_id_mask = 0xfffffff0,
163 .name = "NatSemi DP83865",

--- 18 unchanged lines hidden ---