aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/cw1200/cw1200_sdio.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2013-06-02 11:35:31 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-06-03 15:54:55 -0400
commit7c0b6f49dbea0b09b1de8aa5c942af9c2ad8b54c (patch)
tree23b8516e6302ded0d194b05aa10dfa50b6674839 /drivers/net/wireless/cw1200/cw1200_sdio.c
parent6dd64a304eff76ca7dd41bf63df55efa965fa9ec (diff)
cw1200: Rework SDIO platform support to prevent build problems.
Based on discussions with And Bergmann, this patch changes the SDIO platform code to default to supporting the Sagrad devices, allowing for it to be overridden in board setup code. This renders the cw1200_sagrad module suplerflous, so it is now removed. It also moves the documentation that was in the cw1200_sagrad source to the platform header. Signed-off-by: Solomon Peachy <pizza@shaftnet.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/cw1200/cw1200_sdio.c')
-rw-r--r--drivers/net/wireless/cw1200/cw1200_sdio.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/drivers/net/wireless/cw1200/cw1200_sdio.c b/drivers/net/wireless/cw1200/cw1200_sdio.c
index 574cf727567c..4b3148e47ee7 100644
--- a/drivers/net/wireless/cw1200/cw1200_sdio.c
+++ b/drivers/net/wireless/cw1200/cw1200_sdio.c
@@ -29,6 +29,21 @@ MODULE_LICENSE("GPL");
29 29
30#define SDIO_BLOCK_SIZE (512) 30#define SDIO_BLOCK_SIZE (512)
31 31
32/* Default platform data for Sagrad modules */
33static struct cw1200_platform_data_sdio sagrad_109x_evk_platform_data = {
34 .ref_clk = 38400,
35 .have_5ghz = false,
36 .sdd_file = "sdd_sagrad_1091_1098.bin",
37};
38
39/* Allow platform data to be overridden */
40static struct cw1200_platform_data_sdio *global_plat_data = &sagrad_109x_evk_platform_data;
41
42void __init cw1200_sdio_set_platform_data(struct cw1200_platform_data_sdio *pdata)
43{
44 global_plat_data = pdata;
45}
46
32struct hwbus_priv { 47struct hwbus_priv {
33 struct sdio_func *func; 48 struct sdio_func *func;
34 struct cw1200_common *core; 49 struct cw1200_common *core;
@@ -261,7 +276,7 @@ static struct hwbus_ops cw1200_sdio_hwbus_ops = {
261 276
262/* Probe Function to be called by SDIO stack when device is discovered */ 277/* Probe Function to be called by SDIO stack when device is discovered */
263static int cw1200_sdio_probe(struct sdio_func *func, 278static int cw1200_sdio_probe(struct sdio_func *func,
264 const struct sdio_device_id *id) 279 const struct sdio_device_id *id)
265{ 280{
266 struct hwbus_priv *self; 281 struct hwbus_priv *self;
267 int status; 282 int status;
@@ -280,7 +295,7 @@ static int cw1200_sdio_probe(struct sdio_func *func,
280 295
281 func->card->quirks |= MMC_QUIRK_LENIENT_FN0; 296 func->card->quirks |= MMC_QUIRK_LENIENT_FN0;
282 297
283 self->pdata = cw1200_get_platform_data(); 298 self->pdata = global_plat_data; /* FIXME */
284 self->func = func; 299 self->func = func;
285 sdio_set_drvdata(func, self); 300 sdio_set_drvdata(func, self);
286 sdio_claim_host(func); 301 sdio_claim_host(func);
@@ -374,7 +389,8 @@ static int __init cw1200_sdio_init(void)
374 const struct cw1200_platform_data_sdio *pdata; 389 const struct cw1200_platform_data_sdio *pdata;
375 int ret; 390 int ret;
376 391
377 pdata = cw1200_get_platform_data(); 392 /* FIXME -- this won't support multiple devices */
393 pdata = global_plat_data;
378 394
379 if (cw1200_sdio_on(pdata)) { 395 if (cw1200_sdio_on(pdata)) {
380 ret = -1; 396 ret = -1;
@@ -396,7 +412,9 @@ err:
396static void __exit cw1200_sdio_exit(void) 412static void __exit cw1200_sdio_exit(void)
397{ 413{
398 const struct cw1200_platform_data_sdio *pdata; 414 const struct cw1200_platform_data_sdio *pdata;
399 pdata = cw1200_get_platform_data(); 415
416 /* FIXME -- this won't support multiple devices */
417 pdata = global_plat_data;
400 sdio_unregister_driver(&sdio_driver); 418 sdio_unregister_driver(&sdio_driver);
401 cw1200_sdio_off(pdata); 419 cw1200_sdio_off(pdata);
402} 420}