blob: f279a897a5c7fe0e875fb8b058f4c00ae3059f62 [file] [log] [blame]
Matus Ujhelyi0ca71112012-10-14 19:07:16 +00001/*
2 * drivers/net/phy/at803x.c
3 *
4 * Driver for Atheros 803x PHY
5 *
6 * Author: Matus Ujhelyi <ujhelyi.m@gmail.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13
14#include <linux/phy.h>
15#include <linux/module.h>
16#include <linux/string.h>
17#include <linux/netdevice.h>
18#include <linux/etherdevice.h>
Daniel Mack13a56b42014-06-18 11:01:43 +020019#include <linux/of_gpio.h>
20#include <linux/gpio/consumer.h>
Matus Ujhelyi0ca71112012-10-14 19:07:16 +000021
22#define AT803X_INTR_ENABLE 0x12
Martin Blumenstingle6e4a552016-01-15 01:55:24 +010023#define AT803X_INTR_ENABLE_AUTONEG_ERR BIT(15)
24#define AT803X_INTR_ENABLE_SPEED_CHANGED BIT(14)
25#define AT803X_INTR_ENABLE_DUPLEX_CHANGED BIT(13)
26#define AT803X_INTR_ENABLE_PAGE_RECEIVED BIT(12)
27#define AT803X_INTR_ENABLE_LINK_FAIL BIT(11)
28#define AT803X_INTR_ENABLE_LINK_SUCCESS BIT(10)
29#define AT803X_INTR_ENABLE_WIRESPEED_DOWNGRADE BIT(5)
30#define AT803X_INTR_ENABLE_POLARITY_CHANGED BIT(1)
31#define AT803X_INTR_ENABLE_WOL BIT(0)
32
Matus Ujhelyi0ca71112012-10-14 19:07:16 +000033#define AT803X_INTR_STATUS 0x13
Martin Blumenstingla46bd632016-01-15 01:55:23 +010034
Daniel Mack13a56b42014-06-18 11:01:43 +020035#define AT803X_SMART_SPEED 0x14
36#define AT803X_LED_CONTROL 0x18
Martin Blumenstingla46bd632016-01-15 01:55:23 +010037
Matus Ujhelyi0ca71112012-10-14 19:07:16 +000038#define AT803X_DEVICE_ADDR 0x03
39#define AT803X_LOC_MAC_ADDR_0_15_OFFSET 0x804C
40#define AT803X_LOC_MAC_ADDR_16_31_OFFSET 0x804B
41#define AT803X_LOC_MAC_ADDR_32_47_OFFSET 0x804A
42#define AT803X_MMD_ACCESS_CONTROL 0x0D
43#define AT803X_MMD_ACCESS_CONTROL_DATA 0x0E
44#define AT803X_FUNC_DATA 0x4003
Martin Blumenstingla46bd632016-01-15 01:55:23 +010045
Mugunthan V N1ca6d1b2013-06-03 20:10:06 +000046#define AT803X_DEBUG_ADDR 0x1D
47#define AT803X_DEBUG_DATA 0x1E
Martin Blumenstingla46bd632016-01-15 01:55:23 +010048
Martin Blumenstingl2e5f9f22016-01-15 01:55:22 +010049#define AT803X_DEBUG_REG_0 0x00
50#define AT803X_DEBUG_RX_CLK_DLY_EN BIT(15)
Martin Blumenstingla46bd632016-01-15 01:55:23 +010051
Martin Blumenstingl2e5f9f22016-01-15 01:55:22 +010052#define AT803X_DEBUG_REG_5 0x05
53#define AT803X_DEBUG_TX_CLK_DLY_EN BIT(8)
Matus Ujhelyi0ca71112012-10-14 19:07:16 +000054
Zefir Kurtisi98267312016-03-11 15:31:53 +010055#define AT803X_REG_CHIP_CONFIG 0x1f
56#define AT803X_BT_BX_REG_SEL 0x8000
57
Daniel Mackbd8ca17f2014-06-18 11:01:42 +020058#define ATH8030_PHY_ID 0x004dd076
59#define ATH8031_PHY_ID 0x004dd074
60#define ATH8035_PHY_ID 0x004dd072
61
Matus Ujhelyi0ca71112012-10-14 19:07:16 +000062MODULE_DESCRIPTION("Atheros 803x PHY driver");
63MODULE_AUTHOR("Matus Ujhelyi");
64MODULE_LICENSE("GPL");
65
Daniel Mack13a56b42014-06-18 11:01:43 +020066struct at803x_priv {
67 bool phy_reset:1;
68 struct gpio_desc *gpiod_reset;
69};
70
71struct at803x_context {
72 u16 bmcr;
73 u16 advertise;
74 u16 control1000;
75 u16 int_enable;
76 u16 smart_speed;
77 u16 led_control;
78};
79
Martin Blumenstingl2e5f9f22016-01-15 01:55:22 +010080static int at803x_debug_reg_read(struct phy_device *phydev, u16 reg)
81{
82 int ret;
83
84 ret = phy_write(phydev, AT803X_DEBUG_ADDR, reg);
85 if (ret < 0)
86 return ret;
87
88 return phy_read(phydev, AT803X_DEBUG_DATA);
89}
90
91static int at803x_debug_reg_mask(struct phy_device *phydev, u16 reg,
92 u16 clear, u16 set)
93{
94 u16 val;
95 int ret;
96
97 ret = at803x_debug_reg_read(phydev, reg);
98 if (ret < 0)
99 return ret;
100
101 val = ret & 0xffff;
102 val &= ~clear;
103 val |= set;
104
105 return phy_write(phydev, AT803X_DEBUG_DATA, val);
106}
107
108static inline int at803x_enable_rx_delay(struct phy_device *phydev)
109{
110 return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0, 0,
111 AT803X_DEBUG_RX_CLK_DLY_EN);
112}
113
114static inline int at803x_enable_tx_delay(struct phy_device *phydev)
115{
116 return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, 0,
117 AT803X_DEBUG_TX_CLK_DLY_EN);
118}
119
Daniel Mack13a56b42014-06-18 11:01:43 +0200120/* save relevant PHY registers to private copy */
121static void at803x_context_save(struct phy_device *phydev,
122 struct at803x_context *context)
123{
124 context->bmcr = phy_read(phydev, MII_BMCR);
125 context->advertise = phy_read(phydev, MII_ADVERTISE);
126 context->control1000 = phy_read(phydev, MII_CTRL1000);
127 context->int_enable = phy_read(phydev, AT803X_INTR_ENABLE);
128 context->smart_speed = phy_read(phydev, AT803X_SMART_SPEED);
129 context->led_control = phy_read(phydev, AT803X_LED_CONTROL);
130}
131
132/* restore relevant PHY registers from private copy */
133static void at803x_context_restore(struct phy_device *phydev,
134 const struct at803x_context *context)
135{
136 phy_write(phydev, MII_BMCR, context->bmcr);
137 phy_write(phydev, MII_ADVERTISE, context->advertise);
138 phy_write(phydev, MII_CTRL1000, context->control1000);
139 phy_write(phydev, AT803X_INTR_ENABLE, context->int_enable);
140 phy_write(phydev, AT803X_SMART_SPEED, context->smart_speed);
141 phy_write(phydev, AT803X_LED_CONTROL, context->led_control);
142}
143
Mugunthan V Nea13c9e2013-06-03 20:10:05 +0000144static int at803x_set_wol(struct phy_device *phydev,
145 struct ethtool_wolinfo *wol)
Matus Ujhelyi0ca71112012-10-14 19:07:16 +0000146{
147 struct net_device *ndev = phydev->attached_dev;
148 const u8 *mac;
Mugunthan V Nea13c9e2013-06-03 20:10:05 +0000149 int ret;
150 u32 value;
Matus Ujhelyi0ca71112012-10-14 19:07:16 +0000151 unsigned int i, offsets[] = {
152 AT803X_LOC_MAC_ADDR_32_47_OFFSET,
153 AT803X_LOC_MAC_ADDR_16_31_OFFSET,
154 AT803X_LOC_MAC_ADDR_0_15_OFFSET,
155 };
156
157 if (!ndev)
Mugunthan V Nea13c9e2013-06-03 20:10:05 +0000158 return -ENODEV;
Matus Ujhelyi0ca71112012-10-14 19:07:16 +0000159
Mugunthan V Nea13c9e2013-06-03 20:10:05 +0000160 if (wol->wolopts & WAKE_MAGIC) {
161 mac = (const u8 *) ndev->dev_addr;
Matus Ujhelyi0ca71112012-10-14 19:07:16 +0000162
Mugunthan V Nea13c9e2013-06-03 20:10:05 +0000163 if (!is_valid_ether_addr(mac))
164 return -EFAULT;
Matus Ujhelyi0ca71112012-10-14 19:07:16 +0000165
Mugunthan V Nea13c9e2013-06-03 20:10:05 +0000166 for (i = 0; i < 3; i++) {
167 phy_write(phydev, AT803X_MMD_ACCESS_CONTROL,
Matus Ujhelyi0ca71112012-10-14 19:07:16 +0000168 AT803X_DEVICE_ADDR);
Mugunthan V Nea13c9e2013-06-03 20:10:05 +0000169 phy_write(phydev, AT803X_MMD_ACCESS_CONTROL_DATA,
Matus Ujhelyi0ca71112012-10-14 19:07:16 +0000170 offsets[i]);
Mugunthan V Nea13c9e2013-06-03 20:10:05 +0000171 phy_write(phydev, AT803X_MMD_ACCESS_CONTROL,
Matus Ujhelyi0ca71112012-10-14 19:07:16 +0000172 AT803X_FUNC_DATA);
Mugunthan V Nea13c9e2013-06-03 20:10:05 +0000173 phy_write(phydev, AT803X_MMD_ACCESS_CONTROL_DATA,
Matus Ujhelyi0ca71112012-10-14 19:07:16 +0000174 mac[(i * 2) + 1] | (mac[(i * 2)] << 8));
Mugunthan V Nea13c9e2013-06-03 20:10:05 +0000175 }
176
177 value = phy_read(phydev, AT803X_INTR_ENABLE);
Martin Blumenstingle6e4a552016-01-15 01:55:24 +0100178 value |= AT803X_INTR_ENABLE_WOL;
Mugunthan V Nea13c9e2013-06-03 20:10:05 +0000179 ret = phy_write(phydev, AT803X_INTR_ENABLE, value);
180 if (ret)
181 return ret;
182 value = phy_read(phydev, AT803X_INTR_STATUS);
183 } else {
184 value = phy_read(phydev, AT803X_INTR_ENABLE);
Martin Blumenstingle6e4a552016-01-15 01:55:24 +0100185 value &= (~AT803X_INTR_ENABLE_WOL);
Mugunthan V Nea13c9e2013-06-03 20:10:05 +0000186 ret = phy_write(phydev, AT803X_INTR_ENABLE, value);
187 if (ret)
188 return ret;
189 value = phy_read(phydev, AT803X_INTR_STATUS);
Matus Ujhelyi0ca71112012-10-14 19:07:16 +0000190 }
Mugunthan V Nea13c9e2013-06-03 20:10:05 +0000191
192 return ret;
193}
194
195static void at803x_get_wol(struct phy_device *phydev,
196 struct ethtool_wolinfo *wol)
197{
198 u32 value;
199
200 wol->supported = WAKE_MAGIC;
201 wol->wolopts = 0;
202
203 value = phy_read(phydev, AT803X_INTR_ENABLE);
Martin Blumenstingle6e4a552016-01-15 01:55:24 +0100204 if (value & AT803X_INTR_ENABLE_WOL)
Mugunthan V Nea13c9e2013-06-03 20:10:05 +0000205 wol->wolopts |= WAKE_MAGIC;
Matus Ujhelyi0ca71112012-10-14 19:07:16 +0000206}
207
Daniel Mack6229ed12013-09-21 16:53:02 +0200208static int at803x_suspend(struct phy_device *phydev)
209{
210 int value;
211 int wol_enabled;
Zefir Kurtisi98267312016-03-11 15:31:53 +0100212 int ccr;
Daniel Mack6229ed12013-09-21 16:53:02 +0200213
214 mutex_lock(&phydev->lock);
215
216 value = phy_read(phydev, AT803X_INTR_ENABLE);
Martin Blumenstingle6e4a552016-01-15 01:55:24 +0100217 wol_enabled = value & AT803X_INTR_ENABLE_WOL;
Daniel Mack6229ed12013-09-21 16:53:02 +0200218
219 value = phy_read(phydev, MII_BMCR);
220
221 if (wol_enabled)
222 value |= BMCR_ISOLATE;
223 else
224 value |= BMCR_PDOWN;
225
226 phy_write(phydev, MII_BMCR, value);
227
Zefir Kurtisi98267312016-03-11 15:31:53 +0100228 if (phydev->interface != PHY_INTERFACE_MODE_SGMII)
229 goto done;
230
231 /* also power-down SGMII interface */
232 ccr = phy_read(phydev, AT803X_REG_CHIP_CONFIG);
233 phy_write(phydev, AT803X_REG_CHIP_CONFIG, ccr & ~AT803X_BT_BX_REG_SEL);
234 phy_write(phydev, MII_BMCR, phy_read(phydev, MII_BMCR) | BMCR_PDOWN);
235 phy_write(phydev, AT803X_REG_CHIP_CONFIG, ccr | AT803X_BT_BX_REG_SEL);
236
237done:
Daniel Mack6229ed12013-09-21 16:53:02 +0200238 mutex_unlock(&phydev->lock);
239
240 return 0;
241}
242
243static int at803x_resume(struct phy_device *phydev)
244{
245 int value;
Zefir Kurtisi98267312016-03-11 15:31:53 +0100246 int ccr;
Daniel Mack6229ed12013-09-21 16:53:02 +0200247
248 mutex_lock(&phydev->lock);
249
250 value = phy_read(phydev, MII_BMCR);
251 value &= ~(BMCR_PDOWN | BMCR_ISOLATE);
252 phy_write(phydev, MII_BMCR, value);
253
Zefir Kurtisi98267312016-03-11 15:31:53 +0100254 if (phydev->interface != PHY_INTERFACE_MODE_SGMII)
255 goto done;
256
257 /* also power-up SGMII interface */
258 ccr = phy_read(phydev, AT803X_REG_CHIP_CONFIG);
259 phy_write(phydev, AT803X_REG_CHIP_CONFIG, ccr & ~AT803X_BT_BX_REG_SEL);
260 value = phy_read(phydev, MII_BMCR) & ~(BMCR_PDOWN | BMCR_ISOLATE);
261 phy_write(phydev, MII_BMCR, value);
262 phy_write(phydev, AT803X_REG_CHIP_CONFIG, ccr | AT803X_BT_BX_REG_SEL);
263
264done:
Daniel Mack6229ed12013-09-21 16:53:02 +0200265 mutex_unlock(&phydev->lock);
266
267 return 0;
268}
269
Daniel Mack13a56b42014-06-18 11:01:43 +0200270static int at803x_probe(struct phy_device *phydev)
271{
Andrew Lunne5a03bf2016-01-06 20:11:16 +0100272 struct device *dev = &phydev->mdio.dev;
Daniel Mack13a56b42014-06-18 11:01:43 +0200273 struct at803x_priv *priv;
Uwe Kleine-König687908c2015-03-31 22:08:45 +0200274 struct gpio_desc *gpiod_reset;
Daniel Mack13a56b42014-06-18 11:01:43 +0200275
Fengguang Wu8f2877c2014-06-22 12:32:51 +0200276 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
Daniel Mack13a56b42014-06-18 11:01:43 +0200277 if (!priv)
278 return -ENOMEM;
279
Sebastian Frias9eb13f62016-03-23 11:49:09 +0100280 if (phydev->drv->phy_id != ATH8030_PHY_ID)
281 goto does_not_require_reset_workaround;
282
Sergei Shtylyovd57019d2016-03-23 00:44:40 +0300283 gpiod_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
Uwe Kleine-König687908c2015-03-31 22:08:45 +0200284 if (IS_ERR(gpiod_reset))
285 return PTR_ERR(gpiod_reset);
286
287 priv->gpiod_reset = gpiod_reset;
Daniel Mack13a56b42014-06-18 11:01:43 +0200288
Sebastian Frias9eb13f62016-03-23 11:49:09 +0100289does_not_require_reset_workaround:
Daniel Mack13a56b42014-06-18 11:01:43 +0200290 phydev->priv = priv;
291
292 return 0;
293}
294
Matus Ujhelyi0ca71112012-10-14 19:07:16 +0000295static int at803x_config_init(struct phy_device *phydev)
296{
Mugunthan V N1ca6d1b2013-06-03 20:10:06 +0000297 int ret;
Matus Ujhelyi0ca71112012-10-14 19:07:16 +0000298
Daniel Mack6ff01db2014-04-16 17:19:13 +0200299 ret = genphy_config_init(phydev);
300 if (ret < 0)
301 return ret;
Matus Ujhelyi0ca71112012-10-14 19:07:16 +0000302
Martin Blumenstingl2e5f9f22016-01-15 01:55:22 +0100303 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID ||
304 phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) {
305 ret = at803x_enable_rx_delay(phydev);
306 if (ret < 0)
Mugunthan V N1ca6d1b2013-06-03 20:10:06 +0000307 return ret;
Martin Blumenstingl2e5f9f22016-01-15 01:55:22 +0100308 }
309
310 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID ||
311 phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) {
312 ret = at803x_enable_tx_delay(phydev);
313 if (ret < 0)
Mugunthan V N1ca6d1b2013-06-03 20:10:06 +0000314 return ret;
315 }
316
Matus Ujhelyi0ca71112012-10-14 19:07:16 +0000317 return 0;
318}
319
Zhao Qiang77a99392014-03-28 15:39:41 +0800320static int at803x_ack_interrupt(struct phy_device *phydev)
321{
322 int err;
323
Martin Blumenstingla46bd632016-01-15 01:55:23 +0100324 err = phy_read(phydev, AT803X_INTR_STATUS);
Zhao Qiang77a99392014-03-28 15:39:41 +0800325
326 return (err < 0) ? err : 0;
327}
328
329static int at803x_config_intr(struct phy_device *phydev)
330{
331 int err;
332 int value;
333
Martin Blumenstingla46bd632016-01-15 01:55:23 +0100334 value = phy_read(phydev, AT803X_INTR_ENABLE);
Zhao Qiang77a99392014-03-28 15:39:41 +0800335
Martin Blumenstingle6e4a552016-01-15 01:55:24 +0100336 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
337 value |= AT803X_INTR_ENABLE_AUTONEG_ERR;
338 value |= AT803X_INTR_ENABLE_SPEED_CHANGED;
339 value |= AT803X_INTR_ENABLE_DUPLEX_CHANGED;
340 value |= AT803X_INTR_ENABLE_LINK_FAIL;
341 value |= AT803X_INTR_ENABLE_LINK_SUCCESS;
342
343 err = phy_write(phydev, AT803X_INTR_ENABLE, value);
344 }
Zhao Qiang77a99392014-03-28 15:39:41 +0800345 else
Martin Blumenstingla46bd632016-01-15 01:55:23 +0100346 err = phy_write(phydev, AT803X_INTR_ENABLE, 0);
Zhao Qiang77a99392014-03-28 15:39:41 +0800347
348 return err;
349}
350
Daniel Mack13a56b42014-06-18 11:01:43 +0200351static void at803x_link_change_notify(struct phy_device *phydev)
352{
353 struct at803x_priv *priv = phydev->priv;
354
355 /*
356 * Conduct a hardware reset for AT8030 every time a link loss is
357 * signalled. This is necessary to circumvent a hardware bug that
358 * occurs when the cable is unplugged while TX packets are pending
359 * in the FIFO. In such cases, the FIFO enters an error mode it
360 * cannot recover from by software.
361 */
Timur Tabia05d7df2016-04-26 12:44:18 -0500362 if (phydev->state == PHY_NOLINK) {
363 if (priv->gpiod_reset && !priv->phy_reset) {
364 struct at803x_context context;
Daniel Mack13a56b42014-06-18 11:01:43 +0200365
Timur Tabia05d7df2016-04-26 12:44:18 -0500366 at803x_context_save(phydev, &context);
Daniel Mack13a56b42014-06-18 11:01:43 +0200367
Timur Tabia05d7df2016-04-26 12:44:18 -0500368 gpiod_set_value(priv->gpiod_reset, 1);
369 msleep(1);
370 gpiod_set_value(priv->gpiod_reset, 0);
371 msleep(1);
Daniel Mack13a56b42014-06-18 11:01:43 +0200372
Timur Tabia05d7df2016-04-26 12:44:18 -0500373 at803x_context_restore(phydev, &context);
Daniel Mack13a56b42014-06-18 11:01:43 +0200374
Timur Tabia05d7df2016-04-26 12:44:18 -0500375 phydev_dbg(phydev, "%s(): phy was reset\n",
376 __func__);
377 priv->phy_reset = true;
Daniel Mack13a56b42014-06-18 11:01:43 +0200378 }
Timur Tabia05d7df2016-04-26 12:44:18 -0500379 } else {
380 priv->phy_reset = false;
Daniel Mack13a56b42014-06-18 11:01:43 +0200381 }
382}
383
Mugunthan V N317420a2013-06-03 20:10:04 +0000384static struct phy_driver at803x_driver[] = {
385{
386 /* ATHEROS 8035 */
Daniel Mack13a56b42014-06-18 11:01:43 +0200387 .phy_id = ATH8035_PHY_ID,
388 .name = "Atheros 8035 ethernet",
389 .phy_id_mask = 0xffffffef,
390 .probe = at803x_probe,
391 .config_init = at803x_config_init,
Daniel Mack13a56b42014-06-18 11:01:43 +0200392 .set_wol = at803x_set_wol,
393 .get_wol = at803x_get_wol,
394 .suspend = at803x_suspend,
395 .resume = at803x_resume,
396 .features = PHY_GBIT_FEATURES,
397 .flags = PHY_HAS_INTERRUPT,
398 .config_aneg = genphy_config_aneg,
399 .read_status = genphy_read_status,
Måns Rullgård0eae5982015-11-12 17:40:20 +0000400 .ack_interrupt = at803x_ack_interrupt,
401 .config_intr = at803x_config_intr,
Mugunthan V N317420a2013-06-03 20:10:04 +0000402}, {
403 /* ATHEROS 8030 */
Daniel Mack13a56b42014-06-18 11:01:43 +0200404 .phy_id = ATH8030_PHY_ID,
405 .name = "Atheros 8030 ethernet",
406 .phy_id_mask = 0xffffffef,
407 .probe = at803x_probe,
408 .config_init = at803x_config_init,
409 .link_change_notify = at803x_link_change_notify,
410 .set_wol = at803x_set_wol,
411 .get_wol = at803x_get_wol,
412 .suspend = at803x_suspend,
413 .resume = at803x_resume,
Martin Blumenstingle15bb4c2016-01-15 01:55:21 +0100414 .features = PHY_BASIC_FEATURES,
Daniel Mack13a56b42014-06-18 11:01:43 +0200415 .flags = PHY_HAS_INTERRUPT,
416 .config_aneg = genphy_config_aneg,
417 .read_status = genphy_read_status,
Måns Rullgård0eae5982015-11-12 17:40:20 +0000418 .ack_interrupt = at803x_ack_interrupt,
419 .config_intr = at803x_config_intr,
Mugunthan V N05d7cce2013-06-03 20:10:07 +0000420}, {
421 /* ATHEROS 8031 */
Daniel Mack13a56b42014-06-18 11:01:43 +0200422 .phy_id = ATH8031_PHY_ID,
423 .name = "Atheros 8031 ethernet",
424 .phy_id_mask = 0xffffffef,
425 .probe = at803x_probe,
426 .config_init = at803x_config_init,
Daniel Mack13a56b42014-06-18 11:01:43 +0200427 .set_wol = at803x_set_wol,
428 .get_wol = at803x_get_wol,
429 .suspend = at803x_suspend,
430 .resume = at803x_resume,
431 .features = PHY_GBIT_FEATURES,
432 .flags = PHY_HAS_INTERRUPT,
433 .config_aneg = genphy_config_aneg,
434 .read_status = genphy_read_status,
435 .ack_interrupt = &at803x_ack_interrupt,
436 .config_intr = &at803x_config_intr,
Mugunthan V N317420a2013-06-03 20:10:04 +0000437} };
Matus Ujhelyi0ca71112012-10-14 19:07:16 +0000438
Johan Hovold50fd7152014-11-11 19:45:59 +0100439module_phy_driver(at803x_driver);
Matus Ujhelyi0ca71112012-10-14 19:07:16 +0000440
441static struct mdio_device_id __maybe_unused atheros_tbl[] = {
Daniel Mackbd8ca17f2014-06-18 11:01:42 +0200442 { ATH8030_PHY_ID, 0xffffffef },
443 { ATH8031_PHY_ID, 0xffffffef },
444 { ATH8035_PHY_ID, 0xffffffef },
Matus Ujhelyi0ca71112012-10-14 19:07:16 +0000445 { }
446};
447
448MODULE_DEVICE_TABLE(mdio, atheros_tbl);