diff mbox series

[v3,03/24] wfx: add Makefile/Kconfig

Message ID 20201104155207.128076-4-Jerome.Pouiller@silabs.com
State New
Headers show
Series None | expand

Commit Message

Jérôme Pouiller Nov. 4, 2020, 3:51 p.m. UTC
From: Jérôme Pouiller <jerome.pouiller@silabs.com>

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/net/wireless/silabs/wfx/Kconfig  |  8 ++++++++
 drivers/net/wireless/silabs/wfx/Makefile | 25 ++++++++++++++++++++++++
 2 files changed, 33 insertions(+)
 create mode 100644 drivers/net/wireless/silabs/wfx/Kconfig
 create mode 100644 drivers/net/wireless/silabs/wfx/Makefile

Comments

Kalle Valo Dec. 22, 2020, 3:05 p.m. UTC | #1
Jerome Pouiller <Jerome.Pouiller@silabs.com> writes:

> From: Jérôme Pouiller <jerome.pouiller@silabs.com>

>

> Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>

> ---

>  drivers/net/wireless/silabs/wfx/Kconfig  |  8 ++++++++

>  drivers/net/wireless/silabs/wfx/Makefile | 25 ++++++++++++++++++++++++

>  2 files changed, 33 insertions(+)

>  create mode 100644 drivers/net/wireless/silabs/wfx/Kconfig

>  create mode 100644 drivers/net/wireless/silabs/wfx/Makefile

>

> diff --git a/drivers/net/wireless/silabs/wfx/Kconfig

> b/drivers/net/wireless/silabs/wfx/Kconfig

> new file mode 100644

> index 000000000000..83ee4d0ca8c6

> --- /dev/null

> +++ b/drivers/net/wireless/silabs/wfx/Kconfig

> @@ -0,0 +1,8 @@

> +config WFX

> +	tristate "Silicon Labs wireless chips WF200 and further"

> +	depends on MAC80211

> +	depends on MMC || !MMC # do not allow WFX=y if MMC=m

> +	depends on (SPI || MMC)

> +	help

> +	  This is a driver for Silicons Labs WFxxx series (WF200 and further)

> +	  chipsets. This chip can be found on SPI or SDIO buses.


Kconfig should mention about the SDIO id snafu and that Device Tree is
required.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Jérôme Pouiller Dec. 22, 2020, 9:19 p.m. UTC | #2
On Tuesday 22 December 2020 16:02:38 CET Kalle Valo wrote:
> Jerome Pouiller <Jerome.Pouiller@silabs.com> writes:
> 
> > From: Jérôme Pouiller <jerome.pouiller@silabs.com>
> >
> > Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
> 
> [...]
> 
> > +wfx-$(CONFIG_SPI) += bus_spi.o
> > +wfx-$(subst m,y,$(CONFIG_MMC)) += bus_sdio.o
> 
> Why this subst? And why only for MMC?

CONFIG_SPI is a boolean (y or empty). The both values make senses.

CONFIG_MMC is a tristate (y, m or empty). The substitution above
ensure that bus_sdio.o will included in wfx.ko if CONFIG_MMC is 'm'
("wfx-$(CONFIG_MMC) += bus_sdio.o" wouldn't make the job).

You may want to know what it happens if CONFIG_MMC=m while CONFIG_WFX=y.
This line in Kconfig prevents to compile wfx statically if MMC is a
module:
       depends on MMC || !MMC # do not allow WFX=y if MMC=m
Kalle Valo Dec. 23, 2020, 5:16 a.m. UTC | #3
Jérôme Pouiller <jerome.pouiller@silabs.com> writes:

> On Tuesday 22 December 2020 16:02:38 CET Kalle Valo wrote:
>> Jerome Pouiller <Jerome.Pouiller@silabs.com> writes:
>> 
>> > From: Jérôme Pouiller <jerome.pouiller@silabs.com>
>> >
>> > Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
>> 
>> [...]
>> 
>> > +wfx-$(CONFIG_SPI) += bus_spi.o
>> > +wfx-$(subst m,y,$(CONFIG_MMC)) += bus_sdio.o
>> 
>> Why this subst? And why only for MMC?
>
> CONFIG_SPI is a boolean (y or empty). The both values make senses.
>
> CONFIG_MMC is a tristate (y, m or empty). The substitution above
> ensure that bus_sdio.o will included in wfx.ko if CONFIG_MMC is 'm'
> ("wfx-$(CONFIG_MMC) += bus_sdio.o" wouldn't make the job).
>
> You may want to know what it happens if CONFIG_MMC=m while CONFIG_WFX=y.
> This line in Kconfig prevents to compile wfx statically if MMC is a
> module:
>        depends on MMC || !MMC # do not allow WFX=y if MMC=m

Ok, thanks for explaining this.
diff mbox series

Patch

diff --git a/drivers/net/wireless/silabs/wfx/Kconfig b/drivers/net/wireless/silabs/wfx/Kconfig
new file mode 100644
index 000000000000..83ee4d0ca8c6
--- /dev/null
+++ b/drivers/net/wireless/silabs/wfx/Kconfig
@@ -0,0 +1,8 @@ 
+config WFX
+	tristate "Silicon Labs wireless chips WF200 and further"
+	depends on MAC80211
+	depends on MMC || !MMC # do not allow WFX=y if MMC=m
+	depends on (SPI || MMC)
+	help
+	  This is a driver for Silicons Labs WFxxx series (WF200 and further)
+	  chipsets. This chip can be found on SPI or SDIO buses.
diff --git a/drivers/net/wireless/silabs/wfx/Makefile b/drivers/net/wireless/silabs/wfx/Makefile
new file mode 100644
index 000000000000..0e0cc982ceab
--- /dev/null
+++ b/drivers/net/wireless/silabs/wfx/Makefile
@@ -0,0 +1,25 @@ 
+# SPDX-License-Identifier: GPL-2.0
+
+# Necessary for CREATE_TRACE_POINTS
+CFLAGS_debug.o = -I$(src)
+
+wfx-y := \
+	bh.o \
+	hwio.o \
+	fwio.o \
+	hif_tx_mib.o \
+	hif_tx.o \
+	hif_rx.o \
+	queue.o \
+	data_tx.o \
+	data_rx.o \
+	scan.o \
+	sta.o \
+	key.o \
+	main.o \
+	sta.o \
+	debug.o
+wfx-$(CONFIG_SPI) += bus_spi.o
+wfx-$(subst m,y,$(CONFIG_MMC)) += bus_sdio.o
+
+obj-$(CONFIG_WFX) += wfx.o