X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Fpci%2Fvx222%2Fvx222_ops.c;h=22a9c6a79d889c7796809cea32d1976511a23dc0;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=6f73d05e3ae75b7382d1b18f720f414c15c4d90d;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/sound/pci/vx222/vx222_ops.c b/sound/pci/vx222/vx222_ops.c index 6f73d05e3..22a9c6a79 100644 --- a/sound/pci/vx222/vx222_ops.c +++ b/sound/pci/vx222/vx222_ops.c @@ -22,13 +22,12 @@ #include #include +#include #include #include #include #include "vx222.h" -#define chip_t vx_core_t - static int vx2_reg_offset[VX_REG_MAX] = { [VX_ICR] = 0x00, @@ -353,11 +352,11 @@ static int put_xilinx_data(vx_core_t *chip, unsigned int port, unsigned int coun /* * load the xilinx image */ -static int vx2_load_xilinx_binary(vx_core_t *chip, const snd_hwdep_dsp_image_t *xilinx) +static int vx2_load_xilinx_binary(vx_core_t *chip, const struct firmware *xilinx) { unsigned int i; unsigned int port; - unsigned char *image, data; + unsigned char *image; /* XILINX reset (wait at least 1 milisecond between reset on and off). */ vx_outl(chip, CNTRL, VX_CNTRL_REGISTER_VALUE | VX_XILINX_RESET_MASK); @@ -372,10 +371,9 @@ static int vx2_load_xilinx_binary(vx_core_t *chip, const snd_hwdep_dsp_image_t * else port = VX_GPIOC; /* VX222 V2 and VX222_MIC_BOARD with new PLX9030 use this register */ - image = xilinx->image; - for (i = 0; i < xilinx->length; i++, image++) { - __get_user(data, image); - if (put_xilinx_data(chip, port, 8, data) < 0) + image = xilinx->data; + for (i = 0; i < xilinx->size; i++, image++) { + if (put_xilinx_data(chip, port, 8, *image) < 0) return -EINVAL; /* don't take too much time in this loop... */ cond_resched(); @@ -401,25 +399,22 @@ static int vx2_load_xilinx_binary(vx_core_t *chip, const snd_hwdep_dsp_image_t * /* * load the boot/dsp images */ -static int vx2_load_dsp(vx_core_t *vx, const snd_hwdep_dsp_image_t *dsp) +static int vx2_load_dsp(vx_core_t *vx, int index, const struct firmware *dsp) { int err; - if (*dsp->name) - snd_printdd("loading dsp [%d] %s, size = %Zd\n", - dsp->index, dsp->name, dsp->length); - switch (dsp->index) { - case 0: + switch (index) { + case 1: /* xilinx image */ if ((err = vx2_load_xilinx_binary(vx, dsp)) < 0) return err; if ((err = vx2_test_xilinx(vx)) < 0) return err; return 0; - case 1: + case 2: /* DSP boot */ return snd_vx_dsp_boot(vx, dsp); - case 2: + case 3: /* DSP image */ return snd_vx_dsp_load(vx, dsp); default: