korina.c (3d40aed862874db14e1dd41fd6f12636dcfdcc3e) | korina.c (0b6291ad1940c403734312d0e453e8dac9148f69) |
---|---|
1/* 2 * Driver for the IDT RC32434 (Korina) on-chip ethernet controller. 3 * 4 * Copyright 2004 IDT Inc. (rischelp@idt.com) 5 * Copyright 2006 Felix Fietkau <nbd@openwrt.org> 6 * Copyright 2008 Florian Fainelli <florian@openwrt.org> 7 * Copyright 2017 Roman Yeryomin <roman@advem.lv> 8 * --- 29 unchanged lines hidden (view full) --- 38#include <linux/moduleparam.h> 39#include <linux/sched.h> 40#include <linux/ctype.h> 41#include <linux/types.h> 42#include <linux/interrupt.h> 43#include <linux/ioport.h> 44#include <linux/iopoll.h> 45#include <linux/in.h> | 1/* 2 * Driver for the IDT RC32434 (Korina) on-chip ethernet controller. 3 * 4 * Copyright 2004 IDT Inc. (rischelp@idt.com) 5 * Copyright 2006 Felix Fietkau <nbd@openwrt.org> 6 * Copyright 2008 Florian Fainelli <florian@openwrt.org> 7 * Copyright 2017 Roman Yeryomin <roman@advem.lv> 8 * --- 29 unchanged lines hidden (view full) --- 38#include <linux/moduleparam.h> 39#include <linux/sched.h> 40#include <linux/ctype.h> 41#include <linux/types.h> 42#include <linux/interrupt.h> 43#include <linux/ioport.h> 44#include <linux/iopoll.h> 45#include <linux/in.h> |
46#include <linux/of.h> | 46#include <linux/of_device.h> |
47#include <linux/of_net.h> 48#include <linux/slab.h> 49#include <linux/string.h> 50#include <linux/delay.h> 51#include <linux/netdevice.h> 52#include <linux/etherdevice.h> 53#include <linux/skbuff.h> 54#include <linux/errno.h> --- 1242 unchanged lines hidden (view full) --- 1297 SET_NETDEV_DEV(dev, &pdev->dev); 1298 lp = netdev_priv(dev); 1299 1300 if (mac_addr) 1301 eth_hw_addr_set(dev, mac_addr); 1302 else if (of_get_ethdev_address(pdev->dev.of_node, dev) < 0) 1303 eth_hw_addr_random(dev); 1304 | 47#include <linux/of_net.h> 48#include <linux/slab.h> 49#include <linux/string.h> 50#include <linux/delay.h> 51#include <linux/netdevice.h> 52#include <linux/etherdevice.h> 53#include <linux/skbuff.h> 54#include <linux/errno.h> --- 1242 unchanged lines hidden (view full) --- 1297 SET_NETDEV_DEV(dev, &pdev->dev); 1298 lp = netdev_priv(dev); 1299 1300 if (mac_addr) 1301 eth_hw_addr_set(dev, mac_addr); 1302 else if (of_get_ethdev_address(pdev->dev.of_node, dev) < 0) 1303 eth_hw_addr_random(dev); 1304 |
1305 clk = devm_clk_get_optional(&pdev->dev, "mdioclk"); | 1305 clk = devm_clk_get_optional_enabled(&pdev->dev, "mdioclk"); |
1306 if (IS_ERR(clk)) 1307 return PTR_ERR(clk); 1308 if (clk) { | 1306 if (IS_ERR(clk)) 1307 return PTR_ERR(clk); 1308 if (clk) { |
1309 clk_prepare_enable(clk); | |
1310 lp->mii_clock_freq = clk_get_rate(clk); 1311 } else { 1312 lp->mii_clock_freq = 200000000; /* max possible input clk */ 1313 } 1314 1315 lp->rx_irq = platform_get_irq_byname(pdev, "rx"); 1316 lp->tx_irq = platform_get_irq_byname(pdev, "tx"); 1317 --- 102 unchanged lines hidden --- | 1309 lp->mii_clock_freq = clk_get_rate(clk); 1310 } else { 1311 lp->mii_clock_freq = 200000000; /* max possible input clk */ 1312 } 1313 1314 lp->rx_irq = platform_get_irq_byname(pdev, "rx"); 1315 lp->tx_irq = platform_get_irq_byname(pdev, "tx"); 1316 --- 102 unchanged lines hidden --- |