diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-07 22:21:56 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-07 22:21:56 -0500 |
commit | 7677ced48e2bbbb8d847d34f37e5d96d2b0e41e4 (patch) | |
tree | 0a859f403c02eb854d9ffa11bd17f77056891d07 /drivers/net/macb.c | |
parent | 21d37bbc65e39a26856de6b14be371ff24e0d03f (diff) | |
parent | ac38dfc39e7684f55174742e5f0d6c5a0093bbf6 (diff) |
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (116 commits)
sk98lin: planned removal
AT91: MACB support
sky2: version 1.12
sky2: add new chip ids
sky2: Yukon Extreme support
sky2: safer transmit timeout
sky2: TSO support for EC_U
sky2: use dev_err for error reports
sky2: add Wake On Lan support
fix unaligned exception in /drivers/net/wireless/orinoco.c
Remove unused kernel config option DLCI_COUNT
z85230: spinlock logic
mips: declance: Driver model for the PMAD-A
Spidernet: Rework RX linked list
NET: turn local_save_flags() + local_irq_disable() into local_irq_save()
NET-3c59x: turn local_save_flags() + local_irq_disable() into local_irq_save()
hp100: convert pci_module_init() to pci_register_driver()
NetXen: Added ethtool support for user level tools.
NetXen: Firmware crb init changes.
maintainers: add atl1 maintainers
...
Diffstat (limited to 'drivers/net/macb.c')
-rw-r--r-- | drivers/net/macb.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/drivers/net/macb.c b/drivers/net/macb.c index 25b559b5d5ed..5eb7a3536f29 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c | |||
@@ -1046,6 +1046,14 @@ static int __devinit macb_probe(struct platform_device *pdev) | |||
1046 | 1046 | ||
1047 | spin_lock_init(&bp->lock); | 1047 | spin_lock_init(&bp->lock); |
1048 | 1048 | ||
1049 | #if defined(CONFIG_ARCH_AT91) | ||
1050 | bp->pclk = clk_get(&pdev->dev, "macb_clk"); | ||
1051 | if (IS_ERR(bp->pclk)) { | ||
1052 | dev_err(&pdev->dev, "failed to get macb_clk\n"); | ||
1053 | goto err_out_free_dev; | ||
1054 | } | ||
1055 | clk_enable(bp->pclk); | ||
1056 | #else | ||
1049 | bp->pclk = clk_get(&pdev->dev, "pclk"); | 1057 | bp->pclk = clk_get(&pdev->dev, "pclk"); |
1050 | if (IS_ERR(bp->pclk)) { | 1058 | if (IS_ERR(bp->pclk)) { |
1051 | dev_err(&pdev->dev, "failed to get pclk\n"); | 1059 | dev_err(&pdev->dev, "failed to get pclk\n"); |
@@ -1059,6 +1067,7 @@ static int __devinit macb_probe(struct platform_device *pdev) | |||
1059 | 1067 | ||
1060 | clk_enable(bp->pclk); | 1068 | clk_enable(bp->pclk); |
1061 | clk_enable(bp->hclk); | 1069 | clk_enable(bp->hclk); |
1070 | #endif | ||
1062 | 1071 | ||
1063 | bp->regs = ioremap(regs->start, regs->end - regs->start + 1); | 1072 | bp->regs = ioremap(regs->start, regs->end - regs->start + 1); |
1064 | if (!bp->regs) { | 1073 | if (!bp->regs) { |
@@ -1119,9 +1128,17 @@ static int __devinit macb_probe(struct platform_device *pdev) | |||
1119 | 1128 | ||
1120 | pdata = pdev->dev.platform_data; | 1129 | pdata = pdev->dev.platform_data; |
1121 | if (pdata && pdata->is_rmii) | 1130 | if (pdata && pdata->is_rmii) |
1131 | #if defined(CONFIG_ARCH_AT91) | ||
1132 | macb_writel(bp, USRIO, (MACB_BIT(RMII) | MACB_BIT(CLKEN)) ); | ||
1133 | #else | ||
1122 | macb_writel(bp, USRIO, 0); | 1134 | macb_writel(bp, USRIO, 0); |
1135 | #endif | ||
1123 | else | 1136 | else |
1137 | #if defined(CONFIG_ARCH_AT91) | ||
1138 | macb_writel(bp, USRIO, MACB_BIT(CLKEN)); | ||
1139 | #else | ||
1124 | macb_writel(bp, USRIO, MACB_BIT(MII)); | 1140 | macb_writel(bp, USRIO, MACB_BIT(MII)); |
1141 | #endif | ||
1125 | 1142 | ||
1126 | bp->tx_pending = DEF_TX_RING_PENDING; | 1143 | bp->tx_pending = DEF_TX_RING_PENDING; |
1127 | 1144 | ||
@@ -1148,9 +1165,11 @@ err_out_free_irq: | |||
1148 | err_out_iounmap: | 1165 | err_out_iounmap: |
1149 | iounmap(bp->regs); | 1166 | iounmap(bp->regs); |
1150 | err_out_disable_clocks: | 1167 | err_out_disable_clocks: |
1168 | #ifndef CONFIG_ARCH_AT91 | ||
1151 | clk_disable(bp->hclk); | 1169 | clk_disable(bp->hclk); |
1152 | clk_disable(bp->pclk); | ||
1153 | clk_put(bp->hclk); | 1170 | clk_put(bp->hclk); |
1171 | #endif | ||
1172 | clk_disable(bp->pclk); | ||
1154 | err_out_put_pclk: | 1173 | err_out_put_pclk: |
1155 | clk_put(bp->pclk); | 1174 | clk_put(bp->pclk); |
1156 | err_out_free_dev: | 1175 | err_out_free_dev: |
@@ -1173,9 +1192,11 @@ static int __devexit macb_remove(struct platform_device *pdev) | |||
1173 | unregister_netdev(dev); | 1192 | unregister_netdev(dev); |
1174 | free_irq(dev->irq, dev); | 1193 | free_irq(dev->irq, dev); |
1175 | iounmap(bp->regs); | 1194 | iounmap(bp->regs); |
1195 | #ifndef CONFIG_ARCH_AT91 | ||
1176 | clk_disable(bp->hclk); | 1196 | clk_disable(bp->hclk); |
1177 | clk_disable(bp->pclk); | ||
1178 | clk_put(bp->hclk); | 1197 | clk_put(bp->hclk); |
1198 | #endif | ||
1199 | clk_disable(bp->pclk); | ||
1179 | clk_put(bp->pclk); | 1200 | clk_put(bp->pclk); |
1180 | free_netdev(dev); | 1201 | free_netdev(dev); |
1181 | platform_set_drvdata(pdev, NULL); | 1202 | platform_set_drvdata(pdev, NULL); |