On Fri, 2009-01-16 at 06:15 +0100, Cron Daemon wrote:
>
> +drivers/net/wireless/p54/p54spi.h:28:11: error: unable to open 'mach/board.h'
> +make[2]: *** [drivers/net/wireless/p54/p54spi.o] Error 1
> +make[1]: *** [drivers/net/wireless/p54] Error 2
> +make: *** [_module_drivers/net/wireless] Error 2
p54spi only depends on SPI_MASTER, but includes arm-specific files.
johannes
Christian Lamparter <[email protected]> writes:
>> p54spi only depends on SPI_MASTER, but includes arm-specific files.
>
> Signed-off-by: Christian Lamparter <[email protected]>
> ---
> diff --git a/drivers/net/wireless/p54/Kconfig b/drivers/net/wireless/p54/Kconfig
> index cfc5f41..131dba3 100644
> --- a/drivers/net/wireless/p54/Kconfig
> +++ b/drivers/net/wireless/p54/Kconfig
> @@ -64,7 +64,8 @@ config P54_PCI
>
> config P54_SPI
> tristate "Prism54 SPI (stlc45xx) support"
> - depends on P54_COMMON && SPI_MASTER
> + depends on P54_COMMON && SPI_MASTER && ARCH_OMAP && \
> + (MACH_NOKIA_N800 || MACH_NOKIA_N810)
N800 and N810 support is not on mainline yet, for stlc45xx I decided
to add module parameters for the gpio numbers. Here's the commit from
stlc45xx repo:
http://gitorious.org/projects/stlc45xx/repos/mainline/commits/35afc5df0027d02d49e6f5bf986dcc4deb4ee6cf
After that the driver is generic and should compile everywhere.
omap_get_config() is deprecated anyway, we should use proper
platform_data instead.
--
Kalle Valo
On Friday 16 January 2009 10:30:59 Johannes Berg wrote:
> On Fri, 2009-01-16 at 06:15 +0100, Cron Daemon wrote:
> >
> > +drivers/net/wireless/p54/p54spi.h:28:11: error: unable to open 'mach/board.h'
> > +make[2]: *** [drivers/net/wireless/p54/p54spi.o] Error 1
> > +make[1]: *** [drivers/net/wireless/p54] Error 2
> > +make: *** [_module_drivers/net/wireless] Error 2
>
> p54spi only depends on SPI_MASTER, but includes arm-specific files.
Signed-off-by: Christian Lamparter <[email protected]>
---
diff --git a/drivers/net/wireless/p54/Kconfig b/drivers/net/wireless/p54/Kconfig
index cfc5f41..131dba3 100644
--- a/drivers/net/wireless/p54/Kconfig
+++ b/drivers/net/wireless/p54/Kconfig
@@ -64,7 +64,8 @@ config P54_PCI
config P54_SPI
tristate "Prism54 SPI (stlc45xx) support"
- depends on P54_COMMON && SPI_MASTER
+ depends on P54_COMMON && SPI_MASTER && ARCH_OMAP && \
+ (MACH_NOKIA_N800 || MACH_NOKIA_N810)
---help---
This driver is for stlc4550 or stlc4560 based wireless chips.
This driver is experimental, untested and will probably only work on
On Friday 16 January 2009 20:33:43 Kalle Valo wrote:
> N800 and N810 support is not on mainline yet, for stlc45xx I decided
> to add module parameters for the gpio numbers. Here's the commit from
> stlc45xx repo:
>
> http://gitorious.org/projects/stlc45xx/repos/mainline/commits/35afc5df0027d02d49e6f5bf986dcc4deb4ee6cf
This is the same patch for p54spi.
It removes all N800/N810 specific code from p54spi, so the driver can be used on
other architectures, or configurations as well.
Signed-off-by: Christian Lamparter <[email protected]>
---
All in favour with these changes?
---
diff --git a/drivers/net/wireless/p54/p54spi.c b/drivers/net/wireless/p54/p54spi.c
index b8dede7..7fde243 100644
--- a/drivers/net/wireless/p54/p54spi.c
+++ b/drivers/net/wireless/p54/p54spi.c
@@ -39,6 +39,20 @@
MODULE_FIRMWARE("3826.arm");
MODULE_ALIAS("stlc45xx");
+/*
+ * gpios should be handled in board files and provided via platform data,
+ * but because it's currently impossible for p54spi to have a header file
+ * in include/linux, let's use module paramaters for now
+ */
+
+static int p54spi_gpio_power = 97;
+module_param(p54spi_gpio_power, int, 0444);
+MODULE_PARM_DESC(p54spi_gpio_power, "gpio number for power line");
+
+static int p54spi_gpio_irq = 87;
+module_param(p54spi_gpio_irq, int, 0444);
+MODULE_PARM_DESC(p54spi_gpio_irq, "gpio number for irq line");
+
static void p54spi_spi_read(struct p54s_priv *priv, u8 address,
void *buf, size_t len)
{
@@ -283,14 +297,14 @@ static int p54spi_upload_firmware(struct ieee80211_hw *dev)
static void p54spi_power_off(struct p54s_priv *priv)
{
- disable_irq(gpio_to_irq(priv->config->irq_gpio));
- gpio_set_value(priv->config->power_gpio, 0);
+ disable_irq(gpio_to_irq(p54spi_gpio_irq));
+ gpio_set_value(p54spi_gpio_power, 0);
}
static void p54spi_power_on(struct p54s_priv *priv)
{
- gpio_set_value(priv->config->power_gpio, 1);
- enable_irq(gpio_to_irq(priv->config->irq_gpio));
+ gpio_set_value(p54spi_gpio_power, 1);
+ enable_irq(gpio_to_irq(p54spi_gpio_irq));
/*
* need to wait a while before device can be accessed, the lenght
@@ -626,9 +640,6 @@ static int __devinit p54spi_probe(struct spi_device *spi)
dev_set_drvdata(&spi->dev, priv);
priv->spi = spi;
- priv->config = omap_get_config(OMAP_TAG_WLAN_CX3110X,
- struct omap_wlan_cx3110x_config);
-
spi->bits_per_word = 16;
spi->max_speed_hz = 24000000;
@@ -638,22 +649,22 @@ static int __devinit p54spi_probe(struct spi_device *spi)
goto err_free_common;
}
- ret = gpio_request(priv->config->power_gpio, "p54spi power");
+ ret = gpio_request(p54spi_gpio_power, "p54spi power");
if (ret < 0) {
dev_err(&priv->spi->dev, "power GPIO request failed: %d", ret);
goto err_free_common;
}
- ret = gpio_request(priv->config->irq_gpio, "p54spi irq");
+ ret = gpio_request(p54spi_gpio_irq, "p54spi irq");
if (ret < 0) {
dev_err(&priv->spi->dev, "irq GPIO request failed: %d", ret);
goto err_free_common;
}
- gpio_direction_output(priv->config->power_gpio, 0);
- gpio_direction_input(priv->config->irq_gpio);
+ gpio_direction_output(p54spi_gpio_power, 0);
+ gpio_direction_input(p54spi_gpio_irq);
- ret = request_irq(OMAP_GPIO_IRQ(priv->config->irq_gpio),
+ ret = request_irq(gpio_to_irq(p54spi_gpio_irq),
p54spi_interrupt, IRQF_DISABLED, "p54spi",
priv->spi);
if (ret < 0) {
@@ -661,10 +672,10 @@ static int __devinit p54spi_probe(struct spi_device *spi)
goto err_free_common;
}
- set_irq_type(gpio_to_irq(priv->config->irq_gpio),
+ set_irq_type(gpio_to_irq(p54spi_gpio_irq),
IRQ_TYPE_EDGE_RISING);
- disable_irq(gpio_to_irq(priv->config->irq_gpio));
+ disable_irq(gpio_to_irq(p54spi_gpio_irq));
INIT_WORK(&priv->work, p54spi_work);
init_completion(&priv->fw_comp);
@@ -705,10 +716,10 @@ static int __devexit p54spi_remove(struct spi_device *spi)
ieee80211_unregister_hw(priv->hw);
- free_irq(gpio_to_irq(priv->config->irq_gpio), spi);
+ free_irq(gpio_to_irq(p54spi_gpio_irq), spi);
- gpio_free(priv->config->power_gpio);
- gpio_free(priv->config->irq_gpio);
+ gpio_free(p54spi_gpio_power);
+ gpio_free(p54spi_gpio_irq);
release_firmware(priv->firmware);
mutex_destroy(&priv->mutex);
diff --git a/drivers/net/wireless/p54/p54spi.h b/drivers/net/wireless/p54/p54spi.h
index 5013ebc..7fbe8d8 100644
--- a/drivers/net/wireless/p54/p54spi.h
+++ b/drivers/net/wireless/p54/p54spi.h
@@ -25,7 +25,6 @@
#include <linux/mutex.h>
#include <linux/list.h>
#include <net/mac80211.h>
-#include <mach/board.h>
#include "p54.h"
@@ -108,7 +107,6 @@ struct p54s_priv {
struct p54_common common;
struct ieee80211_hw *hw;
struct spi_device *spi;
- const struct omap_wlan_cx3110x_config *config;
struct work_struct work;
Christian Lamparter <[email protected]> writes:
> On Friday 16 January 2009 20:33:43 Kalle Valo wrote:
>> N800 and N810 support is not on mainline yet, for stlc45xx I decided
>> to add module parameters for the gpio numbers. Here's the commit from
>> stlc45xx repo:
>>
>> http://gitorious.org/projects/stlc45xx/repos/mainline/commits/35afc5df0027d02d49e6f5bf986dcc4deb4ee6cf
>
> This is the same patch for p54spi.
> It removes all N800/N810 specific code from p54spi, so the driver can be used on
> other architectures, or configurations as well.
>
> Signed-off-by: Christian Lamparter <[email protected]>
> ---
> All in favour with these changes?
No complaints from me.
> +/*
> + * gpios should be handled in board files and provided via platform data,
> + * but because it's currently impossible for p54spi to have a header file
> + * in include/linux, let's use module paramaters for now
> + */
For stlc45xx, being an out-of-tree driver, it was impossible to have a
header file for the platform data. But p54spi is a proper in-tree
driver and it shouldn't have that problem. But that's the next step,
it shouldn't hold off this patch.
--
Kalle Valo