Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 194352
b: refs/heads/master
c: 8c00b39
h: refs/heads/master
v: v3
  • Loading branch information
Grazvydas Ignotas authored and John W. Linville committed Apr 16, 2010
1 parent b25a8ac commit 6d03ac0
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 103823db62ffca028c7a214c80266519d2ea7d8d
refs/heads/master: 8c00b39f33bc5340be9b053963321eb9ea6a78ee
40 changes: 40 additions & 0 deletions trunk/drivers/net/wireless/wl12xx/wl1251_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include <linux/mod_devicetable.h>
#include <linux/mmc/sdio_func.h>
#include <linux/mmc/sdio_ids.h>
#include <linux/platform_device.h>
#include <linux/spi/wl12xx.h>

#include "wl1251.h"

Expand All @@ -34,6 +36,8 @@
#define SDIO_DEVICE_ID_TI_WL1251 0x9066
#endif

static struct wl12xx_platform_data *wl12xx_board_data;

static struct sdio_func *wl_to_func(struct wl1251 *wl)
{
return wl->if_priv;
Expand Down Expand Up @@ -144,6 +148,30 @@ static const struct wl1251_if_operations wl1251_sdio_ops = {
.disable_irq = wl1251_sdio_disable_irq,
};

static int wl1251_platform_probe(struct platform_device *pdev)
{
if (pdev->id != -1) {
wl1251_error("can only handle single device");
return -ENODEV;
}

wl12xx_board_data = pdev->dev.platform_data;
return 0;
}

/*
* Dummy platform_driver for passing platform_data to this driver,
* until we have a way to pass this through SDIO subsystem or
* some other way.
*/
static struct platform_driver wl1251_platform_driver = {
.driver = {
.name = "wl1251_data",
.owner = THIS_MODULE,
},
.probe = wl1251_platform_probe,
};

static int wl1251_sdio_probe(struct sdio_func *func,
const struct sdio_device_id *id)
{
Expand All @@ -169,6 +197,11 @@ static int wl1251_sdio_probe(struct sdio_func *func,
wl->if_ops = &wl1251_sdio_ops;
wl->set_power = wl1251_sdio_set_power;

if (wl12xx_board_data != NULL) {
wl->set_power = wl12xx_board_data->set_power;
wl->use_eeprom = wl12xx_board_data->use_eeprom;
}

sdio_release_host(func);
ret = wl1251_init_ieee80211(wl);
if (ret)
Expand Down Expand Up @@ -208,6 +241,12 @@ static int __init wl1251_sdio_init(void)
{
int err;

err = platform_driver_register(&wl1251_platform_driver);
if (err) {
wl1251_error("failed to register platform driver: %d", err);
return err;
}

err = sdio_register_driver(&wl1251_sdio_driver);
if (err)
wl1251_error("failed to register sdio driver: %d", err);
Expand All @@ -217,6 +256,7 @@ static int __init wl1251_sdio_init(void)
static void __exit wl1251_sdio_exit(void)
{
sdio_unregister_driver(&wl1251_sdio_driver);
platform_driver_unregister(&wl1251_platform_driver);
wl1251_notice("unloaded");
}

Expand Down

0 comments on commit 6d03ac0

Please sign in to comment.