blob: 0d30150a3de2fa1e5b85ef628c6ec0aa2e9eaf12 [file] [log] [blame]
Luciano Coelhob2ba99f2011-11-20 23:32:10 +02001/*
2 * This file is part of wl1271
3 *
4 * Copyright (C) 2008-2010 Nokia Corporation
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18 * 02110-1301 USA
19 *
20 */
21
22#include <linux/module.h>
23#include <linux/platform_device.h>
24
Luciano Coelhoffeb5012011-11-21 18:55:51 +020025#include <linux/err.h>
26
Luciano Coelhob2ba99f2011-11-20 23:32:10 +020027#include "../wlcore/wlcore.h"
Luciano Coelhoffeb5012011-11-21 18:55:51 +020028#include "../wlcore/debug.h"
29
Luciano Coelhoc31be252011-11-21 19:25:24 +020030static struct wlcore_ops wl12xx_ops = {
31};
32
Luciano Coelhoffeb5012011-11-21 18:55:51 +020033static int __devinit wl12xx_probe(struct platform_device *pdev)
34{
35 struct wl1271 *wl;
36 struct ieee80211_hw *hw;
37
38 hw = wlcore_alloc_hw();
39 if (IS_ERR(hw)) {
40 wl1271_error("can't allocate hw");
41 return PTR_ERR(hw);
42 }
43
44 wl = hw->priv;
Luciano Coelhoc31be252011-11-21 19:25:24 +020045 wl->ops = &wl12xx_ops;
Luciano Coelhoffeb5012011-11-21 18:55:51 +020046
47 return wlcore_probe(wl, pdev);
48}
Luciano Coelhob2ba99f2011-11-20 23:32:10 +020049
50static const struct platform_device_id wl12xx_id_table[] __devinitconst = {
51 { "wl12xx", 0 },
52 { } /* Terminating Entry */
53};
54MODULE_DEVICE_TABLE(platform, wl12xx_id_table);
55
56static struct platform_driver wl12xx_driver = {
Luciano Coelhoffeb5012011-11-21 18:55:51 +020057 .probe = wl12xx_probe,
Luciano Coelhob2ba99f2011-11-20 23:32:10 +020058 .remove = __devexit_p(wlcore_remove),
59 .id_table = wl12xx_id_table,
60 .driver = {
61 .name = "wl12xx_driver",
62 .owner = THIS_MODULE,
63 }
64};
65
66static int __init wl12xx_init(void)
67{
68 return platform_driver_register(&wl12xx_driver);
69}
70module_init(wl12xx_init);
71
72static void __exit wl12xx_exit(void)
73{
74 platform_driver_unregister(&wl12xx_driver);
75}
76module_exit(wl12xx_exit);
77
78MODULE_LICENSE("GPL v2");
79MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>");