Commit a29878553a9a7b4c06f93c7e383527cf014d4ceb
Committed by
Takashi Iwai
1 parent
afd00d7235
Exists in
master
and in
6 other branches
ALSA: lx6464es - fix device communication via command bus
commit 6175ddf06b6172046a329e3abfd9c901a43efd2e optimized the mem*io functions that have been used to send commands to the device. these optimizations somehow corrupted the communication with the lx6464es, that resulted the device to be unusable with kernels after 2.6.33. this patch emulates the memcpy_*_io functions via a loop to avoid these problems. Signed-off-by: Tim Blechmann <tim@klingt.org> LKML-Reference: <4ECB5257.4040600@ladisch.de> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Showing 1 changed file with 12 additions and 4 deletions Side-by-side Diff
sound/pci/lx6464es/lx_core.c
... | ... | @@ -81,8 +81,12 @@ |
81 | 81 | static void lx_dsp_reg_readbuf(struct lx6464es *chip, int port, u32 *data, |
82 | 82 | u32 len) |
83 | 83 | { |
84 | - void __iomem *address = lx_dsp_register(chip, port); | |
85 | - memcpy_fromio(data, address, len*sizeof(u32)); | |
84 | + u32 __iomem *address = lx_dsp_register(chip, port); | |
85 | + int i; | |
86 | + | |
87 | + /* we cannot use memcpy_fromio */ | |
88 | + for (i = 0; i != len; ++i) | |
89 | + data[i] = ioread32(address + i); | |
86 | 90 | } |
87 | 91 | |
88 | 92 | |
... | ... | @@ -95,8 +99,12 @@ |
95 | 99 | static void lx_dsp_reg_writebuf(struct lx6464es *chip, int port, |
96 | 100 | const u32 *data, u32 len) |
97 | 101 | { |
98 | - void __iomem *address = lx_dsp_register(chip, port); | |
99 | - memcpy_toio(address, data, len*sizeof(u32)); | |
102 | + u32 __iomem *address = lx_dsp_register(chip, port); | |
103 | + int i; | |
104 | + | |
105 | + /* we cannot use memcpy_to */ | |
106 | + for (i = 0; i != len; ++i) | |
107 | + iowrite32(data[i], address + i); | |
100 | 108 | } |
101 | 109 | |
102 | 110 |