Skip to contentSkip to conversation

USB_SERIAL_KEYSPAN_* dependency on FIRMWARE_IN_KERNEL

DISCUSSION Michal Marek 1 participant 2 messages Apr 28, 2010 – May 4, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi David,

I recently disabled CONFIG_FIRMWARE_IN_KERNEL in the default openSUSE kernels (as no built-in driver needs firmware and the initrd takes care of the modules), but this disabled all the CONFIG_USB_SERIAL_KEYSPAN_* options, because there is

config USB_SERIAL_KEYSPAN_MPR
bool "USB Keyspan MPR Firmware"
depends on USB_SERIAL_KEYSPAN && FIRMWARE_IN_KERNEL
etc

in drivers/usb/serial/Kconfig, added in 2971c57 by you. Is there a reason for this dependency or shouldn't this rather depend on FW_LOADER? On a related note, firmware/Makefile has

ifdef CONFIG_FIRMWARE_IN_KERNEL fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_MPR) += keyspan/mpr.fw
...
else
fw-shipped- += keyspan/mpr.fw ...
endif

which just duplicates the dependency (if CONFIG_FIRMWARE_IN_KERNEL is not set, the CONFIG_USB_SERIAL_KEYSPAN_* options won't be set either). Note that I do not have the hardware, so maybe I'm missing something obvious...

thanks,
Michal

#1 lore raw
Quoted 7 lines · Michal Marek

Hi David,

I recently disabled CONFIG_FIRMWARE_IN_KERNEL in the default openSUSE kernels (as no built-in driver needs firmware and the initrd takes care of the modules), but this disabled all the CONFIG_USB_SERIAL_KEYSPAN_* options, because there is

Quoted 7 lines

config USB_SERIAL_KEYSPAN_MPR
bool "USB Keyspan MPR Firmware"
depends on USB_SERIAL_KEYSPAN && FIRMWARE_IN_KERNEL
etc

in drivers/usb/serial/Kconfig, added in 2971c57 by you. Is there a reason for this dependency or shouldn't this rather depend on FW_LOADER?

I found another problem, the kconfig options to select the firmware files are boolean, so scripts/Makefile.fwinst assumes that the firmware is meant for a built-in driver and doesn't install it during modules_install. This patch should fix that.

Michal

Quoted 1 line

From 2092944f13dbc5f5eee313e4b697e105f18a4b9a Mon Sep 17 00:00:00 2001

From: Michal Marek <[email protected]>
Date: Tue, 4 May 2010 12:11:29 +0200
Subject: [PATCH] Fix USB_SERIAL_KEYSPAN firmware dependencies

Make sure the selected firmware is installed during modules_install. Also drop the dependency on FIRMWARE_IN_KERNEL which doesn't make sense.

drivers/usb/serial/Kconfig +39 -12
index c480ea4..15066ec 100644
@@ -296,19 +296,19 @@ config USB_SERIAL_KEYSPAN
 
 config USB_SERIAL_KEYSPAN_MPR
 	bool "USB Keyspan MPR Firmware"
-	depends on USB_SERIAL_KEYSPAN && FIRMWARE_IN_KERNEL
+	depends on USB_SERIAL_KEYSPAN
 	help
 	  Say Y here to include firmware for the Keyspan MPR converter.
 
 config USB_SERIAL_KEYSPAN_USA28
 	bool "USB Keyspan USA-28 Firmware"
-	depends on USB_SERIAL_KEYSPAN && FIRMWARE_IN_KERNEL
+	depends on USB_SERIAL_KEYSPAN
 	help
 	  Say Y here to include firmware for the USA-28 converter.
 
 config USB_SERIAL_KEYSPAN_USA28X
 	bool "USB Keyspan USA-28X Firmware"
-	depends on USB_SERIAL_KEYSPAN && FIRMWARE_IN_KERNEL
+	depends on USB_SERIAL_KEYSPAN
 	help
 	  Say Y here to include firmware for the USA-28X converter.
 	  Be sure you have a USA-28X, there are also 28XA and 28XB
@@ -316,7 +316,7 @@ config USB_SERIAL_KEYSPAN_USA28X
 
 config USB_SERIAL_KEYSPAN_USA28XA
 	bool "USB Keyspan USA-28XA Firmware"
-	depends on USB_SERIAL_KEYSPAN && FIRMWARE_IN_KERNEL
+	depends on USB_SERIAL_KEYSPAN
 	help
 	  Say Y here to include firmware for the USA-28XA converter.
 	  Be sure you have a USA-28XA, there are also 28X and 28XB
@@ -324,7 +324,7 @@ config USB_SERIAL_KEYSPAN_USA28XA
 
 config USB_SERIAL_KEYSPAN_USA28XB
 	bool "USB Keyspan USA-28XB Firmware"
-	depends on USB_SERIAL_KEYSPAN && FIRMWARE_IN_KERNEL
+	depends on USB_SERIAL_KEYSPAN
 	help
 	  Say Y here to include firmware for the USA-28XB converter.
 	  Be sure you have a USA-28XB, there are also 28X and 28XA
@@ -332,46 +332,73 @@ config USB_SERIAL_KEYSPAN_USA28XB
 
 config USB_SERIAL_KEYSPAN_USA19
 	bool "USB Keyspan USA-19 Firmware"
-	depends on USB_SERIAL_KEYSPAN && FIRMWARE_IN_KERNEL
+	depends on USB_SERIAL_KEYSPAN
 	help
 	  Say Y here to include firmware for the USA-19 converter.
 
 config USB_SERIAL_KEYSPAN_USA18X
 	bool "USB Keyspan USA-18X Firmware"
-	depends on USB_SERIAL_KEYSPAN && FIRMWARE_IN_KERNEL
+	depends on USB_SERIAL_KEYSPAN
 	help
 	  Say Y here to include firmware for the USA-18X converter.
 
 config USB_SERIAL_KEYSPAN_USA19W
 	bool "USB Keyspan USA-19W Firmware"
-	depends on USB_SERIAL_KEYSPAN && FIRMWARE_IN_KERNEL
+	depends on USB_SERIAL_KEYSPAN
 	help
 	  Say Y here to include firmware for the USA-19W converter.
 
 config USB_SERIAL_KEYSPAN_USA19QW
 	bool "USB Keyspan USA-19QW Firmware"
-	depends on USB_SERIAL_KEYSPAN && FIRMWARE_IN_KERNEL
+	depends on USB_SERIAL_KEYSPAN
 	help
 	  Say Y here to include firmware for the USA-19QW converter.
 
 config USB_SERIAL_KEYSPAN_USA19QI
 	bool "USB Keyspan USA-19QI Firmware"
-	depends on USB_SERIAL_KEYSPAN && FIRMWARE_IN_KERNEL
+	depends on USB_SERIAL_KEYSPAN
 	help
 	  Say Y here to include firmware for the USA-19QI converter.
 
 config USB_SERIAL_KEYSPAN_USA49W
 	bool "USB Keyspan USA-49W Firmware"
-	depends on USB_SERIAL_KEYSPAN && FIRMWARE_IN_KERNEL
+	depends on USB_SERIAL_KEYSPAN
 	help
 	  Say Y here to include firmware for the USA-49W converter.
 
 config USB_SERIAL_KEYSPAN_USA49WLC
 	bool "USB Keyspan USA-49WLC Firmware"
-	depends on USB_SERIAL_KEYSPAN && FIRMWARE_IN_KERNEL
+	depends on USB_SERIAL_KEYSPAN
 	help
 	  Say Y here to include firmware for the USA-49WLC converter.
 
+# These helpers make sure that the firmware files appear in fw-shipped-m
+# and not fw-shipped-y if the driver is built as a module
+config USB_SERIAL_KEYSPAN_MPR_FW
+	def_tristate USB_SERIAL_KEYSPAN && USB_SERIAL_KEYSPAN_MPR
+config USB_SERIAL_KEYSPAN_USA28_FW
+	def_tristate USB_SERIAL_KEYSPAN && USB_SERIAL_KEYSPAN_USA28
+config USB_SERIAL_KEYSPAN_USA28X_FW
+	def_tristate USB_SERIAL_KEYSPAN && USB_SERIAL_KEYSPAN_USA28X
+config USB_SERIAL_KEYSPAN_USA28XA_FW
+	def_tristate USB_SERIAL_KEYSPAN && USB_SERIAL_KEYSPAN_USA28XA
+config USB_SERIAL_KEYSPAN_USA28XB_FW
+	def_tristate USB_SERIAL_KEYSPAN && USB_SERIAL_KEYSPAN_USA28XB
+config USB_SERIAL_KEYSPAN_USA19_FW
+	def_tristate USB_SERIAL_KEYSPAN && USB_SERIAL_KEYSPAN_USA19
+config USB_SERIAL_KEYSPAN_USA18X_FW
+	def_tristate USB_SERIAL_KEYSPAN && USB_SERIAL_KEYSPAN_USA18X
+config USB_SERIAL_KEYSPAN_USA19W_FW
+	def_tristate USB_SERIAL_KEYSPAN && USB_SERIAL_KEYSPAN_USA19W
+config USB_SERIAL_KEYSPAN_USA19QW_FW
+	def_tristate USB_SERIAL_KEYSPAN && USB_SERIAL_KEYSPAN_USA19QW
+config USB_SERIAL_KEYSPAN_USA19QI_FW
+	def_tristate USB_SERIAL_KEYSPAN && USB_SERIAL_KEYSPAN_USA19QI
+config USB_SERIAL_KEYSPAN_USA49W_FW
+	def_tristate USB_SERIAL_KEYSPAN && USB_SERIAL_KEYSPAN_USA49W
+config USB_SERIAL_KEYSPAN_USA49WLC_FW
+	def_tristate USB_SERIAL_KEYSPAN && USB_SERIAL_KEYSPAN_USA49WLC
+
 config USB_SERIAL_KLSI
 	tristate "USB KL5KUSB105 (Palmconnect) Driver"
 	---help---
firmware/Makefile +12 -19
index 25200d1..b5f9e47 100644
@@ -76,25 +76,18 @@ fw-shipped-$(CONFIG_USB_EMI62) += emi62/loader.fw emi62/bitstream.fw \
 fw-shipped-$(CONFIG_USB_KAWETH) += kaweth/new_code.bin kaweth/trigger_code.bin \
 				   kaweth/new_code_fix.bin \
 				   kaweth/trigger_code_fix.bin
-ifdef CONFIG_FIRMWARE_IN_KERNEL
-fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_MPR) += keyspan/mpr.fw
-fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA18X) += keyspan/usa18x.fw
-fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA19) += keyspan/usa19.fw
-fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA19QI) += keyspan/usa19qi.fw
-fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA19QW) += keyspan/usa19qw.fw
-fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA19W) += keyspan/usa19w.fw
-fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA28) += keyspan/usa28.fw
-fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA28XA) += keyspan/usa28xa.fw
-fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA28XB) += keyspan/usa28xb.fw
-fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA28X) += keyspan/usa28x.fw
-fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA49W) += keyspan/usa49w.fw
-fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA49WLC) += keyspan/usa49wlc.fw
-else
-fw-shipped- += keyspan/mpr.fw keyspan/usa18x.fw keyspan/usa19.fw	\
-	keyspan/usa19qi.fw keyspan/usa19qw.fw keyspan/usa19w.fw		\
-	keyspan/usa28.fw keyspan/usa28xa.fw keyspan/usa28xb.fw		\
-	keyspan/usa28x.fw keyspan/usa49w.fw keyspan/usa49wlc.fw
-endif
+fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_MPR_FW) += keyspan/mpr.fw
+fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA18X_FW) += keyspan/usa18x.fw
+fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA19_FW) += keyspan/usa19.fw
+fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA19QI_FW) += keyspan/usa19qi.fw
+fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA19QW_FW) += keyspan/usa19qw.fw
+fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA19W_FW) += keyspan/usa19w.fw
+fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA28_FW) += keyspan/usa28.fw
+fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA28XA_FW) += keyspan/usa28xa.fw
+fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA28XB_FW) += keyspan/usa28xb.fw
+fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA28X_FW) += keyspan/usa28x.fw
+fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA49W_FW) += keyspan/usa49w.fw
+fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA49WLC_FW) += keyspan/usa49wlc.fw
 fw-shipped-$(CONFIG_USB_SERIAL_TI) += ti_3410.fw ti_5052.fw \
 				      mts_cdma.fw mts_gsm.fw mts_edge.fw
 fw-shipped-$(CONFIG_USB_SERIAL_EDGEPORT) += edgeport/boot.fw edgeport/boot2.fw \