Skip to contentSkip to conversation

sis7019: add support to driver package

PATCH Applied Dave Dillow 1 participant 1 message Dec 14, 2007

lore
Share & tools
lore
#0 lore raw

PATCH v3 2/2 sis7019: add support to driver package

The sis7019 driver uses __ffs(), which first became available in kernel 2.5.2.6. This adds that compatibility function for x86 to adriver.h, and adds a more useful error message for other platforms that try to use it.

---
This is against the alsa-driver hg repo. It builds against 2.6.23, but I've not tested against earlier versions.

 pci/sis7019.c     |    2 ++
 include/adriver.h |   18 ++++++++++++++++++
 2 files changed, 20 insertions(+)
include/adriver.h +18 -0
diff -r 9eda190b55c3 include/adriver.h
@@ -1445,4 +1445,22 @@ static inline unsigned char snd_pci_revi
 #endif
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 3)
+#if defined(__i386__)
+static inline unsigned long __ffs(unsigned long word)
+{
+	__asm__("bsfl %1,%0"
+		:"=r" (word)
+		:"rm" (word));
+	return word;
+}
+#else
+static inline unsigned long __ffs(unsigned long word)
+{
+	__asm__("need_asm_for_your_arch_in_adriver.h");
+	return word;
+}
+#endif
+#endif
+
 #endif /* __SOUND_LOCAL_DRIVER_H */
pci/sis7019.c new file +2 -0
diff -r 9eda190b55c3 pci/sis7019.c
@@ -0,0 +1,2 @@
+#include "../alsa-kernel/pci/sis7019.c"
+EXPORT_NO_SYMBOLS;