blob: 0fc39ac5ca88b9a76a029ca5b3e96de638f73b86 [file] [log] [blame]
Andrew Lunna2443fd2019-01-21 19:05:50 +01001// SPDX-License-Identifier: GPL-2.0+
Herbert Valerio Riedelc9e055a2006-05-07 23:22:53 +02002/*
3 * drivers/net/phy/smsc.c
4 *
5 * Driver for SMSC PHYs
6 *
7 * Author: Herbert Valerio Riedel
8 *
9 * Copyright (c) 2006 Herbert Valerio Riedel <hvr@gnu.org>
10 *
Steve Glendinning90b24cf2012-04-16 12:13:29 +010011 * Support added for SMSC LAN8187 and LAN8700 by steve.glendinning@shawell.net
Steve Glendinning4d9b1a02008-04-28 18:37:29 +010012 *
Herbert Valerio Riedelc9e055a2006-05-07 23:22:53 +020013 */
14
Marco Felschbedd8d72020-09-09 15:45:00 +020015#include <linux/clk.h>
Herbert Valerio Riedelc9e055a2006-05-07 23:22:53 +020016#include <linux/kernel.h>
17#include <linux/module.h>
18#include <linux/mii.h>
19#include <linux/ethtool.h>
Andrew Lunnc6e970a2017-03-28 23:45:06 +020020#include <linux/of.h>
Herbert Valerio Riedelc9e055a2006-05-07 23:22:53 +020021#include <linux/phy.h>
22#include <linux/netdevice.h>
Javier Martinez Canillas43c67592012-01-03 20:23:18 -050023#include <linux/smscphy.h>
Herbert Valerio Riedelc9e055a2006-05-07 23:22:53 +020024
Andre Edich05b35e72020-08-26 13:17:17 +020025/* Vendor-specific PHY Definitions */
26/* EDPD NLP / crossover time configuration */
27#define PHY_EDPD_CONFIG 16
28#define PHY_EDPD_CONFIG_EXT_CROSSOVER_ 0x0001
29
30/* Control/Status Indication Register */
31#define SPECIAL_CTRL_STS 27
32#define SPECIAL_CTRL_STS_OVRRD_AMDIX_ 0x8000
33#define SPECIAL_CTRL_STS_AMDIX_ENABLE_ 0x4000
34#define SPECIAL_CTRL_STS_AMDIX_STATE_ 0x2000
35
Andrew Lunn030a8902017-06-03 20:00:36 +020036struct smsc_hw_stat {
37 const char *string;
38 u8 reg;
39 u8 bits;
40};
41
42static struct smsc_hw_stat smsc_hw_stats[] = {
43 { "phy_symbol_errors", 26, 16},
44};
45
Teresa Remmet0a9c4532016-01-20 13:40:35 +010046struct smsc_phy_priv {
47 bool energy_enable;
Marco Felschbedd8d72020-09-09 15:45:00 +020048 struct clk *refclk;
Teresa Remmet0a9c4532016-01-20 13:40:35 +010049};
50
Steve Glendinning48c41b92008-04-28 18:36:46 +010051static int smsc_phy_config_intr(struct phy_device *phydev)
Herbert Valerio Riedelc9e055a2006-05-07 23:22:53 +020052{
Marco Felsch73654942020-09-09 15:44:57 +020053 struct smsc_phy_priv *priv = phydev->priv;
54 u16 intmask = 0;
55 int rc;
56
57 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
58 intmask = MII_LAN83C185_ISF_INT4 | MII_LAN83C185_ISF_INT6;
59 if (priv->energy_enable)
60 intmask |= MII_LAN83C185_ISF_INT7;
61 }
62
63 rc = phy_write(phydev, MII_LAN83C185_IM, intmask);
Herbert Valerio Riedelc9e055a2006-05-07 23:22:53 +020064
65 return rc < 0 ? rc : 0;
66}
67
Steve Glendinning48c41b92008-04-28 18:36:46 +010068static int smsc_phy_ack_interrupt(struct phy_device *phydev)
Herbert Valerio Riedelc9e055a2006-05-07 23:22:53 +020069{
70 int rc = phy_read (phydev, MII_LAN83C185_ISF);
71
72 return rc < 0 ? rc : 0;
73}
74
Steve Glendinning48c41b92008-04-28 18:36:46 +010075static int smsc_phy_config_init(struct phy_device *phydev)
Herbert Valerio Riedelc9e055a2006-05-07 23:22:53 +020076{
Teresa Remmet0a9c4532016-01-20 13:40:35 +010077 struct smsc_phy_priv *priv = phydev->priv;
Marco Felsch436e3802020-09-09 15:44:58 +020078 int rc;
Teresa Remmet0a9c4532016-01-20 13:40:35 +010079
Marco Felsch436e3802020-09-09 15:44:58 +020080 if (!priv->energy_enable)
81 return 0;
82
83 rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS);
Gwenhael Goavec-Merou21009682014-08-15 15:00:38 +020084
85 if (rc < 0)
86 return rc;
87
Marco Felsch436e3802020-09-09 15:44:58 +020088 /* Enable energy detect mode for this SMSC Transceivers */
89 rc = phy_write(phydev, MII_LAN83C185_CTRL_STATUS,
90 rc | MII_LAN83C185_EDPWRDOWN);
91 if (rc < 0)
92 return rc;
Gwenhael Goavec-Merou21009682014-08-15 15:00:38 +020093
94 return smsc_phy_ack_interrupt(phydev);
95}
96
97static int smsc_phy_reset(struct phy_device *phydev)
98{
trem6ded7cd2012-12-04 08:52:10 +000099 int rc = phy_read(phydev, MII_LAN83C185_SPECIAL_MODES);
100 if (rc < 0)
101 return rc;
102
103 /* If the SMSC PHY is in power down mode, then set it
104 * in all capable mode before using it.
105 */
106 if ((rc & MII_LAN83C185_MODE_MASK) == MII_LAN83C185_MODE_POWERDOWN) {
Manfred Schlaeglfc0f7e32016-06-06 10:47:47 +0200107 /* set "all capable" mode */
trem6ded7cd2012-12-04 08:52:10 +0000108 rc |= MII_LAN83C185_MODE_ALL;
109 phy_write(phydev, MII_LAN83C185_SPECIAL_MODES, rc);
trem6ded7cd2012-12-04 08:52:10 +0000110 }
Manfred Schlaeglfc0f7e32016-06-06 10:47:47 +0200111
112 /* reset the phy */
113 return genphy_soft_reset(phydev);
Herbert Valerio Riedelc9e055a2006-05-07 23:22:53 +0200114}
115
Giuseppe Cavallaro698244a2010-01-06 20:35:14 -0800116static int lan911x_config_init(struct phy_device *phydev)
117{
118 return smsc_phy_ack_interrupt(phydev);
119}
Herbert Valerio Riedelc9e055a2006-05-07 23:22:53 +0200120
Andre Edich05b35e72020-08-26 13:17:17 +0200121static int lan87xx_config_aneg(struct phy_device *phydev)
122{
123 int rc;
124 int val;
125
126 switch (phydev->mdix_ctrl) {
127 case ETH_TP_MDI:
128 val = SPECIAL_CTRL_STS_OVRRD_AMDIX_;
129 break;
130 case ETH_TP_MDI_X:
131 val = SPECIAL_CTRL_STS_OVRRD_AMDIX_ |
132 SPECIAL_CTRL_STS_AMDIX_STATE_;
133 break;
134 case ETH_TP_MDI_AUTO:
135 val = SPECIAL_CTRL_STS_AMDIX_ENABLE_;
136 break;
137 default:
138 return genphy_config_aneg(phydev);
139 }
140
141 rc = phy_read(phydev, SPECIAL_CTRL_STS);
142 if (rc < 0)
143 return rc;
144
145 rc &= ~(SPECIAL_CTRL_STS_OVRRD_AMDIX_ |
146 SPECIAL_CTRL_STS_AMDIX_ENABLE_ |
147 SPECIAL_CTRL_STS_AMDIX_STATE_);
148 rc |= val;
149 phy_write(phydev, SPECIAL_CTRL_STS, rc);
150
151 phydev->mdix = phydev->mdix_ctrl;
152 return genphy_config_aneg(phydev);
153}
154
155static int lan87xx_config_aneg_ext(struct phy_device *phydev)
156{
157 int rc;
158
159 /* Extend Manual AutoMDIX timer */
160 rc = phy_read(phydev, PHY_EDPD_CONFIG);
161 if (rc < 0)
162 return rc;
163
164 rc |= PHY_EDPD_CONFIG_EXT_CROSSOVER_;
165 phy_write(phydev, PHY_EDPD_CONFIG, rc);
166 return lan87xx_config_aneg(phydev);
167}
168
Patrick Trantham4223dbf2012-11-15 09:00:57 +0000169/*
Igor Plyatov776829d2015-08-14 20:11:02 +0300170 * The LAN87xx suffers from rare absence of the ENERGYON-bit when Ethernet cable
171 * plugs in while LAN87xx is in Energy Detect Power-Down mode. This leads to
172 * unstable detection of plugging in Ethernet cable.
173 * This workaround disables Energy Detect Power-Down mode and waiting for
174 * response on link pulses to detect presence of plugged Ethernet cable.
175 * The Energy Detect Power-Down mode is enabled again in the end of procedure to
176 * save approximately 220 mW of power if cable is unplugged.
Patrick Trantham4223dbf2012-11-15 09:00:57 +0000177 */
178static int lan87xx_read_status(struct phy_device *phydev)
179{
Teresa Remmet0a9c4532016-01-20 13:40:35 +0100180 struct smsc_phy_priv *priv = phydev->priv;
Patrick Trantham4223dbf2012-11-15 09:00:57 +0000181
Teresa Remmet0a9c4532016-01-20 13:40:35 +0100182 int err = genphy_read_status(phydev);
183
184 if (!phydev->link && priv->energy_enable) {
Patrick Trantham4223dbf2012-11-15 09:00:57 +0000185 /* Disable EDPD to wake up PHY */
186 int rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS);
187 if (rc < 0)
188 return rc;
189
190 rc = phy_write(phydev, MII_LAN83C185_CTRL_STATUS,
191 rc & ~MII_LAN83C185_EDPWRDOWN);
192 if (rc < 0)
193 return rc;
194
Dejin Zheng6d61f482020-06-20 22:55:34 +0800195 /* Wait max 640 ms to detect energy and the timeout is not
196 * an actual error.
197 */
198 read_poll_timeout(phy_read, rc,
199 rc & MII_LAN83C185_ENERGYON || rc < 0,
200 10000, 640000, true, phydev,
201 MII_LAN83C185_CTRL_STATUS);
Dejin Zheng7ae7ad22020-03-23 23:05:59 +0800202 if (rc < 0)
203 return rc;
Patrick Trantham4223dbf2012-11-15 09:00:57 +0000204
205 /* Re-enable EDPD */
206 rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS);
207 if (rc < 0)
208 return rc;
209
210 rc = phy_write(phydev, MII_LAN83C185_CTRL_STATUS,
211 rc | MII_LAN83C185_EDPWRDOWN);
212 if (rc < 0)
213 return rc;
214 }
215
216 return err;
217}
218
Andrew Lunn030a8902017-06-03 20:00:36 +0200219static int smsc_get_sset_count(struct phy_device *phydev)
220{
221 return ARRAY_SIZE(smsc_hw_stats);
222}
223
224static void smsc_get_strings(struct phy_device *phydev, u8 *data)
225{
226 int i;
227
228 for (i = 0; i < ARRAY_SIZE(smsc_hw_stats); i++) {
Arnd Bergmann2da55392017-06-20 22:40:46 +0200229 strncpy(data + i * ETH_GSTRING_LEN,
Andrew Lunn030a8902017-06-03 20:00:36 +0200230 smsc_hw_stats[i].string, ETH_GSTRING_LEN);
231 }
232}
233
Andrew Lunn030a8902017-06-03 20:00:36 +0200234static u64 smsc_get_stat(struct phy_device *phydev, int i)
235{
236 struct smsc_hw_stat stat = smsc_hw_stats[i];
237 int val;
238 u64 ret;
239
240 val = phy_read(phydev, stat.reg);
241 if (val < 0)
Jisheng Zhang6c3442f2018-04-27 16:18:58 +0800242 ret = U64_MAX;
Andrew Lunn030a8902017-06-03 20:00:36 +0200243 else
244 ret = val;
245
246 return ret;
247}
248
249static void smsc_get_stats(struct phy_device *phydev,
250 struct ethtool_stats *stats, u64 *data)
251{
252 int i;
253
254 for (i = 0; i < ARRAY_SIZE(smsc_hw_stats); i++)
255 data[i] = smsc_get_stat(phydev, i);
256}
257
Marco Felschbedd8d72020-09-09 15:45:00 +0200258static void smsc_phy_remove(struct phy_device *phydev)
259{
260 struct smsc_phy_priv *priv = phydev->priv;
261
262 clk_disable_unprepare(priv->refclk);
263 clk_put(priv->refclk);
264}
265
Teresa Remmet0a9c4532016-01-20 13:40:35 +0100266static int smsc_phy_probe(struct phy_device *phydev)
267{
268 struct device *dev = &phydev->mdio.dev;
269 struct device_node *of_node = dev->of_node;
270 struct smsc_phy_priv *priv;
Marco Felschbedd8d72020-09-09 15:45:00 +0200271 int ret;
Teresa Remmet0a9c4532016-01-20 13:40:35 +0100272
273 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
274 if (!priv)
275 return -ENOMEM;
276
277 priv->energy_enable = true;
278
279 if (of_property_read_bool(of_node, "smsc,disable-energy-detect"))
280 priv->energy_enable = false;
281
282 phydev->priv = priv;
283
Marco Felschbedd8d72020-09-09 15:45:00 +0200284 /* Make clk optional to keep DTB backward compatibility. */
285 priv->refclk = clk_get_optional(dev, NULL);
286 if (IS_ERR(priv->refclk))
287 dev_err_probe(dev, PTR_ERR(priv->refclk), "Failed to request clock\n");
288
289 ret = clk_prepare_enable(priv->refclk);
290 if (ret)
291 return ret;
292
293 ret = clk_set_rate(priv->refclk, 50 * 1000 * 1000);
Zhang Changzhong37344712020-11-12 19:23:59 +0800294 if (ret) {
295 clk_disable_unprepare(priv->refclk);
Marco Felschbedd8d72020-09-09 15:45:00 +0200296 return ret;
Zhang Changzhong37344712020-11-12 19:23:59 +0800297 }
Marco Felschbedd8d72020-09-09 15:45:00 +0200298
Teresa Remmet0a9c4532016-01-20 13:40:35 +0100299 return 0;
300}
301
Christian Hohnstaedtd5bf9072012-07-04 05:44:34 +0000302static struct phy_driver smsc_phy_driver[] = {
303{
Herbert Valerio Riedelc9e055a2006-05-07 23:22:53 +0200304 .phy_id = 0x0007c0a0, /* OUI=0x00800f, Model#=0x0a */
305 .phy_id_mask = 0xfffffff0,
306 .name = "SMSC LAN83C185",
307
Heiner Kallweitdcdecdc2019-04-12 20:47:03 +0200308 /* PHY_BASIC_FEATURES */
Herbert Valerio Riedelc9e055a2006-05-07 23:22:53 +0200309
Teresa Remmet0a9c4532016-01-20 13:40:35 +0100310 .probe = smsc_phy_probe,
311
Herbert Valerio Riedelc9e055a2006-05-07 23:22:53 +0200312 /* basic functions */
Steve Glendinning48c41b92008-04-28 18:36:46 +0100313 .config_init = smsc_phy_config_init,
Gwenhael Goavec-Merou21009682014-08-15 15:00:38 +0200314 .soft_reset = smsc_phy_reset,
Herbert Valerio Riedelc9e055a2006-05-07 23:22:53 +0200315
316 /* IRQ related */
Steve Glendinning48c41b92008-04-28 18:36:46 +0100317 .ack_interrupt = smsc_phy_ack_interrupt,
318 .config_intr = smsc_phy_config_intr,
Herbert Valerio Riedelc9e055a2006-05-07 23:22:53 +0200319
Steve Glendinningc64d2a92009-01-22 14:07:43 -0800320 .suspend = genphy_suspend,
321 .resume = genphy_resume,
Christian Hohnstaedtd5bf9072012-07-04 05:44:34 +0000322}, {
Steve Glendinning4d9b1a02008-04-28 18:37:29 +0100323 .phy_id = 0x0007c0b0, /* OUI=0x00800f, Model#=0x0b */
324 .phy_id_mask = 0xfffffff0,
325 .name = "SMSC LAN8187",
326
Heiner Kallweitdcdecdc2019-04-12 20:47:03 +0200327 /* PHY_BASIC_FEATURES */
Steve Glendinning4d9b1a02008-04-28 18:37:29 +0100328
Teresa Remmet0a9c4532016-01-20 13:40:35 +0100329 .probe = smsc_phy_probe,
330
Steve Glendinning4d9b1a02008-04-28 18:37:29 +0100331 /* basic functions */
Steve Glendinning4d9b1a02008-04-28 18:37:29 +0100332 .config_init = smsc_phy_config_init,
Gwenhael Goavec-Merou21009682014-08-15 15:00:38 +0200333 .soft_reset = smsc_phy_reset,
Steve Glendinning4d9b1a02008-04-28 18:37:29 +0100334
335 /* IRQ related */
336 .ack_interrupt = smsc_phy_ack_interrupt,
337 .config_intr = smsc_phy_config_intr,
338
Andrew Lunn030a8902017-06-03 20:00:36 +0200339 /* Statistics */
340 .get_sset_count = smsc_get_sset_count,
341 .get_strings = smsc_get_strings,
342 .get_stats = smsc_get_stats,
343
Steve Glendinningc64d2a92009-01-22 14:07:43 -0800344 .suspend = genphy_suspend,
345 .resume = genphy_resume,
Christian Hohnstaedtd5bf9072012-07-04 05:44:34 +0000346}, {
Andre Edich05b35e72020-08-26 13:17:17 +0200347 /* This covers internal PHY (phy_id: 0x0007C0C3) for
348 * LAN9500 (PID: 0x9500), LAN9514 (PID: 0xec00), LAN9505 (PID: 0x9505)
349 */
Steve Glendinning4d9b1a02008-04-28 18:37:29 +0100350 .phy_id = 0x0007c0c0, /* OUI=0x00800f, Model#=0x0c */
351 .phy_id_mask = 0xfffffff0,
352 .name = "SMSC LAN8700",
353
Heiner Kallweitdcdecdc2019-04-12 20:47:03 +0200354 /* PHY_BASIC_FEATURES */
Steve Glendinning4d9b1a02008-04-28 18:37:29 +0100355
Teresa Remmet0a9c4532016-01-20 13:40:35 +0100356 .probe = smsc_phy_probe,
357
Steve Glendinning4d9b1a02008-04-28 18:37:29 +0100358 /* basic functions */
Igor Plyatov776829d2015-08-14 20:11:02 +0300359 .read_status = lan87xx_read_status,
Steve Glendinning4d9b1a02008-04-28 18:37:29 +0100360 .config_init = smsc_phy_config_init,
Gwenhael Goavec-Merou21009682014-08-15 15:00:38 +0200361 .soft_reset = smsc_phy_reset,
Andre Edich05b35e72020-08-26 13:17:17 +0200362 .config_aneg = lan87xx_config_aneg,
Steve Glendinning4d9b1a02008-04-28 18:37:29 +0100363
364 /* IRQ related */
365 .ack_interrupt = smsc_phy_ack_interrupt,
366 .config_intr = smsc_phy_config_intr,
367
Andrew Lunn030a8902017-06-03 20:00:36 +0200368 /* Statistics */
369 .get_sset_count = smsc_get_sset_count,
370 .get_strings = smsc_get_strings,
371 .get_stats = smsc_get_stats,
372
Steve Glendinningc64d2a92009-01-22 14:07:43 -0800373 .suspend = genphy_suspend,
374 .resume = genphy_resume,
Christian Hohnstaedtd5bf9072012-07-04 05:44:34 +0000375}, {
Steve Glendinningfd9abb32008-11-05 00:35:37 +0000376 .phy_id = 0x0007c0d0, /* OUI=0x00800f, Model#=0x0d */
377 .phy_id_mask = 0xfffffff0,
378 .name = "SMSC LAN911x Internal PHY",
379
Heiner Kallweitdcdecdc2019-04-12 20:47:03 +0200380 /* PHY_BASIC_FEATURES */
Steve Glendinningfd9abb32008-11-05 00:35:37 +0000381
Teresa Remmet0a9c4532016-01-20 13:40:35 +0100382 .probe = smsc_phy_probe,
383
Steve Glendinningfd9abb32008-11-05 00:35:37 +0000384 /* basic functions */
Giuseppe Cavallaro698244a2010-01-06 20:35:14 -0800385 .config_init = lan911x_config_init,
Steve Glendinningfd9abb32008-11-05 00:35:37 +0000386
387 /* IRQ related */
388 .ack_interrupt = smsc_phy_ack_interrupt,
389 .config_intr = smsc_phy_config_intr,
390
Steve Glendinningc64d2a92009-01-22 14:07:43 -0800391 .suspend = genphy_suspend,
392 .resume = genphy_resume,
Christian Hohnstaedtd5bf9072012-07-04 05:44:34 +0000393}, {
Andre Edich05b35e72020-08-26 13:17:17 +0200394 /* This covers internal PHY (phy_id: 0x0007C0F0) for
395 * LAN9500A (PID: 0x9E00), LAN9505A (PID: 0x9E01)
396 */
Steve Glendinninge072b632009-03-23 15:17:31 -0700397 .phy_id = 0x0007c0f0, /* OUI=0x00800f, Model#=0x0f */
398 .phy_id_mask = 0xfffffff0,
399 .name = "SMSC LAN8710/LAN8720",
400
Heiner Kallweitdcdecdc2019-04-12 20:47:03 +0200401 /* PHY_BASIC_FEATURES */
Steve Glendinninge072b632009-03-23 15:17:31 -0700402
Teresa Remmet0a9c4532016-01-20 13:40:35 +0100403 .probe = smsc_phy_probe,
Marco Felschbedd8d72020-09-09 15:45:00 +0200404 .remove = smsc_phy_remove,
Teresa Remmet0a9c4532016-01-20 13:40:35 +0100405
Steve Glendinninge072b632009-03-23 15:17:31 -0700406 /* basic functions */
Patrick Trantham4223dbf2012-11-15 09:00:57 +0000407 .read_status = lan87xx_read_status,
Patrick Trantham4257d582012-12-06 15:16:02 +0000408 .config_init = smsc_phy_config_init,
Gwenhael Goavec-Merou21009682014-08-15 15:00:38 +0200409 .soft_reset = smsc_phy_reset,
Andre Edich05b35e72020-08-26 13:17:17 +0200410 .config_aneg = lan87xx_config_aneg_ext,
Steve Glendinninge072b632009-03-23 15:17:31 -0700411
412 /* IRQ related */
413 .ack_interrupt = smsc_phy_ack_interrupt,
414 .config_intr = smsc_phy_config_intr,
415
Andrew Lunn030a8902017-06-03 20:00:36 +0200416 /* Statistics */
417 .get_sset_count = smsc_get_sset_count,
418 .get_strings = smsc_get_strings,
419 .get_stats = smsc_get_stats,
420
Steve Glendinninge072b632009-03-23 15:17:31 -0700421 .suspend = genphy_suspend,
422 .resume = genphy_resume,
Joshua Henderson26706d42016-01-09 04:54:21 -0700423}, {
424 .phy_id = 0x0007c110,
425 .phy_id_mask = 0xfffffff0,
426 .name = "SMSC LAN8740",
427
Heiner Kallweitdcdecdc2019-04-12 20:47:03 +0200428 /* PHY_BASIC_FEATURES */
Martin Fuzzey76db2d42019-10-23 11:44:24 +0200429 .flags = PHY_RST_AFTER_CLK_EN,
Joshua Henderson26706d42016-01-09 04:54:21 -0700430
Teresa Remmet0a9c4532016-01-20 13:40:35 +0100431 .probe = smsc_phy_probe,
432
Joshua Henderson26706d42016-01-09 04:54:21 -0700433 /* basic functions */
Joshua Henderson26706d42016-01-09 04:54:21 -0700434 .read_status = lan87xx_read_status,
435 .config_init = smsc_phy_config_init,
436 .soft_reset = smsc_phy_reset,
437
438 /* IRQ related */
439 .ack_interrupt = smsc_phy_ack_interrupt,
440 .config_intr = smsc_phy_config_intr,
441
Andrew Lunn030a8902017-06-03 20:00:36 +0200442 /* Statistics */
443 .get_sset_count = smsc_get_sset_count,
444 .get_strings = smsc_get_strings,
445 .get_stats = smsc_get_stats,
446
Joshua Henderson26706d42016-01-09 04:54:21 -0700447 .suspend = genphy_suspend,
448 .resume = genphy_resume,
Christian Hohnstaedtd5bf9072012-07-04 05:44:34 +0000449} };
Steve Glendinninge072b632009-03-23 15:17:31 -0700450
Johan Hovold50fd7152014-11-11 19:45:59 +0100451module_phy_driver(smsc_phy_driver);
Herbert Valerio Riedelc9e055a2006-05-07 23:22:53 +0200452
453MODULE_DESCRIPTION("SMSC PHY driver");
454MODULE_AUTHOR("Herbert Valerio Riedel");
455MODULE_LICENSE("GPL");
456
Uwe Kleine-Königcf93c942010-10-03 23:43:32 +0000457static struct mdio_device_id __maybe_unused smsc_tbl[] = {
David Woodhouse4e4f10f2010-04-02 01:05:56 +0000458 { 0x0007c0a0, 0xfffffff0 },
459 { 0x0007c0b0, 0xfffffff0 },
460 { 0x0007c0c0, 0xfffffff0 },
461 { 0x0007c0d0, 0xfffffff0 },
462 { 0x0007c0f0, 0xfffffff0 },
Joshua Henderson26706d42016-01-09 04:54:21 -0700463 { 0x0007c110, 0xfffffff0 },
David Woodhouse4e4f10f2010-04-02 01:05:56 +0000464 { }
465};
466
467MODULE_DEVICE_TABLE(mdio, smsc_tbl);