[oss-devel] [PATCH] fix audigy_digital_din (oss_sblive.c) for audigy2 cards
Alex J. Ivasyuv
siegerstein at pochta.ru
Sun May 18 05:40:59 EEST 2008
Hannu Savolainen пишет:
> Hi All,
>
> It looks like the card_type field is confusing so I renamed it to
> feature_mask. In this way it's clear that & should be used to check bits
> instead of ==.
>
>
If so, the full patch:
diff -ru oss-v4.0-build1015-src-gpl/kernel/drv/sblive/sblive.c
oss-v4.0-build1015-src-gpl.good/kernel/drv/sblive/sblive.c
--- oss-v4.0-build1015-src-gpl/kernel/drv/sblive/sblive.c
2008-03-24 07:33:06.000000000 +0200
+++ oss-v4.0-build1015-src-gpl.good/kernel/drv/sblive/sblive.c
2008-05-17 04:09:13.000000000 +0300
@@ -2748,14 +2748,14 @@
/* switch the shared SPDIF/OUT3 to DIGITAL or ANALOG mode */
/* depending on whether the port is SPDIF or analog */
- if (devc->card_type == SB_AUDIGY)
+ if (devc->card_type & SB_AUDIGY)
{
reg = INL (devc->osdev, devc->base + 0x18) & ~A_IOCFG_GPOUT0;
val = (audigy_digital_din) ? 0x4 : 0;
reg |= val;
OUTL (devc->osdev, reg, devc->base + 0x18);
}
- if (devc->card_type == SB_LIVE) /* SBLIVE */
+ if (devc->card_type & SB_LIVE) /* SBLIVE */
{
reg = INL (devc->osdev, devc->base + 0x14) & ~HCFG_GPOUT0;
val = (sblive_digital_din) ? HCFG_GPOUT0 : 0;
@@ -3862,7 +3862,7 @@
devc->voice_busy[i * 2] = 1;
devc->voice_busy[i * 2 + 1] = 1;
portc->resetvol = 0;
- if (devc->card_type == SB_LIVE)
+ if (devc->card_type & SB_LIVE)
{
/*
* Do not enable vmix by default on Live! It would cause enormous
diff -ru oss-v4.0-build1015-src-gpl/kernel/drv/sblive/sblive.h
oss-v4.0-build1015-src-gpl.good/kernel/drv/sblive/sblive.h
--- oss-v4.0-build1015-src-gpl/kernel/drv/sblive/sblive.h
2008-05-17 04:23:29.000000000 +0300
+++ oss-v4.0-build1015-src-gpl.good/kernel/drv/sblive/sblive.h
2008-05-17 04:23:59.000000000 +0300
@@ -220,9 +220,9 @@
#define HLIEH 0x067 /* DW:nocnl */
#define HLIPL 0x068 /* DW:nocnl */
#define HLIPH 0x069 /* DW:nocnl */
-#define GPR0 ((devc->card_type==SB_LIVE)? 0x100:0x400)
/* DW:nocnl */
+#define GPR0 ((devc->card_type&SB_LIVE)? 0x100:0x400)
/* DW:nocnl */
#define TMA0 0x300 /* Tank memory */
-#define UC0 ((devc->card_type==SB_LIVE) ? 0x400:0x600)
/* DSM microcode memory */
+#define UC0 ((devc->card_type&SB_LIVE) ? 0x400:0x600)
/* DSM microcode memory */
/* Interrupt enable register */
#define IE 0x0c
More information about the oss-devel
mailing list