diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/core/pcm_misc.c | 16 | ||||
-rw-r--r-- | sound/pci/riptide/riptide.c | 12 |
2 files changed, 22 insertions, 6 deletions
diff --git a/sound/core/pcm_misc.c b/sound/core/pcm_misc.c index ea2bf82c937..434af3c56d5 100644 --- a/sound/core/pcm_misc.c +++ b/sound/core/pcm_misc.c | |||
@@ -128,6 +128,14 @@ static struct pcm_format_data pcm_formats[SNDRV_PCM_FORMAT_LAST+1] = { | |||
128 | .width = 4, .phys = 4, .le = -1, .signd = -1, | 128 | .width = 4, .phys = 4, .le = -1, .signd = -1, |
129 | .silence = {}, | 129 | .silence = {}, |
130 | }, | 130 | }, |
131 | [SNDRV_PCM_FORMAT_G723_24] = { | ||
132 | .width = 3, .phys = 3, .le = -1, .signd = -1, | ||
133 | .silence = {}, | ||
134 | }, | ||
135 | [SNDRV_PCM_FORMAT_G723_40] = { | ||
136 | .width = 5, .phys = 5, .le = -1, .signd = -1, | ||
137 | .silence = {}, | ||
138 | }, | ||
131 | /* FIXME: the following three formats are not defined properly yet */ | 139 | /* FIXME: the following three formats are not defined properly yet */ |
132 | [SNDRV_PCM_FORMAT_MPEG] = { | 140 | [SNDRV_PCM_FORMAT_MPEG] = { |
133 | .le = -1, .signd = -1, | 141 | .le = -1, .signd = -1, |
@@ -186,6 +194,14 @@ static struct pcm_format_data pcm_formats[SNDRV_PCM_FORMAT_LAST+1] = { | |||
186 | .width = 18, .phys = 24, .le = 0, .signd = 0, | 194 | .width = 18, .phys = 24, .le = 0, .signd = 0, |
187 | .silence = { 0x02, 0x00, 0x00 }, | 195 | .silence = { 0x02, 0x00, 0x00 }, |
188 | }, | 196 | }, |
197 | [SNDRV_PCM_FORMAT_G723_24_1B] = { | ||
198 | .width = 3, .phys = 8, .le = -1, .signd = -1, | ||
199 | .silence = {}, | ||
200 | }, | ||
201 | [SNDRV_PCM_FORMAT_G723_40_1B] = { | ||
202 | .width = 5, .phys = 8, .le = -1, .signd = -1, | ||
203 | .silence = {}, | ||
204 | }, | ||
189 | }; | 205 | }; |
190 | 206 | ||
191 | 207 | ||
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c index ad446267761..59d79962f23 100644 --- a/sound/pci/riptide/riptide.c +++ b/sound/pci/riptide/riptide.c | |||
@@ -97,6 +97,7 @@ | |||
97 | #include <linux/gameport.h> | 97 | #include <linux/gameport.h> |
98 | #include <linux/device.h> | 98 | #include <linux/device.h> |
99 | #include <linux/firmware.h> | 99 | #include <linux/firmware.h> |
100 | #include <linux/kernel.h> | ||
100 | #include <asm/io.h> | 101 | #include <asm/io.h> |
101 | #include <sound/core.h> | 102 | #include <sound/core.h> |
102 | #include <sound/info.h> | 103 | #include <sound/info.h> |
@@ -667,13 +668,12 @@ static u32 atoh(const unsigned char *in, unsigned int len) | |||
667 | unsigned char c; | 668 | unsigned char c; |
668 | 669 | ||
669 | while (len) { | 670 | while (len) { |
671 | int value; | ||
672 | |||
670 | c = in[len - 1]; | 673 | c = in[len - 1]; |
671 | if ((c >= '0') && (c <= '9')) | 674 | value = hex_to_bin(c); |
672 | sum += mult * (c - '0'); | 675 | if (value >= 0) |
673 | else if ((c >= 'A') && (c <= 'F')) | 676 | sum += mult * value; |
674 | sum += mult * (c - ('A' - 10)); | ||
675 | else if ((c >= 'a') && (c <= 'f')) | ||
676 | sum += mult * (c - ('a' - 10)); | ||
677 | mult *= 16; | 677 | mult *= 16; |
678 | --len; | 678 | --len; |
679 | } | 679 | } |