Skip to content

Commit

Permalink
ALSA: lx6464es - fix device communication via command bus
Browse files Browse the repository at this point in the history
commit a298785 upstream.

commit 6175ddf 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>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
timblechmann authored and gregkh committed Dec 9, 2011
1 parent 341f278 commit 5599ae9
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions sound/pci/lx6464es/lx_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,12 @@ unsigned long lx_dsp_reg_read(struct lx6464es *chip, int port)

void lx_dsp_reg_readbuf(struct lx6464es *chip, int port, u32 *data, u32 len)
{
void __iomem *address = lx_dsp_register(chip, port);
memcpy_fromio(data, address, len*sizeof(u32));
u32 __iomem *address = lx_dsp_register(chip, port);
int i;

/* we cannot use memcpy_fromio */
for (i = 0; i != len; ++i)
data[i] = ioread32(address + i);
}


Expand All @@ -94,8 +98,12 @@ void lx_dsp_reg_write(struct lx6464es *chip, int port, unsigned data)
void lx_dsp_reg_writebuf(struct lx6464es *chip, int port, const u32 *data,
u32 len)
{
void __iomem *address = lx_dsp_register(chip, port);
memcpy_toio(address, data, len*sizeof(u32));
u32 __iomem *address = lx_dsp_register(chip, port);
int i;

/* we cannot use memcpy_to */
for (i = 0; i != len; ++i)
iowrite32(data[i], address + i);
}


Expand Down

0 comments on commit 5599ae9

Please sign in to comment.