aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/ahb.c
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vasanth@atheros.com>2011-04-12 03:12:22 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-12 16:59:51 -0400
commit6f11c819d5fb24b637f2db605e5d3c270c979627 (patch)
tree314753175d07d86a232f9da956ea2fa9d83e660a /drivers/net/wireless/ath/ath9k/ahb.c
parentb3ba44c6d1633692b45910ee77064e635e2c3143 (diff)
ath9k: Register id table for platform device
Currently the device id in the platform driver is hardcoded to an id which is specific to AR9130/AR9132 SOCs as it supports only wmac (wireless mac) of these SOCs. But this needs to be dynamic when we want to support different wmac of SOCs. So add id_table to driver to make it extendable to more SOCs. Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Acked-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/ahb.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/ahb.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ahb.c b/drivers/net/wireless/ath/ath9k/ahb.c
index 9cb0efa9b4c0..5193ed58a17b 100644
--- a/drivers/net/wireless/ath/ath9k/ahb.c
+++ b/drivers/net/wireless/ath/ath9k/ahb.c
@@ -21,6 +21,14 @@
21#include <linux/ath9k_platform.h> 21#include <linux/ath9k_platform.h>
22#include "ath9k.h" 22#include "ath9k.h"
23 23
24const struct platform_device_id ath9k_platform_id_table[] = {
25 {
26 .name = "ath9k",
27 .driver_data = AR5416_AR9100_DEVID,
28 },
29 {},
30};
31
24/* return bus cachesize in 4B word units */ 32/* return bus cachesize in 4B word units */
25static void ath_ahb_read_cachesize(struct ath_common *common, int *csz) 33static void ath_ahb_read_cachesize(struct ath_common *common, int *csz)
26{ 34{
@@ -57,6 +65,7 @@ static int ath_ahb_probe(struct platform_device *pdev)
57 struct ath_softc *sc; 65 struct ath_softc *sc;
58 struct ieee80211_hw *hw; 66 struct ieee80211_hw *hw;
59 struct resource *res; 67 struct resource *res;
68 const struct platform_device_id *id = platform_get_device_id(pdev);
60 int irq; 69 int irq;
61 int ret = 0; 70 int ret = 0;
62 struct ath_hw *ah; 71 struct ath_hw *ah;
@@ -116,7 +125,7 @@ static int ath_ahb_probe(struct platform_device *pdev)
116 goto err_free_hw; 125 goto err_free_hw;
117 } 126 }
118 127
119 ret = ath9k_init_device(AR5416_AR9100_DEVID, sc, 0x0, &ath_ahb_bus_ops); 128 ret = ath9k_init_device(id->driver_data, sc, 0x0, &ath_ahb_bus_ops);
120 if (ret) { 129 if (ret) {
121 dev_err(&pdev->dev, "failed to initialize device\n"); 130 dev_err(&pdev->dev, "failed to initialize device\n");
122 goto err_irq; 131 goto err_irq;
@@ -165,8 +174,11 @@ static struct platform_driver ath_ahb_driver = {
165 .name = "ath9k", 174 .name = "ath9k",
166 .owner = THIS_MODULE, 175 .owner = THIS_MODULE,
167 }, 176 },
177 .id_table = ath9k_platform_id_table,
168}; 178};
169 179
180MODULE_DEVICE_TABLE(platform, ath9k_platform_id_table);
181
170int ath_ahb_init(void) 182int ath_ahb_init(void)
171{ 183{
172 return platform_driver_register(&ath_ahb_driver); 184 return platform_driver_register(&ath_ahb_driver);