Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 236406
b: refs/heads/master
c: 68e79bc
h: refs/heads/master
v: v3
  • Loading branch information
Marek Belisko authored and Greg Kroah-Hartman committed Mar 14, 2011
1 parent 2d6f217 commit 6fa9941
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 33 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a209efadf0b93238fe052fe1e92f48ccf6da57a1
refs/heads/master: 68e79bccceba1efc3b4abac1594cb1798dd5e780
60 changes: 28 additions & 32 deletions trunk/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,51 +481,47 @@ static void card_reset_dsp(struct ft1000_device *ft1000dev, bool value)
// Notes:
//
//---------------------------------------------------------------------------
void card_send_command(struct ft1000_device *ft1000dev, void *ptempbuffer, int size)
void card_send_command(struct ft1000_device *ft1000dev, void *ptempbuffer,
int size)
{
unsigned short temp;
unsigned char *commandbuf;
unsigned short temp;
unsigned char *commandbuf;

DEBUG("card_send_command: enter card_send_command... size=%d\n", size);
DEBUG("card_send_command: enter card_send_command... size=%d\n", size);

commandbuf =(unsigned char*) kmalloc(size+2, GFP_KERNEL);
memcpy((void*)commandbuf+2, (void*)ptempbuffer, size);
commandbuf = (unsigned char *)kmalloc(size + 2, GFP_KERNEL);
memcpy((void *)commandbuf + 2, (void *)ptempbuffer, size);

//DEBUG("card_send_command: Command Send\n");
//DEBUG("card_send_command: Command Send\n");

ft1000_read_register(ft1000dev, &temp, FT1000_REG_DOORBELL);
ft1000_read_register(ft1000dev, &temp, FT1000_REG_DOORBELL);

if (temp & 0x0100)
{
msleep(10);
}
if (temp & 0x0100)
msleep(10);

// check for odd word
size = size + 2;
if (size % 4)
{
// Must force to be 32 bit aligned
size += 4 - (size % 4);
}
/* check for odd word */
size = size + 2;

/* Must force to be 32 bit aligned */
if (size % 4)
size += 4 - (size % 4);

//DEBUG("card_send_command: write dpram ... size=%d\n", size);
ft1000_write_dpram32(ft1000dev, 0,commandbuf, size);
msleep(1);
//DEBUG("card_send_command: write into doorbell ...\n");
ft1000_write_register(ft1000dev, FT1000_DB_DPRAM_TX ,FT1000_REG_DOORBELL) ;
msleep(1);
//DEBUG("card_send_command: write dpram ... size=%d\n", size);
ft1000_write_dpram32(ft1000dev, 0, commandbuf, size);
msleep(1);
//DEBUG("card_send_command: write into doorbell ...\n");
ft1000_write_register(ft1000dev, FT1000_DB_DPRAM_TX,
FT1000_REG_DOORBELL);
msleep(1);

ft1000_read_register(ft1000dev, &temp, FT1000_REG_DOORBELL);
//DEBUG("card_send_command: read doorbell ...temp=%x\n", temp);
if ( (temp & 0x0100) == 0)
{
//DEBUG("card_send_command: Message sent\n");
}
ft1000_read_register(ft1000dev, &temp, FT1000_REG_DOORBELL);
//DEBUG("card_send_command: read doorbell ...temp=%x\n", temp);
if ((temp & 0x0100) == 0) {
//DEBUG("card_send_command: Message sent\n");
}

}


//--------------------------------------------------------------------------
//
// Function: dsp_reload
Expand Down

0 comments on commit 6fa9941

Please sign in to comment.