Hi Hauke, On Dec 23, 2010, at 1:00 AM, Hauke Mehrtens wrote: > You also have to backport the CONFIG_WL12XX_PLATFORM_DATA and activate > it in your kernel config, wl1271_sdio depends on that. I did as you suggested and was able to get wl1271_sdio.ko to build. I have attached a patch for this, which can be applied on top of the TI android rowboat-eclair-2.6.32 kernel branch. This kernel works with android-2.2.1 (froyo), although the kernel was originally developed for android eclair. >From cec5d06e38664a44e7b723f55648cbcfbc920d6e Mon Sep 17 00:00:00 2001 From: Elvis Dowson <elvis.dowson@xxxxxxxxx> Date: Thu, 23 Dec 2010 18:52:42 +0400 Subject: [PATCH 3/3] wl12xx: Add support for wl12xx_platform_data. --- drivers/net/wireless/wl12xx/Kconfig | 29 +++++++++++- drivers/net/wireless/wl12xx/Makefile | 2 + drivers/net/wireless/wl12xx/wl12xx_platform_data.c | 28 +++++++++++ include/linux/wl12xx.h | 51 ++++++++++++++++++++ 4 files changed, 109 insertions(+), 1 deletions(-) create mode 100644 drivers/net/wireless/wl12xx/wl12xx_platform_data.c create mode 100644 include/linux/wl12xx.h diff --git a/drivers/net/wireless/wl12xx/Kconfig b/drivers/net/wireless/wl12xx/Kconfig index 785e024..4a8bb25 100644 --- a/drivers/net/wireless/wl12xx/Kconfig +++ b/drivers/net/wireless/wl12xx/Kconfig @@ -41,7 +41,7 @@ config WL1251_SDIO config WL1271 tristate "TI wl1271 support" - depends on WL12XX && SPI_MASTER && GENERIC_HARDIRQS + depends on WL12XX && GENERIC_HARDIRQS depends on INET select FW_LOADER select CRC7 @@ -51,3 +51,30 @@ config WL1271 If you choose to build a module, it'll be called wl1271. Say N if unsure. + +config WL1271_SPI + tristate "TI wl1271 SPI support" + depends on WL1271 && SPI_MASTER + ---help--- + This module adds support for the SPI interface of adapters using + TI wl1271 chipset. Select this if your platform is using + the SPI bus. + + If you choose to build a module, it'll be called wl1251_spi. + Say N if unsure. + +config WL1271_SDIO + tristate "TI wl1271 SDIO support" + depends on WL1271 && MMC + ---help--- + This module adds support for the SDIO interface of adapters using + TI wl1271 chipset. Select this if your platform is using + the SDIO bus. + + If you choose to build a module, it'll be called + wl1271_sdio. Say N if unsure. + +config WL12XX_PLATFORM_DATA + bool + depends on WL1271_SDIO != n + default y diff --git a/drivers/net/wireless/wl12xx/Makefile b/drivers/net/wireless/wl12xx/Makefile index 62e37ad..51b348e 100644 --- a/drivers/net/wireless/wl12xx/Makefile +++ b/drivers/net/wireless/wl12xx/Makefile @@ -12,3 +12,5 @@ wl1271-objs = wl1271_main.o wl1271_spi.o wl1271_cmd.o \ wl1271_ps.o wl1271_acx.o wl1271_boot.o \ wl1271_init.o wl1271_debugfs.o obj-$(CONFIG_WL1271) += wl1271.o + +obj-$(CONFIG_WL12XX_PLATFORM_DATA) += wl12xx_platform_data.o diff --git a/drivers/net/wireless/wl12xx/wl12xx_platform_data.c b/drivers/net/wireless/wl12xx/wl12xx_platform_data.c new file mode 100644 index 0000000..973b110 --- /dev/null +++ b/drivers/net/wireless/wl12xx/wl12xx_platform_data.c @@ -0,0 +1,28 @@ +#include <linux/module.h> +#include <linux/err.h> +#include <linux/wl12xx.h> + +static const struct wl12xx_platform_data *platform_data; + +int __init wl12xx_set_platform_data(const struct wl12xx_platform_data *data) +{ + if (platform_data) + return -EBUSY; + if (!data) + return -EINVAL; + + platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL); + if (!platform_data) + return -ENOMEM; + + return 0; +} + +const struct wl12xx_platform_data *wl12xx_get_platform_data(void) +{ + if (!platform_data) + return ERR_PTR(-ENODEV); + + return platform_data; +} +EXPORT_SYMBOL(wl12xx_get_platform_data); diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h new file mode 100644 index 0000000..4f902e1 --- /dev/null +++ b/include/linux/wl12xx.h @@ -0,0 +1,51 @@ +/* + * This file is part of wl12xx + * + * Copyright (C) 2009 Nokia Corporation + * + * Contact: Luciano Coelho <luciano.coelho@xxxxxxxxx> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + * + */ + +#ifndef _LINUX_WL12XX_H +#define _LINUX_WL12XX_H + +struct wl12xx_platform_data { + void (*set_power)(bool enable); + /* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */ + int irq; + bool use_eeprom; + int board_ref_clock; +}; + +#ifdef CONFIG_WL12XX_PLATFORM_DATA + +int wl12xx_set_platform_data(const struct wl12xx_platform_data *data); + +#else + +static inline +int wl12xx_set_platform_data(const struct wl12xx_platform_data *data) +{ + return -ENOSYS; +} + +#endif + +const struct wl12xx_platform_data *wl12xx_get_platform_data(void); + +#endif -- 1.7.0.4 Best regards, Elvis Dowson -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html